/* 【claude】交易台版面與元件。原則：像交易軟體不像簡報——1px 分隔線、4px 縫、小圓角、緊密表格、沒有漸層／光暈／大卡片。 */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--app); color: var(--text);
  font: 400 var(--fs)/1.45 var(--font-ui); font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; opacity: .45; }
a { color: var(--accent-t); text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 2px; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.up { color: var(--up-t); } .down { color: var(--down-t); }
.dim { color: var(--muted); } .sm { font-size: var(--fs-s); }
.warn-t { color: var(--warn); }
.grow { flex: 1; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 4px; z-index: 100; background: var(--accent); color: #fff; padding: 6px 10px; border-radius: var(--r); }
.skip:focus { left: 8px; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ic .fill, #i-star-on path { fill: var(--warn); stroke: var(--warn); }
kbd { font: 11px var(--font-num); padding: 1px 4px; border: 1px solid var(--line-strong); border-radius: 3px; color: var(--muted); }
::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 4px; } ::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------------ 頂列 */
.top { height: var(--top-h); display: flex; align-items: center; gap: 4px; padding: 0 6px; background: var(--bg); border-bottom: 1px solid var(--line); position: relative; z-index: 10; }
.brand { display: flex; align-items: center; gap: 8px; padding: 0 8px 0 4px; color: var(--text); font-weight: 600; white-space: nowrap; }
.brand img { border-radius: 6px; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.brand span { font-size: 14px; letter-spacing: .02em; }
.symbtn { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px; border-radius: var(--r); min-width: 150px; white-space: nowrap; }
.symbtn:hover, .tbtn:hover, .ibtn:hover { background: var(--hover); }
.symbtn b { font-size: 14px; color: var(--text-hi); }
.symbtn span { color: var(--muted); }
.vsep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; flex: none; }
.ctools { display: flex; align-items: center; gap: 2px; min-width: 0; }
.tbtn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px; border-radius: var(--r); white-space: nowrap; }
.ibtn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: var(--r); color: var(--text); flex: none; }
.ibtn.star[aria-pressed="true"] { color: var(--warn); }
.btn.star .ic { width: 15px; height: 15px; } .btn.star.on { color: var(--warn); border-color: var(--warn); }
.status { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px; border-radius: var(--r); font-size: var(--fs-s); }
.status:hover { background: var(--hover); }
.led { width: 7px; height: 7px; border-radius: 50%; background: var(--down); }
.led.bad { background: var(--warn); }
.warn { display: flex; align-items: center; gap: 6px; color: var(--warn); font-size: var(--fs-s); padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 分段按鈕（TradingView 的時間週期列） */
.seg { display: inline-flex; align-items: center; gap: 2px; }
.seg > button, .seg > label > span { height: 28px; padding: 0 8px; border-radius: var(--r); color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.seg > button:hover, .seg > label:hover > span { background: var(--hover); color: var(--text); }
.seg > button[aria-pressed="true"], .seg input:checked + span { color: var(--accent-t); background: var(--active); font-weight: 600; }
.seg label input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:focus-visible) span { outline: 2px solid var(--accent); }
.seg.scroll { overflow-x: auto; scrollbar-width: none; max-width: 100%; }
/* 可水平捲動列的邊緣淡出（ADR-0055；data-ov 由 T.edgeFade 設定） */
[data-ov="r"] { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
[data-ov="l"] { -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px); mask-image: linear-gradient(90deg, transparent, #000 28px); }
[data-ov="lr"] { -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
/* 說明提示 ⓘ（ADR-0055）：hover／focus／點一下 */
.tipb { display: inline-grid; place-items: center; width: 22px; height: 22px; margin: 0 0 0 2px; padding: 0; border-radius: 50%; color: var(--muted); vertical-align: middle; flex: none; position: relative; cursor: help; }
.tipb::after { content: ''; position: absolute; inset: -8px; }   /* 觸控範圍放大到約 38px，不影響排版 */
.tipb .ic { width: 14px; height: 14px; }
.tipb:hover, .tipb[aria-expanded="true"] { color: var(--accent-t); background: var(--hover); }
.tipbox { position: fixed; z-index: 95; max-width: min(320px, calc(100vw - 16px)); padding: 8px 10px; background: var(--panel); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--r-l); box-shadow: var(--shadow); font-size: var(--fs-s); line-height: 1.55; white-space: pre-line; overflow-y: auto; overscroll-behavior: contain; }
.tipbox[hidden] { display: none; }
.cnt { font-size: 11px; color: var(--muted); font-weight: 400; }

/* ------------------------------------------------------------------ 工作區格線 */
.ws { height: calc(100% - var(--top-h)); display: grid; grid-template-columns: minmax(0, 1fr) var(--side-w) var(--rail-w); gap: var(--gap); padding-top: var(--gap); }
body.side-off .ws { grid-template-columns: minmax(0, 1fr) 0 var(--rail-w); }
body.side-off .side { display: none; }
.center { grid-column: 1; } .side { grid-column: 2; } .rail { grid-column: 3; grid-row: 1; }   /* 側欄收合時圖示列仍固定在最右欄 */
.center { min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(160px, 1fr) var(--gap) var(--bottom-h, 34vh); }
body.bottom-off .center { grid-template-rows: minmax(160px, 1fr) var(--gap) 36px; }
body.bottom-off .resizer { pointer-events: none; }
body.bottom-off .bbody { display: none; }

/* 首頁／圖表切換（ADR-0044）：同一格，一次只顯示一個 */
body:not([data-center="chart"]) .chart-pane, body:not([data-center="home"]) .home-pane, body:not([data-center="radar"]) .radar-pane, body:not([data-center="scan"]) .scan-pane { display: none; }
body:not([data-center="chart"]) #chartTools, body:not([data-center="chart"]) .top > .vsep:not(.hide-s) { visibility: hidden; }
.csw > button { height: 28px; }
body[data-side="screener"] .ws { grid-template-columns: minmax(0, 1fr) var(--side-scr-w) var(--rail-w); }

/* 圖表 */
.chart-pane { position: relative; min-height: 0; background: var(--bg); display: flex; flex-direction: column; }
.chart-pane:fullscreen { background: var(--bg); }
.chart-top { position: absolute; left: 8px; top: 6px; right: 90px; z-index: 6; pointer-events: none; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.legend { font-size: var(--fs-s); line-height: 1.6; color: var(--text); pointer-events: none; text-shadow: 0 0 3px var(--bg); }
.lg-row { display: flex; flex-wrap: wrap; gap: 0 10px; align-items: baseline; }
.lg-row span { color: var(--muted); } .lg-row b { margin-left: 3px; font-weight: 500; }
.lg-row b.up { color: var(--up-t); } .lg-row b.down { color: var(--down-t); }
.lg-sym { color: var(--text-hi) !important; font-weight: 600; font-size: 14px; }
.trade-btns { display: flex; gap: 1px; pointer-events: auto; border-radius: var(--r); overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.trade-btns[hidden] { display: none; }
.tb { display: grid; justify-items: start; gap: 0; min-width: 76px; padding: 4px 10px; background: var(--bg); line-height: 1.25; }
.tb span { font-size: 11px; } .tb b { font-size: 14px; font-weight: 600; }
.tb.buy { color: var(--up-t); } .tb.sell { color: var(--down-t); }
.tb.fav { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 52px; color: var(--muted); }
.tb.fav .ic { width: 16px; height: 16px; } .tb.fav:hover { background: var(--hover); color: var(--text); } .tb.fav.on { color: var(--warn); }
.tb.buy:hover { background: var(--buy); color: #fff; } .tb.sell:hover { background: var(--sell); color: #fff; }
.focus-bar { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); z-index: 7; display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 10px; background: var(--panel); border: 1px solid #ab47bc; border-radius: var(--r); font-size: var(--fs-s); box-shadow: var(--shadow); white-space: nowrap; }
.focus-bar[hidden] { display: none; }
.focus-bar label { display: inline-flex; align-items: center; gap: 4px; }
.chart-host { position: relative; flex: 1; min-height: 0; touch-action: none; }
#chart { position: absolute; inset: 0; z-index: 2; }
#ribbonLayer { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
#measureLayer { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.plan-layer { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.ptag { position: absolute; top: 0; left: 52%; height: 20px; display: flex; align-items: center; gap: 4px; padding: 0 6px; font-size: 11px; white-space: nowrap; color: #fff; background: var(--c); border-radius: 2px; pointer-events: auto; user-select: none; }
.ptag b { font-weight: 600; }
.ptag .up, .ptag .down { color: #fff; }
.ptag.drag { cursor: ns-resize; }
.ptag.drag::before { content: ''; width: 6px; height: 8px; background: repeating-linear-gradient(to bottom, rgba(255,255,255,.8) 0 1px, transparent 1px 3px); }
.ptag.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--c); }
/* ADR-0069：長籌碼——近 60 日主力最大買超／賣超日的當日均價（畫法比照分點投影的最大買賣超日；只蓋主圖，不擋滑鼠） */
.max-layer { position: absolute; left: 0; top: 0; z-index: 3; overflow: hidden; pointer-events: none; }
.mray > * { position: absolute; left: 0; top: 0; }
.mr-line { height: 0; border-top: 1.5px solid var(--c); }
.mr-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.mr-tx, .mr-px { height: 18px; line-height: 18px; padding: 0 6px; border-radius: 4px; font-size: 11px; font-weight: 600; font-style: normal; color: #fff; background: var(--c); white-space: nowrap; }
.mr-px { border-radius: 3px; padding: 0 5px; }
@media (max-width: 900px) { .mr-px, .mr-l { display: none; } .mr-tx { font-size: 10.5px; padding: 0 4px; } }   /* 手機主圖窄：說明文字已含均價，右端不再重複；文字省略「60 日主力」「當日」 */
/* ADR-0073：發動區段——區段底色、發動日直線、前兩名主要買方的區段買進均價線（只蓋主圖，不擋滑鼠） */
.launch-layer { position: absolute; left: 0; top: 0; z-index: 3; overflow: hidden; pointer-events: none; --c: #ab47bc; }
.cost-layer { --c: #e8890c; }   /* ADR-0078：分點投影的淨部位成本線（和發動區段的紫色、計劃線的藍色分開） */
.lz-band > * { position: absolute; left: 0; top: 0; }
.lz-bg { background: color-mix(in srgb, var(--c) 9%, transparent); border-left: 1px dashed color-mix(in srgb, var(--c) 55%, transparent); border-right: 1px dashed color-mix(in srgb, var(--c) 55%, transparent); }
.lz-tl { width: 0; border-left: 1px solid color-mix(in srgb, var(--c) 80%, transparent); }
.lz-tag { height: 18px; line-height: 18px; padding: 0 6px; border-radius: 4px; font-size: 11px; font-weight: 600; color: #fff; background: var(--c); white-space: nowrap; }
@media (max-width: 900px) { .lz-tag { font-size: 10.5px; padding: 0 4px; } }
.chart-host .menu { position: absolute; z-index: 20; min-width: 220px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r-l); box-shadow: var(--shadow); padding: 4px; }
.chart-host .menu button { display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 0 10px; border-radius: var(--r); text-align: left; }
.chart-host .menu button:hover { background: var(--hover); }
.chart-host .menu kbd { margin-left: auto; }
.chart-msg { position: absolute; inset: 0 0 34px; display: grid; place-items: center; padding: 24px; z-index: 5; }
.chart-msg[hidden] { display: none; }
.na { max-width: 460px; display: grid; gap: 10px; text-align: center; justify-items: center; }
.na h2 { font-size: 18px; font-weight: 600; } .na p { color: var(--muted); } .na-px b { font-size: 22px; color: var(--text-hi); margin-right: 8px; }
.skel-chart { color: var(--muted); }
.chart-foot { height: 34px; flex: none; display: flex; align-items: center; gap: 2px; padding: 0 6px; border-top: 1px solid var(--line); }
.chart-foot .hint { font-size: 11px; color: var(--muted); margin-right: 6px; white-space: nowrap; }

/* 下方面板 */
.resizer { cursor: ns-resize; background: transparent; position: relative; }
.resizer:hover, .resizer.on, .resizer:focus-visible { background: var(--accent); }
.bottom { min-height: 0; background: var(--bg); display: flex; flex-direction: column; }
.btabs { height: 36px; flex: none; display: flex; align-items: center; padding: 0 4px 0 6px; border-bottom: 1px solid var(--line); gap: 4px; }
[role="tablist"] { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
[role="tablist"] > [role="tab"], .tabs > button { height: 35px; padding: 0 12px; color: var(--muted); white-space: nowrap; border-bottom: 2px solid transparent; position: relative; display: inline-flex; align-items: center; gap: 6px; }
[role="tab"]:hover { color: var(--text); }
[role="tab"][aria-selected="true"] { color: var(--text-hi); border-bottom-color: var(--accent); font-weight: 600; }
.ndot { width: 6px; height: 6px; border-radius: 50%; background: var(--up); }
.ndot[hidden] { display: none; }
.bbody { flex: 1; min-height: 0; overflow: auto; }

/* 右側面板＋圖示列 */
.side { min-width: 0; min-height: 0; background: var(--bg); overflow: hidden; position: relative; }
.side-rz { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; z-index: 5; cursor: col-resize; }
.side-rz:hover, .side-rz.on, .side-rz:focus-visible { background: var(--accent); }
.side-body { margin-left: 0; }
.side-body { height: 100%; overflow-y: auto; overscroll-behavior: contain; }
.rail { background: var(--bg); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; }
.rail button { width: 48px; min-height: 48px; display: grid; place-items: center; align-content: center; gap: 2px; border-radius: var(--r); color: var(--muted); padding: 4px 0; }
.rail button span { font-size: 10.5px; line-height: 1.1; }
.rail button:hover { background: var(--hover); color: var(--text); }
.rail button[aria-pressed="true"] { color: var(--accent-t); background: var(--active); }
.rail .ic { width: 20px; height: 20px; }
.ph { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 6px 0 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 2; }
.ph h2 { font-size: 14px; font-weight: 600; }
.pad { padding: 12px; }
.pfoot { padding: 8px 12px; font-size: 11px; color: var(--muted); }

/* 清單 */
.wl { width: 100%; border-collapse: collapse; }
.wl th, .wl td { height: var(--row); padding: 0 8px; white-space: nowrap; }
.wl thead th { font-size: 11px; font-weight: 400; color: var(--muted); text-align: left; height: 26px; }
.wl .r { text-align: right; }
.wl tr[data-sym] { cursor: pointer; }
.wl tr[data-sym]:hover td { background: var(--hover); }
.wl tr.cur td { background: var(--active); }
.wl td:first-child { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.wl .nm { color: var(--muted); margin-left: 4px; }
.wl .st { width: 52px; text-align: right; white-space: nowrap; }
.wh th { padding: 0; }
.wh button { width: 100%; display: flex; align-items: center; gap: 4px; height: 28px; padding: 0 6px; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .02em; border-top: 1px solid var(--line); }
.wh button:hover { color: var(--text); }
.wh .ic { width: 14px; height: 14px; }
.wl .empty td { white-space: normal; color: var(--muted); font-size: var(--fs-s); padding: 6px 12px 10px; height: auto; }
.sq { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-left: 3px; vertical-align: middle; }
.sq.good { background: var(--up); } .sq.wait { background: var(--warn); } .sq.risk { background: var(--down); } .sq.mute { background: var(--line-strong); }
.dotw { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); margin-left: 4px; vertical-align: middle; }

/* 個股面板 */
.ihead { display: grid; grid-template-columns: 1fr auto; gap: 6px 8px; padding: 12px; border-bottom: 1px solid var(--line); }
.ihead h2 { font-size: 16px; font-weight: 600; color: var(--text-hi); }
.ihead p { font-size: var(--fs-s); }
.ih-p { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ih-p > b { font-size: 24px; font-weight: 600; }
.ih-a { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.isec { border-bottom: 1px solid var(--line); }
.isec h3 { display: flex; align-items: center; padding-right: 10px; }
.isec h3 > button { flex: 1; display: flex; align-items: center; gap: 4px; height: 34px; padding: 0 8px; font-size: var(--fs); font-weight: 600; text-align: left; }
.isec h3 > button:hover { color: var(--text-hi); }
.isec h3 .ic { width: 14px; height: 14px; color: var(--muted); }
.ib { padding: 0 12px 12px; display: grid; gap: 8px; }
.ib h4 { font-size: var(--fs-s); color: var(--muted); font-weight: 600; margin-top: 4px; }
.verdict { display: flex; flex-wrap: wrap; gap: 4px; }
.say { color: var(--text); }
.bul { margin: 0; padding-left: 16px; font-size: var(--fs-s); display: grid; gap: 2px; }
.bul li::marker { color: var(--muted); }
.fine { font-size: 11px; color: var(--muted); line-height: 1.5; }
.gate-x { font-size: var(--fs-s); color: var(--muted); }
.kv { border-collapse: collapse; width: 100%; }
.kv th, .kv td { padding: 3px 0; text-align: left; vertical-align: top; }
.kv th { color: var(--muted); font-weight: 400; width: 88px; white-space: nowrap; padding-right: 10px; }
.kv.wide th { width: 110px; }
.grid { border-collapse: collapse; width: 100%; font-size: var(--fs-s); }
.grid th, .grid td { padding: 3px 4px; border-bottom: 1px solid var(--line); }
.grid thead th { color: var(--muted); font-weight: 400; }
.grid tbody th { text-align: left; font-weight: 400; }
.grid .r { text-align: right; }
.grid.lz th small { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; }
.grid.lz .lz-n th { border-bottom: 0; padding-bottom: 0; } .grid.lz .lz-n th small { display: inline; margin-left: 6px; }
.grid.lz { table-layout: fixed; }
.lz-h { display: flex; align-items: center; gap: 6px; } .lz-h > span { flex: 1; min-width: 0; } .lz-h .lbtn { flex: none; height: 22px; }
.grid.lz .tag { height: 17px; padding: 0 4px; font-size: 10.5px; }
.grid.kb10 td, .grid.kb60 td { white-space: nowrap; }   /* ADR-0078：張數與淨成本不換行 */
.lz-ev { margin: 0 0 4px; font-size: var(--fs-s); }
.grid.lv th small { display: block; color: var(--muted); font-size: 11px; max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ck { font-style: normal; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 3px; font-size: 11px; font-weight: 700; }
.ck.ok { color: var(--accent-t); background: var(--accent-soft); } .ck.no { color: var(--muted); background: var(--hover); text-decoration: none; } .ck.mid { color: var(--muted); background: transparent; border: 1px solid var(--line-strong); }
.tchk { display: inline-flex; gap: 3px; }
.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: var(--fs-s); }
.plain li { display: flex; gap: 6px; align-items: flex-start; }
.flags { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.flags li { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; }
.flags p { color: var(--muted); font-size: var(--fs-s); }
.tl { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: var(--fs-s); }
.tl time { color: var(--muted); margin-right: 8px; }
.note { display: grid; gap: 8px; }
textarea, input[type="number"], input[type="date"], input[type="search"], input[type="text"], select {
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r); padding: 5px 8px; min-height: 30px; width: 100%;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.frow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.frow label { display: flex; align-items: center; gap: 6px; font-size: var(--fs-s); color: var(--muted); }
.frow input[type="date"] { width: auto; }

/* 標籤（方角、細框，不用膠囊） */
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 3px; font-size: 11px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.tag.sm { height: 18px; font-size: 10.5px; }
.tag.good, .tag.up { color: var(--up-t); background: var(--up-bg); }
.tag.risk, .tag.down { color: var(--down-t); background: var(--down-bg); }
.tag.wait { color: var(--warn); background: var(--warn-bg); }
.tag.mute { color: var(--muted); border-color: var(--line-strong); }
/* ADR-0047：結論＝中性色塊＋文字；技術指標＝藍／黃／灰；紅綠只留給漲跌與買賣超 */
.tag.c-res { color: var(--text-hi); background: var(--hover); border-color: var(--text); }
.tag.c-wait { color: var(--text); background: var(--hover); }
.tag.c-avoid { color: var(--warn); background: var(--hover); border-color: var(--warn); }
.tag.c-mute { color: var(--muted); border-color: var(--line-strong); font-weight: 400; }
.tag.g-pass { color: var(--accent-t); background: var(--accent-soft); }
.tag.g-watch { color: var(--warn); background: var(--warn-bg); }
.tag.g-fail { color: var(--muted); background: var(--hover); }
.tag.g-na { color: var(--muted); border-color: var(--line-strong); font-weight: 400; }
.turn { display: inline-block; margin-left: 4px; padding: 0 3px; font-size: 10.5px; line-height: 16px; border-radius: 3px; border: 1px solid currentColor; white-space: nowrap; }
.turn.up { color: var(--up-t); } .turn.down { color: var(--down-t); }
.cl { font-size: 11px; color: var(--muted); } .cl.c-res { color: var(--text-hi); font-weight: 600; } .cl.c-avoid { color: var(--warn); }

/* 按鈕 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--bg); font-weight: 600; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.sm { height: 28px; padding: 0 10px; font-size: var(--fs-s); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.buy { background: var(--buy); border-color: var(--buy); color: #fff; }
.btn.sell { background: var(--sell); border-color: var(--sell); color: #fff; }
.btn.buy:hover, .btn.sell:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; }
.btn.big { height: 40px; font-size: 14px; width: 100%; }
.btn.wide { width: 100%; }
.btn .ic { width: 16px; height: 16px; }
.lbtn { height: 24px; padding: 0 6px; border-radius: 3px; color: var(--accent-t); font-size: var(--fs-s); }
.lbtn:hover { background: var(--hover); }
.lbtn[aria-pressed="true"] { background: var(--accent); color: #fff; }
.lnk { color: var(--accent-t); font-size: var(--fs-s); padding: 0 4px; }
.lnk:hover { text-decoration: underline; }
.chip { height: 24px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 3px; font-size: 11.5px; color: var(--muted); }
.chip:hover { color: var(--text); border-color: var(--muted); }

/* 下單 */
.order { padding: 12px; display: grid; gap: 8px; }
.sidesw { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sidesw button { display: grid; justify-items: start; padding: 6px 10px; border-radius: var(--r); border: 1px solid var(--line-strong); line-height: 1.3; }
.sidesw span { font-size: var(--fs-s); } .sidesw b { font-size: 15px; }
.s-buy[aria-checked="true"] { background: var(--buy); border-color: var(--buy); color: #fff; }
.s-sell[aria-checked="true"] { background: var(--sell); border-color: var(--sell); color: #fff; }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs.sm > button { height: 30px; padding: 0 10px; font-size: var(--fs-s); }
.fld { display: grid; gap: 4px; }
.fld > span { font-size: var(--fs-s); color: var(--muted); }
.fld em { font-style: normal; color: var(--up-t); font-size: 11px; margin-left: 4px; }
.fld em.dim { color: var(--muted); }
.fld input { font-size: 14px; }
.quick { display: flex; flex-wrap: wrap; gap: 4px; margin-top: -2px; }
.qty { display: flex; align-items: center; gap: 6px; }
.qty input { flex: 1; }
.qty .unit { color: var(--muted); font-size: var(--fs-s); }
.sum { width: 100%; border-collapse: collapse; font-size: var(--fs-s); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sum th, .sum td { padding: 4px 0; } .sum th { text-align: left; color: var(--muted); font-weight: 400; } .sum td { text-align: right; }
.checks { display: grid; gap: 4px; font-size: var(--fs-s); }
.checks p { display: flex; gap: 6px; align-items: flex-start; }
.checks .ic { width: 15px; height: 15px; margin-top: 1px; }
.checks .blk { color: var(--up-t); } .checks .wrn { color: var(--warn); } .checks .okk { color: var(--down-t); }
.exec { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; align-items: center; font-size: var(--fs-s); }
.exec .fine { grid-column: 1 / -1; }
.exec-badge { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-s); padding: 0 8px; height: 26px; border: 1px solid var(--line-strong); border-radius: var(--r); white-space: nowrap; }
.exec-badge .ic { width: 14px; height: 14px; color: var(--warn); }

/* 資料表（TradingView screener 風格） */
.fbar { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--line); flex-wrap: wrap; position: sticky; top: 0; left: 0; background: var(--bg); z-index: 3; }
.sel select { width: auto; min-height: 28px; height: 28px; padding: 0 6px; font-size: var(--fs-s); background: var(--bg); }
.srch { display: flex; align-items: center; gap: 4px; height: 28px; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: var(--r); }
.srch .ic { width: 14px; height: 14px; color: var(--muted); }
.srch input { border: 0; background: transparent; min-height: 0; height: 26px; padding: 0; width: 110px; }
.dt-wrap { overflow: auto; }
.dt { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs); }
.dt th, .dt td { height: var(--row); padding: 0 10px; white-space: nowrap; border-bottom: 1px solid var(--line); text-align: left; }
.dt thead th { position: sticky; top: 0; z-index: 1; background: var(--bg); font-size: 11.5px; font-weight: 400; color: var(--muted); height: 30px; }
.fbar + .dt-wrap .dt thead th, .fbar ~ .dt-wrap .dt thead th { top: 0; }
.dt thead th button { display: inline-flex; align-items: center; gap: 2px; color: inherit; height: 100%; }
.dt thead th button:hover { color: var(--text); }
.dt thead th .ic { width: 12px; height: 12px; }
.dt thead th[aria-sort="ascending"], .dt thead th[aria-sort="descending"] { color: var(--text); }
.dt .r { text-align: right; }
.dt tbody tr[data-sym], .dt tbody tr[data-ind] { cursor: pointer; }
.dt tbody tr:hover td { background: var(--hover); }
.dt tbody tr.cur td { background: var(--active); }
.dt tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.empty-p { position: sticky; left: 0; color: var(--muted); padding: 16px 12px; max-width: min(100%, 100vw); font-size: var(--fs-s); }
.dt small { font-size: 11px; }
.sym { display: inline-flex; gap: 6px; align-items: baseline; }
.sym b { color: var(--text-hi); font-weight: 600; }
.sym .nm { color: var(--text); max-width: 8em; overflow: hidden; text-overflow: ellipsis; }
.why { color: var(--muted); font-size: var(--fs-s); max-width: 14em; display: inline-block; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.dcell { position: relative; display: inline-block; min-width: 120px; text-align: right; }
.dcell span { position: relative; }
.dbar { position: absolute; top: 50%; height: 12px; margin-top: -6px; opacity: .28; border-radius: 1px; }
.dbar.up { background: var(--up); } .dbar.down { background: var(--down); }
.cell-in { width: 84px !important; min-height: 24px; height: 24px; padding: 0 6px; text-align: right; font-size: var(--fs-s); }
.acts { display: inline-flex; gap: 2px; }

/* 資金流向 */
.flow { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100%; }
.mkt { border-right: 1px solid var(--line); padding: 10px 12px; display: grid; gap: 8px; align-content: start; font-size: var(--fs-s); }
.mk-ix { display: grid; gap: 2px; }
.mk-ix b { font-size: 20px; font-weight: 600; }
.breadth { display: flex; height: 6px; border-radius: 2px; overflow: hidden; gap: 1px; }
.breadth i.up { background: var(--up); } .breadth i.down { background: var(--down); } .breadth i.flat { background: var(--line-strong); }
.flow-main { min-width: 0; }

/* 落點圖 */
.map { padding: 6px 10px 10px; }
.map-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 6px; }
.lgd { font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.lgd i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-left: 6px; }
.map svg { width: 100%; height: auto; max-height: 340px; display: block; }
.map svg text { font-size: 10px; fill: var(--muted); font-family: var(--font-num); }
.map svg .cn { fill: var(--muted); font-size: 11px; font-family: var(--font-ui); }
.map svg .ax { stroke: var(--line-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.map svg .q-up { fill: var(--up-bg); opacity: .5; } .map svg .q-down { fill: var(--down-bg); opacity: .5; }
.map circle { cursor: pointer; stroke: var(--bg); stroke-width: 1; fill-opacity: .8; }
.map circle:hover { fill-opacity: 1; stroke: var(--text); }
.g-PASS { fill: var(--up); background: var(--up); } .g-WATCH { fill: var(--warn); background: var(--warn); } .g-FAIL { fill: var(--down); background: var(--down); } .g-UNAVAILABLE { fill: var(--line-strong); background: var(--line-strong); }

/* 首頁：鎖定滿版（ADR-0046）＝大盤一列＋［選股落點｜分隔條｜資金流向］填滿剩餘高度，各區內部捲動 */
.home-pane { min-height: 0; background: var(--bg); overflow: hidden; container-type: inline-size; }
.home { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.mstrip { flex: none; display: flex; align-items: stretch; border-bottom: 1px solid var(--line); overflow: hidden; }
.mi { flex: none; display: grid; gap: 1px; align-content: center; padding: 6px 14px; border-right: 1px solid var(--line); min-width: 104px; }
.mi > span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.mi > span b { font-size: 12px; font-weight: 600; }
.mi > b { font-size: 15px; font-weight: 600; white-space: nowrap; }
.mi small { font-size: 11px; white-space: nowrap; }
.mi.wide { min-width: 180px; } .mi.wide .breadth { margin-top: 5px; }
.mi > b small { font-size: 11px; font-weight: 400; color: var(--muted); }
.mi.itot { background: var(--hover); }
.mhl { flex: 1 1 0; min-width: 0; align-self: center; padding: 0 14px; margin: 6px 0; font-size: var(--fs-s); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; cursor: pointer; }
.mhl[aria-expanded="true"] { -webkit-line-clamp: unset; display: block; }
.home-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, var(--hsplit, 60%)) 10px minmax(0, 1fr); }
.hp { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; container-type: inline-size; }
@container (max-width: 540px) { .hmap .qcells { grid-template-columns: 1fr 1fr; } .hp .hh .seg > button { padding: 0 6px; } }
.hsplit { position: relative; cursor: col-resize; background: var(--app); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; touch-action: none; }
.hsplit::before { content: ''; position: absolute; top: 0; bottom: 0; left: 4px; width: 2px; background: transparent; }
.hsplit:hover::before, .hsplit.on::before, .hsplit:focus-visible::before { background: var(--accent); }
.hsplit button { position: relative; z-index: 1; width: 10px; height: 22px; display: grid; place-items: center; color: var(--muted); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 3px; opacity: 0; }
.hsplit:hover button, .hsplit:focus-within button { opacity: 1; }
.hsplit button .ic { width: 12px; height: 12px; }
.hsplit button:hover { color: var(--text); }
/* 放大：一區獨占 */
.home[data-max="map"] .home-grid { grid-template-columns: minmax(0, 1fr) 0 0; }
.home[data-max="flow"] .home-grid { grid-template-columns: 0 0 minmax(0, 1fr); }
.home[data-max="map"] .hflow, .home[data-max="map"] .hsplit, .home[data-max="flow"] .hmap, .home[data-max="flow"] .hsplit { visibility: hidden; }
.home[data-max] .mstrip { display: none; }
.home[data-max=""] .mstrip { display: flex; }
.hh { flex: none; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 4px 0 12px; border-bottom: 1px solid var(--line); }
.hh h2 { font-size: 14px; font-weight: 600; white-space: nowrap; }
.hh > .dim { font-size: var(--fs-s); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.hh .ibtn[aria-pressed="true"] { color: var(--accent-t); background: var(--active); }
.qcells { flex: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.qc { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 6px 10px; background: var(--bg); font-size: var(--fs-s); color: var(--muted); white-space: nowrap; min-width: 0; }
.qc span { overflow: hidden; text-overflow: ellipsis; }
.qc b { font-size: 15px; font-weight: 600; color: var(--text); }
.qc.up b { color: var(--up-t); } .qc.down b { color: var(--down-t); } .qc.wait b { color: var(--warn); }
.qc:hover { background: var(--hover); color: var(--text); }
.qc[aria-pressed="true"] { background: var(--active); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.qwrap { flex: 1; min-height: 0; overflow: hidden; }
.qnote { flex: none; padding: 6px 12px; font-size: 11.5px; color: var(--muted); border-bottom: 1px solid var(--line); }
.qcells[hidden] { display: none; }
.quad { display: block; }
.quad .q-ur { fill: var(--up); fill-opacity: .05; } .quad .q-dl { fill: var(--down); fill-opacity: .05; } .quad .q-band { fill: var(--muted); fill-opacity: .08; }
.quad .ax { stroke: var(--line-strong); stroke-dasharray: 3 3; }
.quad .qt { font-size: 12px; fill: var(--muted); } .quad .up-t { fill: var(--up-t); } .quad .down-t { fill: var(--down-t); }
.quad .tk { font-size: 10.5px; fill: var(--muted); font-family: var(--font-num); }
.quad .fixed text { paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }   /* 象限標題畫在泡泡之上、加底色描邊（ADR-0056） */
.bub { cursor: pointer; outline: none; }
.bub circle:not(.ring) { fill: var(--c); fill-opacity: .3; stroke: var(--c); stroke-width: 1; }
.bub:hover circle:not(.ring), .bub:focus-visible circle:not(.ring), .bub.hl circle:not(.ring) { fill-opacity: .75; stroke: var(--text); stroke-width: 2; }
.bub.sel circle:not(.ring) { fill-opacity: .6; stroke: var(--text); stroke-width: 2; }
.bub.qoff { opacity: .22; } .bub.qon circle:not(.ring) { fill-opacity: .55; }
.bub .ring { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 3 2; }
.quad .bt { font-size: 11.5px; fill: var(--text); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.quad .bt.hl { font-weight: 700; fill: var(--text-hi); }
/* 顏色＝QFR 把關（沿用正式版落點圖：藍＝通過；避開紅綠，紅綠在台股代表漲跌） */
.gd-PASS { --c: #2962ff; } .gd-WATCH { --c: #d5a637; } .gd-FAIL { --c: #8b929d; } .gd-UNAVAILABLE { --c: #5f6773; }
.hmap .lgd { flex: none; display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 4px 12px 8px; }
.hmap .lgd > span { display: inline-flex; align-items: center; gap: 4px; }
.hmap .lgd i { width: 9px; height: 9px; margin: 0; border-radius: 50%; background: var(--c); }
.hmap .empty-p { flex: 1; }
.mtabs { display: none; }
.rankbar { flex: none; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.fsub { flex: none; padding: 4px 6px; border-bottom: 1px solid var(--line); display: flex; }
.hflow .dt-wrap { flex: 1; min-height: 0; overflow: auto; }
.hflow .pfoot { flex: none; border-top: 1px solid var(--line); }
/* 固定欄寬表：數字右對齊、等寬數字、名稱欄省略號，不會互相擠壓 */
.dt.ft { table-layout: fixed; width: 100%; }
.dt.ft col:not([style]) { width: auto; }
.dt.ft th, .dt.ft td { padding: 0 8px; overflow: hidden; text-overflow: ellipsis; }
.dt.ft thead th.r button { flex-direction: row-reverse; }
.dt.ft .ell { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt.ft .sym { display: flex; min-width: 0; }
.dt.ft .sym .nm { flex: 1; min-width: 0; max-width: none; }
.dt.ft td.barc { padding: 0 6px; }
.dbar2 { position: relative; display: block; height: 12px; background: linear-gradient(var(--line-strong), var(--line-strong)) center / 1px 100% no-repeat; }
.dbar2 i { position: absolute; top: 1px; bottom: 1px; border-radius: 1px; opacity: .75; }
.dbar2 i.up { background: var(--up); } .dbar2 i.down { background: var(--down); }
.hflow .dt tr.cur td { background: var(--active); }
/* 窄容器（手機、側欄＋下方都開的小螢幕）：上下排列、整頁捲動 */
@container (max-width: 820px) {
  /* 捲動交給 .home：容器查詢不能改容器（.home-pane）本身，舊寫法 .home-pane{overflow:auto} 從未生效 → 手機清單滑不動（ADR-0055） */
  .home { display: block; height: 100%; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .home-grid, .home[data-max] .home-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; }
  .home[data-max] .hmap, .home[data-max] .hflow { visibility: visible; }
  .hh [data-max] { display: none; }
  .hmap .hh { flex-wrap: wrap; height: auto; min-height: 40px; padding: 4px 4px 4px 12px; row-gap: 2px; }   /* 標題＋範圍一行、軸切換一行，不再把「可研究…」切掉 */
  .hmap .hh > .dim { flex: 1 1 auto; white-space: normal; }
  .hmap .hh > .grow { display: none; }
  .hmap .hh > .vsep { display: none; }
  .hsplit { display: none; }
  .mtabs { display: flex; padding: 4px 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 4; }
  .mtabs > button { flex: 1; justify-content: center; }
  .home[data-mtab="flow"] .hmap, .home[data-mtab="map"] .hflow { display: none; }
  .hmap { height: min(72vh, 560px); }
  .hflow { max-height: none; }
  .hflow .dt-wrap { overflow-x: auto; overflow-y: visible; }
  /* 窄螢幕（ADR-0054）：4 欄格線——指數｜成交值、漲跌家數整列、外資｜投信｜自營商｜法人合計、摘要整列 */
  .mstrip, .home[data-max] .mstrip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }   /* 需蓋過 .home[data-max=""] .mstrip { display:flex } */
  .mstrip .mi { min-width: 0; padding: 6px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .mstrip .mi.ix, .mstrip .mi.val { grid-column: span 2; }
  .mstrip .mi.val, .mstrip .mi.wide, .mstrip .mi.itot { border-right: 0; }
  .mstrip .mi.wide { grid-column: 1 / -1; }
  .mstrip .mi.inst { padding: 6px 6px; }   /* 法人金額最長「−9,999.9 億」也要放得下（ADR-0083） */
  .mstrip .mi.inst > b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
  .mstrip .mi.inst > span { overflow: hidden; text-overflow: ellipsis; }
  .mhl { grid-column: 1 / -1; -webkit-line-clamp: 3; }
  .mstrip .mi.itot > span { overflow: visible; display: flex; align-items: center; }   /* ⓘ 不被截（ADR-0055） */
  .mstrip .mi.itot .tipb { width: 18px; height: 18px; margin: -3px 0; }
}
/* 很窄（≤ 360px，例如 iPhone SE 320）：法人四格改 2×2，數字不被切（ADR-0055） */
@container (max-width: 360px) {
  .mstrip, .home[data-max] .mstrip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mstrip .mi.ix, .mstrip .mi.val { grid-column: span 1; }
  .mstrip .mi.inst:nth-of-type(odd) { border-right: 0; }
}

/* 右側「選股」 */
.spre { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.spre button { height: 26px; padding: 0 8px; border-radius: var(--r); color: var(--muted); display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-s); }
.spre button:hover { background: var(--hover); color: var(--text); }
.spre button[aria-pressed="true"] { color: var(--accent-t); background: var(--active); font-weight: 600; }
.sflt { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.sflt .sel, .sflt .sel select, .sflt .srch input { width: 100%; }
.sflt .srch { min-width: 0; }
.sact { display: flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: 11.5px; border-bottom: 1px solid var(--line); }
.sact .dim { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sscr .dt thead th { top: 40px; }
.dt.st th, .dt.st td { padding: 0 6px; }
.dt.st td:first-child { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.dt.st .sym .nm { max-width: 5.5em; }
.dt.st td:last-child { width: 18px; }
.dt.st th.pk, .dt.st td.pk { width: 30px; padding: 0 4px 0 8px; } .dt.st .pk input { width: 16px; height: 16px; accent-color: var(--accent); }
.dt.st td .ic { width: 12px; height: 12px; margin-left: 3px; vertical-align: -1px; }
.pickbar { position: sticky; bottom: 0; z-index: 4; display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--panel); border-top: 1px solid var(--line-strong); box-shadow: 0 -6px 12px rgba(0,0,0,.2); }
.pickbar .btn .ic { width: 14px; height: 14px; }
.picking + .pickbar ~ .sreason { display: none; }

/* 選股：漏斗、條件標籤、原因句（ADR-0047） */
.funnel { list-style: none; margin: 0; padding: 6px 8px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-bottom: 1px solid var(--line); }
.funnel li { position: relative; }
.funnel li + li::before { content: '›'; position: absolute; left: -4px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }
.funnel button { width: 100%; display: grid; justify-items: center; gap: 0; padding: 4px 2px; border-radius: var(--r); color: var(--muted); line-height: 1.25; }
.funnel b { font-size: 15px; font-weight: 600; color: var(--text); }
.funnel span { font-size: 11px; white-space: nowrap; }
.funnel button:hover { background: var(--hover); }
.funnel button[aria-pressed="true"] { background: var(--active); color: var(--accent-t); box-shadow: inset 0 -2px 0 var(--accent); }
.funnel button[aria-pressed="true"] b { color: var(--accent-t); }
.sflt .full { grid-column: 1 / -1; }
.chk { display: flex; align-items: center; gap: 6px; font-size: var(--fs-s); color: var(--muted); cursor: pointer; }
.chk input { accent-color: var(--accent); width: 15px; height: 15px; }
.sact { flex-wrap: wrap; }
.fchip { display: inline-flex; align-items: center; gap: 2px; height: 22px; padding: 0 4px 0 8px; border: 1px solid var(--line-strong); border-radius: 3px; font-size: 11.5px; color: var(--text); }
.fchip .ic { width: 12px; height: 12px; color: var(--muted); }
.fchip:hover { border-color: var(--muted); }
.sreason { position: sticky; bottom: 0; background: var(--panel); border-top: 1px solid var(--line); padding: 8px 12px; font-size: var(--fs-s); line-height: 1.5; min-height: 52px; }
.dt.st tr.inst td { color: var(--muted); }
.dt.st .tag { height: 18px; font-size: 11px; padding: 0 5px; }
.q3 { border-collapse: collapse; width: 100%; }
.q3 th { width: 64px; text-align: left; font-weight: 400; color: var(--muted); padding: 3px 0; font-size: var(--fs-s); }
.q3 td { padding: 3px 0; }
.q3 b { font-size: 14px; }
.why { font-size: var(--fs-s); padding: 6px 8px; background: var(--hover); border-left: 2px solid var(--accent); border-radius: 0 var(--r) var(--r) 0; line-height: 1.5; }
.bub.inst circle:not(.ring) { fill: none; stroke-dasharray: 2 2; stroke-width: 1.2; }
.gd-inst { --c: transparent; border: 1px dashed var(--muted); }

/* 外資投行共識雷達（ADR-0048） */
.tag.t-cons { color: var(--fr-cons); background: var(--fr-cons-bg); } .tag.t-accel { color: var(--fr-accel); background: var(--fr-accel-bg); }
.tag.t-div { color: var(--fr-div); background: var(--fr-div-bg); } .tag.t-info { color: var(--accent-t); background: var(--accent-soft); }
.tag.t-mute { color: var(--muted); border-color: var(--line-strong); font-weight: 400; }
.t-cons-t { color: var(--fr-cons); } .t-accel-t { color: var(--fr-accel); } .t-div-t { color: var(--fr-div); }
.radar-pane { min-height: 0; background: var(--bg); overflow: hidden; container-type: inline-size; }
/* ADR-0064：全市場分點異常清單（沿用外資雷達的 .fr 版型） */
.scan-pane { min-height: 0; background: var(--bg); overflow: hidden; container-type: inline-size; }
.scantop { grid-template-columns: minmax(260px, 1.7fr) repeat(4, minmax(0, 1fr)); }
.scantop .frc[aria-pressed="true"] { background: var(--hover); border-top-color: var(--accent, var(--text)); }
.scantop .frc b.up { color: var(--up-t); } .scantop .frc b.down { color: var(--down-t); }
.scan .dt td .tag + .tag { margin-left: 2px; }
.scan tr[data-scan] { cursor: pointer; }
.scan tr.open > td { background: var(--hover); }
.scan-det > td { padding: 0 !important; background: var(--bg2, var(--bg)); }
.scand { display: grid; grid-template-columns: auto 1fr 1fr 1.4fr; gap: 12px 20px; padding: 10px 14px; white-space: normal; }
.scand h4 { font-size: 11.5px; font-weight: 600; color: var(--muted); margin: 0 0 4px; }
.scand ol, .scand ul { margin: 0; padding-left: 18px; font-size: 12px; } .scand li.up { color: var(--up-t); } .scand li.down { color: var(--down-t); }
.scanbars rect.up { fill: var(--up-t); } .scanbars rect.down { fill: var(--down-t); } .scanbars .zl { stroke: var(--line); stroke-width: 1; }
@container (max-width: 760px) { .scand { grid-template-columns: 1fr 1fr; } }
.fr { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.frtop { flex: none; display: grid; grid-template-columns: minmax(280px, 1.7fr) repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.frmain { padding: 10px 14px; display: grid; gap: 4px; align-content: start; border-right: 1px solid var(--line); }
.frmain h2 { font-size: 12px; font-weight: 400; color: var(--muted); }
.frh { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.frh b { font-size: 18px; font-weight: 700; } .frh span { color: var(--text); }
.frfeat { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: var(--fs-s); }
.frfeat span { display: inline-flex; align-items: center; gap: 3px; } .frfeat .ic { width: 14px; height: 14px; color: var(--fr-cons); }
.frc { display: grid; align-content: start; gap: 2px; padding: 10px 12px; text-align: left; border-right: 1px solid var(--line); border-top: 2px solid transparent; min-width: 0; }
.frc:last-child { border-right: 0; }
.frc span { font-size: 11px; color: var(--muted); } .frc b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frc small { font-size: 11.5px; color: var(--muted); }
.frc.t-cons { border-top-color: var(--fr-cons); } .frc.t-accel { border-top-color: var(--fr-accel); } .frc.t-div { border-top-color: var(--fr-div); }
.frc:hover:not(:disabled) { background: var(--hover); }
.frbar { flex: none; display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.frbar .fine { display: inline-flex; align-items: center; gap: 4px; } .frbar .fine .ic { width: 14px; height: 14px; }
.frbody { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.frbody > .dt-wrap, .frsplit .dt-wrap { flex: 1; min-height: 0; overflow: auto; }
.frbody > .pfoot { flex: none; border-top: 1px solid var(--line); }
.frf { flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.frf.adv .sel select { width: auto; }
.frsplit { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 38%); }
.frsplit.br { grid-template-columns: 220px minmax(0, 1fr); }
.frdet { min-height: 0; overflow: auto; padding: 12px 14px; border-left: 1px solid var(--line); display: grid; gap: 8px; align-content: start; }
.frsplit.br .frdet { border-left: 1px solid var(--line); }
.frdet h3 { font-size: 16px; font-weight: 600; } .frdet h4 { font-size: var(--fs-s); color: var(--muted); font-weight: 600; margin-top: 6px; }
.frdet .frow { margin-top: 6px; }
.num-l { counter-reset: n; } .num-l li::before { counter-increment: n; content: counter(n) '.'; color: var(--muted); margin-right: 4px; }
.heat { display: inline-block; width: 70px; height: 6px; margin-right: 6px; background: var(--line); border-radius: 2px; vertical-align: middle; overflow: hidden; }
.heat i { display: block; height: 100%; background: var(--fr-cons); }
.brl { list-style: none; margin: 0; padding: 4px 0; overflow: auto; min-height: 0; }
.brl li { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 8px 12px; cursor: pointer; border-left: 2px solid transparent; }
.brl li .num { grid-column: 1 / -1; font-size: 11.5px; }
.brl li:hover { background: var(--hover); } .brl li[aria-selected="true"] { background: var(--active); border-left-color: var(--accent); }
.meters { display: grid; gap: 5px; }
.meter { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; gap: 8px; font-size: var(--fs-s); }
.meter > span { color: var(--muted); } .meter em { font-style: normal; text-align: right; }
.meter i { display: block; height: 8px; background: var(--line); border-radius: 2px; overflow: hidden; }
.meter i b { display: block; height: 100%; background: var(--accent); }
.meter.t-cons i b { background: var(--fr-cons); } .meter.t-accel i b { background: var(--fr-accel); } .meter.t-div i b { background: var(--fr-div); }
.frtags { display: flex; flex-wrap: wrap; gap: 4px; }
.who summary { list-style: none; cursor: pointer; } .who summary::-webkit-details-marker { display: none; }
.brs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; font-size: var(--fs-s); }
.brs li { display: flex; gap: 6px; align-items: baseline; } .brs li b { min-width: 4.5em; font-weight: 500; }
.who:not([open]) .fr-n { display: none; } .who[open] .lnk { display: none; } .who .lnk { display: inline-block; margin-top: 4px; }
.story { list-style: none; margin: 0; padding: 0 0 0 10px; border-left: 2px solid var(--line-strong); display: grid; gap: 6px; font-size: var(--fs-s); }
.story li { display: grid; grid-template-columns: 40px 1fr; gap: 6px; position: relative; }
.story li::before { content: ''; position: absolute; left: -15px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.story li.LEAD_BROKER_ENTRY::before, .story li.BROKER_CONFIRMATION::before, .story li.FOREIGN_NET_BUY::before { background: var(--fr-cons); }
.story li.TRUST_JOIN::before { background: var(--accent); } .story li.PRICE_CONFIRMATION::before { background: var(--fr-accel); }
.story li.BROKER_REDUCE::before, .story li.FOREIGN_NET_SELL::before { background: var(--fr-div); }
.story time { color: var(--muted); }
.q3fr th { cursor: help; }
@container (max-width: 900px) {
  .fr { display: block; height: 100%; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }   /* 同上：捲動交給 .fr（ADR-0055） */
  .frtop { grid-template-columns: 1fr 1fr; } .frmain { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--line); }
  .frc:nth-child(odd) { border-right: 0; }
  .frsplit, .frsplit.br { grid-template-columns: minmax(0, 1fr); } .frdet { border-left: 0; border-top: 1px solid var(--line); }
  .brl { display: flex; overflow-x: auto; } .brl li { flex: none; }
  .frbody > .dt-wrap, .frsplit .dt-wrap { overflow-y: visible; }   /* 不再巢狀 70vh 捲動框：整頁一起捲 */
  .frf > .seg { max-width: 100%; }
  .frdet { overflow: visible; }
}

/* 設定面板（側欄） */
.stabs { position: sticky; top: 40px; background: var(--bg); z-index: 2; padding: 0 4px; }
.stabs > button { flex: 1; }
.setb { padding: 12px; display: grid; gap: 12px; }
.grid1 { display: grid; grid-template-columns: 1fr; gap: 12px; }
.grid1 .full { grid-column: 1; }
.setb .kv th { width: 76px; }
.setb .frow { flex-wrap: wrap; }
.show-s { display: none; }

/* 交易訊號 */
.sig-ok { display: inline-flex; align-items: center; gap: 2px; color: var(--accent-t); font-size: var(--fs-s); }
.sig-ok .ic, td .warn-t .ic { width: 14px; height: 14px; vertical-align: -2px; }
button.exec-badge:hover { background: var(--hover); }
.sigset { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; display: grid; gap: 10px; }
.sigset h3 { font-size: 14px; font-weight: 600; }
.sigset .fld select { width: 100%; }

/* 持倉與風控 */
.kpis { display: flex; flex-wrap: wrap; align-items: stretch; border-bottom: 1px solid var(--line); }
.kpi { display: grid; gap: 1px; padding: 8px 14px; border-right: 1px solid var(--line); min-width: 120px; }
.kpi span { font-size: 11px; color: var(--muted); }
.kpi b { font-size: 15px; font-weight: 600; }
.kpi small { font-size: 11px; }
.kpis > .btn { align-self: center; margin: 0 10px; }
.alerts { list-style: none; margin: 0; padding: 6px 12px; display: grid; gap: 3px; border-bottom: 1px solid var(--line); font-size: var(--fs-s); }
.alerts li { display: flex; gap: 6px; align-items: center; color: var(--warn); }
.alerts li.risk { color: var(--up-t); }
.alerts .ic { width: 14px; height: 14px; }
.inds { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: var(--fs-s); }
.ind-b { display: inline-flex; align-items: center; gap: 6px; }
.ind-b i { display: inline-block; width: 60px; height: 6px; background: var(--line); border-radius: 2px; position: relative; overflow: hidden; }
.ind-b i { background: linear-gradient(var(--accent), var(--accent)) no-repeat 0 0 / var(--w, 0) 100%, var(--line); }
.ind-b i.over { outline: 1px solid var(--warn); }
.txns { border-bottom: 1px solid var(--line); }
.txns summary { padding: 8px 12px; cursor: pointer; font-size: var(--fs-s); color: var(--muted); }

/* 浮層／對話框 */
.pop { position: fixed; z-index: 60; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r-l); box-shadow: var(--shadow); padding: 6px 0; max-height: calc(100vh - 60px); overflow: auto; min-width: 280px; }
.ind h4 { font-size: 11px; color: var(--muted); font-weight: 600; padding: 8px 12px 4px; letter-spacing: .03em; }
.opt { display: flex; align-items: center; gap: 10px; padding: 5px 12px; cursor: pointer; }
.opt:hover { background: var(--hover); }
.opt small { display: block; font-size: 11px; color: var(--muted); }
.opt.row { justify-content: space-between; }
.opt.row select { width: auto; min-height: 26px; height: 26px; padding: 0 4px; }
.opt.dis { opacity: .5; }
.opt input[type="range"] { flex: 1; accent-color: var(--accent); }
.opt input[type="checkbox"], .radios input, .cats input { accent-color: var(--accent); width: 15px; height: 15px; }
.radios { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 4px 12px 6px; }
.radios label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.pop .fine { padding: 4px 12px 6px; max-width: 320px; }
dialog { color: var(--text); background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r-l); box-shadow: var(--shadow); padding: 0; }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
.find { width: min(560px, calc(100vw - 24px)); margin-top: 10vh; }
.find-in { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.find-in input { border: 0; background: transparent; height: 48px; font-size: 16px; padding: 0; }
.find ul { list-style: none; margin: 0; padding: 4px 0; max-height: 50vh; overflow: auto; }
.find li[role="option"] { display: grid; grid-template-columns: 56px auto 1fr auto; gap: 10px; align-items: center; padding: 0 14px; height: 34px; cursor: pointer; }
.find li[aria-selected="true"], .find li[role="option"]:hover { background: var(--hover); }
.find li b { color: var(--text-hi); }
.find .fh { padding: 8px 14px 4px; font-size: 11px; color: var(--muted); }
.dlg { width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 48px); }
.dlg-h { display: flex; align-items: center; gap: 12px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--line); }
.dlg-h h2 { font-size: 15px; font-weight: 600; }
.dlg-b { padding: 16px; overflow: auto; max-height: calc(100vh - 110px); display: grid; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.grid2 .full { grid-column: 1 / -1; }
.in-u { display: flex; align-items: center; gap: 6px; }
.in-u em { font-style: normal; color: var(--muted); font-size: var(--fs-s); white-space: nowrap; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; }
.steps li > i { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; }
.steps li.done > i { background: var(--accent); border-color: var(--accent); color: #fff; }
.steps li.done > i .ic { width: 13px; height: 13px; }
.cats { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; }
.cats label { display: inline-flex; gap: 6px; align-items: center; }
.preview { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; font-size: var(--fs-s); }
.banner { padding: 8px 12px; border: 1px solid var(--warn); border-radius: var(--r); display: flex; align-items: center; gap: 10px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; z-index: 90; background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: var(--r); font-size: var(--fs-s); transition: opacity .15s var(--ease), transform .15s var(--ease); max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--up); color: #fff; }

.mnav { display: none; }
.chart-mtools { display: none; }
/* 手機底部面板（ADR-0052） */
.sheet-back { position: fixed; inset: 0; z-index: 59; background: rgba(0, 0, 0, .45); }
.pop.sheet { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: 100%; min-width: 0; max-height: 78vh; border-radius: 12px 12px 0 0; padding: 0; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); }
.sheet-h { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.sheet-h b { font-size: 15px; }
.sheet-b { overflow: auto; padding: 4px 0 12px; }
.pop.sheet .opt { min-height: 44px; }
.coach { position: absolute; left: 8px; right: 8px; z-index: 30; display: grid; gap: 4px; padding: 10px 12px; background: var(--accent); color: #fff; border-radius: var(--r-l); box-shadow: var(--shadow); font-size: var(--fs-s); }
.coach::before { content: ''; position: absolute; top: -6px; left: calc(var(--ax, 50%) - 14px); border: 6px solid transparent; border-top: 0; border-bottom-color: var(--accent); }
.coach b { font-size: 14px; } .coach .btn { justify-self: end; background: #fff; color: var(--accent); border-color: #fff; }

/* ------------------------------------------------------------------ 中型螢幕：側欄變窄 */
@media (max-width: 1200px) { :root { --side-w: 290px; --side-scr-w: 330px; } .chart-foot .hint { display: none; } }

/* ------------------------------------------------------------------ 手機：TradingView App 式底部分頁，一次一個畫面 */
@media (max-width: 900px) {
  :root { --fs: 14px; --row: 40px; --top-h: 48px; }
  body { overflow: hidden; }
  .hide-s { display: none !important; }
  .top { gap: 2px; padding: 0 4px; }
  .symbtn { min-width: 0; padding: 0 8px; }
  .top .ctools .vsep, .top > .vsep, .top > .grow, .status .num { display: none; }
  .ctools { flex: 1; overflow-x: auto; scrollbar-width: none; }
  body:not([data-view="chart"]) .top .ctools { visibility: hidden; }
  .symbtn b { font-size: 15px; }
  .ws { display: block; height: calc(100% - var(--top-h) - 56px - env(safe-area-inset-bottom)); padding: 0; }
  .rail, .resizer, .side-rz { display: none; }
  .center, .side, .bottom, .chart-pane, .home-pane, .radar-pane, .scan-pane { display: none; }
  body[data-view="home"] .center { display: block; height: 100%; }
  body[data-view="home"] .home-pane { display: block; height: 100%; }
  body[data-view="radar"] .center { display: block; height: 100%; }
  body[data-view="radar"] .radar-pane { display: block; height: 100%; }
  body[data-view="scan"] .center { display: block; height: 100%; }
  body[data-view="scan"] .scan-pane { display: block; height: 100%; }
  body[data-view="screen"] .side, body[data-view="settings"] .side { display: block; height: 100%; }
  .show-s { display: inline-grid; }
  .qcells { grid-template-columns: 1fr 1fr; }
  body[data-view="chart"] .center, body[data-view="bottom"] .center { display: block; height: 100%; }
  body[data-view="chart"] .ws { overflow-y: auto; }
  body[data-view="chart"] .center { height: auto; }
  body[data-view="chart"] .chart-pane { display: flex; height: 58vh; min-height: 320px; }
  body[data-view="chart"] .side { display: block; border-top: var(--gap) solid var(--app); }
  body[data-view="chart"] .side-body { height: auto; overflow: visible; }
  body[data-view="bottom"] .bottom { display: flex; height: 100%; }
  body[data-view="list"] .side, body[data-view="order"] .side { display: block; height: 100%; }
  body.side-off .side { display: block; }
  body.bottom-off .bbody { display: block; }
  #bottomToggle { display: none; }
  .chart-mtools { display: flex; align-items: center; gap: 2px; padding: 2px 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; flex: none; }
  .chart-mtools .vsep { display: none; }
  .chart-mtools .ind-m { margin-left: auto; color: var(--accent-t); border: 1px solid var(--accent); height: 34px; }
  .chart-pane { position: relative; }
  .chart-top { top: 42px; }
  .mnav { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; left: 0; right: 0; bottom: 0; height: calc(56px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--bg); border-top: 1px solid var(--line); z-index: 20; }
  .mnav button { display: grid; place-items: center; align-content: center; gap: 2px; font-size: 11px; color: var(--muted); min-height: 44px; }
  .mnav button[aria-current="page"] { color: var(--accent-t); }
  .mnav .ic { width: 22px; height: 22px; }
  .seg > button, .ibtn, .tbtn, .lbtn, .chip { min-height: 36px; }
  .ibtn { width: 40px; height: 40px; }
  .flow { grid-template-columns: 1fr; }
  .mkt { border-right: 0; border-bottom: 1px solid var(--line); grid-template-columns: 1fr 1fr; }
  .mkt .say, .mkt > p { grid-column: 1 / -1; }
  .fbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .fbar .grow { display: none; }
  .dt th, .dt td { padding: 0 8px; }
  .dt .hide-s { display: none; }
  /* 長名稱（產業、外資狀態、分點）最多兩行，不再只剩「電腦及週邊…」（ADR-0055） */
  .dt.ft .ell { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; padding: 3px 0; }
  .tipb { width: 26px; height: 26px; }
  .chart-top { right: 8px; }
  .lg-row:first-child > span:nth-child(3), .lg-row:first-child > span:nth-child(4), .lg-row:first-child > span:nth-child(5), .lg-row:first-child > span:nth-child(6), .lg-row:first-child > span:last-child { display: none; }
  .trade-btns { display: none !important; }
  .lg-row + .lg-row { display: none; }
  .ptag { left: 8px; }
  .grid2 { grid-template-columns: 1fr; }
  input, select, textarea { font-size: 16px !important; }
  .dlg, .find { width: 100vw; max-width: 100vw; margin: 0; height: 100%; max-height: 100%; border-radius: 0; }
  .kpi { min-width: 50%; border-bottom: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ADR-0066：盤後 K 棒提示 */
.eodn { font-size: 11px; color: var(--warn); background: var(--warn-bg); padding: 1px 6px; border-radius: 3px; white-space: nowrap; margin-right: 8px; }
@media (max-width: 900px) { .eodn { font-size: 10.5px; } }

/* ADR-0068：短籌碼｜長籌碼 */
#cvHdr .cvsw { margin-left: 6px; }
:root[data-chipview="long"] .cvsw [data-cv="long"][aria-pressed="true"] { color: var(--warn); }
.lcv { font-size: 10.5px; color: var(--warn); background: var(--warn-bg); padding: 0 5px; border-radius: 3px; margin-left: 4px; font-weight: 600; }
.sscr .ph h2, .sscr .ph > .num { white-space: nowrap; }
.cvsw.sm button { padding: 0 7px; font-size: 12px; }
@media (max-width: 900px) { .sscr .ph .cvsw.sm button { padding: 0 5px; font-size: 11.5px; } }
/* ADR-0079：長籌碼視角下，仍是短籌碼口徑的模組（每日摘要、今日變化）標「短籌碼」；短籌碼視角與基礎模式不顯示 */
.cv-short { display: none; }
:root[data-chipview="long"] .cv-short { display: inline; color: var(--muted); font-weight: 400; }

/* ADR-0081：hidden 必須覆蓋元件的 grid／flex／table 排版。 */
[hidden] { display: none !important; }
.info-guide, .scr-guide { padding: 8px 12px; color: var(--muted); font-size: var(--fs-s); border-bottom: 1px solid var(--line); line-height: 1.6; }
.info-tools { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 4px 12px; border-bottom: 1px solid var(--line); }
.info-tools button { min-height: 30px; }
.smore { border-bottom: 1px solid var(--line); }
.smore summary { cursor: pointer; padding: 8px 12px; color: var(--muted); font-size: var(--fs-s); }
.smore[open] summary { color: var(--text); }

:root[data-mode="basic"] .info-guide, :root[data-mode="basic"] .info-tools { display: none; }
@media (max-width: 760px) {
  .info-tools button, .isec h3 > button { min-height: 44px; }
  .smore summary { min-height: 44px; display: flex; align-items: center; gap: 8px; }
  .smore summary::before { content: '▸'; }
  .smore[open] summary::before { content: '▾'; }
}

.smore:not([open]) > .sflt { display: none; }
