/* Ghost Bid (formerly PSA10 Tracker) — app shell (sidebar / tab bar), overview list + detail drawer,
   display case, card pages. Bebas Neue for display type, Montserrat for text,
   Noto Sans JP (bold) as the fallback for Japanese card names. */

:root {
  /* Ghost Bid theme (2026-10-18): violet ground, ghost purple, yellow for prices and actions, holo for the strongest signal */
  --bg: #100c18;
  --side: #140f1f;
  --panel: #1a1426;
  --panel-2: #221a32;
  --hover: #2a2140;
  --band: #2a2140;
  --line: #2e2443;
  --line-2: #3a2e55;
  --line-3: #4a3d68;
  --text: #f1edf9;
  --soft: #d6cfe8;
  --muted: #b9b0cf;
  --muted-2: #9d93b6;   /* captions and labels */
  --accent: #ffd23f;
  --accent-2: #ffe07a;
  --on-accent: #100c18;
  --ghost: #7c5cc4;
  --ghost-soft: #c9bdf0;
  --holo: linear-gradient(135deg, #ff7eb6, #ffd23f 30%, #5eead4 60%, #b48bff);
  --holo-line: linear-gradient(90deg, #ff7eb6, #ffd23f 25%, #5eead4 50%, #7aa2ff 75%, #b48bff);
  --green-strong: #1f9d61;
  --green: #45d483;
  --amber: #f5a524;
  --amber-strong: #d9861a;
  --red: #f0524d;
  --neg: #ff6b63;
  --psa-red: #b8322c;
  /* numbers, titles and labels: Barlow Condensed (only weight 600 is loaded, so every weight renders as 600) */
  --display: "Barlow Condensed", "Noto Sans JP", "Arial Narrow", sans-serif;
  --logo: "Bebas Neue", "Arial Narrow", sans-serif;
  --sans: Montserrat, "Noto Sans JP", system-ui, -apple-system, sans-serif;
  --radius: 8px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
button, input, select { font: inherit; color: inherit; }
img { display: block; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.display { font-family: var(--display); font-weight: 400; letter-spacing: 0.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.jp { font-family: var(--display); font-weight: 400; letter-spacing: 0.02em; }
.lbl { font-family: var(--display); font-size: 15px; letter-spacing: 0.1em; color: var(--muted-2); line-height: 1.2; }
.pos, .up { color: var(--green); }
.neg, .down { color: var(--neg); }
.flat, .muted { color: var(--muted-2); }
.asof { margin-left: 6px; font: 400 11px var(--sans); letter-spacing: 0; color: var(--muted-2); white-space: nowrap; }

/* ---------- shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; height: var(--app-h, 100dvh); width: 240px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 26px;
  /* the home-screen app draws under the status bar and home indicator (viewport-fit=cover) */
  padding: calc(24px + env(safe-area-inset-top)) 14px calc(20px + env(safe-area-inset-bottom));
  background: var(--side); border-right: 1px solid var(--line); overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand { gap: 6px; }
.brand-mark { width: 34px; height: 34px; flex: 0 0 auto; margin-right: 2px; }
.brand-word { font: 28px var(--logo); letter-spacing: 0.04em; line-height: 1; white-space: nowrap; }
.brand-ten { align-self: flex-start; margin-top: 2px; font: 13px var(--logo); line-height: 1; padding: 3px 4px 1px; border-radius: 3px; color: var(--on-accent);
  background: linear-gradient(135deg, #ff7eb6, #ffd23f 30%, #5eead4 60%, #b48bff); }
.nav { display: flex; flex-direction: column; gap: 16px; }
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-h { padding: 0 12px 4px; font: 700 10px var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-2); }
.nav a {
  display: flex; align-items: center; gap: 12px; min-height: 38px; padding: 0 12px; border-radius: 6px;
  font: 19px var(--display); letter-spacing: 0.06em; color: var(--muted);
}
.nav a:hover { background: var(--panel); color: var(--text); }
.nav a.on { background: var(--hover); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.nav svg, .tabbar svg, .back-link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.nav span { flex-grow: 1; }
.nav em, .more-list em { font: 400 11px var(--sans); font-style: normal; color: var(--muted-2); font-variant-numeric: tabular-nums; }
@media (max-height: 1000px) { .sidebar { gap: 18px; } }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 4px; }
.snap-select {
  background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 0 10px; min-height: 44px; font: 500 13px var(--sans);
}
.card-requests { font-size: 11px; color: var(--muted-2); line-height: 1.4; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px;
  border-radius: var(--radius); border: 1px solid var(--line-3); background: transparent; color: var(--text);
  font: 20px var(--display); letter-spacing: 0.06em; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--on-accent); }

.mobile-bar, .tabbar { display: none; }

.main { flex-grow: 1; min-width: 0; padding: 26px 28px 40px; display: flex; flex-direction: column; gap: 18px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head h1 { margin: 0; font-size: 46px; }
.page-sub { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.back-link { display: inline-flex; align-items: center; gap: 4px; font: 19px var(--display); letter-spacing: 0.06em; min-height: 36px; }
.view { display: flex; flex-direction: column; gap: 18px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.section-title { font: 26px var(--display); letter-spacing: 0.04em; margin: 0 0 8px; font-weight: 400; }
.empty-state, .loading { padding: 28px 20px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- key numbers ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpis.market .cell {
  display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; min-width: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text);
}
.kpi-d { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.kpis.market .k { font: 15px var(--display); letter-spacing: 0.1em; color: var(--muted-2); }
.kpis.market .v { font: 36px var(--display); letter-spacing: 0.02em; line-height: 1.05; font-variant-numeric: tabular-nums; text-transform: capitalize; }
.kpis.market .v[style] { font-size: 26px !important; font-family: var(--display) !important; }
.kpis.market .d { font-size: 12px; color: var(--muted); }

/* ---------- signal pills + banners ---------- */
.sig-pill.limit { font: 16px var(--display); letter-spacing: 0.08em; line-height: 1; color: var(--on-accent); background: var(--accent); padding: 3px 6px 1px; border-radius: 3px; }
.sig-new { font: 14px var(--display); letter-spacing: 0.08em; line-height: 1; background: var(--accent); color: var(--on-accent); border-radius: 3px; padding: 3px 5px 1px; }
.banner { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 12px 16px; font-size: 13px; color: var(--soft); }
.banner strong { display: block; font: 18px var(--display); letter-spacing: 0.05em; color: var(--text); margin-bottom: 2px; }
.banner.warning { border-left-color: var(--amber); }
.banner.correction { border-left-color: var(--red); }
.banner.auto { border-left-color: var(--muted-2); }
.banner ul { margin: 4px 0 0; padding-left: 18px; }

/* ---------- overview 1.1: ticker, market today, needs you, your money ---------- */
.ticker { display: flex; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.tk { flex: 1 1 200px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; padding: 10px 16px; color: var(--text); border-right: 1px solid var(--line); min-width: 0; }
.tk:last-child { border-right: 0; }
.tk:hover { background: var(--panel-2); color: var(--text); }
.tk-k { flex-basis: 100%; font: 700 10px var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.tk-v { font-size: 26px; line-height: 1; }
.tk-d { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tk-d small { margin-left: 3px; font-weight: 600; font-size: 10px; color: var(--muted-2); }
.today { display: flex; flex-direction: column; gap: 10px; }
.today-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.today-h { font: 20px var(--display); letter-spacing: 0.05em; margin-right: 4px; }
.tchip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tchip { max-width: 420px; display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: 600 12px var(--sans); cursor: pointer; }
.tchip i { width: 8px; height: 8px; border-radius: 50%; background: var(--soft); flex-shrink: 0; }
.tchip:hover, .tchip[aria-expanded="true"] { border-color: var(--muted); }
.tchip.t-warning { background: rgba(245, 165, 36, 0.12); border-color: rgba(245, 165, 36, 0.4); }
.tchip.t-warning i { background: var(--amber); }
.tchip.t-correction { background: rgba(240, 82, 77, 0.12); border-color: rgba(240, 82, 77, 0.4); }
.tchip.t-correction i { background: var(--red); }
.tchip.t-info i { background: var(--accent); }
.tchip.t-quiet { cursor: default; background: transparent; color: var(--muted); }
.tchip.t-quiet i { background: var(--muted-2); }
.ov-top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 18px; align-items: stretch; }
.inbox { display: flex; flex-direction: column; }
.inbox, .money { padding: 16px 20px; }
.inbox .section-title, .money .section-title { margin: 0; }
.ib-n { color: var(--accent); }
.ib-list { list-style: none; margin: 8px 0 0; padding: 0; }
.ib-item { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 0; border-top: 1px solid var(--line); color: var(--text); }
.ib-item:hover { color: var(--text); }
.ib-item:hover .ib-go { color: var(--accent); }
.ib-item > .vtag, .ib-item > .sig-pill { flex: 0 0 auto; min-width: 84px; justify-content: center; text-align: center; }
.ib-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ib-txt b { font-size: 19px; line-height: 1.15; }
.ib-txt small { font-size: 12px; color: var(--muted); line-height: 1.4; }
.ib-go { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; color: var(--muted-2); flex-shrink: 0; }
.ib-quiet { display: flex; align-items: center; gap: 12px; padding: 12px 0 2px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.ib-quiet .vtag { min-width: 84px; justify-content: center; }
.ib-quiet a b { color: var(--text); font-size: 17px; }
.ib-none { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.od { margin-top: auto; padding-top: 14px; container-type: inline-size; }
.od-h { display: block; margin-bottom: 8px; }
.od-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.od-tile { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, 0.02); color: var(--text); min-width: 0; transition: border-color .15s, background .15s; }
.od-tile:hover { color: var(--text); border-color: rgba(255, 210, 63, 0.45); background: rgba(255, 210, 63, 0.05); }
.od-th { width: 40px; height: 56px; flex: 0 0 40px; }
.od-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.od-txt b { font-size: 14px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.od-txt small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.od-bar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; margin-top: 2px; }
.od-bar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.od-tile.own .od-bar i { background: var(--green); }
.od-gap { font-size: 11px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.od-tile.own .od-gap { color: var(--green); }
@container (max-width: 680px) { .od-grid { grid-template-columns: 1fr; gap: 6px; } .od-tile { padding: 6px 10px; } .od-th { width: 30px; height: 42px; flex-basis: 30px; } .od-txt { display: grid; grid-template-columns: minmax(0, 1fr) minmax(110px, 32%); column-gap: 14px; align-items: center; } .od-txt b { grid-column: 1; } .od-txt small { grid-column: 1; } .od-bar { grid-column: 2; grid-row: 1; } .od-gap { grid-column: 2; grid-row: 2; white-space: nowrap; justify-content: flex-end; } .od-gap em { display: none; } }
.od-gap { display: flex; justify-content: space-between; gap: 6px; }
.od-gap em { font-style: normal; font-weight: 600; color: var(--muted-2); text-transform: uppercase; letter-spacing: .06em; font-size: 10px; }
.vtag.review { color: var(--accent-2); border-color: rgba(255, 224, 122, 0.5); }
.money { display: flex; flex-direction: column; gap: 4px; }
.mn-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.mn-head a { font-size: 12px; font-weight: 600; }
.mn-v { font-size: 44px; line-height: 1; }
.mn-d { font-size: 13px; font-weight: 700; }
.mn-d small { font-weight: 500; color: var(--muted); }
.mn-d { margin-bottom: 10px; }
.mn-rows { margin: auto 0 0; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.mn-rows div { display: flex; justify-content: space-between; gap: 10px; }
.mn-rows dt { color: var(--muted); }
.mn-rows dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.mn-rows .amb { color: var(--amber); }
@media (max-width: 1299px) {
  .ov-top { grid-template-columns: 1fr; gap: 14px; }
  .money { display: grid; grid-template-columns: auto auto minmax(0, 1fr) minmax(200px, 280px); grid-template-areas: "h h h h" "l l . r" "v d . r"; align-items: end; column-gap: 14px; row-gap: 2px; }
  .money .mn-head { grid-area: h; }
  .money .lbl { grid-area: l; }
  .money .mn-v { grid-area: v; font-size: 38px; }
  .money .mn-d { grid-area: d; margin-bottom: 4px; }
  .money .mn-rows { grid-area: r; margin: 0; padding: 0 0 0 16px; border-top: 0; border-left: 1px solid var(--line); align-self: stretch; justify-content: center; }
}

/* ---------- verdict tags ---------- */
.vtag {
  display: inline-flex; align-items: center; font: 15px var(--display); letter-spacing: 0.08em; line-height: 1;
  padding: 4px 9px 2px; border-radius: 4px; border: 1px solid transparent; white-space: nowrap;
}
.vtag.definitely_buy { background: var(--green-strong); color: #fff; }
.vtag.buy { background: var(--green); color: #06170d; }
.vtag.watch { color: var(--amber); border-color: var(--amber); }
.vtag.dont_buy { color: var(--neg); border-color: var(--neg); }
.vtag.defer, .vtag.none { color: var(--muted); border-color: var(--line-3); }
.vtag.pulled { color: #7cc4ff; border-color: rgba(124, 196, 255, 0.55); }
.limit-chip, .due-chip {
  display: inline-flex; font: 14px var(--display); letter-spacing: 0.08em; line-height: 1; padding: 4px 6px 2px; border-radius: 3px; margin-left: 6px;
}
.limit-chip { background: var(--accent); color: var(--on-accent); }
.vtag.sell-sell { background: var(--accent); color: var(--on-accent); }
.vtag.sell-peak, .vtag.sell-rich { color: var(--accent); border-color: var(--accent); }
.vtag.sell-take_profit { background: var(--green); color: #06170d; }
.vtag.sell-hold { color: var(--muted); border-color: var(--line-3); }
.tile-chips .vtag.sell-hold { background: var(--bg); }
.sell-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: var(--panel-2); border: 1px solid #2c2c32; border-radius: var(--radius); padding: 10px 12px; font-size: 13px; margin-top: 8px; }
.sell-row strong { font: 22px var(--display); letter-spacing: 0.04em; color: var(--accent); font-weight: 400; line-height: 1; }
.sell-row .sell-state { margin-left: auto; }

/* ---------- card picture (.slab keeps its name; since 2026-10-11 it's just the card, no PSA case around it) ---------- */
.slab { display: flex; flex-direction: column; flex-shrink: 0; }
.slab-art { position: relative; flex-grow: 1; border-radius: 5% / 3.6%; overflow: hidden; }
.slab-art:has(img.card-img) { background: none; border-radius: 0; overflow: visible; }
.slab img.card-img { filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5)); }
.slab.xs img.card-img, .slab.tbl img.card-img { filter: none; }
.slab-art, .wthumb, .pf-thumb { position: relative; overflow: hidden; }
/* Card photos: --h/--cx/--cy are set per photo by trimImages() so the card itself fills
   ~92% of the frame height; the defaults fit SNKRDUNK's usual transparent margin. */
img.card-img {
  position: absolute; left: 50%; top: 50%; width: auto; max-width: none;
  height: var(--h, 115%);
  transform: translate(calc(var(--cx, 0.5) * -100%), calc(var(--cy, 0.5) * -100%));
}
.slab.xs { width: 34px; height: 48px; }
.slab.md { width: 110px; height: 164px; }
.slab.lg { width: 100%; height: 100%; }
.slab.xl { width: 180px; height: 270px; }
.art-1 { background: linear-gradient(155deg, #3a3630 0%, #1a1814 55%, #0e0d0b 100%); }
.art-2 { background: linear-gradient(155deg, #5b3f78 0%, #382450 55%, #1c1128 100%); }
.art-3 { background: linear-gradient(155deg, #caa23a 0%, #8a5f1e 55%, #4a3410 100%); }
.art-4 { background: linear-gradient(155deg, #2f6a63 0%, #1c4038 55%, #0d211d 100%); }
.art-5 { background: linear-gradient(155deg, #7a3a3a 0%, #4a2020 55%, #210f0f 100%); }
.art-6 { background: linear-gradient(155deg, #33517a 0%, #1c2e4a 55%, #0d1622 100%); }
.art-7 { background: linear-gradient(155deg, #3f6b3a 0%, #243d20 55%, #111e0e 100%); }
.art-8 { background: linear-gradient(155deg, #4a4f5c 0%, #2a2d35 55%, #15161a 100%); }

/* ---------- zone bars ---------- */
.zb { position: relative; display: flex; align-items: center; height: 22px; min-width: 0; }
.zb-track { display: flex; width: 100%; height: 6px; border-radius: 3px; overflow: hidden; }
.zb.thin { height: 12px; }
.zb.thin .zb-track { height: 4px; border-radius: 2px; }
.zb-track i, .gauge-legend i { display: block; height: 100%; }
.z-db { background: var(--green-strong); }
.z-bu { background: var(--green); }
.z-w { background: var(--amber); }
.z-x { background: var(--red); flex-grow: 1; }
.zb-now { position: absolute; top: 2px; bottom: 2px; width: 2px; margin-left: -1px; background: var(--text); border-radius: 1px; }
.zb.thin .zb-now { top: 0; bottom: 0; }
.zb-lim { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--accent); border: 2px solid var(--panel); }
.zb-none { font-size: 12px; color: var(--muted-2); }

/* ---------- overview: list + drawer ---------- */
.split { display: flex; gap: 18px; align-items: flex-start; }
.watchlist { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.wl-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.seg.wl-filter { border-radius: var(--radius); padding: 3px; gap: 2px; background: var(--panel); border-color: var(--line); }
.seg.wl-filter button { min-height: 34px; padding: 0 14px; border-radius: 6px; font-size: 13px; font-weight: 700; }
.seg.wl-filter button + button { border-left: 0; }
.seg.wl-filter button[aria-selected="true"] { background: var(--line); color: var(--text); }
.seg.wl-filter button span { margin-left: 3px; color: var(--muted-2); font-weight: 600; }
.seg.wl-filter button:disabled { opacity: 0.4; cursor: default; }
#watchlist { display: flex; flex-direction: column; gap: 14px; }
.wl-sec { overflow: hidden; }
.wl-sec-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 14px 18px 0; }
.wl-sec-h .section-title { margin: 0; }
.wl-sec-note { font-size: 12px; color: var(--muted); }
.wl-head, .wl-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 90px minmax(50px, 120px) 66px 56px 60px 96px 112px; gap: 10px; align-items: center; padding: 0 18px; }
.wl-head { padding-top: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font: 15px var(--display); letter-spacing: 0.1em; color: var(--muted-2); }
.wl-head .r, .wl-price, .wl-chg { text-align: right; }
.wl-head span { white-space: nowrap; }
.wl-head button { all: unset; cursor: pointer; white-space: nowrap; font: inherit; letter-spacing: inherit; color: inherit; }
.wl-head button:hover, .wl-head button.on { color: var(--text); }
.wl-head button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.wl-head button.on::after { content: ' ▲'; font-size: 10px; color: var(--accent); }
.wl-head button.on[data-dir="desc"]::after { content: ' ▼'; }
.wl-sortbar { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.wl-sortbar select { max-width: 240px; }
.wl-sortbar select, .wl-sortbar button { background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: 6px; min-height: 34px; padding: 0 10px; font: 500 12px var(--sans); cursor: pointer; }
.wl-row { min-height: 70px; padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid #1d1d21; color: var(--text); }
.wl-row:last-child { border-bottom: 0; }
.wl-row:hover { background: #19191d; color: var(--text); }
.wl-row.sel { background: var(--hover); box-shadow: inset 3px 0 0 var(--accent); }
.wl-row.hit .wl-price { color: var(--accent); }
.wl-name { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.wl-name b { font-size: 19px; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-name small, .wname small { font-size: 12px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-price { font-size: 22px; }
.wl-price .wl-sub { display: block; font: 600 10px var(--sans); letter-spacing: 0; color: var(--muted-2); text-align: right; margin-top: 1px; white-space: nowrap; }
.wl-chg { font-size: 13px; font-variant-numeric: tabular-nums; }
.wl-trend { font-weight: 700; }
.wl-trend .chg-sub { font-weight: 500; white-space: nowrap; }
.wl-tag { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.wl-tag > span { display: inline-grid; grid-auto-flow: row; justify-items: stretch; gap: 5px; }
.wl-tag > span > * { margin-left: 0; justify-content: center; text-align: center; }
.wl-tag > span > .vtag, .wl-tag > span > .diy-chip, .wl-tag > span > .limit-chip { font-size: 14px; padding: 4px 9px 2px; }
.drawer { width: 350px; flex-shrink: 0; position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; border-color: var(--line-2); padding: 20px; }

/* ---------- card detail (drawer + page) ---------- */
.cd { display: flex; flex-direction: column; gap: 16px; }
.cd-hero { display: flex; gap: 18px; align-items: center; }
.cd-info { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cd-name { font-size: 28px; line-height: 1.1; color: var(--text); }
.cd-name:hover { color: var(--accent); }
.cd-meta { font-size: 12px; color: var(--muted-2); }
.cd-price { font-size: 40px; margin-top: 2px; }
.cd-plabel { font-size: 12px; color: var(--muted-2); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cd-off, .cd-delta { font-size: 12px; color: var(--muted); }
.cd-off .pct { color: var(--neg); font-variant-numeric: tabular-nums; }
.cd-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 2px; }
.flag { font: 600 10px var(--sans); letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 6px; border-radius: 3px; border: 1px solid var(--line-3); color: var(--muted); }
.flag.confirmed { color: var(--green); border-color: rgba(69, 212, 131, 0.4); }
.flag.unconfirmed { color: var(--amber); border-color: rgba(245, 165, 36, 0.4); }
.cd-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(max-content, 1fr); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.cd-tabs::-webkit-scrollbar { display: none; }
.cd-tabs button { min-height: 44px; padding: 0 12px; white-space: nowrap; background: none; border: 0; color: var(--muted-2); font: 19px var(--display); letter-spacing: 0.06em; cursor: pointer; }
.cd-tabs button:hover { color: var(--text); }
.cd-tabs button[aria-selected="true"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.cd-panel { display: flex; flex-direction: column; gap: 16px; }
.cd-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cd-decide { display: flex; flex-direction: column; gap: 14px; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 16px 18px; }
.cd-decide-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cd-decide .gauge-wrap { padding-top: 22px; }
.cd-facts { display: flex; flex-direction: column; gap: 8px; }
.cd-page .cd-facts .cd-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cd-decide .sell-row .sell-state { display: none; }
@media (max-width: 640px) { .cd-page .cd-facts .cd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cd-folds { display: flex; flex-direction: column; gap: 8px; }
.cd-fold { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.cd-fold summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 16px; }
.cd-fold summary::-webkit-details-marker { display: none; }
.cd-fold summary b { font: 19px var(--display); letter-spacing: 0.05em; font-weight: 400; }
.cd-fold summary small { flex: 1; font-size: 12px; color: var(--muted); }
.cd-fold summary svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.15s; }
.cd-fold[open] summary svg { transform: rotate(180deg); }
.cd-fold summary:hover b { color: var(--accent); }
.cd-fold-b { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.cd-actions .btn-primary { flex-grow: 1; }
.cd-note { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.cd-note.warn { color: var(--accent); }
.cd-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.cd-stat { background: var(--panel-2); border-radius: var(--radius); padding: 10px 12px; min-width: 0; }
.cd-stat .lbl { font: 400 11px var(--sans); letter-spacing: 0; color: var(--muted-2); }
.cd-stat .val { font: 21px var(--display); letter-spacing: 0.05em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.cd-stat .asof { display: block; margin: 2px 0 0; }
.depth-bar-track { height: 3px; background: var(--line-2); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.depth-bar-fill { height: 100%; background: var(--accent); }

.gauge-wrap { padding-top: 26px; }
.gauge-track { position: relative; height: 10px; border-radius: 5px; }
.marker { position: absolute; top: -8px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.marker .stem { width: 2px; height: 26px; background: var(--text); border-radius: 1px; }
.marker .tag { position: absolute; left: 50%; transform: translateX(-50%); bottom: 30px; white-space: nowrap; font: 15px var(--display); letter-spacing: 0.05em; line-height: 1; background: var(--text); color: var(--bg); padding: 3px 5px 1px; border-radius: 3px; }
.marker.peak .stem { background: var(--muted-2); }
.marker.peak .tag { background: transparent; color: var(--muted); padding: 0; bottom: auto; top: 30px; }
.marker.limit { pointer-events: auto; cursor: grab; touch-action: none; top: -5px; z-index: 2; }
.marker.limit .knob { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); border: 3px solid var(--panel); box-shadow: 0 0 0 1px var(--accent); }
.marker.limit .tag { background: var(--accent); color: var(--on-accent); bottom: auto; top: 24px; }
.marker.limit.dragging { cursor: grabbing; }
.marker.edge-r .tag { left: auto; right: -1px; transform: none; }
.marker.edge-l .tag { left: -1px; transform: none; }
.gauge-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 30px; font-size: 11px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.gauge-legend span { display: inline-flex; align-items: center; gap: 5px; }
.gauge-legend i { width: 8px; height: 8px; border-radius: 2px; }

.limit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: var(--panel-2); border: 1px solid #2c2c32; border-radius: var(--radius); padding: 10px 12px; font-size: 13px; }
.limit-lbl { font: 16px var(--display); letter-spacing: 0.08em; color: var(--muted); }
.limit-row strong { font: 22px var(--display); letter-spacing: 0.04em; color: var(--accent); font-weight: 400; line-height: 1; }
.limit-hit-note { color: var(--green); font-weight: 600; font-size: 12px; }
.limit-gap { color: var(--muted-2); font-size: 12px; }
.limit-actions { margin-left: auto; display: flex; gap: 6px; }
.limit-btn { min-height: 34px; padding: 0 12px; border-radius: 6px; background: transparent; border: 1px solid var(--line-3); color: var(--text); font: 600 12px var(--sans); cursor: pointer; }
.limit-btn:hover { border-color: var(--accent); }
.limit-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.limit-input { width: 110px; min-height: 34px; background: var(--bg); border: 1px solid var(--line-3); border-radius: 6px; padding: 0 8px; font-variant-numeric: tabular-nums; }
.limit-hint { flex-basis: 100%; font-size: 11px; color: var(--muted-2); }
.owned-note { color: var(--green); font-weight: 600; font-size: 12px; }

.verdict { display: flex; flex-direction: column; gap: 8px; }
.verdict-head { margin: 0; font: 24px var(--display); letter-spacing: 0.03em; font-weight: 400; line-height: 1.1; }
.verdict p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--soft); }
.verdict-stale { font-size: 12px; color: var(--amber); line-height: 1.5; }
.tier-pending { font-size: 13px; color: var(--muted); padding: 10px 12px; border: 1px dashed var(--line-3); border-radius: var(--radius); }

/* card page */
.cd-page .cd-price { font-size: 52px; }
.cd-page .cd-info .cd-actions { margin-top: 10px; }
@media (min-width: 900px) {
  .cd-page { display: grid; grid-template-columns: 280px minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 40px; row-gap: 16px; align-items: start; max-width: 1120px; }
  .cd-page .cd-hero { grid-column: 1; grid-row: 1 / span 2; flex-direction: column; align-items: flex-start; position: sticky; top: 24px; }
  .cd-page .slab.xl { width: 220px; height: 330px; }
  .cd-page .cd-info .cd-actions { flex-direction: column; align-self: stretch; }
  .cd-page .cd-tabs { grid-column: 2; grid-row: 1; }
  .cd-page .cd-panel { grid-column: 2; grid-row: 2; }
}
.market-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.market-notes p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.55; }
.market-notes .panel { padding: 14px 16px; }

/* history + listings */
.history-block .lbl, .spark-block .lbl, .distribution .lbl { font: 15px var(--display); letter-spacing: 0.08em; color: var(--muted); margin-bottom: 6px; }
.history-block svg, .spark-block svg { width: 100%; height: 160px; display: block; }
.spark-block svg { height: 90px; }
.hist-empty, .loading-inline { font-size: 13px; color: var(--muted); }
.hist-ref-line { stroke-dasharray: 4 3; stroke-width: 1; vector-effect: non-scaling-stroke; }
.hist-ref-line.db { stroke: var(--green-strong); }
.hist-ref-line.bu { stroke: var(--amber); }
.hist-ref-line.ceil { stroke: var(--red); }
.hist-ref-label { font-size: 9px; font-family: var(--sans); }
.hist-ref-label.db { fill: var(--green-strong); }
.hist-ref-label.bu { fill: var(--amber); }
.hist-ref-label.ceil { fill: var(--red); }
.hist-note { font-size: 11px; color: var(--muted-2); margin-top: 6px; }
.detail-grade { display: flex; flex-direction: column; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.detail-grade:last-child { border-bottom: 0; }
.detail-grade h3 { margin: 0; font: 24px var(--display); letter-spacing: 0.04em; font-weight: 400; display: flex; align-items: center; gap: 10px; }
.grade-pill { font: 500 11px var(--sans); color: var(--muted); border: 1px solid var(--line-3); border-radius: 3px; padding: 2px 6px; }
.raw-note { font-size: 12px; color: var(--amber); }
.detail-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.detail-row > div { background: var(--panel-2); border-radius: var(--radius); padding: 8px 10px; }
.stat-label { font-size: 11px; color: var(--muted-2); }
.stat-value { font: 20px var(--display); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.sales-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 16px; font-size: 12px; font-variant-numeric: tabular-nums; }
.sales-list li { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid #1d1d21; padding: 3px 0; }
.sales-list .when { color: var(--muted-2); }

/* ---------- display case ---------- */
.collection { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 28px 22px; }
.tile { display: flex; flex-direction: column; gap: 8px; color: var(--text); min-width: 0; }
.tile:hover { color: var(--text); }
.tile-slab { position: relative; display: block; aspect-ratio: 0.72; transition: transform 0.15s ease; }
.tile:hover .tile-slab { transform: translateY(-3px); }
.tile-chips { position: absolute; right: 16px; bottom: 16px; }
.tile-chips .vtag { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); }
.tile-chips .vtag.watch, .tile-chips .vtag.dont_buy, .tile-chips .vtag.defer, .tile-chips .vtag.none { background: var(--bg); }
.tile-limit, .tile-owned { position: absolute; left: 16px; font: 16px var(--display); letter-spacing: 0.06em; line-height: 1; padding: 5px 8px 3px; border-radius: 4px; background: var(--bg); }
.tile-pl { top: 54px; position: absolute; left: 16px; font: 16px var(--display); letter-spacing: 0.06em; line-height: 1; padding: 5px 8px 3px; border-radius: 4px; background: var(--bg); border: 1px solid currentColor; }
.tile-pl.pos { color: var(--green); } .tile-pl.neg { color: var(--neg); }
.tile-limit { top: 54px; color: var(--accent); border: 1px solid var(--accent); }
.tile-owned { bottom: 16px; color: var(--green); border: 1px solid var(--green); }
.tile.hit .tile-limit { background: var(--accent); color: var(--on-accent); }
.tile-name { font-size: 25px; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 6px; }
.tile-price { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; }
.tile-price b { font-size: 30px; font-weight: 400; }
.tile-chg { display: inline-flex; align-items: baseline; gap: 4px; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tile-chg small { font-size: 10px; color: var(--muted-2); margin-left: 4px; }
.tile-meta { font-size: 12px; color: var(--muted-2); }
.tile-add { aspect-ratio: 0.72; align-items: center; justify-content: center; text-align: center; gap: 6px; border: 1.5px dashed var(--line-3); border-radius: var(--radius); color: var(--muted); font-size: 14px; padding: 16px; }
.tile-add:hover { border-color: var(--accent); color: var(--text); }
.tile-add .display { font-size: 60px; color: var(--accent); line-height: 0.9; }
.tile-add small { font-size: 12px; color: var(--muted-2); }

/* ---------- watching ---------- */
.watch-panel { display: flex; flex-direction: column; gap: 8px; }
.watch-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 110px 150px 90px 150px; gap: 14px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px; color: var(--text); }
.watch-row:hover { border-color: var(--line-3); color: var(--text); }
.wthumb { width: 44px; height: 60px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.wname { display: flex; flex-direction: column; min-width: 0; }
.wname b { font-size: 21px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wraw { display: flex; flex-direction: column; text-align: right; }
.wraw small { font-size: 11px; color: var(--muted-2); }
.wraw b { font-size: 22px; font-weight: 400; }
.wmeta { font-size: 13px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.wstate { font-size: 12px; color: var(--muted-2); text-align: right; }

/* ---------- holdings ---------- */
.pf-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.pf-summary:empty { display: none; }
.pf-stat, .pl-stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.pf-stat .lbl, .pl-stat .lbl { display: block; font: 15px var(--display); letter-spacing: 0.1em; color: var(--muted-2); }
.pf-stat .val, .pl-stat .val { font: 30px var(--display); letter-spacing: 0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pf-list { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.pf-list:has(.empty-state) { background: transparent; border-style: dashed; }
.pf-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.pf-row:last-child { border-bottom: 0; }
.pf-thumb { width: 40px; height: 56px; background: var(--panel-2); border-radius: 4px; overflow: hidden; flex-shrink: 0; }
.pf-info { flex-grow: 1; min-width: 0; }
.pf-name { font: 22px var(--display); letter-spacing: 0.02em; }
.pf-name a { color: var(--text); }
.pf-name a:hover { color: var(--accent); }
.pf-meta { font-size: 12px; color: var(--muted-2); }
.pf-remove { color: var(--muted-2); text-decoration: underline; }
.pf-remove:hover { color: var(--neg); }
.pf-current { text-align: right; flex-shrink: 0; }
.pf-current .val { font: 24px var(--display); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.pf-pnl { font-size: 12px; font-variant-numeric: tabular-nums; }
.pf-pnl .pos, .pf-pnl .neg { font-weight: 600; }

/* ---------- planner + track record ---------- */
.planner { display: flex; flex-direction: column; gap: 14px; }
.pl-mode { display: inline-flex; align-self: flex-start; background: var(--panel); border: 1px solid #2c2c32; border-radius: 10px; padding: 3px; }
.pl-mode button { min-height: 38px; padding: 0 16px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: 19px var(--display); letter-spacing: 0.06em; cursor: pointer; }
.pl-mode button.on { background: var(--hover); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.pl-note { font-size: 12px; color: var(--amber); }
.pl-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.pl-stat .val.pos { color: var(--green); }
.pl-stat .val.neg { color: var(--neg); }
.pl-stat .val.muted { color: var(--muted); }
.pl-yen { color: var(--muted-2); margin-right: 2px; }
.pl-budget { width: 140px; background: transparent; border: 0; border-bottom: 1px dashed var(--line-3); font: 30px var(--display); letter-spacing: 0.02em; color: var(--text); padding: 0; }
.pl-budget:focus { outline: none; border-bottom-color: var(--accent); }
.pl-bar { display: flex; height: 8px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.pl-bar-spent { height: 100%; background: var(--muted-2); }
.pl-bar-fill { height: 100%; background: var(--accent); }
.pl-bar-fill.over { background: var(--red); }
.pl-list { display: flex; flex-direction: column; gap: 6px; }
.pl-row { display: grid; grid-template-columns: 22px 44px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.pl-row:hover { border-color: var(--line-3); }
.pl-row.on { border-color: var(--accent); background: #1d1b12; }
.pl-row input { width: 18px; height: 18px; accent-color: var(--accent); grid-row: span 2; }
.pl-name { font: 21px var(--display); letter-spacing: 0.02em; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pl-price { font: 24px var(--display); letter-spacing: 0.02em; text-align: right; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05; }
.pl-src { font: 400 11px var(--sans); color: var(--muted-2); }
.pl-sub { grid-column: 3 / -1; font-size: 12px; color: var(--muted-2); }
.pl-fits { color: var(--green); font-weight: 600; }
.pl-owned { font: 14px var(--display); letter-spacing: 0.08em; color: var(--green); border: 1px solid rgba(69, 212, 131, 0.4); border-radius: 3px; padding: 2px 5px 0; }
.tr-hint { font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.tr-h { font: 22px var(--display); letter-spacing: 0.06em; font-weight: 400; color: var(--muted); margin: 10px 0 0; }
.tr-list { display: flex; flex-direction: column; gap: 6px; }
.tr-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.tr-main { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.tr-name { font: 21px var(--display); letter-spacing: 0.02em; }
.tr-meta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tr-odds { font: 22px var(--display); color: var(--accent); letter-spacing: 0.04em; }
.tr-res { text-align: right; }
.tr-sub { grid-column: 1 / -1; font-size: 12px; color: var(--muted-2); line-height: 1.5; font-variant-numeric: tabular-nums; }
.tr-pill { font: 15px var(--display); letter-spacing: 0.08em; line-height: 1; padding: 4px 8px 2px; border-radius: 4px; border: 1px solid var(--line-3); white-space: nowrap; }
.tr-pill.pos { background: var(--green); border-color: var(--green); color: #06170d; }
.tr-pill.neg { color: var(--neg); border-color: var(--neg); }
.tr-pill.pend { color: var(--accent); border-color: rgba(255, 210, 63, 0.5); }
.tr-pill.muted { color: var(--muted-2); }
.tr-note { font-size: 12px; color: var(--muted-2); line-height: 1.6; margin: 6px 0 0; }

/* ---------- market & notes, tables ---------- */
.notes { padding: 20px 22px; }
.notes-when { margin: 0 0 10px; font-size: 12px; color: var(--muted-2); }
.notes-body { white-space: pre-wrap; font-size: 13px; line-height: 1.65; color: var(--soft); }
.table-section { display: flex; flex-direction: column; gap: 8px; }
.table-note { margin: 0; font-size: 12px; color: var(--muted); }
.table-scroll { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 12px; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #1d1d21; vertical-align: top; }
th { font: 17px var(--display); letter-spacing: 0.03em; font-weight: 400; color: var(--text); min-width: 140px; }
td:first-child { color: var(--muted); white-space: nowrap; }
tr.divider td { font: 15px var(--display); letter-spacing: 0.1em; color: var(--accent); background: var(--panel-2); }
td em { color: var(--muted-2); font-style: normal; }
.pill { display: inline-flex; font: 14px var(--display); letter-spacing: 0.08em; line-height: 1; padding: 3px 7px 1px; border-radius: 3px; border: 1px solid var(--line-3); }
.pill.definitely_buy { background: var(--green-strong); border-color: var(--green-strong); color: #fff; }
.pill.buy { background: var(--green); border-color: var(--green); color: #06170d; }
.pill.watch { color: var(--amber); border-color: var(--amber); }
.pill.dont_buy { color: var(--neg); border-color: var(--neg); }

.more-list { display: flex; flex-direction: column; gap: 8px; }
.more-h { margin: 8px 0 0; font: 700 11px var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-2); }
.more-grp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.more-list a { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 52px; padding: 0 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); font: 18px/1.1 var(--display); letter-spacing: 0.05em; color: var(--text); }
.more-list a.more-add { margin-top: 8px; justify-content: center; color: var(--accent); }

/* ---------- mid widths: no drawer, rows open the card page ---------- */
@media (max-width: 1199px) {
  .drawer { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- phones ---------- */
@media (max-width: 899px) {
  .app { display: block; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .mobile-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: sticky; top: 0; z-index: 20; padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top));
    background: rgba(16, 12, 24, 0.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  }
  .mobile-bar .brand { padding: 0; }
  .mobile-bar .brand-mark { width: 28px; height: 28px; }
  .mobile-bar .brand-word { font-size: 24px; }
  .mobile-bar .brand-ten { font-size: 11px; }
  .mobile-bar .snap-select { min-height: 36px; font-size: 12px; min-width: 0; max-width: 52%; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(20, 15, 31, 0.96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted-2); font: 14px var(--display); letter-spacing: 0.08em; }
  .tabbar a.on { color: var(--accent); }
  .tabbar svg { width: 22px; height: 22px; }
  .main { padding: 16px 16px 24px; gap: 14px; }
  .page-head h1 { font-size: 38px; }
  .kpis { gap: 8px; }
  .kpis.market .cell { padding: 10px 12px; }
  .kpis.market .v { font-size: 24px; }
  .kpi-d { font-size: 11px; }
  .ticker { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tk { flex: 0 0 auto; padding: 8px 12px; gap: 2px 8px; }
  .tk-v { font-size: 20px; }
  .tk-d small { display: none; }
  .tk-d + .tk-d { display: none; }
  .today-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .today-h { display: none; }
  .tchip { flex: 0 0 auto; white-space: nowrap; }
  .inbox, .money { padding: 12px 14px; }
  .ib-item > .vtag, .ib-item > .sig-pill, .ib-quiet .vtag { min-width: 64px; }
  .ib-txt b { font-size: 17px; }
  .money { display: flex; flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 12px; }
  .money .mn-head { flex-basis: 100%; margin-bottom: 0; }
  .money .lbl { display: none; }
  .mn-v { font-size: 30px; }
  .mn-d { margin-bottom: 0; }
  .money .mn-v { font-size: 30px; }
  .money .mn-rows { flex-basis: 100%; margin: 6px 0 0; padding: 8px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .wl-bar { flex-direction: column; align-items: stretch; }
  .seg.wl-filter button { flex: 1; min-height: 38px; }
  .wl-sec { background: transparent; border: 0; overflow: visible; display: flex; flex-direction: column; gap: 8px; }
  .wl-sec-h { padding: 6px 2px 0; }
  .wl-head { display: none; }
  .wl-sortbar { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--muted); }
  .wl-sortbar select { flex: 1; background: var(--panel); color: var(--text); border: 1px solid var(--line-3); border-radius: 8px; padding: 8px 10px; font: inherit; }
  .wl-sortbar button { background: var(--panel); color: var(--text); border: 1px solid var(--line-3); border-radius: 8px; padding: 7px 12px; font: inherit; cursor: pointer; }
  #watchlist { display: flex; flex-direction: column; gap: 8px; }
  .wl-row {
    grid-template-columns: 28px minmax(0, 1fr) auto; grid-template-areas: "slab name price" "slab tag trend" "bar bar bar";
    gap: 4px 10px; padding: 12px; min-height: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  }
  .wl-row:last-child { border-bottom: 1px solid var(--line); }
  .wl-row.sel { background: var(--panel); box-shadow: none; }
  .wl-row .slab { grid-area: slab; width: 28px; height: 40px; }
  .wl-name { grid-area: name; }
  .wl-name b { font-size: 20px; }
  .wl-price { grid-area: price; font-size: 22px; }
  .wl-tag { grid-area: tag; justify-content: flex-end; }
  .wl-tag { flex-direction: row; align-items: center; justify-content: flex-start; }
  .wl-tag > span { display: flex; flex-wrap: wrap; justify-items: initial; gap: 4px 6px; }
  .wl-heat { display: none; }
  .wl-row .zb, .wl-row .zb-none { grid-area: bar; height: 14px; margin-top: 4px; }
  .wl-chg { display: none; }
  .wl-chg.wl-trend { display: block; grid-area: trend; font-size: 12px; }
  .wl-row .wl-trend .chg-sub { display: none; }
  .collection { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; }
  .tile-chips { right: 10px; bottom: 10px; }
  .tile-limit { left: 10px; top: 38px; font-size: 14px; }
  .tile-owned { left: 10px; bottom: 10px; font-size: 14px; }
  .tile-name { font-size: 20px; }
  .tile-price b { font-size: 23px; }
  .tile-chg { font-size: 11px; flex-basis: 100%; }
  .tile-chg small:first-child { margin-left: 0; }
  .tile-meta { display: none; }
  .cd-page .cd-hero { align-items: center; }
  .slab.xl { width: 120px; height: 180px; }
  .cd-page .cd-price { font-size: 40px; }
  .cd-page .cd-actions {
    position: fixed; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 15;
    padding: 10px 16px; background: rgba(16, 12, 24, 0.95); border-top: 1px solid var(--line);
  }
  .card-page { padding-bottom: 70px; }
  .watch-row { grid-template-columns: 36px minmax(0, 1fr) auto; grid-template-areas: "thumb name raw" "thumb heat meta" "thumb state state"; gap: 2px 12px; }
  .wheat { grid-area: heat; flex-direction: row; align-items: center; gap: 6px; }
  .wthumb { grid-area: thumb; width: 36px; height: 50px; }
  .wname { grid-area: name; }
  .wraw { grid-area: raw; }
  .wmeta { grid-area: meta; font-size: 11px; }
  .wstate { grid-area: state; text-align: left; }
  .pf-stat .val, .pl-stat .val, .pl-budget { font-size: 24px; }
  .pl-budget { width: 110px; }
}

/* My-tier index (market view) */
.custom-index { padding: 18px 20px; margin: 14px 0; }
.ci-note { font-size: 12px; color: var(--muted); margin: 0 0 12px; line-height: 1.5; }
.ci-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.ci-v { font: 28px var(--display); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.ci-fig { margin: 0; }
.ci-cap { display: flex; flex-direction: column; gap: 2px; margin: 0 0 8px; }
.ci-cap-t { font-size: 13px; font-weight: 600; color: var(--text); }
.ci-cap-s { font-size: 11px; color: var(--muted); }
.ci-plot { position: relative; width: 100%; outline: none; touch-action: pan-y; }
.ci-plot:focus-visible { box-shadow: 0 0 0 2px var(--accent); border-radius: 4px; }
.ci-plot svg { display: block; overflow: visible; }
.ci-grid { stroke: var(--line); stroke-width: 1; }
.ci-axis { stroke: var(--line-3); stroke-width: 1; }
.ci-ytick { fill: var(--muted); font-size: 11px; text-anchor: end; font-variant-numeric: tabular-nums; }
.ci-xtick { fill: var(--muted); font-size: 11px; text-anchor: middle; }
.ci-basel { fill: var(--muted); font-size: 10px; text-anchor: end; }
.ci-cross { stroke: var(--soft); stroke-width: 1; stroke-dasharray: 2 3; }
.ci-dot-me { fill: var(--accent); stroke: var(--panel); stroke-width: 2; }
.ci-dot-pk { fill: var(--muted-2); stroke: var(--panel); stroke-width: 2; }
.ci-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--panel-2, #1c1c21); border: 1px solid var(--line-3); border-radius: 8px; padding: 8px 10px; font-size: 12px; line-height: 1.55; color: var(--soft); white-space: nowrap; box-shadow: 0 6px 18px rgba(0,0,0,0.35); }
.ci-tip b { color: var(--text); font-variant-numeric: tabular-nums; }
.ci-tip-d { color: var(--text); font-weight: 600; margin-bottom: 2px; }
.ci-tip .ci-key { margin-left: 0; margin-right: 6px; vertical-align: middle; }
.ci-base { stroke: var(--line-3); stroke-dasharray: 3 4; }
.ci-line { fill: none; stroke: var(--accent); stroke-width: 2; }
.ci-line-pk { fill: none; stroke: var(--muted-2); stroke-width: 1.5; stroke-dasharray: 5 4; }
.ci-legend { font-size: 11px; color: var(--muted); margin-top: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ci-key { display: inline-block; width: 16px; height: 0; border-top: 2px solid var(--accent); margin-left: 8px; }
.ci-key:first-child { margin-left: 0; }
.ci-key-pk { border-top: 2px dashed var(--muted-2); }
.ci-bf { fill: var(--line-2); opacity: 0.35; }
.ci-key-bf { display: inline-block; width: 12px; height: 10px; background: var(--line-2); opacity: 0.7; margin-left: 8px; border-radius: 2px; }
.ci-range { display: flex; gap: 6px; margin: 0 0 8px; }
.ci-rng { font-family: inherit; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-3); background: transparent; color: var(--muted); cursor: pointer; }
.ci-rng.on { background: var(--accent); border-color: var(--accent); color: #111; }
.ci-members { margin-top: 12px; font-size: 12px; }
.ci-members summary { cursor: pointer; color: var(--soft); }
.ci-members table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.ci-members th, .ci-members td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ci-members .muted { color: var(--muted-2); }
@media (max-width: 800px) { .ci-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ci-v { font-size: 22px; } }

/* tier review status + vs. market (card detail) */
.due-chip { color: var(--amber); border: 1px solid rgba(245, 165, 36, 0.5); }
.tier-age { font-size: 12px; color: var(--muted); margin: 8px 0; line-height: 1.5; }
.tier-age.due { color: var(--soft); background: rgba(245, 165, 36, 0.08); border: 1px solid rgba(245, 165, 36, 0.4); border-radius: var(--radius); padding: 8px 10px; }
.tier-age.due b { color: var(--amber); }
.vs-mkt { margin-top: 12px; background: var(--panel-2); border: 1px solid #2c2c32; border-radius: var(--radius); padding: 10px 12px; font-size: 13px; }
.vs-mkt .lbl { display: block; margin-bottom: 6px; }
.vs-row { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 3px 0; font-variant-numeric: tabular-nums; }
.vs-row > span:first-child { color: var(--muted-2); min-width: 56px; }
.vs-gap { font-weight: 600; }
.vs-mkt .muted { color: var(--muted-2); }
.vs-mkt .cd-note { margin-top: 6px; }

/* track record grouped by card */
.tr-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.tr-bar .tr-h { margin: 0; }
.tr-cards { display: flex; flex-direction: column; gap: 8px; }
.tr-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.tr-card > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; padding: 12px 14px; }
.tr-card > summary::-webkit-details-marker { display: none; }
.tr-card > summary::before { content: '▸'; color: var(--muted-2); margin-right: -6px; transition: transform .15s; }
.tr-card[open] > summary::before { transform: rotate(90deg); }
.tr-card[open] > summary { border-bottom: 1px solid var(--line); }
.tr-cname { display: flex; align-items: baseline; gap: 8px; flex: 1 1 220px; min-width: 0; }
.tr-csum { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.tr-dot { color: var(--line-3); }
.tr-cbody { padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.tr-sh { font: 16px var(--display); letter-spacing: 0.08em; color: var(--muted-2); margin-top: 4px; }
.tr-cbody .tr-row { background: var(--panel-2); }

/* limit sync + odds */
.limit-sync { flex-basis: 100%; font-size: 12px; color: var(--amber); }
.limit-sync a { color: var(--accent); font-weight: 600; }
.limit-sync.ok { color: var(--green); }
.limit-sync-hint { display: block; color: var(--muted-2); font-size: 11px; margin-top: 2px; }
.limit-live { flex-basis: 100%; font-size: 12px; color: var(--soft); }
.limit-odds { margin-top: 6px; font-size: 13px; color: var(--soft); line-height: 1.5; padding: 0 2px; }
.limit-odds b { color: var(--accent); font-weight: 700; }
.limit-odds-note { display: block; font-size: 11px; color: var(--muted-2); }

/* release calendar (market view) */
.ev-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ev-list li { display: grid; grid-template-columns: 150px 1fr; gap: 2px 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px; }
.ev-list li.on { border-color: var(--amber); }
.ev-list li.tba { opacity: 0.7; }
.ev-when { font-variant-numeric: tabular-nums; color: var(--soft); grid-row: span 2; }
.ev-name { color: var(--text); }
.ev-meta { font-size: 11px; color: var(--muted); }
@media (max-width: 600px) { .ev-list li { grid-template-columns: 1fr; } .ev-when { grid-row: auto; } }

/* trading activity (heat) */
.heat-chip { display: inline-flex; align-items: center; gap: 4px; font: 15px var(--display); letter-spacing: 0.08em; line-height: 1; padding: 4px 9px 2px; border-radius: 4px; border: 1px solid var(--line-3); color: var(--muted); white-space: nowrap; vertical-align: middle; }
.heat-chip svg { width: 12px; height: 12px; flex: none; margin-top: -2px; }
.heat-hot { color: var(--neg); border-color: rgba(255, 107, 99, 0.65); background: rgba(255, 107, 99, 0.08); }
.heat-active { color: var(--green); border-color: rgba(69, 212, 131, 0.6); background: rgba(69, 212, 131, 0.08); }
.heat-slow { color: #8fd3ff; border-color: rgba(143, 211, 255, 0.55); background: rgba(143, 211, 255, 0.08); }
.heat-cold { color: var(--muted-2); border-style: dashed; }
.wl-heat { display: flex; align-items: center; }
.wheat { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.wheat small { font-size: 11px; color: var(--muted-2); white-space: nowrap; }
.tile-chips { display: flex; gap: 6px; align-items: center; }
.tile-chips .heat-chip { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); }
.tile-chips .heat-chip { background: var(--bg); }
.heat-sub { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.heat-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.heat-table th, .heat-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.heat-table th { font-size: 11px; color: var(--muted); font-weight: 600; }
.heat-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.heat-table a { color: var(--text); text-decoration: none; }

/* tables page sorting */
.tbl-sortbar { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 4px; flex-wrap: wrap; }
.tbl-sortbar select { background: var(--panel); color: var(--text); border: 1px solid var(--line-3); border-radius: 8px; padding: 7px 10px; font: inherit; min-width: 200px; }
.tbl-sortbar button { background: var(--panel); color: var(--text); border: 1px solid var(--line-3); border-radius: 8px; padding: 6px 12px; font: inherit; cursor: pointer; }
.tsort { all: unset; cursor: pointer; border-bottom: 1px dashed var(--line-3); }
.tsort:hover, .tsort.on { color: var(--text); border-bottom-color: var(--accent); }
.tsort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tsort.on::after { content: ' ▲'; font-size: 10px; color: var(--accent); }
.tsort.on[data-dir="desc"]::after { content: ' ▼'; }

/* card pictures in the Tables page headers */
.slab.tbl { width: 56px; height: 80px; }
th.tc-head { vertical-align: top; min-width: 110px; }
th.tc-head a { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; color: var(--text); text-decoration: none; }
th.tc-head a:hover b { color: var(--accent); }
th.tc-head b { font-size: 14px; line-height: 1.25; font-weight: 700; white-space: normal; }
th.tc-head small { font-size: 11px; color: var(--muted-2); font-weight: 400; white-space: nowrap; }

.lim-gap { color: var(--soft); }
.lim-hit { color: var(--accent); font-weight: 700; }

/* overview: drop the least essential columns when the list gets narrow (e.g. detail panel open),
   so card names keep enough room */
.watchlist { container-type: inline-size; }
@media (min-width: 900px) {
@container (max-width: 960px) {
  .wl-head, .wl-row { grid-template-columns: 34px minmax(0, 1fr) 96px 70px 52px 62px 96px 112px; }
  .wl-head .wl-zone, .wl-row .zb, .wl-row .zb-none { display: none; }
}
@container (max-width: 700px) {
  .wl-head, .wl-row { grid-template-columns: 34px minmax(0, 1fr) 96px 70px 62px 96px 112px; }
  .wl-head [data-sort="chgLast"], .wl-row .wl-last { display: none; }
}
}

/* interactive card-page charts */
.lc-plot { position: relative; width: 100%; outline: none; touch-action: pan-y; margin-top: 4px; }
.lc-plot:focus-visible { box-shadow: 0 0 0 2px var(--accent); border-radius: 4px; }
.lc-plot svg, .history-block .lc-plot svg, .spark-block .lc-plot svg { display: block; overflow: visible; width: 100%; height: auto; }
.lc-plot .ci-tip { white-space: normal; max-width: 260px; }
.lc-bar { fill: var(--line-3); }
.lc-bar.in { fill: var(--accent); opacity: 0.9; }
.lc-hl { fill: rgba(255, 255, 255, 0.06); pointer-events: none; }
.hist-ref-line.lim { stroke: var(--soft); stroke-dasharray: 2 3; stroke-width: 1.2; }
.hist-ref-label.lim { fill: var(--soft); font-size: 10px; }

/* ---------- refresh indicator (shown while fresh data loads over a cached copy) ---------- */
body.is-updating::before {
  content: ""; position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 100;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 40% 100%; background-repeat: no-repeat;
  animation: psa10-updating 1s linear infinite;
}
@keyframes psa10-updating { from { background-position: -40% 0; } to { background-position: 140% 0; } }
@media (prefers-reduced-motion: reduce) { body.is-updating::before { animation: none; background: var(--accent); opacity: 0.5; } }

/* ---------- collection ⇄ card page transition (see onHashChange in app.js) ---------- */
::view-transition-group(card-hero) { animation-duration: 0.42s; animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1); }
::view-transition-old(card-hero), ::view-transition-new(card-hero) { animation-duration: 0.42s; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.22s; }
@keyframes cd-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
body.cd-entering .page-head,
body.cd-entering #card-page .cd-info > *,
body.cd-entering #card-page .cd-tabs,
body.cd-entering #card-page .cd-panel { animation: cd-rise 0.38s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
body.cd-entering .page-head { animation-delay: 0.16s; }
body.cd-entering #card-page .cd-info > :nth-child(1) { animation-delay: 0.22s; }
body.cd-entering #card-page .cd-info > :nth-child(2) { animation-delay: 0.26s; }
body.cd-entering #card-page .cd-info > :nth-child(3) { animation-delay: 0.30s; }
body.cd-entering #card-page .cd-info > :nth-child(4) { animation-delay: 0.34s; }
body.cd-entering #card-page .cd-info > :nth-child(5) { animation-delay: 0.38s; }
body.cd-entering #card-page .cd-info > :nth-child(n+6) { animation-delay: 0.42s; }
body.cd-entering #card-page .cd-tabs { animation-delay: 0.44s; }
body.cd-entering #card-page .cd-panel { animation-delay: 0.50s; }
@media (prefers-reduced-motion: reduce) {
  body.cd-entering .page-head, body.cd-entering #card-page * { animation: none !important; }
}
/* keep the navigation chrome still while the page underneath changes */
.sidebar { view-transition-name: app-sidebar; }
.mobile-bar { view-transition-name: app-mobilebar; }
.tabbar { view-transition-name: app-tabbar; }
::view-transition-old(app-sidebar), ::view-transition-old(app-mobilebar), ::view-transition-old(app-tabbar) { display: none; }
::view-transition-new(app-sidebar), ::view-transition-new(app-mobilebar), ::view-transition-new(app-tabbar) { animation: none; }
::view-transition-group(app-sidebar), ::view-transition-group(app-mobilebar), ::view-transition-group(app-tabbar) { animation: none; }

/* ---------- head to head (#/compare) + budget duel (#/duel) ---------- */
.cmp-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.cmp-bar.on { padding: 10px 14px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--panel); }
.cmp-bar .cmp-hint { flex-grow: 1; color: var(--muted); font-size: 13px; }
.cmp-bar.on { position: sticky; top: 8px; z-index: 15; border-color: var(--accent); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); }
.cmp-bar.on .cmp-hint { color: var(--text); font-weight: 600; }
.cmp-bar .btn[disabled] { opacity: 0.4; pointer-events: none; }
.tile-pick { position: absolute; top: 12px; right: 12px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.85); background: rgba(11, 11, 13, 0.55); display: flex; align-items: center; justify-content: center; font: 20px var(--display); color: var(--on-accent); line-height: 1; }
.tile.picking .tile-slab { transition: transform 0.15s ease, box-shadow 0.15s ease; border-radius: 10px; }
.tile.picked .tile-slab { box-shadow: 0 0 0 3px var(--pc); }
.tile.picking:not(.picked) .tile-slab { opacity: 0.85; }

.compare-page, .duel-page { display: flex; flex-direction: column; gap: 16px; }
.h2h-hero { display: grid; grid-template-columns: minmax(0, 1fr) 90px minmax(0, 1fr); align-items: center; padding: 26px 30px; }
.h2h-side { display: flex; gap: 24px; align-items: center; min-width: 0; }
.h2h-side.h2h-b { flex-direction: row-reverse; text-align: right; }
.h2h-side.h2h-b .h2h-info { align-items: flex-end; }
.h2h-slab { flex-shrink: 0; border-radius: 10px; }
.h2h-slab .slab-art { box-shadow: 0 0 0 3px var(--cc); }
.h2h-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.h2h-who { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.h2h-who i { width: 10px; height: 10px; border-radius: 50%; }
.h2h-side.h2h-b .h2h-who { flex-direction: row-reverse; }
.h2h-name { font-size: 30px; line-height: 1.05; color: var(--text); }
.h2h-name:hover { color: var(--accent); }
.h2h-meta { font-size: 12px; color: var(--muted-2); }
.h2h-price { font-size: 46px; }
.h2h-v { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.h2h-side.h2h-b .h2h-v { justify-content: flex-end; }
.h2h-v small { font-size: 11px; color: var(--muted-2); }
.h2h-vs { text-align: center; font-size: 64px; color: var(--line-3); }
.h2h-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.h2h-rel { font-size: 12px; color: var(--soft); padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px; }
.h2h-rel.rel-one, .h2h-rel.rel-partly { border-color: var(--amber); color: var(--amber); }
.h2h-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 520px; }
.h2h-panel { display: flex; flex-direction: column; gap: 14px; }
.h2h-panel[hidden] { display: none; }

.tp-group { padding: 16px 26px 8px; }
.tp-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.tp-head .section-title { margin: 0; }
.tp-chip { font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; background: var(--panel-2); color: var(--muted); }
.tp-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 230px minmax(0, 1fr) 130px; grid-template-areas: "a ab lab bb b"; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.tp-a { grid-area: a; text-align: right; font-size: 25px; color: var(--soft); white-space: nowrap; }
.tp-b { grid-area: b; font-size: 25px; color: var(--soft); white-space: nowrap; }
.tp-a.lead, .tp-b.lead { color: var(--text); }
.tp-ab { grid-area: ab; display: flex; justify-content: flex-end; }
.tp-bb { grid-area: bb; display: flex; }
.tp-ab i, .tp-bb i { display: block; height: 12px; border-radius: 3px; }
.tp-lab { grid-area: lab; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1px; }
.tp-lab b { font-size: 13px; font-weight: 600; }
.tp-lab small { font-size: 11px; color: var(--muted-2); }

.race-ctl { display: flex; gap: 10px; flex-wrap: wrap; }
.race-ctl .pl-mode button[disabled] { opacity: 0.35; cursor: not-allowed; }
.race-box { padding: 16px 18px 10px; }
.race-legend { display: flex; gap: 8px 20px; flex-wrap: wrap; font-size: 13px; }
.race-legend b { font-weight: 600; }
.race-key { display: inline-block; width: 20px; border-top: 3px solid; vertical-align: middle; margin-right: 8px; }
.race-key.dash { border-top-style: dashed; border-top-width: 2px; }
.zl { padding: 16px 26px 18px; display: flex; flex-direction: column; gap: 16px; }
.zl-sub { font-size: 12px; }
.zl-row { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 16px; align-items: center; }
.zl-name { font-weight: 700; font-size: 14px; }
.zl-name small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.zl-track { position: relative; height: 30px; }
.zl-track i { position: absolute; top: 10px; height: 10px; }
.zl-track i:first-child { border-radius: 3px 0 0 3px; }
.zl-track i:nth-child(4) { border-radius: 0 3px 3px 0; }
.zl-track .z-db { background: var(--green-strong); } .zl-track .z-bu { background: var(--green); } .zl-track .z-w { background: var(--amber); } .zl-track .z-x { background: var(--red); }
.zl-now { position: absolute; top: 0; width: 14px; height: 30px; margin-left: -7px; box-sizing: border-box; border: 3px solid #fff; border-radius: 4px; }
.zl-lim { position: absolute; top: 3px; width: 4px; height: 24px; margin-left: -2px; background: var(--accent); border-radius: 2px; }
.gauge-legend .zl-key-now { width: 10px; height: 10px; border: 2px solid #fff; border-radius: 2px; background: none; }
.gauge-legend .zl-key-lim { width: 4px; height: 12px; background: var(--accent); border-radius: 2px; }

.pl-top { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.pl-cmp-hint { font-size: 12px; color: var(--muted-2); }
.du-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.du-grid.du-n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.du-grid.du-n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.du-grid.du-nmany { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.du-card { border-top: 4px solid; padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.du-head { display: flex; gap: 16px; align-items: center; }
.du-id { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.du-id .h2h-name { font-size: 26px; }
.du-prices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.du-p { background: var(--panel-2); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.du-p .display { font-size: 32px; }
.du-p .acc { color: var(--accent); }
.du-p small { font-size: 12px; color: var(--muted); }
.du-p small.pos { color: var(--green); font-weight: 600; } .du-p small.neg { color: var(--neg); font-weight: 600; }
.du-oddsbox { display: flex; flex-direction: column; gap: 8px; }
.du-odds { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "lab val" "bar bar"; gap: 5px 10px; align-items: center; font-size: 13px; }
.du-odds > span:first-child { grid-area: lab; }
.du-odds .du-bar { grid-area: bar; }
.du-odds b { grid-area: val; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.du-diy b { white-space: nowrap; }
.du-bar { position: relative; height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; }
.du-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; }
.du-diy { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; font-size: 13px; }
.du-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 18px 20px; align-items: center; }
.du-sum .du-p { background: none; padding: 0; }
.du-rel ul { margin: 0; padding-left: 18px; font-size: 12px; color: var(--amber); display: flex; flex-direction: column; gap: 4px; }
.du-rel b { color: var(--text); }

@media (max-width: 1199px) {
  .du-grid.du-n3, .du-grid.du-nmany { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .h2h-hero .slab.xl { width: 140px; height: 210px; }
}
@media (max-width: 899px) {
  .cmp-bar.on { top: calc(66px + env(safe-area-inset-top)); }
  .h2h-hero { grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr); padding: 16px 12px; align-items: start; }
  .h2h-side, .h2h-side.h2h-b { flex-direction: column; text-align: center; gap: 10px; }
  .h2h-side .h2h-info, .h2h-side.h2h-b .h2h-info { align-items: center; }
  .h2h-hero .slab.xl { width: 112px; height: 168px; }
  .h2h-hero .h2h-name { font-size: 20px; }
  .h2h-hero .h2h-meta { display: none; }
  .h2h-price { font-size: 30px; }
  .h2h-hero .h2h-v { justify-content: center; }
  .h2h-hero .h2h-v small { display: none; }
  .du-id .h2h-name { font-size: 22px; }
  .h2h-vs { font-size: 28px; margin-top: 70px; }
  .h2h-tabs { max-width: none; }
  .tp-group { padding: 12px 14px 4px; }
  .tp-row { grid-template-columns: 86px minmax(0, 1fr) minmax(0, 1fr) 86px; grid-template-areas: "lab lab lab lab" "a ab bb b"; gap: 4px 6px; padding: 8px 0 10px; }
  .tp-a, .tp-b { font-size: 20px; }
  .tp-a { text-align: left; } .tp-b { text-align: right; }
  .tp-ab i, .tp-bb i { height: 9px; }
  .zl { padding: 14px 14px 16px; }
  .zl-row { grid-template-columns: 1fr; gap: 4px; }
  .race-box { padding: 12px 8px 8px; }
  .du-grid, .du-grid.du-n3, .du-grid.du-n4, .du-grid.du-nmany { grid-template-columns: 1fr; }
  .du-card { padding: 16px; }
  .du-sum { grid-template-columns: 1fr; }
}

/* card pictures in the budget planner (same thumbnail as the watching page) */
.pl-thumb { grid-area: auto; grid-column: 2; grid-row: 1 / span 2; }

/* ---------- scored calls (#/scored) ---------- */
a.pl-stat.pl-link { color: var(--text); display: block; transition: border-color .15s ease, background .15s ease; }
a.pl-stat.pl-link:hover { border-color: var(--accent); background: var(--hover); color: var(--text); }
.pl-link-go { color: var(--accent); font-weight: 600; white-space: nowrap; }
.sc-h { margin: 8px 0 0; }
.sc-list { display: flex; flex-direction: column; gap: 8px; }
.sc-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--line-3); border-radius: var(--radius); }
.sc-row.right { border-left-color: var(--green); }
.sc-row.wrong { border-left-color: var(--neg); }
.sc-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sc-top { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.sc-name { font-size: 22px; font-weight: 400; }
.sc-name a { color: var(--text); } .sc-name a:hover { color: var(--accent); }
.sc-call { font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sc-label { font-size: 12px; color: var(--muted); }
.sc-why { font-size: 13px; color: var(--soft); }
.sc-res { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
@media (max-width: 899px) {
  .sc-row { grid-template-columns: 34px minmax(0, 1fr); }
  .sc-res { grid-column: 2; flex-direction: row; align-items: center; justify-content: flex-start; }
}

/* track record: one-sentence explanation under each score tile */
.tr-explain { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.45; color: var(--muted); }

/* ---------- insights ("What stands out") on the card page ---------- */
.insights { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.ins-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 12px; }
.ins { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--line-3); border-radius: var(--radius); padding: 0 14px; }
.ins-up { border-left-color: var(--green); } .ins-down { border-left-color: var(--neg); } .ins-neutral { border-left-color: var(--accent); }
.ins summary { cursor: pointer; list-style: none; padding: 11px 0; font-weight: 600; font-size: 14px; display: flex; justify-content: space-between; gap: 10px; }
.ins summary::-webkit-details-marker { display: none; }
.ins summary::after { content: '+'; color: var(--muted-2); font-weight: 400; }
.ins[open] summary::after { content: '−'; }
.ins p { margin: 0 0 10px; font-size: 13px; line-height: 1.5; color: var(--soft); }
.ins p:last-child { padding-bottom: 4px; }
.ins-written { background: var(--panel); border: 1px solid var(--accent); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.ins-wh { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; flex-wrap: wrap; }
.ins-hl { font-size: 14px; }
.ins-written p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--soft); white-space: pre-line; }
.wl-nline { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wl-nline b { min-width: 0; }
/* same shape as the verdict / activity pills (.vtag, .heat-chip) */
.ins-pill { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; font: 15px var(--display); letter-spacing: 0.08em; line-height: 1; padding: 4px 9px 2px; border-radius: 4px; border: 1px solid rgba(255, 210, 63, 0.55); color: var(--accent); white-space: nowrap; }
.ins-pill { padding: 3px 5px; }
.ins-pill svg { width: 13px; height: 13px; }
.ins-quiet { border-left-color: var(--line-3); }
.ins-quiet summary { color: var(--soft); }
.ins-q { display: grid; grid-template-columns: 130px 1fr; gap: 10px; font-size: 13px; line-height: 1.45; padding: 6px 0; border-top: 1px solid var(--line); }
.ins-q span:first-child { color: var(--muted); }
.ins-q span:last-child { color: var(--soft); }
.ins-q:last-child { margin-bottom: 8px; }
@media (max-width: 640px) { .ins-q { grid-template-columns: 1fr; gap: 2px; } }
.ins-src { font-size: 12px; line-height: 1.6; }
.ins-written p + p { margin-top: 8px; }
.ins-lab { display: block; font: 15px var(--display); letter-spacing: 0.08em; color: var(--accent); margin-bottom: 1px; }

/* slab premium (DIY tab) */
.prem { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.prem-h { margin: 0 0 10px; font: 20px var(--display); letter-spacing: 0.06em; }
.prem-h .muted { font: 400 12px var(--sans); letter-spacing: 0; margin-left: 8px; }
.prem-mean { font-size: 13px; line-height: 1.5; color: var(--soft); margin: 10px 0 4px; }
.prem-ch { margin-top: 14px; }
.prem-ch > .lbl { font-size: 12px; margin-bottom: 4px; }
.prem-ch > .lbl .muted { margin-left: 6px; }
.hist-ref-line.norm { stroke: var(--muted); stroke-dasharray: 4 4; }
.hist-ref-label.norm { fill: var(--muted); }

/* Scout */
.sc-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.sc-toggle { font-size: 12px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.sc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 14px; }
.sc-card { display: grid; grid-template-columns: 110px 1fr; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; animation: sc-in 0.45s ease both; animation-delay: calc(var(--i) * 70ms); }
@keyframes sc-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .sc-card { animation: none; } }
.sc-img img { width: 110px; border-radius: 6px; display: block; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45); }
.sc-img.noimg { background: var(--panel-2); border-radius: 6px; min-height: 156px; }
.sc-img.noimg img { display: none; }
.sc-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sc-head b { display: block; font-size: 15px; line-height: 1.3; }
.sc-head .muted { font-size: 11px; }
.sc-price { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sc-price .display { font-size: 28px; line-height: 1; margin-right: 4px; }
.sc-pill { font: 400 11px var(--sans); padding: 3px 7px; border-radius: 999px; border: 1px solid var(--line-3); color: var(--muted); }
.sc-pill.pos { color: var(--green); border-color: rgba(69, 212, 131, 0.45); }
.sc-pill.warn { color: var(--amber); border-color: currentColor; }
.sc-why { margin: 2px 0 0; padding-left: 16px; font-size: 12px; line-height: 1.5; color: var(--soft); }
.sc-chart { margin-top: 2px; }
.sc-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.sc-actions .btn { min-height: 32px; padding: 0 10px; font-size: 12px; }
.sc-all { margin-top: 18px; }
.sc-all summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.sc-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12px; }
.sc-table th, .sc-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.sc-table td:first-child { white-space: normal; }
@media (max-width: 599px) { .sc-table th, .sc-table td { white-space: normal; padding: 6px 4px; } .sc-table { table-layout: fixed; word-break: break-word; } }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; }
@media (max-width: 640px) { .sc-grid { grid-template-columns: 1fr; } .sc-card { grid-template-columns: 88px 1fr; } .sc-img img { width: 88px; } }

/* picture viewer */
.lightbox { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.86); padding: calc(20px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom)); cursor: zoom-out; }
.lightbox.on { display: flex; animation: lb-in 0.18s ease; }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
.lightbox img { max-width: min(92vw, 640px); max-height: 100%; border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); }
.lb-close { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 16px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-3); background: var(--panel); color: var(--text); font-size: 26px; line-height: 1; cursor: pointer; }
body.lb-open { overflow: hidden; }
.sc-img { padding: 0; border: 0; background: none; cursor: zoom-in; display: block; align-self: start; }

/* You vs the model */
.pq-board { display: grid; grid-template-columns: 1fr auto 1fr; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pq-side { padding: 18px 22px; }
.pq-side.you { background: linear-gradient(90deg, rgba(255, 210, 63, 0.10), transparent); }
.pq-side.model { text-align: right; background: linear-gradient(270deg, rgba(124, 184, 255, 0.10), transparent); }
.pq-who { font: 30px var(--display); letter-spacing: 0.05em; line-height: 1; }
.you .pq-who, .pq-you, .pq-you-t { color: var(--accent); }
.model .pq-who, .pq-model, .pq-model-t { color: #7cb8ff; }
.pq-big { font: 56px var(--display); line-height: 1; margin-top: 6px; }
.pq-vs { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 24px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.pq-score { font: 46px var(--display); line-height: 1; }
.pq-score b { color: var(--accent); font-weight: 400; } .pq-score i { color: #7cb8ff; font-style: normal; }
.pq-hint { color: var(--muted-2); font-size: 11px; line-height: 1.4; }
.pq-note { margin: 8px 0 0; }
.pq-save { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding: 12px 14px; border: 1px solid rgba(255, 210, 63, 0.5); border-radius: 10px; background: rgba(255, 210, 63, 0.05); font-size: 13px; }
.pq-h { font: 24px var(--display); letter-spacing: 0.05em; margin: 28px 0 12px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pq-h .muted { font: 400 12px var(--sans); letter-spacing: 0; }
.pq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); gap: 14px; }
.pq { display: grid; grid-template-columns: 110px 1fr; gap: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; animation: sc-in 0.45s ease both; animation-delay: calc(var(--i) * 60ms); }
.pq.locked { border-color: rgba(255, 210, 63, 0.45); }
.pq-slab { align-self: start; }
.pq-main { min-width: 0; }
.pq-name { font: 600 14px var(--sans); }
.pq-name small { color: var(--muted-2); font-weight: 400; font-size: 11px; margin-left: 4px; }
.pq-q { font: 24px var(--display); letter-spacing: 0.03em; line-height: 1.1; margin: 6px 0; }
.pq-q .dn { color: var(--green); } .pq-q .up { color: var(--red); }
.pq-facts { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.pq-facts b { color: var(--text); font-weight: 600; }
.pq-meter { position: relative; height: 8px; border-radius: 4px; background: var(--line); margin: 12px 0 4px; }
.pq-meter .band { position: absolute; top: 0; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); }
.pq-meter .now, .pq-meter .tgt { position: absolute; top: -4px; width: 3px; height: 16px; border-radius: 2px; margin-left: -1px; }
.pq-meter .now { background: var(--text); } .pq-meter .tgt { background: var(--green); } .pq-meter .tgt.up { background: var(--red); }
.pq-slider { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.pq-slider input { flex: 1; accent-color: var(--accent); height: 30px; }
.pq-pct { font: 32px var(--display); width: 64px; text-align: right; color: var(--accent); }
.pq-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.pq-reveal { display: flex; gap: 16px; align-items: center; margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--panel-2); }
.pq-you, .pq-model { font: 30px var(--display); line-height: 1; }
.pq-status { margin-left: auto; text-align: right; font-size: 12px; color: var(--muted); }
.yes { color: var(--green); } .no { color: var(--red); }
.pq-res { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pq-rrow { display: grid; grid-template-columns: 40px 1.6fr 1fr 56px 56px 110px 70px; gap: 12px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 13px; }
.pq-rrow:first-child { border-top: 0; }
.pq-thumb .slab { width: 36px; height: 52px; }
.pq-num { font: 22px var(--display); }
.pq-chip { font: 14px var(--display); letter-spacing: 0.08em; padding: 4px 8px 2px; border-radius: 4px; border: 1px solid var(--line-3); color: var(--muted); }
.pq-chip.you { color: var(--accent); border-color: rgba(255, 210, 63, 0.55); } .pq-chip.model { color: #7cb8ff; border-color: rgba(124, 184, 255, 0.55); }
.pq-chart { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
@media (max-width: 760px) {
  .pq-grid { grid-template-columns: 1fr; } .pq { grid-template-columns: 84px 1fr; } .pq .slab.md { width: 84px; height: 126px; }
  .pq-board { grid-template-columns: 1fr; } .pq-vs { border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px; } .pq-side.model { text-align: left; }
  .pq-rrow { grid-template-columns: 36px 1fr 48px 48px 64px; } .pq-rrow > :nth-child(3), .pq-rrow > :nth-child(6) { display: none; }
}

/* Stories */
.st { display: grid; grid-template-columns: minmax(180px, 280px) 1fr; gap: 22px; align-items: start; }
.st-art { padding: 0; border: 0; background: none; cursor: zoom-in; position: sticky; top: 16px; }
.st-art img { width: 100%; border-radius: 12px; display: block; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55); }
.st-body h4 { font: 18px var(--display); letter-spacing: 0.08em; color: var(--accent); margin: 16px 0 4px; }
.st-body p, .st-body li { font-size: 14px; line-height: 1.65; color: var(--soft); margin: 0; }
.st-body ul { margin: 0; padding-left: 18px; }
.st-body li + li { margin-top: 4px; }
.st-by { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.st-by b { font: 30px var(--display); letter-spacing: 0.04em; line-height: 1; }
.st-en { margin-top: 14px !important; }
.st-src { margin-top: 16px !important; font-size: 11px !important; color: var(--muted-2) !important; line-height: 1.6 !important; }
.st-src a { color: var(--muted); }
.st-shared { font-size: 13px; color: var(--soft); margin: 0 0 16px; }
.st-shared .lbl { margin-right: 8px; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.st-tile { display: flex; flex-direction: column; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; color: var(--text); animation: sc-in 0.45s ease both; animation-delay: calc(min(var(--i), 12) * 40ms); transition: border-color 0.15s, transform 0.15s; }
.st-tile:hover { border-color: var(--line-3); transform: translateY(-2px); color: var(--text); }
.st-pic { display: block; aspect-ratio: 63 / 88; overflow: hidden; border-radius: 10px; }
.st-pic img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.22); } /* the photos are the card centred on a wider canvas: cover crops just the empty sides */
.st-tb { display: flex; flex-direction: column; gap: 3px; }
.st-tb b { font-size: 14px; }
.st-tb .muted { font-size: 11px; }
.st-teaser { font-size: 12px; line-height: 1.5; color: var(--soft); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 700px) { .st { grid-template-columns: 1fr; } .st-art { position: static; max-width: 260px; margin: 0 auto; } .st-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

/* combination finder (#/combos) */
.pl-finder { min-height: 42px; }
.cb-budget { font-size: 13px; color: var(--muted); }
.cb-budget a { color: var(--accent); margin-left: 4px; }
.cb-pool { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.cb-pool summary { cursor: pointer; padding: 12px 14px; font: 19px var(--display); letter-spacing: 0.05em; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; }
.cb-pool summary b { color: var(--text); font-weight: 400; }
.cb-hint { margin-left: auto; font: 400 11px var(--sans); color: var(--muted-2); letter-spacing: 0; }
.cb-pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 6px; padding: 0 12px 12px; }
.cb-prow { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto auto; gap: 2px 10px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.cb-prow.pin { border-color: var(--accent); }
.cb-prow.off { opacity: 0.45; }
.cb-prow.off .cb-pn { text-decoration: line-through; }
.cb-pthumb { width: 32px; height: 44px; grid-row: span 2; }
.cb-pn { font: 17px var(--display); letter-spacing: 0.03em; line-height: 1.1; }
.cb-pp { font: 17px var(--display); text-align: right; line-height: 1; font-variant-numeric: tabular-nums; }
.cb-pp i, .cb-cp i { display: block; font: 400 10px var(--sans); color: var(--muted-2); font-style: normal; }
.cb-ptg { display: flex; gap: 4px; grid-row: span 2; }
.cb-ptg button { width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--line-3); background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; filter: grayscale(1); opacity: 0.6; }
.cb-ptg button.on { filter: none; opacity: 1; border-color: var(--accent); background: #2a2614; }
.cb-ptg button:disabled { cursor: default; opacity: 0.25; }
.cb-prow em { grid-column: 2 / 4; font: 400 10px var(--sans); color: var(--amber); font-style: normal; }
.cb-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.cb-tabs button { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-3); background: transparent; color: var(--muted); font: 19px var(--display); letter-spacing: 0.05em; cursor: pointer; }
.cb-tabs button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.cb-catsub { margin: -4px 0 0; font-size: 12px; color: var(--muted-2); }
.cb-picks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
@media (max-width: 1000px) { .cb-picks { grid-template-columns: 1fr; } }
.cb-combo { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.cb-combo.first { border-color: var(--accent); }
.cb-ch { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.cb-rank { display: flex; align-items: baseline; gap: 6px; }
.cb-rank span { font: 18px var(--display); color: var(--muted-2); }
.cb-rank b { font: 34px var(--display); font-weight: 400; color: var(--accent); line-height: 1; }
.cb-rank i { font: 400 11px var(--sans); color: var(--muted-2); font-style: normal; }
.cb-tot { font: 28px var(--display); text-align: right; line-height: 1; font-variant-numeric: tabular-nums; }
.cb-tot span { display: block; font: 600 11px var(--sans); }
.cb-tot .pos { color: var(--green); }
.cb-tot .neg { color: var(--amber); }
.cb-bar { position: relative; height: 6px; background: var(--panel-2); border-radius: 3px; }
.cb-bar div { height: 100%; border-radius: 3px; background: var(--accent); }
.cb-bar div.over { background: var(--amber); }
.cb-bar span { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); opacity: 0.7; }
.cb-meta { font-size: 12px; color: var(--muted); }
.cb-why { font-size: 11px; color: var(--muted-2); margin-top: -6px; }
.cb-chips { display: flex; flex-direction: column; gap: 5px; }
.cb-chip { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 5px 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; color: inherit; text-decoration: none; }
.cb-chip:hover { border-color: var(--line-3); }
.cb-chip.pinned { border-color: rgba(255, 210, 63, 0.5); }
.cb-cthumb { width: 34px; height: 48px; }
.cb-cn { font: 17px var(--display); letter-spacing: 0.03em; line-height: 1.1; }
.cb-cp { font: 17px var(--display); text-align: right; line-height: 1; font-variant-numeric: tabular-nums; }
.cb-use { margin-top: 2px; }
.cb-prow .wthumb.cb-pthumb { grid-area: auto / auto / span 2; width: 32px; height: 44px; }
.cb-chip .wthumb.cb-cthumb { grid-area: auto; width: 34px; height: 48px; }
@media (max-width: 640px) {
  .cb-pgrid { grid-template-columns: 1fr; padding: 0 8px 8px; }
  .cb-hint { margin-left: 0; width: 100%; }
}
.cb-codds { grid-column: 2 / -1; font-size: 11px; color: var(--muted); line-height: 1.35; }
.cb-codds b { color: var(--text); font-weight: 600; }
.cb-codds i { color: var(--muted-2); font-style: normal; }
.cb-codds.hit { color: var(--green); }
.cb-odds-sum { font-size: 12px; color: var(--muted); padding: 6px 8px; border-radius: 6px; background: var(--panel-2); }
.cb-odds-sum b { color: var(--accent); font-weight: 600; }
.cb-odds-sum b.pos { color: var(--green); }
.cb-odds-sum b.neg { color: var(--red); }

/* upside tab + tier check (data/value_model.json) */
.tier-check { margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.5; padding: 0 2px; }
.tier-check b { color: var(--text); font-weight: 600; }
.tc-lbl { font: 14px var(--display); letter-spacing: 0.08em; color: var(--muted-2); margin-right: 4px; }
.tc-flag { color: var(--amber); font-weight: 600; }
.tc-note { display: block; font-size: 11px; color: var(--amber); }
.up-wrap { display: flex; flex-direction: column; gap: 12px; }
.up-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.up-col { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.up-buy { display: flex; justify-content: space-between; align-items: baseline; }
.up-buy span { font: 18px var(--display); letter-spacing: 0.06em; color: var(--muted); }
.up-buy strong { font: 28px var(--display); font-weight: 400; letter-spacing: 0.02em; }
.up-hl { font: 17px var(--display); letter-spacing: 0.06em; color: var(--accent); margin-bottom: 6px; }
.up-range { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.up-cell { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; text-align: center; }
.up-cell.mid { border-color: var(--line-3); }
.up-cell b { display: block; font: 22px var(--display); font-weight: 400; font-variant-numeric: tabular-nums; line-height: 1.1; }
.up-cell span { font-size: 11px; }
.up-cell .pos { color: var(--green); }
.up-cell .neg { color: var(--neg); }
.up-lbls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; font-size: 10px; color: var(--muted-2); text-align: center; margin-top: 3px; }
.up-odds { margin-top: 8px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.up-odds b { color: var(--accent); }
.up-odds i { font-style: normal; color: var(--muted-2); }

/* previous / next card on the card page */
.card-nav { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; margin: -6px 0 16px; }
.cn-btn { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--muted); text-decoration: none; min-width: 0; }
.cn-btn:hover { border-color: var(--line-3); color: var(--text); }
.cn-next { justify-content: flex-end; text-align: right; }
.cn-btn svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; }
.cn-thumb { width: 28px; height: 40px; flex: none; }
.cn-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.cn-txt small { font: 13px var(--display); letter-spacing: 0.08em; color: var(--muted-2); }
.cn-txt b { font: 18px var(--display); font-weight: 400; letter-spacing: 0.03em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cn-pos { font: 16px var(--display); letter-spacing: 0.08em; color: var(--muted-2); }
@media (max-width: 640px) {
  .cn-thumb { display: none; }
  .cn-btn { padding: 6px 8px; gap: 6px; }
  .cn-txt b { font-size: 15px; }
}

/* Overview side panel (slim) */
.dw { display: flex; flex-direction: column; gap: 14px; }
.dw-head { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 16px; align-items: start; }
.dw-head .slab { width: 118px; }
.dw-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dw-info .cd-name { font: 30px var(--display); letter-spacing: 0.03em; line-height: 1; color: var(--text); text-decoration: none; }
.dw-info .cd-name:hover { color: var(--accent); }
.dw-info .cd-meta { font-size: 11px; color: var(--muted-2); margin-bottom: 6px; }
.dw-info .cd-price { font-size: 46px; line-height: 1; }
.dw-delta { font-size: 11px; color: var(--muted-2); }
.dw-delta .up { color: var(--green); } .dw-delta .down { color: var(--neg); }
.dw-info .cd-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.dw-verdict { font-size: 13px; color: var(--soft); line-height: 1.45; padding: 10px 12px; border-left: 3px solid var(--amber); background: var(--panel-2); border-radius: 0 8px 8px 0; }
.dw-verdict b { color: var(--text); font-weight: 600; }
.dw-verdict.buyzone { border-left-color: var(--green); }
.dw-verdict.dontbuy { border-left-color: var(--neg); }
.dw-verdict.muted { border-left-color: var(--line-3); color: var(--muted); }
.dw-due { font-size: 12px; color: var(--amber); margin-top: -6px; }
.dw-ins { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: var(--soft); padding: 10px 12px; border: 1px solid #3a3420; background: #14140f; border-radius: 10px; text-decoration: none; }
.dw-ins svg { flex: none; width: 16px; height: 16px; fill: var(--accent); margin-top: 2px; }
.dw-ins b { color: var(--text); font-weight: 600; }
.dw-ins i { font-style: normal; color: var(--accent); white-space: nowrap; }
.dw-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dw-st { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.dw-st .k { font: 14px var(--display); letter-spacing: 0.08em; color: var(--muted-2); display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.dw-st .v { font: 24px var(--display); line-height: 1.1; font-variant-numeric: tabular-nums; }
.dw-st .v small { font-size: 14px; color: var(--muted-2); }
.dw-st .s { font-size: 11px; color: var(--muted); line-height: 1.4; }
.dw-st .pos, .dw-st .up { color: var(--green); } .dw-st .neg, .dw-st .down { color: var(--neg); } .dw-st .amb { color: var(--amber); }
.dw-lim.limit-row { display: block; }
.dw-lim.limit-row:has(.limit-input) { display: flex; grid-column: 1 / -1; }
.dw-lact { display: flex; gap: 6px; margin-top: 6px; }
.limit-btn.dw-mini { min-height: 24px; padding: 0 7px; font-size: 11px; }
.dw-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dw-acts .btn-primary { grid-column: 1 / -1; }
.dw-acts .btn { white-space: nowrap; padding: 0 8px; justify-content: center; }

/* rate my portfolio */
.rate-page { display: flex; flex-direction: column; gap: 16px; }
.rt-sum { padding: 18px 20px; }
.rt-head { font-size: 13px; color: var(--muted); }
.rt-head b { color: var(--text); }
.rt-rel { margin: 0; padding-left: 18px; font-size: 12px; color: var(--muted); }
.rt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.rt-cat { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rt-ch { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.rt-ch h3 { margin: 0; font-size: 15px; }
.rt-score { font-family: 'Bebas Neue', sans-serif; font-size: 30px; color: var(--accent); line-height: 1; }
.rt-score i { font-family: Montserrat, sans-serif; font-style: normal; font-size: 11px; color: var(--muted); margin-left: 4px; }
.rt-rank { font-size: 13px; font-weight: 600; }
.rt-rank.amb { color: var(--accent); }
.rt-bar { height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
.rt-bar i { display: block; height: 100%; background: var(--muted); }
.rt-bar i.pos { background: var(--green); } .rt-bar i.amb { background: var(--accent); } .rt-bar i.neg { background: var(--red); }
.rt-best { font-size: 12px; line-height: 1.5; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.rt-best .rt-open { min-height: 32px; padding: 4px 10px; font-size: 12px; margin-left: auto; }
.du-rate { margin-top: 8px; align-self: flex-start; }

.rt-find { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12px; margin-top: 4px; }
.rt-keep { border: 1px solid var(--accent); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; background: rgba(255, 210, 63, 0.05); }
.rt-keep.same { border-color: var(--line, #333); color: var(--muted); background: none; }
.rt-kh { line-height: 1.6; }
.rt-kh > span { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-right: 4px; }
.rt-adds { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 4px; }
.rt-add { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; min-width: 0; }
.rt-add > span:last-child { display: flex; flex-direction: column; line-height: 1.3; }
.rt-add b { font-weight: 600; }
.rt-add i { font-style: normal; color: var(--muted); font-size: 11px; }
.wthumb.rt-th { width: 30px; height: 42px; flex: none; border-radius: 3px; }
.rt-kn { color: var(--muted); }
.rt-kn b { color: var(--text); }
.rt-kn .amb { color: var(--accent); }
.rt-take { align-self: flex-start; min-height: 32px; padding: 4px 10px; font-size: 12px; }

.rt-overall { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--accent); }
.rt-overall .rt-ch h3 { color: var(--accent); }
.rt-ovcats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.rt-ovc { background: var(--panel-2); border-radius: 6px; padding: 8px 10px; display: grid; grid-template-columns: 1fr auto auto; gap: 2px 8px; font-size: 12px; align-items: baseline; }
.rt-ovc span { color: var(--muted); }
.rt-ovc b { color: var(--text); }
.rt-ovc i { font-style: normal; font-size: 11px; }
.rt-ovc small { grid-column: 1 / -1; font-size: 11px; }
.rt-ovc small.amb { color: var(--accent); }

/* rate my portfolio: hover a card to remove it */
.rt-item { position: relative; transition: padding-left .2s ease; }
.rt-item .cb-chip { transition: border-color .2s ease; }
.rt-del { position: absolute; left: 0; top: 50%; width: 28px; height: 28px; margin-top: -14px; border-radius: 50%; border: 1px solid var(--line-3, #444); background: var(--panel-2); color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; opacity: 0; transform: translateX(-6px); transition: opacity .2s ease, transform .2s ease, color .15s, border-color .15s; pointer-events: none; }
.rt-item:hover, .rt-item:focus-within { padding-left: 36px; }
.rt-item:hover .rt-del, .rt-item:focus-within .rt-del { opacity: 1; transform: none; pointer-events: auto; }
.rt-del:hover, .rt-del:focus-visible { color: var(--red); border-color: var(--red); }
@media (hover: none) {
  .rt-item { padding-left: 36px; }
  .rt-del { opacity: 1; transform: none; pointer-events: auto; }
}
@media (prefers-reduced-motion: reduce) { .rt-item, .rt-del { transition: none; } }

/* remove / restore cards */
.cd-remove { color: var(--muted); }
.cd-remove:hover:not(:disabled) { color: var(--red); border-color: var(--red); }
.cd-remove.armed { color: #fff; background: var(--red); border-color: var(--red); }
.cd-remove:disabled { opacity: .45; cursor: not-allowed; }
.rm-list { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 6px; display: flex; flex-direction: column; gap: 8px; }
.rm-list h3 { margin: 0 0 2px; font-size: 14px; }
.rm-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; padding: 8px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.rm-name { font-weight: 600; }
.rm-st { flex: 1; font-size: 12px; }
.rm-row .btn { min-height: 32px; padding: 4px 12px; font-size: 12px; }


/* verdict box: today's call (computed) + the dated written analysis, folded */
.verdict-written { border-top: 1px solid #2c2c32; padding-top: 8px; }
.verdict-written summary { cursor: pointer; font-size: 12px; color: var(--muted, #8a8a94); list-style: none; }
.verdict-written summary::-webkit-details-marker { display: none; }
.verdict-written summary::before { content: '▸ '; }
.verdict-written[open] summary::before { content: '▾ '; }
.verdict-written p { margin-top: 8px; }
.verdict-written-note { font-size: 11px; color: var(--muted, #8a8a94); margin-top: 6px; line-height: 1.5; }

/* hype exposure (data/hype.json) */
.hype { margin-top: 10px; background: var(--panel-2); border: 1px solid #2c2c32; border-left: 3px solid var(--muted); border-radius: var(--radius); padding: 12px 14px; font-size: 13px; line-height: 1.55; }
.hype-high { border-left-color: var(--red); }
.hype-medium { border-left-color: var(--amber); }
.hype-low { border-left-color: var(--green); }
.hype-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.hype-lbl { font: 14px var(--display); letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
.hype-level { font: 24px var(--display); letter-spacing: 0.04em; font-weight: 400; line-height: 1; }
.hype-high .hype-level { color: var(--red); }
.hype-medium .hype-level { color: var(--amber); }
.hype-low .hype-level { color: var(--green); }
.hype-na .hype-level { color: var(--muted); font-size: 18px; }
.hype-sub { color: var(--muted); font-size: 12px; }
.hype-meter { position: relative; display: grid; grid-template-columns: 1fr 1fr 1fr; margin: 10px 0 8px; height: 18px; border-radius: 9px; overflow: visible;
  background: linear-gradient(90deg, rgba(69,212,131,.35) 0 33.3%, rgba(245,165,36,.35) 33.3% 66.7%, rgba(240,82,77,.4) 66.7% 100%); }
.hype-meter span { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--text); opacity: .75; display: flex; align-items: center; justify-content: center; }
.hype-meter i { position: absolute; top: -4px; width: 4px; height: 26px; margin-left: -2px; background: var(--text); border-radius: 2px; box-shadow: 0 0 0 2px var(--panel-2); }
.hype-row { display: grid; grid-template-columns: 130px 70px 1fr; align-items: center; gap: 10px; margin: 3px 0; font-size: 12.5px; }
.hype-k { color: var(--muted); }
.hype-mini { height: 6px; background: #2c2c32; border-radius: 3px; overflow: hidden; }
.hype-mini i { display: block; height: 100%; background: var(--text); opacity: .7; }
.hype-v b { color: var(--text); }
.hype-means { margin: 8px 0 4px; color: var(--soft, var(--text)); }
.hype-foot { margin: 0; font-size: 11px; color: var(--muted); }
@media (max-width: 600px) { .hype-row { grid-template-columns: 1fr; gap: 2px; } .hype-mini { display: none; } }

/* sealed product on the Holdings page */
.sl-wrap { margin-top: 28px; display: flex; flex-direction: column; gap: 12px; }
.sl-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sl-head .section-title { margin: 0; }
.sl-note { margin: -4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.sl-list { display: flex; flex-direction: column; gap: 12px; }
.sl-item { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.sl-top { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid #1d1d21; }
.sl-icon { flex: none; width: 44px; height: 44px; border-radius: 8px; background: var(--panel-2); display: grid; place-items: center; color: var(--accent); }
.sl-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.sl-info { flex: 1; min-width: 0; }
.sl-name { font: 22px var(--display); letter-spacing: 0.03em; line-height: 1.15; }
.sl-pulls { display: flex; flex-direction: column; }
.sl-pull { display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 30px; border-bottom: 1px solid #1d1d21; }
.sl-pthumb { width: 34px; height: 47px; flex: none; border-radius: 3px; background: var(--panel-2); }
.sl-pthumb img { width: 100%; height: 100%; object-fit: contain; }
.sl-pinfo { flex: 1; min-width: 0; }
.sl-pname { font-weight: 600; font-size: 14px; }
.sl-pname a { color: inherit; }
.sl-st { display: inline-block; margin-left: 6px; font: 11px var(--display); letter-spacing: 0.06em; padding: 2px 5px 0; border-radius: 3px; border: 1px solid var(--muted); color: var(--muted); vertical-align: 1px; }
.sl-st.at-psa { border-color: var(--amber); color: var(--amber); }
.sl-st.psa10 { border-color: var(--accent); color: var(--on-accent); background: var(--accent); }
.sl-empty { padding: 10px 16px 10px 30px; color: var(--muted); font-size: 13px; border-bottom: 1px solid #1d1d21; }
.sl-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px 12px 30px; }
.sl-add-lbl { color: var(--muted); font-size: 12px; margin-right: 2px; }
.sl-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; color: var(--text); text-decoration: none; background: var(--panel-2); }
.sl-chip img { width: 18px; height: 25px; object-fit: contain; border-radius: 2px; }
.sl-chip:hover { border-color: var(--accent); }
.sl-other { padding-left: 10px; color: var(--accent); }
@media (max-width: 600px) { .sl-pull, .sl-empty, .sl-add { padding-left: 16px; } .sl-name { font-size: 19px; } }
.sl-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 600px) { .sl-summary { gap: 8px; } .sl-summary .pf-stat { padding: 10px; } .sl-summary .val { font-size: 20px; } .sl-summary .lbl { font-size: 12px; } .sl-icon { display: none; } }

/* Holdings page: totals at the top right (singles + sealed, not the budget) */
.page-aside { display: grid; grid-template-columns: repeat(3, auto); gap: 4px 22px; text-align: right; align-self: flex-end; }
.page-aside[hidden] { display: none; }
.pa-cell { display: flex; flex-direction: column; align-items: flex-end; }
.pa-cell .lbl { font: 13px var(--display); letter-spacing: 0.1em; color: var(--muted-2); }
.pa-cell .v { font: 28px var(--display); letter-spacing: 0.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.pa-pct { font-size: 12px; font-weight: 600; }
.pa-note { grid-column: 1 / -1; font-size: 11px; color: var(--muted-2); }
@media (max-width: 700px) { .page-head:has(.page-aside:not([hidden])) { flex-wrap: wrap; } .page-aside { width: 100%; grid-template-columns: repeat(3, 1fr); text-align: left; } .pa-cell { align-items: flex-start; } .pa-cell .v { font-size: 22px; } }

/* sealed product pictures */
.sl-photo { flex: none; width: 84px; height: 84px; border-radius: 8px; overflow: hidden; background: var(--panel-2); display: block; }
.sl-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.sl-photo:hover img { transform: scale(1.05); }
.sl-photo.broken { background: var(--panel-2); }
a.sl-icon { width: 84px; height: 84px; flex-direction: column; gap: 2px; text-decoration: none; border: 1px dashed var(--line); }
a.sl-icon span { font-size: 10px; color: var(--muted-2); }
a.sl-icon:hover { border-color: var(--accent); }
@media (max-width: 600px) { .sl-photo, a.sl-icon { width: 64px; height: 64px; } a.sl-icon { display: grid; } }
.sl-photo img { object-fit: contain; padding: 4px; }
.sl-name a { color: inherit; text-decoration: none; }
.sl-name a:hover { color: var(--accent); }

/* Log purchase dialog (Bought it) */
.bd { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); padding: 0; width: min(440px, calc(100vw - 32px)); }
.bd::backdrop { background: rgba(0,0,0,.6); }
.bd-form { display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 16px; }
.bd-head { display: flex; gap: 12px; align-items: center; margin-bottom: 4px; }
.bd-thumb { width: 36px; height: 50px; }
.bd-title { font: 24px var(--display); letter-spacing: .04em; line-height: 1; }
.bd-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.bd-row { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; font-size: 13px; }
.bd-row > span { color: var(--muted); }
.bd-row input[type=number], .bd-row input[type=date], .bd-row input[type=text] { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; color: var(--text); padding: 8px 10px; font: inherit; font-size: 15px; width: 100%; box-sizing: border-box; color-scheme: dark; }
.bd-row input:focus { outline: none; border-color: var(--accent); }
.bd-row[hidden] { display: none; }
.bd-seg { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.bd-seg label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.bd-seg input { accent-color: var(--accent); }
.bd-hint { font-size: 11.5px; color: var(--muted-2); line-height: 1.5; margin-top: -4px; }
.bd-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* ---------- owned cards: sell zones, gauge markers ---------- */
.z-sh { background: var(--line-3); }
.z-st { background: var(--amber); }
.z-ss { background: var(--green-strong); flex-grow: 1; }
.sell-gauge .sg-bar { position: absolute; inset: 0; display: flex; border-radius: 5px; overflow: hidden; }
.sell-gauge .sg-bar i { display: block; height: 100%; }
.marker.cost .stem, .marker.be .stem, .marker.target .stem { height: 14px; width: 3px; }
.marker.cost, .marker.be, .marker.target { top: -2px; }
.marker.cost .stem { background: var(--muted); }
.marker.be .stem { background: #7aa7ff; }
.marker.target .stem { background: var(--accent); }
.sg-legend { flex-wrap: wrap; }
.sg-dot { display: inline-block !important; width: 8px !important; height: 8px !important; border-radius: 50%; vertical-align: middle; margin-right: 4px; }
.sg-dot.cost { background: var(--muted); } .sg-dot.be { background: #7aa7ff; } .sg-dot.target { background: var(--accent); }
.zb-cost { position: absolute; top: 4px; bottom: 4px; width: 2px; margin-left: -1px; background: var(--muted); border-radius: 1px; }
.pos-stats .s { font-size: 12px; margin-top: 2px; }
.pos-stats .s.pos { color: var(--green); } .pos-stats .s.neg { color: var(--neg); }

/* ---------- should I grade this? ---------- */
.vtag.gr-grade { background: var(--green); color: #06170d; }
.vtag.gr-close { color: var(--amber); border-color: var(--amber); }
.vtag.gr-dont { color: var(--neg); border-color: var(--neg); }
.grade-line { font-size: 12.5px; line-height: 1.5; margin-top: 6px; color: var(--soft); }
.grade-line .vtag { font-size: 13px; padding: 3px 7px 1px; margin-right: 4px; vertical-align: 1px; }
.grade-line b { color: var(--text); }
.grade-panel { background: var(--panel-2); border: 1px solid #2c2c32; border-radius: var(--radius); padding: 10px 12px; margin-top: 8px; font-size: 13px; }
.gp-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.gp-copy { margin-top: 6px; }

/* ---------- portfolio value over time ---------- */
.pfh { margin-bottom: 22px; }
.pfh-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.pfh-head .section-title { margin: 0; }
.pfh-ctl { display: flex; flex-wrap: wrap; gap: 8px; }
.seg { display: inline-flex; border: 1px solid var(--line-3); border-radius: 6px; overflow: hidden; }
.seg button { background: transparent; color: var(--muted); border: 0; padding: 5px 10px; font: 600 12px var(--sans); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line-3); }
.seg button.on { background: var(--panel-2); color: var(--accent); }
.pfh-read { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 4px; font-size: 13px; color: var(--soft); }
.pfh-read b { color: var(--text); font-variant-numeric: tabular-nums; }
.pfh-read .pos b, .pfh-read .neg b { color: inherit; }
.pfh-key { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.pfh-key.w { background: var(--accent); height: 3px; } .pfh-key.s { background: var(--muted-2); } .pfh-key.b { width: 8px; height: 8px; border-radius: 1px; background: var(--text); transform: rotate(45deg); }
.pfh-wrap { position: relative; }
.pfh-wrap svg { display: block; max-width: 100%; touch-action: pan-y; }
.pfh-worth { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.pfh-spent { fill: none; stroke: var(--muted-2); stroke-width: 1.5; stroke-dasharray: 5 4; }
.pfh-buy path { fill: var(--text); stroke: var(--panel); stroke-width: 2; paint-order: stroke; }
.pfh-sub { fill: var(--muted); font-size: 11px; }
.pfh-res { fill: none; stroke-width: 2; } .pfh-res.good { stroke: var(--green); } .pfh-res.bad { stroke: var(--neg); }
.pfh-resfill.good { fill: var(--green); opacity: 0.14; } .pfh-resfill.bad { fill: var(--neg); opacity: 0.14; }
.pfh-cross { stroke: var(--muted); stroke-width: 1; }
.pfh-tip { position: absolute; top: 6px; background: var(--panel-2); border: 1px solid var(--line-3); border-radius: 6px; padding: 6px 10px; font-size: 12px; display: flex; flex-direction: column; gap: 2px; pointer-events: none; font-variant-numeric: tabular-nums; z-index: 3; }
.pfh-table { margin-top: 8px; font-size: 12px; } .pfh-table summary { cursor: pointer; color: var(--soft); }
.pfh-table table { width: 100%; border-collapse: collapse; margin-top: 6px; } .pfh-table th, .pfh-table td { text-align: right; padding: 4px 8px; border-bottom: 1px solid var(--line); } .pfh-table th:first-child, .pfh-table td:first-child { text-align: left; }

.basis-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 14px; font-size: 12.5px; }
.basis-bar .lbl { font: 15px var(--display); letter-spacing: 0.08em; color: var(--muted); }

.sold-years { margin: 10px 0 14px; } .sold-years table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.sold-years th, .sold-years td { padding: 7px 12px; text-align: right; border-bottom: 1px solid var(--line); } .sold-years th:first-child, .sold-years td:first-child { text-align: left; }
.sold-years th { font: 14px var(--display); letter-spacing: 0.06em; color: var(--muted); font-weight: 400; }

.wl-chg .chg-sub { display: block; font: 600 10px var(--sans); letter-spacing: 0; color: var(--muted-2); margin-top: 1px; white-space: nowrap; }

/* raw singles on the Holdings page: raw A-rank, PSA10 ask and the DIY cost side by side */
.pf-trio { display: flex; gap: 22px; align-items: flex-start; text-align: right; }
.pf-tri { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; width: 112px; font-variant-numeric: tabular-nums; }
.pf-tri:nth-child(2) { width: 168px; }
.pf-tri .k { font: 13px var(--display); letter-spacing: 0.06em; color: var(--muted); }
.pf-tri b { font: 22px var(--display); letter-spacing: 0.02em; font-weight: 400; color: var(--text); }
.pf-tri span:not(.k) { font-size: 12px; font-weight: 600; min-height: 14px; }
.pf-tri small { font-size: 10.5px; color: var(--muted-2); }
@media (max-width: 720px) { .pf-trio { flex-direction: column; gap: 6px; } .pf-tri { flex-direction: row; gap: 8px; align-items: baseline; justify-content: flex-end; } }

.own-filter { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--soft); cursor: pointer; margin-left: auto; }
.own-filter input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* raw cards on the collection page: raw A-rank vs paid, and the DIY cost */
.tile-raw { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.tile-raw b { color: var(--soft); font-weight: 600; } .tile-raw i { font-style: normal; font-weight: 600; }
.tile-raw .pos { color: var(--green); } .tile-raw .neg { color: var(--neg); }

/* ---------- track record: closed windows, baseline, return vs the market ---------- */
.pl-stat .val.tr-two { font: 500 13px/1.6 var(--sans); letter-spacing: 0; }
.pl-stat .val.tr-two b { font-weight: 700; color: var(--text); }
.tr-cmph, .tr-cmp { display: grid; grid-template-columns: 1fr auto auto; gap: 2px 12px; align-items: baseline; font-variant-numeric: tabular-nums; }
.tr-cmph { font-size: 10.5px; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 4px; }
.tr-cmph span:nth-child(n+2), .tr-cmp b, .tr-cmp i { text-align: right; min-width: 48px; }
.pl-summary.tr-sum { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.tr-cmp { font-size: 13px; color: var(--muted); }
.tr-cmp b { font-weight: 700; color: var(--text); } .tr-cmp b.pos { color: var(--green); } .tr-cmp b.neg { color: var(--neg); }
.tr-cmp i { font-style: normal; color: var(--muted-2); }
.tr-res .tr-meta { display: block; margin-top: 2px; }

/* ---------- holdings: vs the market since purchase, entry timing, benchmark ---------- */
.pf-timing { font-size: 12px; line-height: 1.5; margin-top: 4px; color: var(--muted); }
.pf-timing > i { font-style: normal; margin: 0 6px; color: var(--line-3); }
.pf-timing b { font-weight: 700; color: var(--soft); } .pf-timing b.pos { color: var(--green); } .pf-timing b.neg { color: var(--neg); }
.pos-stats + .pf-timing { margin: -4px 0 12px; }
.pfh-bench { fill: none; stroke: #7cb8ff; stroke-width: 1.6; stroke-dasharray: 2 4; stroke-linecap: round; opacity: 0.9; }
.pfh-key.bm { background: #7cb8ff; }

/* ---------- market: My-tier breadth; card page: supply and demand ---------- */
.ci-breadth { margin: 4px 0 14px; padding: 12px 0 0; border-top: 1px solid var(--line); }
.ci-bh { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ci-breadth .ci-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 800px) { .ci-breadth .ci-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sd-block { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); }
.sd-h { margin-bottom: 8px; }

/* ---------- PSA submission planner (#/submit) ---------- */
.sub-field { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.sub-field input { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 6px; color: var(--text); font: 500 13px var(--sans); padding: 5px 8px; }
.sub-field input[type=number] { width: 90px; font-variant-numeric: tabular-nums; }
.submit-page .pl-top { flex-wrap: wrap; gap: 10px 16px; }
.sub-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 14px 0; font-size: 12.5px; }
.submit-page .pl-name a { color: var(--text); } .submit-page .pl-name a:hover { color: var(--accent); }
.sub-h { margin-top: 24px; }
.submit-page .pl-mode { flex-wrap: wrap; max-width: 100%; }

/* ---------- holdings 1.1: section tabs, next step ---------- */
.seg-link { display: inline-flex; align-items: center; padding: 0 12px; min-height: 34px; font: 700 13px var(--sans); color: var(--accent); white-space: nowrap; }
.seg-link span { margin: 0 2px; color: var(--muted-2); font-weight: 600; }
.pf-next { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 2px; font-size: 12px; color: var(--soft); }
.pf-next a { font-weight: 600; }
@media (max-width: 640px) { .cd-fold summary small { display: none; } }

/* PSA grading backlog panel (Market page) and the line on Submissions */
.psa-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.psa-sub { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.psa-bar { position: relative; height: 34px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; margin: 4px 0 18px; overflow: visible; }
.psa-fill { height: 100%; background: rgba(124, 184, 255, 0.28); border-right: 2px solid #7cb8ff; border-radius: 7px 0 0 7px; display: flex; align-items: center; padding-left: 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.psa-line-mark { position: absolute; top: -6px; bottom: -6px; border-left: 2px dashed var(--accent); }
.psa-line-mark span { position: absolute; top: 100%; left: 4px; margin-top: 2px; font-size: 11px; color: var(--accent); white-space: nowrap; }
.psa-bar + .lc-plot, .psa-bar + * { margin-top: 22px; }
.psa-tbl { margin: 14px 0 8px; }
.psa-tiers { list-style: none; margin: 14px 0; padding: 0; display: grid; gap: 8px; font-size: 13px; }
.psa-note { margin: 0 0 12px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); font-size: 12px; color: var(--soft); line-height: 1.5; }
.psa-note a { color: var(--accent); }
@media (max-width: 800px) { .psa-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Grails page (data/grails.json): long-term goals, gallery layout ---------- */
.gr-meta { margin: 2px 0 0; font-size: 12px; color: var(--muted-2); }
.grc-name { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grc-name h2 { margin: 0; font: 34px var(--display); letter-spacing: 0.03em; line-height: 1.05; }
.gr-chg { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.gr-chg small { font-weight: 500; color: var(--muted-2); }
.gr-foot { display: flex; flex-wrap: wrap; gap: 8px; }
.gr-foot .btn { min-height: 40px; font-size: 18px; padding: 0 14px; }

/* funding panel */
.gr-fund { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.gf-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 20px; }
.gf-head .section-title { margin: 0; }
.gf-head dl { display: flex; gap: 22px; margin: 0; }
.gf-head dt { font: 700 10px var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); }
.gf-head dd { margin: 0; font: 26px var(--display); letter-spacing: 0.03em; font-variant-numeric: tabular-nums; }
.gf-row { display: grid; grid-template-columns: minmax(120px, 200px) 1fr auto; align-items: center; gap: 12px; font-size: 13px; }
.gf-name { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gf-bar { position: relative; height: 12px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; }
.gf-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; }
.gf-tp { background: rgba(255, 210, 63, 0.28); }
.gf-now { background: var(--accent); }
.gf-pct { color: var(--soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.gf-pct b { color: var(--text); }
.gf-pct b.pos { color: var(--green); }
.gf-note { margin: 0; font-size: 11px; color: var(--muted-2); line-height: 1.5; }
.gr-fund.compact .gf-note { display: none; }

/* Gallery layout */
.grc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grc { display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--panel); }
.grc-frame { position: relative; display: flex; justify-content: center; align-items: center; padding: 44px 24px; min-height: 520px; overflow: hidden; background: #050506; isolation: isolate; }
.grc-glow { position: absolute; inset: -20%; background-size: cover; background-position: center; filter: blur(46px) saturate(1.4); opacity: 0.55; z-index: -1; }
.grc-frame::after { content: ""; position: absolute; inset: 0; background: radial-gradient(70% 60% at 50% 50%, transparent 30%, rgba(5, 5, 6, 0.75)); z-index: -1; }
.grc-frame .slab.lg { width: min(340px, 78%); height: auto; aspect-ratio: 63 / 88; transition: transform 0.25s; }
.grc-frame .slab img.card-img { filter: drop-shadow(0 26px 40px rgba(0, 0, 0, 0.7)); }
.grc-frame:hover .slab.lg { transform: scale(1.015); }
.grc-plaque { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); }
.grc-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 4px 0 0; }
.grc-nums > div { padding: 0 10px; border-left: 1px solid var(--line); min-width: 0; }
.grc-nums > div:first-child { padding-left: 0; border-left: 0; }
.grc-nums dt { font: 700 10px var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); }
.grc-nums dd { margin: 2px 0 0; font-size: 30px; line-height: 1.05; }
.grc-nums > div:first-child dd { color: var(--accent); }
.grc-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; font-size: 12px; }

@media (max-width: 899px) {
  .grc-grid { grid-template-columns: 1fr; }
  .grc-frame { min-height: 0; padding: 34px 20px; }
  .grc-nums dd { font-size: 24px; }
  .gf-row { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 480px) {
  .grc-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 10px; }
  .grc-nums > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .grc-name h2 { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) { .grc-frame .slab.lg { transition: none; } }

/* ---------- weekly recap (#/recap) + overview card ---------- */
.recap-page { display: flex; flex-direction: column; gap: 16px; max-width: 1180px; }
.rc-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.rc-nav > :first-child { justify-self: start; }
.rc-nav > :last-child { justify-self: end; }
.rc-flags em:not(.pos):not(.neg) { color: var(--muted-2); }
.rc-week { text-align: center; display: flex; flex-direction: column; }
.rc-week b { font-size: 30px; }
.rc-head { padding: 18px 22px; background: linear-gradient(135deg, rgba(255, 210, 63, 0.10), transparent 60%), var(--panel); }
.rc-headline { margin: 0; font: 600 18px/1.45 var(--sans); color: var(--text); }
.rc-take { margin: 8px 0 0; color: var(--soft); }
.rc-basis { margin: 10px 0 0; font-size: 12px; }
.rc-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.rc-tile { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rc-tile b { font-size: 34px; }
.rc-tile small { color: var(--muted-2); font-size: 12px; }
.rc-money { border-color: rgba(255, 210, 63, 0.35); }
.rc-spark { width: 100%; height: 40px; margin-top: 6px; overflow: visible; }
.rc-spark path { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.rc-spark.up path { stroke: var(--green); } .rc-spark.down path { stroke: var(--neg); }
.rc-spark .rc-end { fill: var(--text); }
.rc-spark .rc-hit { fill: transparent; cursor: default; }
.rc-spark .rc-hit:hover { fill: rgba(255, 255, 255, 0.12); }
div.rc-spark { font-size: 11px; height: auto; }
.rc-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.rc-panel { padding: 16px 18px 10px; }
.rc-empty { margin: 4px 0 12px; font-size: 13px; }
.rc-row { display: grid; grid-template-columns: 30px minmax(0, 1.4fr) minmax(70px, 1fr) 70px; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid #1d1d21; color: var(--text); }
.rc-row:hover { background: #19191d; color: var(--text); }
.rc-row .slab { width: 26px; height: 36px; }
.rc-name { min-width: 0; display: flex; flex-direction: column; }
.rc-name b { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-name small { color: var(--muted-2); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-name small b { font: 600 11px var(--sans); color: var(--soft); }
.rc-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.rc-flags em { font: 600 10px var(--sans); font-style: normal; padding: 1px 6px; border-radius: 3px; border: 1px solid currentColor; }
.rc-bar { position: relative; height: 10px; }
.rc-bar::before { content: ''; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--line-3); }
.rc-bar i { position: absolute; top: 1px; height: 8px; max-width: 50%; }
.rc-bar i.up { background: var(--green); border-radius: 0 4px 4px 0; }
.rc-bar i.down { background: var(--neg); border-radius: 4px 0 0 4px; }
.rc-pct { text-align: right; font: 700 14px var(--sans); font-variant-numeric: tabular-nums; }
.rc-pct small { display: block; font: 600 10px var(--sans); color: var(--muted-2); }
.rc-tl { list-style: none; margin: 4px 0 8px; padding: 0; }
.rc-tl li { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid #1d1d21; position: relative; }
.rc-tl-d { font: 15px var(--display); letter-spacing: 0.06em; color: var(--accent); padding-top: 1px; }
.rc-tl li.mine .rc-tl-d { color: var(--green); }
.rc-tl-d.now { color: var(--soft); }
.rc-tl b { font-weight: 600; }
.rc-tl p { margin: 2px 0 0; color: var(--soft); font-size: 13px; }
.rc-src { font-size: 12px; }
.rc-ahead { border-color: rgba(255, 210, 63, 0.35); }
.recap-card { margin-top: 2px; }
.rc-card { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 26px; padding: 12px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; color: var(--text); }
.rc-card:hover { border-color: var(--line-3); color: var(--text); }
.rc-card-h { display: flex; flex-direction: column; margin-right: 6px; }
.rc-card-h .lbl { color: var(--accent); }
.rc-card-h small { font-size: 11px; }
.rc-kv { display: flex; flex-direction: column; min-width: 0; }
.rc-kv small { font: 600 10px var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-2); }
.rc-kv b { font-weight: 700; font-size: 14px; white-space: nowrap; }
.rc-kv .jp { font-size: 16px; }
.rc-next b { font-weight: 600; color: var(--soft); white-space: normal; }
.rc-go { margin-left: auto; color: var(--accent); font-weight: 600; font-size: 13px; }
@media (max-width: 899px) {
  .rc-cols { grid-template-columns: 1fr; }
  .rc-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rc-tile b { font-size: 28px; }
  .rc-week b { font-size: 22px; }
  .rc-nav .btn { padding: 6px 10px; font-size: 12px; }
  .rc-go { margin-left: 0; }
}
@media (max-width: 560px) {
  .rc-row { grid-template-columns: 26px minmax(0, 1fr) 44px 58px; gap: 8px; }
  .rc-tl li { grid-template-columns: 70px minmax(0, 1fr); }
}

/* self-grade signal (selfGrade in app.js): next to the verdict, never instead of it */
.diy-chip { display: inline-flex; font: 14px var(--display); letter-spacing: 0.08em; line-height: 1; padding: 4px 6px 2px; border-radius: 3px; margin-left: 6px; color: #7cc4ff; border: 1px dashed #7cc4ff; white-space: nowrap; cursor: help; }
.cd-diy-line { margin: 6px 0 2px; font-size: 13px; color: var(--soft); border-left: 2px solid #7cc4ff; padding-left: 10px; }

/* Overview "Market" column (marketChip): activity pill with an optional red "Hype" end */
.mkt-chip { display: inline-flex; align-items: stretch; white-space: nowrap; cursor: help; }
.mkt-chip .heat-chip { vertical-align: top; }
.mkt-chip.has-hype .heat-chip { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: 0; }
.mkt-hype { display: inline-flex; align-items: center; font: 13px var(--display); letter-spacing: 0.08em; line-height: 1; padding: 4px 7px 2px; color: #fff; background: var(--red); border-radius: 0 4px 4px 0; }
.mkt-chip > .mkt-hype:first-child { border-radius: 4px; }

/* Focus watch (scripts/focus.py → data/focus_report.json): Overview panel above Needs you */
.focus-watch { padding: 16px 20px; margin-bottom: 16px; border-color: var(--accent); }
.focus-watch .section-title { margin: 0 0 10px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.fw-asof { font: 500 12px var(--sans); color: var(--muted-2); letter-spacing: 0; }
.fw-card + .fw-card { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.fw-head { display: flex; align-items: center; gap: 12px; color: var(--text); }
.fw-head:hover { color: var(--text); }
.fw-th { width: 40px; flex: 0 0 auto; }
.fw-name { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.fw-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fw-name small { color: var(--muted-2); font-size: 12px; }
.fw-status { flex: 0 0 auto; padding: 4px 10px; border-radius: 999px; font: 700 12px var(--sans); text-transform: uppercase; letter-spacing: .04em; background: var(--panel-2); color: var(--soft); border: 1px solid var(--line-2); }
.fw-status.go { background: var(--green-strong); color: #fff; border-color: transparent; }
.fw-status.close { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.fw-status.turn { background: var(--amber); color: #1a1000; border-color: transparent; }
.fw-status.drift { color: var(--neg); border-color: var(--neg); background: transparent; }
.fw-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 12px 0 6px; }
.fw-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fw-stat b { font: 400 26px/1 var(--display); letter-spacing: .02em; }
.fw-stat b em { font: 500 12px var(--sans); font-style: normal; color: var(--muted); }
.fw-stat small { color: var(--muted); font-size: 12px; }
.fw-spark-w { position: relative; margin: 6px 0 14px; }
.fw-spark { display: block; width: 100%; height: 56px; }
.fw-sp-cap { position: absolute; left: 0; bottom: -14px; font-size: 10px; color: var(--muted-2); }
.fw-line { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.fw-dot { stroke: var(--accent); stroke-width: 7; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.fw-tgt { stroke: var(--green); stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.fw-tgt-l { position: absolute; left: 0; transform: translateY(-120%); color: var(--green); font: 600 10px var(--sans); }
.fw-sales, .fw-book, .fw-note { margin: 4px 0; font-size: 13px; color: var(--soft); }
.fw-sales span { display: inline-block; margin-right: 6px; color: var(--muted); }
.fw-sales span.hit { color: var(--green); font-weight: 700; }
.fw-note { color: var(--muted); font-style: italic; }
.fw-flags { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.fw-flags li { padding-left: 16px; position: relative; color: var(--soft); }
.fw-flags li::before { content: "·"; position: absolute; left: 4px; color: var(--muted-2); }
.fw-flags li.go::before, .fw-flags li.warn::before { content: "!"; font-weight: 700; }
.fw-flags li.go::before { color: var(--green); }
.fw-flags li.warn::before { color: var(--amber); }
@media (max-width: 640px) { .fw-grid { grid-template-columns: 1fr 1fr; } .fw-stat b { font-size: 22px; } }

/* Focus watch: book depth, the panel's lead block */
.fw-depth { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 1.6fr) minmax(150px, .9fr); gap: 20px; align-items: end;
  margin: 12px 0 4px; padding: 14px 16px; background: var(--panel-2); border: 1px solid var(--line-2); border-left: 4px solid var(--muted-2); border-radius: var(--radius); }
.fw-depth.fw-d-deep { border-left-color: var(--neg); }
.fw-depth.fw-d-thin { border-left-color: var(--green); }
.fw-depth.fw-d-normal { border-left-color: var(--accent); }
.fw-dmain { display: flex; flex-direction: column; gap: 4px; align-self: start; }
.fw-dnum { display: flex; align-items: center; gap: 10px; }
.fw-dnum b { font: 400 56px/0.9 var(--display); color: var(--text); }
.fw-dnum span { font-size: 12px; color: var(--muted); line-height: 1.3; }
.fw-ddelta { font: 700 12px var(--sans); color: var(--muted); }
.fw-ddelta.down { color: var(--green); }
.fw-ddelta.up { color: var(--neg); }
.fw-dread { margin: 4px 0 0; font-size: 13px; color: var(--soft); }
.fw-dasof { color: var(--muted-2); font-size: 11px; }
.fw-ladder { position: relative; height: calc(var(--rows) * 11px + 4px); min-height: 70px; display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 3px; align-items: end; padding-top: 4px; }
.fw-col { display: flex; flex-direction: column-reverse; gap: 2px; position: relative; z-index: 1; }
.fw-col i { display: block; height: 9px; border-radius: 1px; background: var(--line-3); }
.fw-col i.in { background: var(--neg); }
.fw-zone { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(240, 82, 77, .10); border-right: 1px dashed rgba(240, 82, 77, .5); }
.fw-zone span { position: absolute; top: -2px; left: 4px; font: 600 10px var(--sans); color: var(--neg); transform: translateY(-100%); white-space: nowrap; }
.fw-ltgt { position: absolute; top: 0; bottom: 0; border-left: 2px dashed var(--green); z-index: 2; }
.fw-ltgt span { position: absolute; top: -2px; left: 4px; transform: translateY(-100%); font: 600 10px var(--sans); color: var(--green); }
.fw-laxis { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted-2); margin-top: 4px; border-top: 1px solid var(--line-2); padding-top: 3px; }
.fw-lnote { margin: 6px 0 0; font-size: 12px; color: var(--green); }
.fw-trend { align-self: stretch; display: flex; flex-direction: column; }
.fw-tbars { flex: 1; min-height: 70px; display: flex; gap: 4px; align-items: stretch; margin-top: 6px; }
.fw-tb { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; min-width: 0; }
.fw-tb i { display: block; width: 100%; background: var(--line-3); border-radius: 2px 2px 0 0; min-height: 2px; }
.fw-tb.now i { background: var(--accent); }
.fw-tb b { font: 600 11px var(--sans); color: var(--muted); }
.fw-tb.now b { color: var(--text); }
.fw-tb small { font-size: 10px; color: var(--muted-2); }
@media (max-width: 900px) { .fw-depth { grid-template-columns: 1fr 1fr; } .fw-dladder { grid-column: 1 / -1; order: 3; } }
@media (max-width: 560px) { .fw-depth { grid-template-columns: 1fr; } }

/* ================= Ghost Bid theme, 2026-10-18 =================
   Same markup and features as before; this block restyles them:
   - the sidebar keeps its layout, in the new colours with a holo edge;
   - Overview panels get a header band; Focus "Near limit" and buy windows get the holo finish. */
body { font-variant-numeric: tabular-nums; }
/* sidebar in the Ghost Bid colours: group labels in the brand colours, a holo edge, the current page as a yellow-marked pill */
.sidebar { background: var(--side); border-right: 0; box-shadow: inset -2px 0 0 0 transparent; }
.sidebar::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 2px; background: linear-gradient(180deg, #ff7eb6, #ffd23f 25%, #5eead4 50%, #7aa2ff 75%, #b48bff); opacity: 0.85; pointer-events: none; }
.nav-group:nth-child(1) .nav-h { color: var(--accent); }
.nav-group:nth-child(2) .nav-h { color: var(--ghost-soft); }
.nav-group:nth-child(3) .nav-h { color: #5eead4; }
.nav a:hover { background: var(--panel); }
.nav a.on { background: var(--hover); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.nav a.on em { color: var(--accent); }
/* header bands on the Overview's panels */
.inbox > .section-title:first-child, .focus-watch > .section-title:first-child, .notes > .section-title:first-child, .custom-index > .section-title:first-child {
  margin: -16px -20px 12px; padding: 9px 20px 7px; background: var(--band); border-radius: 9px 9px 0 0; font-size: 21px; }
.notes > .section-title:first-child { margin: -20px -22px 12px; padding-left: 22px; }
.custom-index > .section-title:first-child { margin: -18px -20px 12px; }
.focus-watch > .section-title:first-child { background: var(--accent); color: var(--on-accent); }
.focus-watch > .section-title:first-child .fw-asof { color: rgba(16, 12, 24, 0.75); }
.focus-watch { border-color: var(--line-2); }
.wl-sec-h { padding: 9px 18px 7px; background: var(--band); }
.wl-sec.wl-owned .wl-sec-h { background: var(--ghost); }
.wl-sec.wl-owned .wl-sec-h .muted, .wl-sec.wl-owned .wl-sec-note { color: rgba(255, 255, 255, 0.8); }
.panel { border-radius: 12px; }
/* holo: the strongest signal only */
.fw-status.close, .fw-status.go { background: var(--holo); color: var(--on-accent); border-color: transparent; }
.vtag.definitely_buy { background: var(--holo); color: var(--on-accent); }
.money > .mn-head:first-child { margin: -16px -20px 10px; padding: 9px 20px 7px; background: var(--band); border-radius: 11px 11px 0 0; align-items: center; }
.money > .mn-head:first-child .section-title { font-size: 21px; }
@media (max-width: 899px) { .money > .mn-head:first-child { margin: -12px -14px 8px; padding: 8px 14px 6px; } .inbox > .section-title:first-child { margin: -12px -14px 10px; padding: 8px 14px 6px; } }
.sidebar .brand { padding: 0 6px; }
.sidebar .brand-word { font-size: 26px; }
.sub-away-th { flex: none; width: 52px; height: 72px; }
