/*
 * 風暴演習室 — 絲絨深色與金的投影牆。1440×900 單屏不捲動；窄螢幕改成直向堆疊。
 * 台股慣例：跌＝綠（--down）、漲＝紅（--up）；金色只留給「原點」與行動。
 * 螢幕上的字最小 13px（會議室投影要讀得到）；只有列印用的一頁紙例外。
 */
:root {
  --velvet: #241114; --velvet-2: #160C0E; --ink: #0E0708;
  --line: rgba(255, 244, 240, .16); --line-2: rgba(255, 244, 240, .08);
  --text: #F7EEE9; --muted: #C4B3AD; --dim: #A39590;
  --gold: #C89B3C; --gold-b: #E2B95A; --gold-soft: rgba(226, 185, 90, .12);
  --up: #FF9D94; --down: #7FD6A4; --under: #9C928D;
  --sans: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", "Segoe UI", sans-serif;
  --serif: "Noto Serif TC", "PMingLiU", "Songti TC", serif;
  --mono: "Cascadia Mono", "Consolas", "SFMono-Regular", monospace;
  --ease: cubic-bezier(.2, .7, .3, 1);
  /* 共用確認視窗（平台的元件）套上這個 app 的金黑主題；結構、警語與固定回覆不變 */
  --si-cta-bg: #2A1519; --si-cta-fg: #F7EEE9; --si-cta-muted: #C4B3AD; --si-cta-line: rgba(255, 244, 240, .16); --si-cta-soft: rgba(255, 244, 240, .07);
  --si-cta-accent: #E2B95A; --si-cta-accent-fg: #1B0E11; --si-cta-radius: 18px;
}
* { box-sizing: border-box; }
html { height: 100%; }
body { margin: 0; min-height: 100%; background: var(--ink); color: var(--text); font: 15px/1.6 var(--sans); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
i, em { font-style: normal; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold-b); outline-offset: 2px; border-radius: 6px; }
h2:focus, .sh-done:focus { outline: none; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 99; background: var(--gold-b); color: #1B0E11; padding: 6px 12px; border-radius: 8px; font-weight: 700; }
.skip:focus { left: 8px; }
.defs { position: absolute; }
.ic { width: 1.1em; height: 1.1em; flex: none; vertical-align: -0.16em; }
.up { color: var(--up); } .down { color: var(--down); } .flat { color: var(--muted); }
.gold { color: var(--gold-b); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.fine { font-size: 13px; line-height: 1.5; color: var(--dim); }
.lab { font-size: 13px; font-weight: 700; letter-spacing: .12em; color: var(--gold-b); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.link.back-mx { display: none; margin-left: auto; letter-spacing: 0; font-weight: 400; }
.demo-tag { display: inline-block; font: 700 13px/1.45 var(--sans); letter-spacing: .02em; color: #1B0E11; background: #E8C877; border-radius: 4px; padding: 0 6px; white-space: nowrap; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(226, 185, 90, .3); border-top-color: var(--gold-b); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; margin-right: 8px; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shim { 0% { background-position: -300px 0; } 100% { background-position: 300px 0; } }
.shim { position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 244, 240, .06), transparent); background-size: 300px 100%; background-repeat: no-repeat; animation: shim 1.3s linear infinite; }

/* 按鈕 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 5px 14px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 244, 240, .04); color: var(--text); font-size: 13.5px; font-weight: 700; transition: border-color .16s var(--ease), background .16s var(--ease); }
.btn:hover:not(:disabled) { border-color: var(--gold-b); background: var(--gold-soft); }
.btn.gold { border-color: rgba(226, 185, 90, .6); color: var(--gold-b); }
.btn:disabled, .primary:disabled, .chipbtn:disabled { opacity: .45; }
.primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 8px 22px; border: 0; border-radius: 12px; background: linear-gradient(180deg, #EBC76E, #C89B3C); color: #1B0E11; font-size: 15.5px; font-weight: 800; letter-spacing: .02em; box-shadow: 0 8px 22px rgba(200, 155, 60, .22); transition: transform .16s var(--ease), box-shadow .16s var(--ease); }
.primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(200, 155, 60, .3); }
.primary:focus-visible { outline-color: #fff; }
.primary .spin { border-color: rgba(27, 14, 17, .25); border-top-color: #1B0E11; }
.ghost { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--muted); font-size: 13px; text-decoration: none; white-space: nowrap; }
.ghost:hover { color: var(--text); border-color: var(--gold-b); }
.link { display: inline-flex; align-items: center; gap: 3px; background: none; border: 0; padding: 0; color: var(--gold-b); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none; border-radius: 10px; border: 1px solid var(--line); background: none; color: var(--muted); }
.icon-btn:hover:not(:disabled) { color: var(--text); border-color: var(--gold-b); }
.icon-btn:disabled { opacity: .35; }
.chipbtn { min-height: 32px; padding: 3px 12px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--muted); font-size: 13px; font-weight: 700; }
.chipbtn:hover:not(:disabled) { border-color: var(--gold-b); color: var(--text); }
.chipbtn.on { background: var(--gold-b); border-color: var(--gold-b); color: #1B0E11; }
.chipbtn small { display: block; font-size: 13px; font-weight: 400; line-height: 1.2; }
.verify { display: inline-block; margin-left: 6px; padding: 0 6px; border: 1px solid rgba(226, 185, 90, .5); border-radius: 4px; background: none; color: var(--gold-b); font: 700 13px/1.4 var(--sans); vertical-align: 1px; }
.verify:hover { background: var(--gold-b); color: #1B0E11; }
.in { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(0, 0, 0, .28); min-width: 0; }
.in:focus-within { border-color: var(--gold-b); box-shadow: 0 0 0 2px rgba(226, 185, 90, .35); }
.in span { color: var(--dim); font-size: 13px; flex: none; }
.in input { flex: 1; min-width: 0; width: 100%; border: 0; background: none; outline: none; font-weight: 700; font-size: 16px; padding: 6px 0; }
.in.wide input { font-weight: 400; font-size: 14px; }

/* 錯誤要給引導 */
.si-error { border: 1px solid rgba(255, 157, 148, .45); border-left: 4px solid var(--up); background: rgba(255, 157, 148, .07); border-radius: 12px; padding: 12px 16px; font-size: 14px; }
.si-error b { font-size: 15px; }
.si-error ul { margin: 4px 0 0; padding-left: 18px; list-style: disc; }
.si-error p { margin-top: 4px; color: var(--muted); }
.si-error .err-guide { color: var(--text); }
.si-error-trace { font: 13px var(--mono); color: var(--dim) !important; }
.err-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
dialog.si-cta { box-shadow: 0 0 0 1px rgba(226, 185, 90, .45), 0 30px 90px rgba(0, 0, 0, .6); }
/* 共用確認視窗裡 12.5px 的小字，在這面牆上統一拉到 13px（只調字級，不動結構與文字） */
dialog.si-cta .si-cta-time, dialog.si-cta .si-cta-pill, dialog.si-cta .si-cta-list time, dialog.si-cta .si-cta-state { font-size: 13px; }

/* ── 投影牆 ── */
.wall { min-height: 100vh; display: flex; flex-direction: column;
  background: radial-gradient(1100px 520px at 22% -8%, rgba(120, 44, 56, .5) 0%, transparent 62%), radial-gradient(900px 520px at 104% 108%, rgba(96, 60, 24, .34) 0%, transparent 58%), linear-gradient(180deg, #1D0F12, #120A0C 70%, #0E0708); }
.top { position: relative; flex: none; display: flex; align-items: center; gap: 10px 20px; flex-wrap: wrap; min-height: 56px; padding: 8px 20px; border-bottom: 1px solid var(--line-2); }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold) 18%, var(--gold-b) 50%, var(--gold) 82%, transparent); opacity: .55; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.gem { width: 30px; height: 30px; flex: none; color: var(--gold-b); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text b { font: 700 19px/1.2 var(--serif); letter-spacing: .12em; white-space: nowrap; }
.brand-text small { font-size: 13px; color: var(--dim); white-space: nowrap; }
.steps { display: flex; gap: 2px; margin-right: auto; min-width: 0; }
.steps button { display: flex; align-items: center; gap: 7px; min-height: 36px; padding: 4px 12px 4px 6px; border: 0; border-radius: 999px; background: none; color: var(--dim); font-size: 14px; font-weight: 700; white-space: nowrap; }
.steps button i { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid currentColor; font: 700 13px var(--serif); }
.steps button:not(:disabled):hover { color: var(--text); }
.steps button.done { color: var(--muted); }
.steps button.done i { background: rgba(226, 185, 90, .2); border-color: var(--gold); color: var(--gold-b); }
.steps button.on { color: var(--gold-b); background: var(--gold-soft); }
.steps button.on i { background: var(--gold-b); border-color: var(--gold-b); color: #1B0E11; }
.steps button:disabled { opacity: .45; }
.top-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.chip { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.chip.demo { color: #1B0E11; background: #E8C877; }
.chip.live { color: var(--down); border: 1px solid rgba(127, 214, 164, .4); }
.today-pill { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; max-width: 100%; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: rgba(0, 0, 0, .25); color: var(--text); font-size: 13px; white-space: nowrap; }
.today-pill:hover { border-color: var(--gold-b); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; }
.act > .dot, .act .dot { background: var(--gold-b); box-shadow: 0 0 0 4px rgba(226, 185, 90, .18); }
.watch > .dot { background: #E8C877; }

.main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 404px; gap: 14px; padding: 10px 20px 8px; }
.stage-gate .main { display: none; }
.stage-storm .gate { display: none; }
.zone { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; outline: none; }

/* 法遵頁尾 */
.legal { flex: none; padding: 5px 20px 7px; border-top: 1px solid var(--line-2); color: var(--dim); font-size: 13px; line-height: 1.45; display: grid; grid-template-columns: minmax(0, 610px) minmax(0, 1fr); grid-auto-flow: dense; gap: 0 24px; }
.legal p { min-width: 0; grid-column: 1; }
.legal .si-legal-main { color: var(--muted); }
.legal .si-legal-src { grid-column: 2; grid-row: 1 / span 3; }
.legal .si-legal-demo { color: var(--muted); }
.legal .si-legal-demo .demo-tag { margin-right: 8px; }

/* ── 風暴矩陣 ── */
.mx { flex: 1; min-height: 0; display: grid; grid-template-columns: 228px repeat(3, minmax(0, 1fr)); grid-template-rows: auto repeat(var(--rows, 4), minmax(0, 1fr)); gap: 8px; }
.mx-corner { padding: 2px 4px 6px; min-width: 0; border-bottom: 1px solid var(--line-2); }
.mx-corner .big { font: 700 25px/1.2 var(--sans); letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mx-corner .big small { font-size: 13px; font-weight: 400; color: var(--muted); margin-right: 6px; }
.mx-corner .sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mx-crisis { padding: 0 12px 6px; border-bottom: 1px solid var(--line); min-width: 0; transition: border-color .2s; }
.mx-crisis.sel { border-bottom-color: var(--gold-b); }
.mx-crisis p { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.yr { font: 700 32px/1.05 var(--serif); color: var(--gold-b); letter-spacing: .02em; }
.nm { font: 700 17px/1.2 var(--serif); letter-spacing: .08em; }
.mx-crisis small { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }

.mx-rowhead { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: rgba(0, 0, 0, .2); min-width: 0; min-height: 0; overflow: hidden; transition: border-color .16s, background .16s; }
.mx-rowhead.sel { border-color: rgba(226, 185, 90, .6); background: rgba(226, 185, 90, .07); }
.rh-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: none; border: 0; padding: 0; text-align: left; min-width: 0; }
.rh-no { flex: none; font: 700 13px/1.5 var(--sans); color: #1B0E11; background: var(--gold-b); padding: 0 8px; border-radius: 999px; white-space: nowrap; }
.rh-name { font: 700 18px/1.25 var(--serif); letter-spacing: .04em; min-width: 0; }
.rh-main:hover .rh-name { color: var(--gold-b); }
.wbar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: rgba(255, 244, 240, .08); flex: none; }
.wbar i { display: block; height: 100%; }
.wline { font-size: 13px; line-height: 1.4; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.wline b { color: var(--text); font-weight: 700; } .wline i { color: var(--dim); margin: 0 2px; }
.rh-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; color: var(--dim); min-width: 0; }
.rh-foot span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cell { position: relative; display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 8px 12px 7px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(180deg, rgba(255, 244, 240, .05), rgba(255, 244, 240, .015)); min-width: 0; min-height: 0; overflow: hidden; transition: border-color .16s var(--ease), background .16s var(--ease), box-shadow .16s var(--ease); }
button.cell:hover { border-color: rgba(226, 185, 90, .55); }
.cell.sel { border-color: var(--gold-b); box-shadow: inset 0 0 0 1px var(--gold-b), 0 10px 28px rgba(0, 0, 0, .35); background: linear-gradient(180deg, rgba(226, 185, 90, .12), rgba(226, 185, 90, .02)); }
.cell.sub { border-style: dashed; }
.cell-k { display: none; font: 700 13px var(--sans); color: var(--gold-b); letter-spacing: .08em; }
.sub-strip { display: block; font-size: 13px; line-height: 1.4; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub-strip em, .sub-note em, .pp-sub em { display: inline-block; font: 700 13px/1.4 var(--sans); color: #1B0E11; background: #F3C98B; border-radius: 4px; padding: 0 6px; margin-right: 6px; }
.cell-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px 8px; min-width: 0; }
.depth { font: 800 27px/1.05 var(--sans); letter-spacing: -.01em; white-space: nowrap; }
.cell.flat .depth { color: var(--muted); }
.cell-side { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; min-width: 0; margin-left: auto; }
.cell-money { font-size: 13px; line-height: 1.4; color: var(--muted); white-space: nowrap; }
.cell-money i { color: var(--text); font-weight: 700; }
.tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.tags em { font: 700 13px/1.4 var(--sans); color: var(--gold-b); border: 1px solid rgba(226, 185, 90, .6); border-radius: 4px; padding: 0 4px; white-space: nowrap; }
.viz { display: flex; flex-direction: column; gap: 3px; flex: 1; min-height: 26px; }
.tankwrap { position: relative; flex: 1; min-height: 16px; border-top: 1.5px solid rgba(226, 185, 90, .7); background: repeating-linear-gradient(90deg, transparent 0, transparent calc(var(--tick, 33.33%) - 1px), rgba(255, 244, 240, .09) calc(var(--tick, 33.33%) - 1px), rgba(255, 244, 240, .09) var(--tick, 33.33%)); }
.clip { position: absolute; inset: 0; clip-path: inset(-8px calc(100% - var(--p, 100%)) -8px 0); }
.tank { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.w-body { fill: url(#gw); stroke: none; }
.w-fall { fill: none; stroke: var(--down); stroke-width: 2.2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.w-rise { fill: none; stroke: #D9CFCA; stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; opacity: .85; }
.flagdot { position: absolute; top: -1px; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; background: var(--gold-b); transform: rotate(45deg); box-shadow: 0 0 0 3px rgba(226, 185, 90, .22); }
.bar { position: relative; height: 7px; flex: none; border-radius: 4px; background: rgba(255, 244, 240, .07); }
.bar .clip { display: flex; inset: 0; clip-path: inset(0 calc(100% - var(--p, 100%)) 0 0); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; flex: none; }
.bar .fall { background: var(--down); }
.bar .under { background: var(--under); }
.bar .cap { width: 7px; background: var(--gold-b); }
.bar .more { flex: 1; min-width: 6px; background: repeating-linear-gradient(90deg, var(--under) 0 4px, transparent 4px 8px); opacity: .7; }
.cell-nums { display: flex; flex-wrap: wrap; gap: 0 12px; font-size: 13px; line-height: 1.45; color: var(--muted); min-width: 0; }
.cell-nums b { color: var(--text); font-size: 14.5px; }
.cell-nums .n-r b { color: var(--gold-b); }
.cell-nums .still b { color: var(--text); }
.cell.na { justify-content: center; gap: 3px; border-style: dashed; background: repeating-linear-gradient(135deg, rgba(255, 244, 240, .028) 0 8px, transparent 8px 16px); }
.na-t { font: 700 17px/1.3 var(--serif); letter-spacing: .06em; color: var(--muted); }
.na-s { font-size: 13px; color: var(--text); }
.na-f { font-size: 13px; color: var(--dim); }
.cell.skel, .mx-rowhead.skel { min-height: 96px; }
.mx-wait { font-size: 14px; color: var(--muted); padding: 4px 2px; }
.zone-err { margin: auto; max-width: 620px; width: 100%; display: flex; flex-direction: column; gap: 12px; }
.zone-err h2 { font: 700 22px var(--serif); }

.mx-ctrl { flex: none; display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; min-width: 0; padding-top: 2px; }
.scrub { flex: 1 1 110px; min-width: 90px; display: flex; }
.scrub input { width: 100%; accent-color: var(--gold-b); height: 22px; }
.clock { font-size: 13px; color: var(--muted); white-space: nowrap; }
.clock b { display: inline-block; min-width: 1.5em; text-align: center; font: 800 24px/1 var(--sans); color: var(--gold-b); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.lg { display: inline-block; width: 18px; height: 6px; border-radius: 3px; }
.lg.fall { background: var(--down); } .lg.under { background: var(--under); } .lg.cap { width: 8px; height: 8px; border-radius: 0; background: var(--gold-b); transform: rotate(45deg); }
.subsw { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; white-space: nowrap; }
.subsw > span { padding: 0 9px 0 10px; font-size: 13px; font-weight: 700; color: #F3C98B; }
.subsw button { min-height: 34px; padding: 3px 10px; border: 0; border-left: 1px solid var(--line); background: none; color: var(--muted); font-size: 13px; font-weight: 700; }
.subsw button:hover:not(:disabled) { color: var(--text); background: var(--gold-soft); }
.subsw button[aria-pressed="true"] { background: #F3C98B; color: #1B0E11; }
.subsw .spin { width: 11px; height: 11px; margin-right: 5px; border-color: rgba(27, 14, 17, .25); border-top-color: #1B0E11; }
.mx-help { position: absolute; right: 0; bottom: 48px; z-index: 5; width: min(600px, 100%); display: grid; gap: 6px; padding: 14px 16px; border: 1px solid rgba(226, 185, 90, .5); border-radius: 14px; background: #251317; box-shadow: 0 20px 60px rgba(0, 0, 0, .55); font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.mx-help h3 { font: 700 15px var(--sans); color: var(--gold-b); }
.mx-help b { color: var(--text); }
#subErr:empty { display: none; }

/* ── 對策台 ── */
.panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(180deg, rgba(255, 244, 240, .055), rgba(255, 244, 240, .015)); padding: 10px 16px 12px; overflow: hidden; }
.pn-empty { margin: auto 0; color: var(--muted); font-size: 14px; display: grid; gap: 8px; }
.pn-head, .pn-next { flex: none; }
.pn-head h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font: 700 21px/1.3 var(--serif); letter-spacing: .05em; margin-top: 1px; }
.verdict { margin-top: 3px; font-size: 13.5px; line-height: 1.5; }
.verdict b { color: var(--gold-b); } .verdict b.down { color: var(--down); }
.pn-scroll { flex: 1; min-height: 0; overflow: auto; margin: 0 -6px; padding: 0 6px; scrollbar-width: thin; scrollbar-color: rgba(226, 185, 90, .4) transparent; }
.pn-sec { border-top: 1px solid var(--line-2); padding-top: 5px; margin-top: 6px; min-width: 0; }
.pn-sec h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; font: 700 14.5px/1.4 var(--sans); color: var(--gold-b); letter-spacing: .04em; }
.pn-sec h3 span { font-weight: 400; font-size: 13px; color: var(--dim); letter-spacing: 0; }
.na-note { font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.na-note b { color: var(--text); }
.sub-note { font-size: 13px; line-height: 1.45; color: var(--text); padding: 4px 8px; margin-bottom: 4px; border-radius: 8px; border: 1px dashed rgba(243, 201, 139, .55); background: rgba(243, 201, 139, .07); }
.sub-note.plain { border-color: var(--line); background: none; color: var(--muted); }
.story { display: grid; gap: 1px; }
.story li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 2px 10px; align-items: baseline; font-size: 13.5px; line-height: 1.4; }
.story .s-l { color: var(--muted); min-width: 0; }
.story b { font: 400 13px var(--mono); color: var(--muted); }
.story em { font-weight: 700; text-align: right; white-space: nowrap; }
.story li.tr em { color: var(--down); }
.story .s-l i { margin-left: 6px; font-weight: 800; }
.story li.rc em { color: var(--gold-b); }
.story li.still em { color: var(--muted); font-weight: 400; }
/* 再平衡有沒有救到你：三場各一列，正在看的那一場把差額、次數、稅放大攤開 */
.rb { display: grid; gap: 1px; }
.rb-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0 8px; align-items: baseline; width: 100%; text-align: left; font-size: 13.5px; line-height: 1.45; padding: 1px 8px; border-radius: 8px; border: 1px solid transparent; background: none; color: inherit; }
.rb-row:hover { border-color: var(--line); }
.rb-row.on { border-color: rgba(226, 185, 90, .45); background: rgba(0, 0, 0, .22); padding: 3px 8px 4px; }
.rb-k { font: 700 15px var(--serif); color: var(--gold-b); }
.rb-d { color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .rb-d b { color: var(--text); } .rb-d i { margin: 0 4px; color: var(--dim); } .rb-d small { margin-left: 6px; font-size: 13px; color: #F3C98B; }
.rb-d.muted { color: var(--dim); }
.rb-v { font-weight: 700; font-size: 13px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; color: var(--muted); }
.rb-v.good { color: #1B0E11; background: var(--gold-b); border-color: var(--gold-b); }
.rb-v.bad { color: var(--text); border-color: rgba(255, 244, 240, .45); }
.rb-t { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0 14px; font-size: 13px; color: var(--muted); min-width: 0; }
.rb-t b { font-size: 15px; color: var(--text); }
.sec-tabs { display: flex; align-items: baseline; gap: 2px 14px; flex-wrap: wrap; margin-bottom: 4px; }
.sec-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 0 0 1px; font: 700 14.5px/1.4 var(--sans); letter-spacing: .04em; color: var(--dim); }
.sec-tabs button[aria-selected="true"] { color: var(--gold-b); border-bottom-color: var(--gold-b); }
.sec-tabs button:hover { color: var(--text); }
.sec-tabs span { margin-left: auto; font-size: 13px; color: var(--dim); }
.al-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-bottom: 6px; }
.al-l { font-size: 13px; color: var(--muted); margin-right: 2px; }
.al-pick .chipbtn { min-height: 27px; padding: 0 10px; }
.al-strip { position: relative; height: 30px; border-top: 1.5px solid rgba(226, 185, 90, .7); margin: 0 4px 17px; }
.al-strip svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.al-area { fill: rgba(127, 214, 164, .28); stroke: var(--down); stroke-width: 1; vector-effect: non-scaling-stroke; }
.al-line { stroke: var(--gold-b); stroke-width: 1; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; fill: none; }
.bell { position: absolute; top: -6px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--gold-b); box-shadow: 0 0 0 3px rgba(226, 185, 90, .25); }
.al-y0, .al-y1 { position: absolute; bottom: -18px; font: 13px/1.3 var(--sans); color: var(--dim); white-space: nowrap; }
.al-y0 { left: -4px; } .al-y1 { right: -4px; }
.fan { border-top: 0; }
.fan-band { fill: rgba(226, 185, 90, .2); stroke: none; }
.fan-mid { fill: none; stroke: var(--gold-b); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.fan-base { fill: none; stroke: rgba(255, 244, 240, .6); stroke-width: 1; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.al-sum { font-size: 13.5px; line-height: 1.45; } .al-sum b { color: var(--gold-b); font-size: 16px; }
.roll-sum b { color: var(--text); font-size: 14.5px; } .roll-t { font-weight: 700; color: var(--text); }
.al-tab { width: 100%; border-collapse: collapse; margin-top: 2px; font-size: 13px; }
.al-tab th, .al-tab td { padding: 0 3px; text-align: right; white-space: nowrap; font-weight: 700; line-height: 1.5; }
.al-tab thead th { font-weight: 400; font-size: 13px; color: var(--dim); border-bottom: 1px solid var(--line-2); }
.al-tab th:first-child { text-align: left; padding-left: 0; }
.al-tab tbody th { font: 700 13px/1.5 var(--mono); color: var(--text); }
.al-tab td:last-child { padding-right: 0; }
.al-wait { font-size: 13.5px; color: var(--muted); }
.al .fine { margin-top: 3px; line-height: 1.4; }
.pn-next { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line-2); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.pn-next .primary { min-width: 0; padding: 8px 14px; font-size: 15px; }
.pn-next .decided { grid-column: 1 / -1; display: flex; gap: 6px; align-items: baseline; font-size: 13px; color: var(--gold-b); }
.paper-btn { min-height: 46px; }

/* ── 入場 ── */
.gate { flex: 1; min-height: 0; overflow: auto; position: relative; display: flex; flex-direction: column; }
.gate-in { position: relative; width: 100%; max-width: 1360px; margin: auto; padding: 20px 32px; display: grid; grid-template-columns: minmax(0, 4.2fr) minmax(0, 7.8fr); gap: 44px; align-items: center; }
.gate-head { min-width: 0; }
.eyebrow { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 700; letter-spacing: .3em; color: var(--gold-b); }
.eyebrow .rule { width: 40px; height: 1px; background: var(--gold-b); }
.gate-head h1 { margin-top: 16px; font: 700 clamp(30px, 3.5vw, 50px)/1.28 var(--serif); letter-spacing: .04em; }
.gate-head .lead { margin-top: 16px; font-size: 16px; line-height: 1.85; color: var(--muted); max-width: 30em; }
.gate-head .lead b { color: var(--text); font-weight: 700; white-space: nowrap; }
.gate-fig { display: block; width: 100%; max-width: 440px; height: auto; margin-top: 18px; }
.gate-fig text { font: 13px var(--sans); fill: var(--muted); }
.gate-fig .gf-g { fill: var(--gold-b); font-weight: 700; }
.gate-today { margin-top: 20px; display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, .25); color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.gate-today:hover { border-color: var(--gold-b); }
.gate-today .dot { margin-top: 8px; }
.gt-t { flex: 1; min-width: 0; } .gt-t b { display: block; color: var(--gold-b); font-size: 13px; letter-spacing: .14em; }
.gate-card { min-width: 0; border: 1px solid rgba(226, 185, 90, .32); border-radius: 18px; background: linear-gradient(180deg, rgba(43, 20, 24, .92), rgba(24, 13, 15, .92)); box-shadow: 0 30px 80px rgba(0, 0, 0, .45); padding: 18px 22px 16px; display: grid; gap: 12px; }
.demo-band { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: rgba(232, 200, 119, .1); border: 1px solid rgba(232, 200, 119, .35); font-size: 13.5px; line-height: 1.6; }
.demo-band p { flex: 1 1 260px; min-width: 0; color: var(--text); } .demo-band b { color: var(--gold-b); }
.snap { display: grid; gap: 6px; padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(226, 185, 90, .5); background: var(--gold-soft); }
.snap-t { font-size: 14px; line-height: 1.6; } .snap-t b { color: var(--gold-b); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tabs button { min-height: 42px; padding: 6px 16px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: 700 16px var(--serif); letter-spacing: .08em; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--gold-b); border-bottom-color: var(--gold-b); }
.tabs button:disabled { opacity: .45; }
.gate-wait { color: var(--muted); padding: 30px 0; }
.gate-grid { display: grid; grid-template-columns: minmax(0, 3.6fr) minmax(0, 7.4fr); gap: 20px; min-width: 0; }
.paste { display: grid; gap: 8px; align-content: start; min-width: 0; }
.paste label, .lump label, .fld label, .fld-l { font-size: 14px; font-weight: 700; color: var(--text); }
.paste label small { display: block; font-weight: 400; font-size: 13px; color: var(--dim); }
textarea { width: 100%; min-width: 0; resize: vertical; border: 1px solid var(--line); border-radius: 10px; background: rgba(0, 0, 0, .3); padding: 8px 10px; font: 14px/1.6 var(--mono); }
textarea:focus { outline: none; border-color: var(--gold-b); box-shadow: 0 0 0 2px rgba(226, 185, 90, .45); }
textarea::placeholder, input::placeholder { color: rgba(196, 179, 173, .5); }
.bad { display: grid; gap: 5px; }
.bad li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; color: var(--up); line-height: 1.5; }
.bad b { font-family: var(--mono); color: var(--text); } .bad-tail { color: var(--dim); }
.bad .chipbtn { min-height: 30px; color: var(--gold-b); border-color: rgba(226, 185, 90, .55); }
.hold { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
#holdList { display: grid; gap: 5px; max-height: 250px; overflow: auto; padding-right: 2px; }
.hold-empty { padding: 16px 14px; border: 1px dashed var(--line); border-radius: 10px; font-size: 14px; line-height: 1.7; color: var(--muted); }
.hold-row { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, .95fr) minmax(0, 1.2fr) 70px 34px; gap: 6px; align-items: center; min-width: 0; }
.hold-row.head { font-size: 13px; color: var(--dim); padding-right: 2px; }
.hold-row.head span:nth-child(3), .hold-row.head span:nth-child(4) { text-align: right; }
.hold-row select, .hold-row > input, .sw-row select { min-width: 0; width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 9px; background: #1E1013; padding: 0 8px; font-size: 14px; }
.hold-row > input { text-align: right; font-weight: 700; }
.hold-row select:focus, .hold-row > input:focus, .sw-row select:focus { outline: none; border-color: var(--gold-b); box-shadow: 0 0 0 2px rgba(226, 185, 90, .35); }
.hold-row.bad > input, .hold-row.bad .in { border-color: var(--up); }
.row-hint { grid-column: 1 / -1; font-size: 13px; color: var(--up); } .row-hint:empty { display: none; }
.hold-row.cash { padding-top: 6px; border-top: 1px dashed var(--line); }
.cash-l { font-size: 14px; font-weight: 700; } .cash-l small { display: block; font-weight: 400; font-size: 13px; color: var(--dim); }
.hold-row.cash .in { grid-column: 2 / 4; min-height: 36px; padding: 0 8px; } .hold-row.cash .in input { font-size: 14px; text-align: right; padding: 4px 0; }
.hold-row.cash .hv { display: none; }
.hv { text-align: right; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hp { position: relative; height: 22px; border-radius: 5px; background: rgba(255, 244, 240, .06); overflow: hidden; }
.hp i { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(226, 185, 90, .4); }
.hp b { position: absolute; right: 5px; top: 0; font-size: 13px; line-height: 22px; }
.hold-foot { justify-content: space-between; margin-top: 2px; }
.total { font-size: 13.5px; color: var(--muted); text-align: right; } .total b { font-size: 19px; color: var(--gold-b); margin-left: 6px; } .total small { display: block; font-size: 13px; color: var(--dim); }
.lump { display: grid; gap: 8px; padding: 8px 0; }
.bigin { display: flex; align-items: baseline; gap: 10px; border-bottom: 2px solid var(--gold); padding: 4px 2px; min-width: 0; }
.bigin:focus-within { border-bottom-color: var(--gold-b); box-shadow: 0 3px 0 rgba(226, 185, 90, .35); }
.bigin span { font-size: 18px; color: var(--muted); }
.bigin input { flex: 1; min-width: 0; width: 100%; border: 0; outline: none; background: none; font: 800 clamp(28px, 4vw, 44px)/1.2 var(--sans); color: var(--gold-b); }
.lump-eq { font-size: 15px; font-weight: 700; color: var(--text); min-height: 1.5em; } .lump-eq.bad { color: var(--up); font-weight: 400; font-size: 13.5px; }
.gate-foot { display: grid; gap: 8px; }
.gate-foot .primary { justify-self: start; min-width: 220px; font-size: 17px; min-height: 52px; }
.gate-err:empty { display: none; }
.gate-err { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 12px; border-radius: 10px; border: 1px solid rgba(255, 157, 148, .45); background: rgba(255, 157, 148, .07); font-size: 14px; }
.gate-err p { flex: 1 1 220px; min-width: 0; }
.gate::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 46%; pointer-events: none; opacity: .5;
  background: radial-gradient(60% 120% at 20% 120%, rgba(226, 185, 90, .12), transparent 60%); }

/* ── 視窗共用 ── */
dialog.sheet, dialog.mini { padding: 0; border: 1px solid rgba(226, 185, 90, .45); border-radius: 18px; background: linear-gradient(180deg, #2B1519, #190D10); color: var(--text); box-shadow: 0 30px 90px rgba(0, 0, 0, .6); max-height: calc(100vh - 16px); overflow: auto; }
dialog.sheet::backdrop, dialog.mini::backdrop { background: rgba(8, 4, 5, .74); }
dialog.sheet { width: min(1300px, calc(100vw - 24px)); scrollbar-width: thin; scrollbar-color: rgba(226, 185, 90, .45) transparent; }
dialog.mini { width: min(620px, calc(100vw - 24px)); padding: 18px 20px 20px; }
dialog.mini > * + * { margin-top: 10px; }
.mini-head, .sh-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.mini-head h2, .sh-head h2 { font: 700 23px/1.3 var(--serif); letter-spacing: .05em; margin-top: 2px; }
.sh-head { padding: 12px 22px 6px; }
.sh-head h2 { display: flex; align-items: baseline; gap: 4px 16px; flex-wrap: wrap; }
.sh-head h2 .wline { font: 400 13.5px/1.5 var(--sans); letter-spacing: 0; display: inline; }

/* ── 決策桌 ── */
.sh-grid { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 18px; padding: 4px 22px 10px; align-items: start; }
.sh-side { display: grid; gap: 11px; min-width: 0; padding-right: 18px; border-right: 1px solid var(--line-2); align-self: stretch; align-content: start; }
.fld { display: grid; gap: 5px; align-content: start; min-width: 0; }
.fld-err { font-size: 13px; color: var(--up); }
.keep { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.5; color: var(--muted); cursor: pointer; }
.keep input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--gold-b); }
.sh-done { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin: 2px 22px 8px; padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(226, 185, 90, .7); background: var(--gold-soft); }
.sh-done > .ic { width: 26px; height: 26px; color: var(--gold-b); margin-top: 2px; }
.sh-done > div:first-of-type { flex: 1 1 320px; min-width: 0; display: grid; gap: 2px; }
.sh-done b { font: 700 19px/1.4 var(--serif); letter-spacing: .04em; color: var(--gold-b); } .sh-done span { font-size: 13px; color: var(--muted); word-break: break-all; } .sh-done p { font-size: 14px; }
.sh-body { display: grid; gap: 8px; min-width: 0; align-content: start; }
.sh-brief { font-size: 14.5px; line-height: 1.55; }
.sh-note, .sh-basis { font-size: 13.5px; line-height: 1.55; padding: 6px 12px; border-radius: 10px; border: 1px dashed var(--line); color: var(--muted); }
.sh-basis b { color: var(--text); } .sh-basis b.gold { color: var(--gold-b); }
.sh-cash { padding: 6px 12px; border-radius: 10px; border: 1px solid rgba(226, 185, 90, .3); background: rgba(226, 185, 90, .05); }
.sh-cash .ap-legs ul { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2px 18px; }
.sh-load { color: var(--muted); font-size: 14px; }
.ap-sub { font-size: 13px; color: var(--dim); }
.sh-now { display: grid; gap: 4px; min-width: 0; }
.sh-now ul { display: grid; gap: 1px; }
.sh-now li { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 6px; align-items: baseline; font-size: 13px; padding: 1px 0; border-bottom: 1px solid var(--line-2); }
.sh-now li b { font: 700 13px var(--mono); } .sh-now li span { color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .sh-now li em { font-weight: 700; white-space: nowrap; } .sh-now li em i { margin: 0 3px; color: var(--dim); font-weight: 400; }
.sh-now li.add em { color: var(--gold-b); }
.sh-now li.cut em { color: var(--muted); }
.sh-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; transition: opacity .2s; }
.sh-cards.one { grid-template-columns: minmax(0, 1fr); }
.sh-cards.busy { opacity: .45; pointer-events: none; }
.ap { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 10px 14px 0; border: 1px solid var(--line); border-radius: 14px; background: rgba(0, 0, 0, .22); }
.ap.skel { min-height: 300px; overflow: hidden; }
.ap.chosen { border-color: var(--gold-b); box-shadow: inset 0 0 0 1px var(--gold-b); }
.ap.off { opacity: .8; }
.ap header { display: flex; align-items: baseline; justify-content: space-between; gap: 2px 8px; flex-wrap: wrap; }
.ap-no { font: 700 13px/1.5 var(--sans); color: #1B0E11; background: var(--gold-b); border-radius: 999px; padding: 0 8px; white-space: nowrap; }
.ap h3 { font: 700 18px/1.3 var(--serif); letter-spacing: .04em; flex: 1 1 100%; min-width: 0; }
.ap-sell { font-size: 13px; font-weight: 700; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.ap-sell.yes { color: #F3C98B; border-color: rgba(243, 201, 139, .55); } .ap-sell.no { color: var(--muted); }
.ap-sum { font-size: 13px; line-height: 1.45; color: var(--muted); min-height: 4.35em; }
.ap-figs { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr); gap: 6px; padding: 5px 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.ap-figs div { min-width: 0; } .ap-figs dt { font-size: 13px; color: var(--dim); white-space: nowrap; } .ap-figs dd { font-size: 15.5px; font-weight: 800; white-space: nowrap; } .ap-figs dd small { font-size: 13px; font-weight: 400; color: var(--muted); }
.ap-more { display: grid; gap: 6px; flex: 1; align-content: start; }
.ap-legs ul { display: grid; gap: 1px; margin-top: 2px; }
.ap-legs li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px; align-items: center; font-size: 13px; }
.lg-side { font-weight: 700; font-size: 13px; width: 21px; height: 21px; display: inline-flex; align-items: center; justify-content: center; border-radius: 5px; border: 1px solid var(--line); }
.lg-side.buy { color: var(--gold-b); border-color: rgba(226, 185, 90, .5); } .lg-side.sell { color: var(--text); }
.lg-sym { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.lg-sym b { font: 700 13px var(--mono); color: var(--text); }
.lg-amt { text-align: right; white-space: nowrap; font-weight: 700; } .lg-amt small { font-weight: 400; font-size: 13px; color: var(--dim); margin-right: 6px; }
.pj { position: relative; height: 28px; margin-top: 3px; border-bottom: 1px solid var(--line-2); }
.pj svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pj-line { fill: none; stroke: var(--gold-b); stroke-width: 2; vector-effect: non-scaling-stroke; }
.pj-thr { fill: none; stroke: var(--dim); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.pj .sold { position: absolute; bottom: -4px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: #F3C98B; }
.pj-cap { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--dim); margin-top: 2px; } .pj-cap b { color: var(--text); }
.ap-h1 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; font-size: 13px; color: var(--muted); } .ap-h1 b { font-size: 15px; color: var(--text); } .ap-h1 b.up { color: var(--up); } .ap-h1 b.down { color: var(--down); }
.ap-h2 { font-size: 13px; color: var(--muted); }
.ap-rule { font-size: 13px; line-height: 1.5; color: var(--muted); padding: 5px 9px; border-radius: 8px; background: rgba(226, 185, 90, .07); border: 1px solid rgba(226, 185, 90, .2); }
.ap-rule b { color: var(--gold-b); }
/* 「選這個做法」永遠看得到：卡片再長，按鈕都黏在視窗底 */
.ap footer { position: sticky; bottom: 0; margin: auto -14px 0; padding: 9px 14px 10px; border-radius: 0 0 14px 14px; background: #1C0F12; border-top: 1px solid var(--line-2); box-shadow: 0 -12px 14px -10px rgba(0, 0, 0, .7); }
.ap footer .primary { width: 100%; min-height: 44px; font-size: 15px; padding: 6px 12px; }
.ap-off { font-size: 13px; color: var(--muted); padding-bottom: 4px; }
.lc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 8px 28px; align-items: start; }
.lc-h { margin-top: 10px; }
.lc-tab { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 3px; }
.lc-tab th, .lc-tab td { padding: 3px 6px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line-2); font-weight: 700; }
.lc-tab thead th { font-weight: 400; font-size: 13px; color: var(--dim); } .lc-tab th:first-child { text-align: left; padding-left: 0; white-space: normal; font-weight: 400; color: var(--muted); }
.lc-tab tr.on th, .lc-tab tr.on td { color: var(--gold-b); background: rgba(226, 185, 90, .07); }
.sh-foot { display: grid; gap: 1px; font-size: 13px; line-height: 1.5; color: var(--dim); }
.sh-foot b { color: var(--muted); }
.sh-legal { padding: 6px 0 0; border-top: 1px solid var(--line-2); grid-template-columns: minmax(0, 1fr); }
.sh-legal .si-legal-src, .sh-legal p { grid-column: 1; grid-row: auto; }

/* ── 今日與我設定的條件（自己畫的金黑版）、換一組、金鑰 ── */
.td-head { display: flex; gap: 10px; align-items: baseline; font-size: 16px; line-height: 1.6; }
.td-items { display: grid; gap: 6px; }
.td-items li { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); display: grid; gap: 4px; font-size: 14px; }
.td-items li.act { border-color: rgba(226, 185, 90, .55); }
.td-items li span { color: var(--muted); font-size: 13.5px; }
.td-mkt, .td-wait { font-size: 13.5px; color: var(--muted); }
.cd-title { font: 700 17px var(--serif); letter-spacing: .06em; color: var(--gold-b); padding-top: 10px; border-top: 1px solid var(--line-2); margin-top: 14px !important; }
.cd-list { display: grid; gap: 6px; }
.cd { padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, .2); display: grid; gap: 5px; }
.cd.off { opacity: .8; }
.cd-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 14.5px; }
.cd-k { font-size: 13px; font-weight: 700; color: #1B0E11; background: var(--gold-b); border-radius: 999px; padding: 0 8px; white-space: nowrap; }
.cd.off .cd-k { background: var(--under); }
.cd-s { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }
.cd-c { font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.cd-t { font-size: 13.5px; line-height: 1.55; padding: 6px 10px; border-radius: 8px; background: var(--gold-soft); }
.cd-none { font-size: 14px; color: var(--muted); line-height: 1.7; }
.cd-off summary { cursor: pointer; font-size: 14px; font-weight: 700; color: var(--muted); padding: 6px 0; }
.cd-off[open] summary { margin-bottom: 6px; }
.sw-list { display: grid; gap: 6px; }
.sw-list button { width: 100%; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.5fr) auto; gap: 4px 10px; align-items: center; text-align: left; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, .2); }
.sw-list button:hover:not(:disabled) { border-color: var(--gold-b); background: var(--gold-soft); }
.sw-list button:disabled { opacity: .55; }
.sw-n b { display: block; font: 700 16px var(--serif); } .sw-n small { color: var(--muted); font-size: 13px; }
.sw-d { display: flex; flex-wrap: wrap; gap: 0 10px; font-size: 13px; color: var(--dim); } .sw-d b { color: var(--down); } .sw-d i { margin-left: 3px; color: #F3C98B; font-weight: 400; }
.sw-s { font-size: 13px; font-weight: 700; color: var(--gold-b); white-space: nowrap; }
.sw-custom { border-top: 1px solid var(--line-2); padding-top: 10px; display: grid; gap: 8px; }
.sw-custom h3 { font: 700 15px var(--sans); color: var(--gold-b); }
.sw-rows { display: grid; gap: 6px; }
.sw-row { display: grid; grid-template-columns: minmax(0, 1fr) 104px 34px; gap: 8px; }
.sw-row .in { min-height: 36px; }
.sw-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 14px; color: var(--up); } .sw-sum.ok { color: var(--gold-b); }
#keyDlg p { font-size: 14px; line-height: 1.7; }

/* ── 董事會一頁紙（螢幕預覽；紙本用的字級，不在投影牆 13px 的規則裡）── */
.paper { position: fixed; inset: 0; z-index: 40; overflow: auto; background: rgba(10, 5, 6, .94); padding: 14px 20px 24px; }
.pp-tools { max-width: 1100px; margin: 0 auto 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.pp-tools p { flex: 1 1 280px; min-width: 0; } .pp-tools b { font: 700 19px var(--serif); color: var(--text); letter-spacing: .08em; }
.pp-fit { max-width: 1100px; margin: 0 auto; overflow: hidden; }
.page { width: 277mm; height: 190mm; transform-origin: top left; background: #FFFDF8; color: #201B1A; padding: 7mm 10mm 5mm; display: flex; flex-direction: column; gap: 2.2mm; font: 11.5px/1.5 var(--sans); font-variant-numeric: tabular-nums; box-shadow: 0 24px 70px rgba(0, 0, 0, .55); overflow: hidden; }
.page h2 { font: 700 12px/1.4 var(--sans); letter-spacing: .1em; color: #8A6417; }
.pp-cav { margin-left: 8px; font-weight: 700; letter-spacing: 0; color: #9A4A12; }
.pp-head { flex: none; display: flex; justify-content: space-between; align-items: flex-end; gap: 8mm; border-bottom: 1.5px solid #201B1A; padding-bottom: 2.2mm; }
.pp-eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: .22em; color: #8A6417; display: flex; gap: 8px; align-items: center; }
.pp-demo { letter-spacing: .04em; background: #E8C877; color: #1B0E11; padding: 0 6px; border-radius: 3px; }
.pp-head h1 { font: 700 23px/1.3 var(--serif); letter-spacing: .04em; }
.pp-head dl { display: grid; grid-template-columns: auto auto; gap: 0 8mm; font-size: 10.5px; min-width: 0; }
.pp-head dl div { display: flex; gap: 6px; min-width: 0; } .pp-head dt { color: #77706C; white-space: nowrap; } .pp-head dd { font-weight: 700; }
.pp-head dl div:nth-child(n+3) { grid-column: 1 / -1; }
.pp-main { display: grid; grid-template-columns: minmax(0, 1fr) 64mm; gap: 6mm; flex: none; }
.pp-chart { display: flex; flex-direction: column; gap: 1.2mm; min-width: 0; }
.pp-chart table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.pp-chart thead th { text-align: left; font-weight: 400; font-size: 11px; padding: 0 3mm 1mm; border-bottom: 1px solid #D9D2CC; }
.pp-chart thead th:first-child { width: 27mm; }
.pp-chart thead b { font: 700 17px var(--serif); margin-right: 4px; } .pp-chart thead small { display: block; color: #77706C; font-size: 10px; }
.pp-chart tbody th { text-align: left; vertical-align: top; padding: 1.4mm 2mm 1.4mm 0; border-bottom: 1px solid #E8E2DE; }
.pp-chart tbody th b { display: block; font: 700 14px var(--serif); } .pp-chart tbody th span { font-size: 10px; font-weight: 400; color: #77706C; }
.pp-chart td { vertical-align: top; padding: 1.4mm 3mm; border-bottom: 1px solid #E8E2DE; border-left: 1px solid #F0EBE7; }
.pp-chart td.na { color: #77706C; font-size: 11px; background: repeating-linear-gradient(135deg, #F6F2EE 0 6px, #FFFDF8 6px 12px); } .pp-chart td.na span { display: block; font-weight: 700; } .pp-chart td.na small { font-size: 10px; }
.pp-sub { font-size: 10px; line-height: 1.4; color: #5A3A10; margin: 0 0 .6mm; } .pp-sub em { font-size: 10px; padding: 0 4px; margin-right: 4px; }
.pp-nums { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; } .pp-nums b { font-size: 19px; font-weight: 800; color: #1E7F4F; } .pp-nums b.flat { color: #77706C; } .pp-nums span { font-size: 10px; color: #4A4340; }
.pp-bar { display: flex; height: 7px; margin: 1mm 0; background: #EFEAE5; border-radius: 4px; overflow: hidden; }
.pp-bar i { display: block; height: 100%; flex: none; } .pp-bar .fall, .pp-legend .fall { background: #1E7F4F; } .pp-bar .under, .pp-legend .under { background: #A39A95; } .pp-bar .cap, .pp-legend .cap { width: 6px; background: #C89B3C; } .pp-bar .more { flex: 1; background: repeating-linear-gradient(90deg, #A39A95 0 4px, transparent 4px 8px); }
.pp-money { font-size: 10px; line-height: 1.4; color: #4A4340; }
.pp-legend { display: flex; flex-wrap: wrap; gap: 1mm 4mm; font-size: 10px; color: #4A4340; margin-top: .6mm; }
.pp-legend span { display: inline-flex; align-items: center; gap: 4px; } .pp-legend i { display: inline-block; width: 14px; height: 6px; border-radius: 3px; } .pp-legend i.cap { width: 6px; }
.pp-trace, .page small { font-family: var(--mono); font-size: 9.5px; color: #77706C; }
.pp-three { display: flex; flex-direction: column; gap: 1.6mm; min-width: 0; border-left: 1.5px solid #201B1A; padding-left: 5mm; }
.pp-n { flex: 1; display: flex; flex-direction: column; justify-content: center; border-bottom: 1px solid #E8E2DE; padding-bottom: 1.2mm; min-width: 0; }
.pp-n:last-child { border-bottom: 0; }
.pp-n p { font-size: 10.5px; color: #4A4340; } .pp-n b { font: 800 22px/1.2 var(--sans); white-space: nowrap; } .pp-n span { font-size: 10px; color: #4A4340; line-height: 1.4; }
.pp-n:first-of-type b { color: #1E7F4F; }
.pp-text { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 6mm; border-top: 1.5px solid #201B1A; padding-top: 2.2mm; flex: 1; min-height: 0; align-content: start; }
.pp-para p { font: 12.5px/1.7 var(--serif); margin-top: 1mm; text-align: justify; }
.pp-decide { min-width: 0; }
.pp-decide p { margin-top: 1mm; font-size: 11px; line-height: 1.55; }
.pp-ok b { font-size: 13px; color: #8A6417; }
.pp-decide ul { margin: 1mm 0 0; padding-left: 14px; list-style: disc; font-size: 10.5px; line-height: 1.5; }
.pp-note { background: #F4F1EE; border-radius: 4px; padding: 3px 8px; }
.pp-wait { font-weight: 700; }
.pp-none { font-size: 12px; color: #4A4340; }
.pp-foot { flex: none; border-top: 1px solid #D9D2CC; padding-top: 1.5mm; font-size: 9.5px; line-height: 1.45; color: #77706C; }
/* 手機：直向、看得清楚的閱讀版（列印仍然是 A4 橫式，見最下面）*/
.paper.reflow .page { width: auto; height: auto; overflow: visible; padding: 16px 14px; gap: 12px; font-size: 14px; border-radius: 10px; }
.paper.reflow .page h2 { font-size: 14px; }
.paper.reflow .pp-head { flex-direction: column; align-items: flex-start; gap: 8px; } .paper.reflow .pp-head h1 { font-size: 22px; } .paper.reflow .pp-head dl { grid-template-columns: minmax(0, 1fr); font-size: 13px; } .paper.reflow .pp-eyebrow { font-size: 13px; letter-spacing: .12em; }
.paper.reflow .pp-main, .paper.reflow .pp-text { grid-template-columns: minmax(0, 1fr); gap: 14px; }
.paper.reflow .pp-chart table, .paper.reflow .pp-chart tbody, .paper.reflow .pp-chart tr, .paper.reflow .pp-chart td, .paper.reflow .pp-chart tbody th { display: block; width: auto; }
.paper.reflow .pp-chart thead { display: none; }
.paper.reflow .pp-chart tbody th { border: 0; padding: 8px 0 2px; } .paper.reflow .pp-chart tbody th b { font-size: 17px; display: inline; margin-right: 8px; } .paper.reflow .pp-chart tbody th span { font-size: 13px; }
.paper.reflow .pp-chart td { border-left: 0; padding: 8px 0; } .paper.reflow .pp-chart td::before { display: block; font: 700 13px var(--sans); color: #8A6417; margin-bottom: 2px; }
.paper.reflow .pp-chart td:nth-of-type(1)::before { content: "2008 金融海嘯"; } .paper.reflow .pp-chart td:nth-of-type(2)::before { content: "2020 疫情崩跌"; } .paper.reflow .pp-chart td:nth-of-type(3)::before { content: "2022 升息空頭"; }
.paper.reflow .pp-chart td.na { padding: 8px 10px; font-size: 14px; } .paper.reflow .pp-chart td.na small, .paper.reflow .pp-sub, .paper.reflow .pp-sub em { font-size: 13px; }
.paper.reflow .pp-nums b { font-size: 24px; } .paper.reflow .pp-nums span, .paper.reflow .pp-money, .paper.reflow .pp-legend { font-size: 13px; }
.paper.reflow .pp-trace, .paper.reflow .page small { font-size: 13px; display: block; }
.paper.reflow .pp-three { border-left: 0; padding-left: 0; border-top: 1.5px solid #201B1A; padding-top: 10px; } .paper.reflow .pp-n p, .paper.reflow .pp-n span { font-size: 13.5px; } .paper.reflow .pp-n b { font-size: 26px; }
.paper.reflow .pp-para p { font-size: 15px; text-align: left; } .paper.reflow .pp-decide p, .paper.reflow .pp-decide ul { font-size: 14px; } .paper.reflow .pp-ok b { font-size: 16px; }
.paper.reflow .pp-foot { font-size: 13px; } .paper.reflow .pp-cav { display: block; margin: 2px 0 0; }

/* 進場的動態：矩陣亮起來、入場畫面浮上來（尊重「減少動態」設定，見最下面）*/
@keyframes cellin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.mx.fresh > * { animation: cellin .4s var(--ease) both; }
.mx.fresh > *:nth-child(n+5) { animation-delay: .04s; } .mx.fresh > *:nth-child(n+9) { animation-delay: .08s; } .mx.fresh > *:nth-child(n+13) { animation-delay: .12s; } .mx.fresh > *:nth-child(n+17) { animation-delay: .16s; }
.gate-in.first .gate-head, .gate-in.first .gate-card { animation: cellin .6s var(--ease) both; } .gate-in.first .gate-card { animation-delay: .08s; }

/* ── 單屏投影牆：寬螢幕而且夠高時不捲動 ── */
@media (min-width: 1200px) and (min-height: 820px) {
  .wall { height: 100vh; overflow: hidden; }
  body.paper-open { overflow: hidden; }
}
/* 夠寬但不夠高（筆電）：維持左右兩欄，整頁可以捲，格子不壓扁 */
@media (min-width: 1200px) and (max-height: 819px) {
  .mx { grid-template-rows: none; }
  .cell { min-height: 140px; }
  .panel { overflow: visible; align-self: start; }
  .pn-scroll { overflow: visible; }
  .gate { overflow: visible; }
}
/* 1200～1400 寬（一般筆電）：格子比較窄，大數字縮一點，和右邊的「谷底剩」不擠在一起 */
@media (min-width: 1200px) and (max-width: 1400px) {
  .depth { font-size: 24px; }
}
/* 比投影牆窄：對策台移到矩陣下面，整頁可以捲 */
@media (max-width: 1199px) {
  .main { grid-template-columns: minmax(0, 1fr); }
  .mx { grid-template-rows: none; }
  .cell { min-height: 140px; } .mx-rowhead { min-height: 0; }
  .panel { overflow: visible; scroll-margin-top: 8px; }
  .pn-scroll { overflow: visible; }
  .pn-next { margin-top: 12px; }
  .link.back-mx { display: inline-flex; }
  .cell { scroll-margin: 80px 0; }
  .gate { overflow: visible; }
  .gate-in { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 24px 20px; }
  .sh-cards, .lc-grid { grid-template-columns: minmax(0, 1fr); }
  .sh-grid { grid-template-columns: minmax(0, 1fr); }
  .sh-side { padding-right: 0; border-right: 0; }
  .ap-sum { min-height: 0; }
  .ap footer { position: static; }
  .legal { grid-template-columns: minmax(0, 1fr); }
  .legal .si-legal-src { grid-column: 1; grid-row: auto; }
  .mx-help { position: static; width: auto; }
}
/* 手機：矩陣改成一欄，每個配置底下排三場風暴 */
@media (max-width: 719px) {
  .top { padding: 8px 12px; gap: 8px 10px; }
  .brand-text small { display: none; }
  .steps { order: 3; flex: 1 1 100%; justify-content: space-between; margin: 0; }
  .steps button { padding: 4px 8px 4px 4px; font-size: 13px; gap: 5px; min-width: 0; }
  .top-right { margin-left: auto; justify-content: flex-end; }
  #aiLink { display: none; }
  .main { padding: 10px 12px 8px; }
  .mx { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .mx-crisis { display: none; }
  .cell-k { display: block; }
  .mx-rowhead { margin-top: 10px; }
  .cell { min-height: 132px; }
  .legend { flex-basis: 100%; }
  .legal { padding: 8px 12px 12px; }
  .gate-in { padding: 18px 12px 20px; }
  .gate-head h1 { font-size: 29px; }
  .gate-head .lead { font-size: 15px; margin-top: 12px; }
  .gate-fig { display: none; }
  .gate-today { margin-top: 14px; }
  .gate-card { padding: 14px 12px; border-radius: 14px; }
  .gate-grid { grid-template-columns: minmax(0, 1fr); }
  .hold-row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 34px; }
  .hold-row .hv { grid-column: 1; grid-row: 2; text-align: left; font-size: 13px; color: var(--muted); }
  .hold-row .hp { grid-column: 2 / 4; grid-row: 2; }
  .hold-row.head span:nth-child(3), .hold-row.head span:nth-child(4) { display: none; }
  .hold-row.cash { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); } .hold-row.cash .in { grid-column: 2; } .hold-row.cash .hp { grid-column: 1 / -1; grid-row: 2; } .hold-row.cash > span:empty { display: none; }
  .gate-foot .primary { width: 100%; }
  #holdList { max-height: none; }
  .tabs button { font-size: 15px; padding: 6px 10px; }
  dialog.sheet { width: calc(100vw - 12px); max-height: calc(100vh - 12px); border-radius: 14px; }
  .sh-head { padding: 12px 14px 8px; } .sh-grid { padding: 4px 14px 14px; } .sh-done { margin: 2px 14px 8px; }
  .mini-head h2, .sh-head h2 { font-size: 20px; }
  dialog.mini { padding: 14px; }
  .sw-list button { grid-template-columns: minmax(0, 1fr) auto; } .sw-d { grid-column: 1 / -1; grid-row: 2; }
  .paper { padding: 10px 8px 20px; }
  .pn-next { grid-template-columns: minmax(0, 1fr); }
  .subsw { order: 5; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ── 列印：只印一頁紙（A4 橫式）。不管螢幕上是預覽還是手機閱讀版，印出來都一樣 ── */
@page { size: A4 landscape; margin: 10mm; }
@media print {
  html, body { background: #fff !important; height: auto !important; min-height: 0 !important; overflow: visible !important; }
  body > *:not(#paper) { display: none !important; }
  #paper, #paper[hidden] { display: block !important; position: static !important; padding: 0 !important; background: none !important; overflow: visible !important; }
  .pp-tools { display: none !important; }
  .pp-fit { max-width: none !important; height: auto !important; overflow: visible !important; margin: 0 !important; }
  .page, .paper.reflow .page { width: 277mm !important; height: 190mm !important; overflow: hidden !important; border-radius: 0 !important; font-size: 11.5px !important; gap: 2.2mm !important; transform: none !important; margin: 0 !important; box-shadow: none !important; background: #fff !important; padding: 2mm 2mm 0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ── 第三輪 ── */
/* 替身：格子上先寫占幾成；超過一半是現金的格子降級（空心大字＋參考價值低），並排換同類 */
.sub-strip b { color: #F3C98B; font-weight: 700; }
.cell.weak { background: repeating-linear-gradient(135deg, rgba(255, 244, 240, .025) 0 8px, transparent 8px 16px); }
.cell.weak .depth { color: transparent; -webkit-text-stroke: 1.2px var(--down); }
.cell.weak .cell-nums { opacity: .7; }
.weak-tag { font: 700 13px/1.35 var(--sans); color: #F3C98B; white-space: nowrap; }
.cell-alt { font-size: 13px; line-height: 1.35; color: var(--muted); white-space: nowrap; } .cell-alt b { font-size: 15px; font-weight: 800; }
.sub-note.weak { border-style: solid; border-color: rgba(243, 201, 139, .8); }
.sub-note b { color: #F3C98B; } .sub-note b.down { color: var(--down); }
.story li.split { grid-template-columns: minmax(0, 1fr); } .story li.split em { text-align: left; white-space: normal; font-weight: 400; color: var(--muted); font-size: 13px; }
/* 槓桿型／反向型商品 */
.lev { display: inline-block; font: 700 13px/1.35 var(--sans); font-style: normal; color: #FFD9B0; background: rgba(214, 69, 65, .35); border: 1px solid rgba(255, 140, 120, .6); border-radius: 4px; padding: 0 5px; margin-left: 6px; white-space: nowrap; vertical-align: 1px; }
.lev-note { font-size: 13px; line-height: 1.5; color: #FFD9B0; padding: 4px 8px; margin-top: 4px; border-radius: 8px; border: 1px solid rgba(255, 140, 120, .45); background: rgba(214, 69, 65, .12); }
.lev-note b { display: inline-block; margin-right: 6px; padding: 0 5px; border-radius: 4px; background: rgba(214, 69, 65, .45); color: #fff; }
.hold-row.lev-row .row-hint { color: #FFD9B0; }
.hold-row.dup .row-hint { color: #F3C98B; } .hold-row.dup select { border-color: #F3C98B; }
/* 等待超過三秒的補充說明 */
em.slow { font-style: normal; color: var(--dim); }
/* 決策桌：欄位不合法就不能往下走 */
.fld.bad .in { border-color: var(--up); }
.fld-err { line-height: 1.5; } .fld-err .link { margin-left: 8px; }
.fld-err.flash { animation: errflash 1.1s ease 1; }
@keyframes errflash { 0%, 60% { background: rgba(214, 69, 65, .22); } 100% { background: transparent; } }
.sh-block { font-size: 14px; line-height: 1.5; color: #FFD9B0; padding: 6px 10px; border-radius: 10px; border: 1px solid rgba(255, 140, 120, .55); background: rgba(214, 69, 65, .12); }
.sh-block .link { margin-left: 8px; } .sh-block.wait { color: var(--muted); border-color: var(--line); background: none; }
.primary.blocked { opacity: .55; filter: saturate(.4); cursor: not-allowed; }
.ap-sell.mid { color: var(--gold-b); border-color: rgba(226, 185, 90, .5); }
.ap-h1 span { display: inline-flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.ap-h3 { font-size: 13px; color: var(--dim); }
.subtag { display: inline-block; font: 700 13px/1.35 var(--sans); font-style: normal; color: #1B0E11; background: #F3C98B; border-radius: 4px; padding: 0 5px; margin-left: 6px; }
.sh-basis p { font-size: 13px; line-height: 1.5; } .sh-basis .fine { margin-top: 2px; }
.sh-done .sh-read { color: var(--text); } .sh-done .sh-read b { font: 700 13px var(--sans); color: var(--gold-b); letter-spacing: 0; }
.sh-done .sh-warn { color: #FFD9B0; font-weight: 700; }
.ap footer { position: static; margin-top: auto; background: none; border-top: 0; box-shadow: none; }
/* 一頁紙 */
.pp-weak { font-size: 10px; line-height: 1.35; color: #7A3B10; margin: 0 0 .6mm; font-weight: 700; }
.pp-chart td.weak .pp-nums b { color: transparent; -webkit-text-stroke: .8px #1E7F4F; }
.pp-lev { font-size: 9.5px; line-height: 1.45; color: #8A2A22; margin-top: 1mm; } .pp-lev b { margin-right: 4px; }
.pp-src { font-size: 10px !important; color: #4A4340; }
.paper.reflow .pp-weak, .paper.reflow .pp-lev, .paper.reflow .pp-src { font-size: 13px !important; }
/* 交給我的 AI */
#aiDlg { width: min(520px, calc(100vw - 24px)); }
#aiDlg > p { font-size: 14px; line-height: 1.6; padding: 0 22px; margin-top: 8px; } #aiDlg > .row { padding: 12px 22px 18px; gap: 10px; }
/* 筆電（1301 寬以上、700～819 高，例如 1366×768）：一頁放得下，不捲。更窄更矮的（1280×720）格子太擠，維持整頁可以捲、格子不壓扁 */
@media (min-width: 1301px) and (min-height: 700px) and (max-height: 819px) {
  .wall { height: 100vh; overflow: hidden; }
  body.paper-open { overflow: hidden; }
  .mx { grid-template-rows: auto repeat(var(--rows, 4), minmax(0, 1fr)); gap: 6px; }
  .cell { min-height: 0; padding: 6px 10px 5px; gap: 2px; }
  .panel { overflow: hidden; align-self: stretch; }
  .pn-scroll { overflow: auto; }
  .gate { overflow: auto; }
  .top { min-height: 48px; padding: 5px 20px; }
  .main { padding: 6px 20px 4px; gap: 12px; }
  .mx-crisis { padding-bottom: 3px; } .mx-crisis small { margin-top: 0; }
  .mx-rowhead { padding: 5px 10px; gap: 2px; }
  .legal { padding: 3px 20px 4px; line-height: 1.35; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .depth { font-size: 23px; }
}
/* 手機：列名下的連結也要好按 */
@media (max-width: 719px) {
  .rh-foot .link { min-height: 40px; display: inline-flex; align-items: center; padding: 0 4px; }
}

.story li.split .s-l { color: var(--muted); font-size: 13px; } .story li.split .s-l b { font: 700 13px var(--sans); color: var(--text); }
.fan { height: 26px; margin-bottom: 15px; }

.cell-alt { display: flex; flex-direction: column; align-items: flex-end; } .cell-alt b { font-size: 17px; line-height: 1.2; }

.pp-lines { margin-top: 1mm; font-size: 10.5px; line-height: 1.55; } .pp-lines b { color: #5A3A10; }
.paper.reflow .pp-lines { font-size: 14px; }
