/* 方案與價格：兩張可購買方案並排在標題卡下方。色彩依方案分為藍（Insight）與金（Precision）；「我的」訂閱方案卡的徽章與階梯共用這兩組方案色。 */
.lpa-plan-grid {
  --lpa-plan-gap: 8px;
  container-type: inline-size;
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--lpa-plan-gap);
}
.lpa-plan-card {
  --lpa-plan-inline: clamp(8px, 2.6cqw, 22px);
  --lpa-plan-check-size: clamp(15px, 4.4cqw, 26px);
  --lpa-plan-check: #86d94a;
  --lpa-plan-check-mark: #0c1f0b;
  --lpa-plan-text: var(--color-text);
  position: relative;
  /* 標題、四列規格、按鈕共六列，兩張卡片共用同一組列高，內容行數不同時各列仍然對齊。 */
  display: grid;
  min-width: 0;
  grid-row: span 6;
  grid-template-rows: subgrid;
  padding: clamp(10px, 3cqw, 22px) var(--lpa-plan-inline) clamp(10px, 3cqw, 22px);
  border: 1px solid var(--lpa-plan-frame);
  border-radius: var(--radius);
  background: var(--lpa-plan-surface);
  box-shadow: 0 0 0 1px var(--lpa-plan-frame-faint), 0 0 18px var(--lpa-plan-glow), inset 0 1px 0 var(--lpa-plan-sheen);
  color: var(--lpa-plan-text);
  font-size: clamp(11px, 3.15cqw, 17px);
  line-height: 1.45;
}
:is(.lpa-plan-card, .account-plan-badge, .account-plan-tag, .account-plan-step)[data-lpa-plan="insight"] {
  --lpa-plan-accent: #6fb6ff;
  --lpa-plan-frame: #3f8fe0;
  --lpa-plan-frame-faint: rgb(63 143 224 / 22%);
  --lpa-plan-glow: rgb(46 128 220 / 26%);
  --lpa-plan-sheen: rgb(170 210 255 / 28%);
  --lpa-plan-surface: linear-gradient(180deg, #13243a 0%, #0b1626 34%, #070f1b 100%);
  --lpa-plan-divider: rgb(136 170 210 / 26%);
  --lpa-plan-mark-surface: linear-gradient(180deg, #17365c, #0c1c33);
  /* 價格條與 Precision 的金色價格條同一級亮度，維持銀藍；價格字加深，在條的最暗處對比仍高於 4.5:1。 */
  --lpa-plan-ribbon: linear-gradient(180deg, #b0bccd 0%, #8795aa 100%);
  --lpa-plan-ribbon-text: #0c2551;
  --lpa-plan-action: linear-gradient(180deg, #56677f 0%, #2b3a50 48%, #1c2839 100%);
  --lpa-plan-action-frame: rgb(190 214 244 / 62%);
  --lpa-plan-action-lip: color-mix(in srgb, #56677f var(--key-lip-mix), #000);
  --lpa-plan-action-text: var(--color-text);
  --lpa-plan-emphasis: var(--lpa-plan-text);
}
:is(.lpa-plan-card, .account-plan-badge, .account-plan-tag, .account-plan-step)[data-lpa-plan="precision"] {
  /* 圖示、強調字與「我的」的徽章、階梯同一階金色，不比價格條亮：深色底上的亮黃粗體字會刺眼。 */
  --lpa-plan-accent: var(--gold-action-bright);
  --lpa-plan-frame: #d2a23a;
  --lpa-plan-frame-faint: rgb(210 162 58 / 26%);
  --lpa-plan-glow: rgb(214 160 44 / 30%);
  --lpa-plan-sheen: rgb(255 226 150 / 34%);
  --lpa-plan-surface: linear-gradient(180deg, #2a2110 0%, #151108 34%, #0a0805 100%);
  --lpa-plan-divider: rgb(214 176 92 / 28%);
  --lpa-plan-mark-surface: linear-gradient(180deg, #3a2c0e, #191205);
  /* 價格條與訂閱按鈕沿用設定視窗「儲存設定」降過的金色。 */
  --lpa-plan-ribbon: linear-gradient(180deg, var(--gold-action-bright) 0%, var(--gold-action) 100%);
  --lpa-plan-ribbon-text: #2c1d04;
  --lpa-plan-action: var(--gold-key-face);
  --lpa-plan-action-frame: var(--gold-key-frame);
  --lpa-plan-action-lip: color-mix(in srgb, var(--gold-action) var(--key-lip-mix), #000);
  --lpa-plan-action-text: var(--gold-key-text);
  --lpa-plan-emphasis: var(--lpa-plan-accent);
}
.lpa-plan-card svg { display: block; width: 100%; height: 100%; }
.lpa-plan-heading {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(6px, 1.8cqw, 12px) clamp(6px, 2cqw, 16px);
  padding-bottom: clamp(8px, 2.4cqw, 16px);
}
.lpa-plan-mark {
  width: clamp(28px, 8.4cqw, 60px);
  height: clamp(28px, 8.4cqw, 60px);
  padding: 18%;
  border: 1px solid var(--lpa-plan-frame);
  border-radius: var(--radius);
  background: var(--lpa-plan-mark-surface);
  box-shadow: 0 0 8px var(--lpa-plan-glow), inset 0 1px 0 var(--lpa-plan-sheen);
  color: var(--lpa-plan-accent);
}
.lpa-plan-title { min-width: 0; }
.lpa-plan-title h2 {
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-ui-tc);
  font-size: clamp(14px, 4.3cqw, 26px);
  font-style: italic;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}
.lpa-plan-title p { margin: 2px 0 0; color: #c6ccd6; font-size: clamp(10.5px, 3cqw, 18px); line-height: 1.3; }
.lpa-plan-price {
  display: flex;
  min-width: 0;
  margin: 0;
  padding: 2px clamp(6px, 2cqw, 16px);
  grid-column: 1 / -1;
  align-items: baseline;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--lpa-plan-ribbon);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 32%);
  color: var(--lpa-plan-ribbon-text);
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}
.lpa-plan-price strong { font-size: clamp(21px, 6.6cqw, 34px); font-weight: 800; }
.lpa-plan-currency, .lpa-plan-cycle { font-size: clamp(11px, 3.2cqw, 20px); }
/* Play can place the currency after a long amount or use a different writing direction. */
.lpa-plan-price[data-play-price] { flex-wrap: wrap; gap: 0 .2em; white-space: normal; text-align: center; }
.lpa-plan-price [data-play-amount] { min-width: 0; overflow-wrap: anywhere; }
.lpa-plan-facts { display: grid; min-width: 0; margin: 0; grid-row: span 4; grid-template-rows: subgrid; }
.lpa-plan-fact {
  position: relative;
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 2px;
  /* 右側留給勾號，勾號固定垂直置中，不隨內容換行而移動。 */
  padding: clamp(6px, 1.9cqw, 14px) calc(var(--lpa-plan-check-size) + 6px) clamp(6px, 1.9cqw, 14px) 0;
  border-top: 1px solid var(--lpa-plan-divider);
}
.lpa-plan-fact:last-child { border-bottom: 1px solid var(--lpa-plan-divider); }
.lpa-plan-fact dt { display: flex; min-width: 0; align-items: center; gap: clamp(4px, 1.4cqw, 12px); color: var(--color-text); font-weight: 700; }
.lpa-plan-fact dt > svg { width: 1.25em; height: 1.25em; flex: 0 0 auto; color: var(--lpa-plan-accent); }
.lpa-plan-fact dd { min-width: 0; margin: 0; }
/* 演算法名稱保留為單位，查詢期數使用獨立一行。 */
.lpa-plan-value { display: block; min-width: 0; }
.lpa-plan-value > span { display: block; text-wrap: balance; }
.lpa-plan-fact dt > span { white-space: nowrap; }
.lpa-plan-value em { color: var(--lpa-plan-emphasis); font-style: normal; font-weight: 700; }
.lpa-plan-included {
  position: absolute;
  top: 50%;
  right: 0;
  width: var(--lpa-plan-check-size);
  height: var(--lpa-plan-check-size);
  color: var(--lpa-plan-check);
  transform: translateY(-50%);
}
.lpa-plan-purchase {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin-top: clamp(10px, 3cqw, 22px);
  padding: 6px clamp(6px, 2cqw, 18px);
  align-items: center;
  justify-content: center;
  gap: 4px;
  /* 3px 厚邊（styles.css --key-*）：厚邊是下框、從原高度扣出，按鈕與卡片尺寸不變；原本的 1px 框改畫成內側線，在厚邊上方收口。 */
  border: 0 solid transparent;
  border-bottom: var(--key-lip-primary) solid var(--lpa-plan-action-lip);
  border-radius: var(--key-primary-radius);
  background: var(--lpa-plan-action) padding-box;
  box-shadow: inset 0 0 0 1px var(--lpa-plan-action-frame), inset 0 1px 0 rgb(255 255 255 / 24%), 0 2px 8px rgb(0 0 0 / 45%);
  color: var(--lpa-plan-action-text);
  font-family: var(--font-ui-tc);
  font-size: clamp(11.5px, 3.4cqw, 22px);
  font-weight: 800;
  line-height: 1.3;
}
.lpa-plan-purchase > span { min-width: 0; white-space: nowrap; }
.lpa-plan-purchase > svg { width: 1em; height: 1em; flex: 0 0 auto; }
/* The read-only web catalog keeps the two plan colours. */
.lpa-plan-purchase:disabled { opacity: 1; cursor: default; }
.lpa-plan-card:has([data-play-price]) .lpa-plan-purchase > span { white-space: normal; overflow-wrap: anywhere; }
.lpa-plan-card:has([data-play-price]) .lpa-plan-purchase:disabled { opacity: .65; }
.lpa-billing-actions { display: grid; min-width: 0; gap: 8px; }
.lpa-billing-actions .account-auth-status { overflow-wrap: anywhere; }
.lpa-billing-actions button, .lpa-billing-actions a { min-height: 44px; }
/* 每張卡片寬到放得下設計稿的單列排法時才切換：價格在標題右側，規格為「項目｜內容」。較窄時維持上下排列。 */
@container (min-width: 1000px) {
  .lpa-plan-heading { grid-template-columns: auto minmax(0, 1fr) auto; }
  .lpa-plan-price { grid-column: auto; padding-block: 6px; }
  .lpa-plan-fact { grid-template-columns: 9.5em minmax(0, 1fr); align-items: center; gap: 0; }
  .lpa-plan-fact dd { padding-left: 1em; border-left: 1px solid var(--lpa-plan-divider); }
}
@media (forced-colors: active) {
  .lpa-plan-card, .lpa-plan-mark, .lpa-plan-price, .lpa-plan-purchase { border: 1px solid CanvasText; background: Canvas; color: CanvasText; forced-color-adjust: auto; }
}

/* 訂閱須知：兩張卡片下方直接可見的說明文字（Google Play 訂閱揭露），沒有按鈕。外框與說明頁的章節卡同一套
   （account.css），說明才不會散在頁面底色上；字級沿用 .doc-blocks。 */
.lpa-plan-terms { display: grid; gap: 10px; }
.lpa-plan-terms h3 { margin: 0; color: var(--color-announcement-text); font-size: 13px; font-weight: 600; white-space: nowrap; }
/* 「不訂閱也能使用」底下三個小項不用金色：與大標同色時整張卡有七個金色粗體，刺眼又分不出層級。 */
.lpa-plan-terms h3 + .doc-blocks dt { color: var(--color-text); }
/* 四個文字連結一列等寬。字的外框只有行高加上下各 6px，看不見的命中區補到 44px，四格互不重疊。 */
.lpa-plan-links {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--page-divider) 45%, transparent);
  font-family: var(--font-ui-tc);
  font-size: 12px;
  line-height: 1.5;
}
.lpa-plan-links a {
  position: relative;
  min-width: 0;
  padding: 6px 0;
  color: var(--color-announcement-text);
  font-weight: 600;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.lpa-plan-links a::after { position: absolute; inset: -7px 0; content: ""; }
.lpa-plan-links a:focus-visible { outline: 2px solid var(--color-selected); outline-offset: 2px; }
