/* ==========================================================================
   Yorvale AI: design system
   Tokens -> base -> layout -> components -> pages. Light, dark, and system themes.
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #f6f6f4; --surface: #ffffff; --surface-2: #f2f2ef; --surface-3: #e9e9e5;
  --border: #e6e5e0; --border-strong: #d5d4ce; --grid: #ecebe6;
  --text: #131312; --text-2: #55544f; --muted: #85847e;
  --accent: #2a78d6; --accent-strong: #1c5cab; --accent-soft: #e8f1fc; --on-accent: #ffffff;
  --up: #0b7a3b; --up-soft: #e4f4ea; --down: #c92a2a; --down-soft: #fbe9e9; --warn: #b36b00; --warn-soft: #fdf1dc;
  --t-great: #12a150; --t-good: #78b21a; --t-ok: #e0a100; --t-weak: #e8702a; --t-poor: #d63b3b;
  --lv-very_bearish: #d93636; --lv-bearish: #f0872a; --lv-neutral: #f2c230; --lv-bullish: #7bc86c; --lv-very_bullish: #1f9d55;
  --star: #f2a900;
  --shadow-sm: 0 1px 2px rgba(19,19,18,.05); --shadow-md: 0 10px 30px rgba(19,19,18,.12);
  --radius: 14px; --radius-sm: 10px;
  --header-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #0e0e0d; --surface: #171716; --surface-2: #1f1f1e; --surface-3: #292927;
    --border: #2a2a28; --border-strong: #3a3a37; --grid: #232321;
    --text: #f5f5f2; --text-2: #b9b8b0; --muted: #86857d;
    --accent: #4d94ee; --accent-strong: #7db0f5; --accent-soft: #14233a; --on-accent: #0b1220;
    --up: #3ccf7c; --up-soft: #112a1c; --down: #f27474; --down-soft: #321818; --warn: #f2b84b; --warn-soft: #33270f;
    --t-great: #34d17a; --t-good: #a3d94a; --t-ok: #f2b84b; --t-weak: #f58a54; --t-poor: #f06a6a;
    --lv-very_bearish: #f06a6a; --lv-bearish: #fb923c; --lv-neutral: #f5c542; --lv-bullish: #86d36f; --lv-very_bullish: #34d17a;
    --star: #f5b301;
    --shadow-sm: none; --shadow-md: 0 14px 36px rgba(0,0,0,.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0e0d; --surface: #171716; --surface-2: #1f1f1e; --surface-3: #292927;
  --border: #2a2a28; --border-strong: #3a3a37; --grid: #232321;
  --text: #f5f5f2; --text-2: #b9b8b0; --muted: #86857d;
  --accent: #4d94ee; --accent-strong: #7db0f5; --accent-soft: #14233a; --on-accent: #0b1220;
  --up: #3ccf7c; --up-soft: #112a1c; --down: #f27474; --down-soft: #321818; --warn: #f2b84b; --warn-soft: #33270f;
  --t-great: #34d17a; --t-good: #a3d94a; --t-ok: #f2b84b; --t-weak: #f58a54; --t-poor: #f06a6a;
  --lv-very_bearish: #f06a6a; --lv-bearish: #fb923c; --lv-neutral: #f5c542; --lv-bullish: #86d36f; --lv-very_bullish: #34d17a;
  --star: #f5b301;
  --shadow-sm: none; --shadow-md: 0 14px 36px rgba(0,0,0,.5);
}

/* ---------- base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 14.5px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
input, select { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.num { font-variant-numeric: tabular-nums; }
.r { text-align: right; }
.up { color: var(--up); } .down { color: var(--down); } .muted { color: var(--muted); }
.mini { font-size: 12px; color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border); }
.skip:focus { left: 8px; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- tier colours (magnitude of rating) */
.r-great { --tier: var(--t-great); } .r-good { --tier: var(--t-good); } .r-ok { --tier: var(--t-ok); } .r-weak { --tier: var(--t-weak); } .r-poor { --tier: var(--t-poor); }

/* ---------- header */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--border); }
.bar { display: flex; align-items: center; gap: 22px; height: var(--header-h); }
.logo { display: flex; align-items: center; gap: 10px; flex: none; }
.logo.static { margin-bottom: 10px; }
.wordmark { font-weight: 650; font-size: 17px; letter-spacing: -.02em; display: inline-flex; align-items: center; gap: 6px; }
.wordmark .ai { font-size: 11px; font-weight: 650; letter-spacing: .04em; background: var(--accent-soft); color: var(--accent-strong); padding: 2px 6px; border-radius: 6px; }
.nav { display: flex; gap: 2px; height: 100%; }
.nav button { position: relative; display: flex; align-items: center; gap: 7px; padding: 0 10px; color: var(--text-2); font-weight: 500; transition: color .15s; }
.nav button:hover { color: var(--text); }
.nav button.on { color: var(--text); }
.nav button.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.nav button.on .ic { color: var(--accent); }
.bar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.search { position: relative; width: 220px; transition: width .2s; }
.search:focus-within { width: 300px; }
.search input { width: 100%; height: 36px; padding: 0 34px 0 36px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); outline: none; }
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.search .s-ic { position: absolute; left: 11px; top: 9px; color: var(--muted); pointer-events: none; }
.search kbd { position: absolute; right: 9px; top: 8px; font: 500 11px/18px Inter, sans-serif; color: var(--muted); border: 1px solid var(--border-strong); border-radius: 5px; padding: 0 6px; background: var(--surface-2); pointer-events: none; }
.search:focus-within kbd { display: none; }
.results { position: absolute; top: 42px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-md); overflow: hidden; max-height: 70vh; overflow-y: auto; z-index: 40; }
.results a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; }
.results a:hover, .results a.active { background: var(--surface-2); }
.rs-main { display: flex; gap: 8px; min-width: 0; align-items: baseline; }
.rs-main span { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.rs-tag { font-size: 11px; font-weight: 600; color: var(--muted); background: var(--surface-2); padding: 2px 8px; border-radius: 999px; }
.rs-empty { padding: 14px; color: var(--muted); }
.iconbtn { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--text-2); transition: background .15s, color .15s; }
.iconbtn:hover { background: var(--surface-3); color: var(--text); }
.iconbtn.sm { width: 28px; height: 28px; border-radius: 8px; }
.acct { position: relative; display: flex; align-items: center; gap: 8px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 650; font-size: 14px; }
.dot { position: absolute; top: 2px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--down); color: #fff; font: 700 10px/16px Inter, sans-serif; text-align: center; font-style: normal; box-shadow: 0 0 0 2px var(--bg); }
.menu, .notes { position: absolute; top: 46px; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-md); z-index: 50; overflow: hidden; }
.menu { width: 240px; padding: 6px; }
.menu-id { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; display: grid; }
.menu-id small { color: var(--muted); font-size: 12px; } .menu-id b { font-weight: 550; overflow: hidden; text-overflow: ellipsis; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 8px; color: var(--text-2); text-align: left; }
.menu-item:hover { background: var(--surface-2); color: var(--text); }
.notes { width: min(400px, calc(100vw - 24px)); max-height: 70vh; overflow: auto; }
.nhead { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.note { display: block; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
.note:last-child { border-bottom: 0; } .note:hover { background: var(--surface-2); }
.note.new { background: var(--accent-soft); }
.note small { display: block; color: var(--muted); margin-top: 3px; }
.note-empty { padding: 24px 16px; color: var(--muted); text-align: center; }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); font-weight: 550; transition: background .15s, border-color .15s, filter .15s; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.06); background: var(--accent); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }
.btn.block { width: 100%; height: 40px; }
.btn:disabled { opacity: .6; cursor: default; }
.btnrow { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.linkbtn { color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }
.linkbtn:hover { color: var(--text); }
.star { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--muted); transition: background .15s, color .15s; }
.star:hover { background: var(--surface-3); color: var(--star); }
.star.on, .btn.watch.on { color: var(--star); }
.star.on .ic, .btn.watch.on .ic { fill: var(--star); }
.btn.watch.on { border-color: color-mix(in srgb, var(--star) 55%, var(--border)); }

/* ---------- page scaffolding */
main { padding-top: 28px; padding-bottom: 56px; min-height: 70vh; outline: none; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.pagehead h1 { font-size: 30px; line-height: 1.15; letter-spacing: -.025em; font-weight: 650; }
.pagehead .sub { color: var(--text-2); margin-top: 6px; max-width: 640px; }
.live { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 3px color-mix(in srgb, var(--up) 22%, transparent); }

.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpis.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow-sm); min-width: 0; }
.kpi .lbl { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi .val { font-size: 28px; line-height: 1.1; font-weight: 650; letter-spacing: -.025em; }
.kpi .val.sm { font-size: 18px; letter-spacing: -.01em; }
.kpi .val-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi .sub { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kpi .sub a { color: var(--accent-strong); }
.skel-val { display: block; height: 28px; width: 60%; border-radius: 8px; background: var(--surface-3); animation: pulse 1.3s ease-in-out infinite; }
.dotkey { width: 8px; height: 8px; border-radius: 50%; background: var(--tier); flex: none; }
@keyframes pulse { 50% { opacity: .5; } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); min-width: 0; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-h h2 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; letter-spacing: -.005em; }
.card-h h2 .ic { color: var(--muted); width: 17px; height: 17px; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; } .c7 { grid-column: span 7; } .c12 { grid-column: span 12; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.fine { font-size: 12.5px; color: var(--muted); margin-top: 14px; }
.fine.inline { margin: 0; }
.lead { font-size: 17px; font-weight: 600; letter-spacing: -.01em; line-height: 1.4; margin-bottom: 10px; }
.about { color: var(--text-2); font-size: 14px; }
.about.body { font-size: 14.5px; margin-bottom: 4px; }
.strong { color: var(--text); font-weight: 550; font-size: 13.5px; margin-top: 8px; }
.src { font-size: 12px; font-weight: 550; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.src.claude { background: var(--accent-soft); color: var(--accent-strong); }
.th { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.brief { margin-bottom: 22px; }
.callout { background: var(--surface-2); border-radius: 12px; padding: 16px; border: 1px solid transparent; }
.callout h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.callout p { color: var(--text-2); font-size: 14px; }
.callout.t-undervalued { background: var(--up-soft); } .callout.t-overvalued { background: var(--down-soft); } .callout.t-comeback { background: var(--accent-soft); }
.notice { padding: 14px 16px; border-radius: 12px; background: var(--surface-2); margin: 16px 0; }
.notice.err { background: var(--down-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--down) 35%, transparent); }
.empty-state { text-align: center; padding: 44px 20px; }
.empty-state h3 { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.empty-state p { color: var(--text-2); max-width: 440px; margin: 0 auto; }
.skel { display: grid; gap: 12px; }
.skel i { display: block; height: 14px; border-radius: 7px; background: var(--surface-3); animation: pulse 1.3s ease-in-out infinite; }

ul.pts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
ul.pts li { position: relative; padding-left: 20px; color: var(--text); font-size: 14px; }
ul.pts li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 8px; height: 8px; border-radius: 50%; }
ul.pts.g li::before { background: var(--up); } ul.pts.b li::before { background: var(--down); }
.alist { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.alist li { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--surface-2); border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.alform { display: flex; flex-wrap: wrap; gap: 8px; }
.alform select, .alform input { height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); }
.alform input { width: 110px; }
.derr { color: var(--down); font-size: 13px; min-height: 18px; }

/* ---------- tags, chips, ratings */
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 550; white-space: nowrap; background: var(--surface-2); color: var(--text-2); }
.tag .ic { width: 12px; height: 12px; }
.tag.t-undervalued { background: var(--up-soft); color: var(--up); } .tag.t-overvalued { background: var(--down-soft); color: var(--down); }
.tag.t-comeback { background: var(--accent-soft); color: var(--accent-strong); }
.tag.big { font-size: 14px; padding: 4px 12px; font-weight: 600; }
.tags { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.rating { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 56px; height: 28px; padding: 0 10px; border-radius: 999px; background: color-mix(in srgb, var(--tier) 13%, var(--surface)); font-weight: 650; font-variant-numeric: tabular-nums; }
.rating i { width: 7px; height: 7px; border-radius: 50%; background: var(--tier); }
.trend { display: block; font-size: 11px; font-weight: 600; margin-top: 2px; }
.chg { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 550; font-variant-numeric: tabular-nums; padding: 2px 8px 2px 5px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.chg .ic { width: 12px; height: 12px; stroke-width: 2.4; }
.chg.up { background: var(--up-soft); color: var(--up); } .chg.down { background: var(--down-soft); color: var(--down); }
.since { display: block; font-size: 12px; }
.spark path { stroke: var(--up); } .spark.down path { stroke: var(--down); }
.range { position: relative; display: block; width: 100px; height: 4px; border-radius: 2px; background: var(--surface-3); margin: 6px 0 8px; }
.range i { position: absolute; top: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); transform: translateX(-50%); box-sizing: content-box; margin-top: -2px; }

/* tabs + chips */
.tabsline { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabsline::-webkit-scrollbar { display: none; }
.tabsline button { position: relative; display: flex; align-items: center; gap: 7px; padding: 10px 14px; color: var(--text-2); font-weight: 500; white-space: nowrap; }
.tabsline button:hover { color: var(--text); }
.tabsline button.on { color: var(--text); font-weight: 600; }
.tabsline button.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px; }
.tabsline .count { font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--surface-3); padding: 1px 7px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.tabsline .count:empty { display: none; }
.sectors { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: thin; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font-weight: 500; font-size: 13.5px; white-space: nowrap; transition: border-color .15s, background .15s; }
.chip:hover { border-color: var(--muted); }
.chip b { font-size: 12px; font-weight: 600; color: var(--muted); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip.on b { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.hint { color: var(--text-2); font-size: 13.5px; margin: 4px 0 14px; max-width: 880px; }
.hint b { color: var(--text); }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.selectwrap { display: inline-flex; align-items: center; gap: 8px; }
.selectwrap select { height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
.progress { position: relative; background: var(--surface-2); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-size: 13px; color: var(--text-2); overflow: hidden; }
.progress i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); transition: width .4s; }
.seg-tabs { display: inline-flex; gap: 2px; background: var(--surface-3); padding: 3px; border-radius: 10px; }
.seg-tabs button { padding: 6px 14px; border-radius: 8px; font-weight: 550; color: var(--text-2); }
.seg-tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg-tabs.sm button { padding: 4px 11px; font-size: 13px; }

/* ---------- table */
.table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: clip; --cols: 36px minmax(190px, 2.4fr) minmax(90px, 1fr) 96px minmax(130px, 1.2fr) 84px 150px 96px 36px; }
.thead, .trow { display: grid; grid-template-columns: var(--cols); gap: 14px; align-items: center; padding: 0 18px; }
.thead { height: 38px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--border); position: sticky; top: var(--header-h); z-index: 5; }
.trow { min-height: 62px; border-top: 1px solid var(--border); transition: background .12s; }
.thead + .trow { border-top: 0; }
.trow:hover { background: var(--surface-2); }
.rk { color: var(--muted); font-size: 13px; }
.asset { display: flex; align-items: center; gap: 12px; min-width: 0; }
.asset > div { min-width: 0; }
.asset b { display: block; font-weight: 600; line-height: 1.25; }
.asset span { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo-sm, .logo-lg { border-radius: 50%; flex: none; object-fit: cover; background: var(--surface-3); }
.logo-sm { width: 32px; height: 32px; } .logo-lg { width: 52px; height: 52px; }
.logo-sm.ph, .logo-lg.ph { display: grid; place-items: center; font-weight: 650; font-size: 12px; color: var(--text-2); background: var(--surface-3); }
.logo-lg.ph { font-size: 16px; }
.pricecell b { font-weight: 600; display: block; }
.mob-only { display: none; }
.trendcell { display: flex; flex-direction: column; justify-content: center; }
.ratingcell { display: flex; flex-direction: column; align-items: flex-end; }

/* ---------- detail */
.crumbs { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.crumbs a:hover { color: var(--text); } .crumbs .ic { width: 14px; height: 14px; }
.dhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; margin-bottom: 20px; }
.dident { display: flex; gap: 16px; align-items: center; min-width: 0; }
.dident h1 { font-size: 28px; line-height: 1.15; letter-spacing: -.025em; font-weight: 650; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.symbadge { font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--text-2); background: var(--surface-3); padding: 3px 9px; border-radius: 8px; }
.dmeta { color: var(--text-2); margin-top: 4px; }
.stags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.stag { font-size: 12px; font-weight: 500; color: var(--text-2); padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border-strong); }
.dprice { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.pricebig { font-size: 40px; line-height: 1; font-weight: 650; letter-spacing: -.03em; }
.pricechg { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.col-main, .col-side { display: grid; gap: 16px; min-width: 0; }
.col-side { position: sticky; top: calc(var(--header-h) + 16px); }
.ring-track { stroke: var(--surface-3); } .ring-fill { stroke: var(--tier); }
.fvbar { margin-top: 18px; }
.fvtrack { position: relative; height: 6px; border-radius: 3px; background: var(--surface-3); }
.fvtrack i { position: absolute; top: -4px; width: 14px; height: 14px; border-radius: 50%; transform: translateX(-50%); border: 3px solid var(--surface-2); box-sizing: border-box; }
.fv-price { background: var(--text); } .fv-fair { background: var(--accent); }
.fvkey { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--text-2); margin-top: 12px; flex-wrap: wrap; }
.fvkey i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.k-price { background: var(--text); } .k-fair { background: var(--accent); }
.chart-meta { display: flex; align-items: baseline; gap: 10px; margin: -2px 0 8px; font-size: 13.5px; }
.chart-meta .num { font-weight: 650; font-size: 15px; }
.chartbox { position: relative; }
#ch { display: block; width: 100%; height: 300px; touch-action: pan-y; }
#ch .grid { stroke: var(--grid); stroke-width: 1; }
#ch .axis { fill: var(--muted); font-size: 11px; font-family: Inter, sans-serif; font-variant-numeric: tabular-nums; }
#ch .cross { stroke: var(--text-2); stroke-width: 1; }
.ctip { position: absolute; pointer-events: none; display: flex; flex-direction: column; gap: 1px; padding: 6px 10px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow-md); font-size: 12px; color: var(--muted); z-index: 5; white-space: nowrap; }
.ctip b { color: var(--text); font-size: 14px; font-weight: 650; }
.tableview { margin-top: 12px; font-size: 13px; }
.tableview summary { cursor: pointer; color: var(--text-2); width: max-content; }
.tv-scroll { max-height: 240px; overflow: auto; margin-top: 8px; }
.ltable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ltable th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 600; padding: 6px 4px; border-bottom: 1px solid var(--border); }
.ltable th.r, .ltable td.r { text-align: right; }
.ltable td { padding: 8px 4px; border-bottom: 1px solid var(--border); }
.ltable tr:last-child td { border-bottom: 0; }
.prow { padding: 12px 0; border-top: 1px solid var(--border); }
.prow:first-of-type { border-top: 0; padding-top: 2px; }
.prow-h { display: flex; justify-content: space-between; font-weight: 550; margin-bottom: 7px; }
.prow p { color: var(--muted); font-size: 12.5px; margin-top: 7px; }
.mbar { height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--tier, var(--accent)) 14%, var(--surface-3)); overflow: hidden; }
.mbar i { display: block; height: 100%; border-radius: 3px; background: var(--tier); }
.dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 28px; margin: 0; }
.dli { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.dli dt { color: var(--text-2); font-size: 13.5px; } .dli dd { margin: 0; font-weight: 550; text-align: right; }
.q { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: var(--surface-3); color: var(--muted); font-size: 10px; font-weight: 700; cursor: help; vertical-align: 1px; }

/* ---------- sentiment */
.gs.lv-very_bearish { stroke: var(--lv-very_bearish); } .gs.lv-bearish { stroke: var(--lv-bearish); } .gs.lv-neutral { stroke: var(--lv-neutral); } .gs.lv-bullish { stroke: var(--lv-bullish); } .gs.lv-very_bullish { stroke: var(--lv-very_bullish); }
.seg.lv-very_bearish { background: var(--lv-very_bearish); } .seg.lv-bearish { background: var(--lv-bearish); } .seg.lv-neutral { background: var(--lv-neutral); } .seg.lv-bullish { background: var(--lv-bullish); } .seg.lv-very_bullish { background: var(--lv-very_bullish); }
.lvtag, .lvbig { display: inline-block; font-weight: 600; white-space: nowrap; color: #fff; }
.lvtag { padding: 2px 10px; border-radius: 999px; font-size: 12px; }
.lvtag.big { font-size: 15px; padding: 4px 14px; }
.lvbig { padding: 6px 18px; border-radius: 12px; font-size: 19px; }
.lv-very_bearish.lvtag, .lv-very_bearish.lvbig { background: var(--lv-very_bearish); } .lv-bearish.lvtag, .lv-bearish.lvbig { background: var(--lv-bearish); color: #3a1414; }
.lv-neutral.lvtag, .lv-neutral.lvbig { background: var(--lv-neutral); color: #1d1d1b; } .lv-bullish.lvtag, .lv-bullish.lvbig { background: var(--lv-bullish); color: #0f2a18; } .lv-very_bullish.lvtag, .lv-very_bullish.lvbig { background: var(--lv-very_bullish); }
.lvtag.none { background: var(--surface-3); color: var(--muted); }
.gcard { text-align: center; }
.gcard .card-h { text-align: left; }
.gauge-svg { width: 100%; max-width: 340px; height: auto; display: block; margin: 4px auto 0; }
.gl { fill: var(--muted); font-size: 11px; font-weight: 500; }
.glevel { margin-top: 4px; }
.gscore { font-size: 36px; font-weight: 650; letter-spacing: -.03em; margin-top: 8px; }
.gscore.sm { font-size: 22px; margin: 8px 0 10px; }
.gscore small { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 3px; letter-spacing: 0; }
.gchg { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 550; }
.meter { position: relative; display: flex; height: 8px; gap: 2px; margin: 8px 0; }
.meter .seg { flex: 1; opacity: .9; }
.meter .seg:first-child { border-radius: 4px 0 0 4px; } .meter .seg:last-child { border-radius: 0 4px 4px 0; }
.meter .mk { position: absolute; top: -4px; width: 4px; height: 16px; background: var(--text); border-radius: 2px; transform: translateX(-2px); box-shadow: 0 0 0 2px var(--surface); }
.crow { padding: 12px 0; border-top: 1px solid var(--border); }
.crow.na { opacity: .6; }
.chead { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.cname { font-weight: 550; font-size: 14px; }
.src2 { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.cdetail { font-size: 13px; color: var(--muted); }
.cdetail b { color: var(--text); }
.crowd { display: inline-flex; align-items: center; gap: 3px; color: var(--warn); font-size: 12px; font-weight: 600; margin-left: 6px; }
.crowd .ic { width: 12px; height: 12px; }
.trendgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.tcard { display: block; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; transition: background .12s; }
a.tcard:hover { background: var(--surface-3); }
.tsym { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.sig { display: grid; grid-template-columns: 1fr auto 44px; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.sig small { text-align: right; color: var(--muted); }

/* ---------- dialog */
.dlg { border: 1px solid var(--border); border-radius: 18px; padding: 24px; width: min(420px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-md); }
.dlg::backdrop { background: rgba(8, 10, 14, .55); backdrop-filter: blur(3px); }
.dlg form { display: grid; gap: 14px; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; }
.dlg-head h2 { font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.dlg .seg-tabs { display: flex; } .dlg .seg-tabs button { flex: 1; }
.dsub { color: var(--text-2); font-size: 14px; }
.dlg label { display: grid; gap: 6px; font-size: 13px; font-weight: 550; color: var(--text-2); }
.dlg input { height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--bg); outline: none; }
.dlg input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.tip { position: fixed; z-index: 80; max-width: 270px; background: #1c1c1b; color: #f5f5f2; padding: 9px 12px; border-radius: 10px; font-size: 13px; line-height: 1.45; box-shadow: var(--shadow-md); pointer-events: none; }

/* ---------- footer */
.foot { border-top: 1px solid var(--border); background: var(--surface); padding: 40px 0 48px; margin-top: 24px; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 32px; }
.foot-brand p { color: var(--text-2); max-width: 340px; font-size: 13.5px; }
.foot-col { display: grid; gap: 8px; align-content: start; font-size: 13.5px; color: var(--text-2); }
.foot-col h4 { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.foot-col a:hover { color: var(--text); }
.foot-legal { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); padding-top: 24px; border-top: 1px solid var(--border); max-width: 900px; }
.foot-legal strong { color: var(--text-2); }
.agentline { margin-top: 14px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.agentline a { color: var(--accent-strong); font-weight: 550; }

/* ---------- responsive */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: 1fr; }
  .col-side { position: static; }
}
@media (max-width: 1500px) {
  .nav button span { display: none; }
  .nav button.on span { display: inline; }
  .search { width: 190px; } .search:focus-within { width: 260px; }
}
@media (max-width: 860px) {
  :root { --header-h: 56px; }
  .wrap { padding: 0 16px; }
  .top { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); } /* backdrop-filter would make the header the containing block of the fixed bottom nav */
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .bar { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; row-gap: 10px; gap: 10px; }
  .bar-right { display: contents; }
  .logo { order: 1; } #themebtn { order: 2; margin-left: auto; } .acct { order: 3; }
  .search { order: 4; flex: 1 1 100%; width: 100%; } .search:focus-within { width: 100%; } .search kbd { display: none; }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: auto; display: grid; grid-template-columns: repeat(7, 1fr); gap: 0; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .nav button, .nav button.on { flex-direction: column; gap: 3px; padding: 6px 0; font-size: 11px; justify-content: center; }
  .nav button span, .nav button.on span { display: inline; }
  .nav button.on::after { display: none; }
  .thead { top: 0; position: static; }
  .pagehead h1, .dident h1 { font-size: 24px; }
  .kpis, .kpis.four, .kpis.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis > .kpi:last-child:nth-child(odd) { grid-column: span 2; }
  .kpi .val { font-size: 24px; }
  .grid { gap: 12px; } .c4, .c5, .c6, .c7 { grid-column: span 12; }
  .two { grid-template-columns: 1fr; gap: 18px; }
  .dl { grid-template-columns: 1fr; }
  .dhead { flex-direction: column; } .dprice { align-items: flex-start; text-align: left; } .pricebig { font-size: 34px; }
  .table { --cols: 22px minmax(0, 1fr) auto 66px 32px; }
  .thead, .trow { gap: 10px; padding: 0 12px; }
  .hide-m { display: none !important; }
  .mob-only { display: block; margin-top: 2px; }
  .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; }
  .card { padding: 18px; }
  .menu, .notes { position: fixed; top: 64px; right: 12px; left: 12px; width: auto; }
}

@media (max-width: 520px) { #si { display: none; } .acct .btn.primary { height: 34px; padding: 0 12px; } }

/* ETF top holdings */
.hold { display: grid; gap: 12px; }
.hrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; }
.hn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.hn b { color: var(--text); font-weight: 600; margin-right: 4px; }
.hp { font-weight: 600; }
.hbar { grid-column: 1 / -1; height: 5px; }
.hbar i { background: var(--accent); }

.kpis.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* studio */
.studio-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.studio-add { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.studio-list { display: grid; gap: 16px; }
.post-text { width: 100%; resize: vertical; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font: 400 15px/1.5 Inter, system-ui, sans-serif; outline: none; }
.post-text:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.post-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 8px 0 4px; flex-wrap: wrap; }
.count-x { font-weight: 600; font-size: 13px; color: var(--text-2); }
.count-x.over { color: var(--down); }
.checks { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.checks li { display: flex; gap: 8px; align-items: flex-start; }
.checks .ic { width: 15px; height: 15px; margin-top: 3px; }
.checks .ok { color: var(--up); } .checks .warn { color: var(--warn); } .checks .bad { color: var(--down); }
.post-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.poststatus { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
.poststatus.s-approved { background: var(--accent-soft); color: var(--accent-strong); } .poststatus.s-posted { background: var(--up-soft); color: var(--up); }

/* ---------- key numbers scorecard ---------- */
.sc-summary { display: grid; gap: 10px; background: var(--surface-2); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.sc-sumtext { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.sc-sumtext b { font-size: 15px; font-weight: 600; } .sc-sumtext span { color: var(--text-2); font-size: 13px; }
.sc-bar { display: flex; gap: 2px; height: 8px; }
.sc-bar i { border-radius: 4px; min-width: 6px; }
.sb-good { background: var(--up); } .sb-fair { background: var(--warn); } .sb-poor { background: var(--down); }
.sc-legend { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.sc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 14px; height: 6px; border-radius: 3px; display: inline-block; }
.lg-good { background: color-mix(in srgb, var(--up) 55%, var(--surface)); } .lg-fair { background: color-mix(in srgb, var(--warn) 55%, var(--surface)); } .lg-poor { background: color-mix(in srgb, var(--down) 50%, var(--surface)); }
.lg-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--border-strong); display: inline-block; }
.lg-tick { width: 2px; height: 12px; background: var(--text-2); display: inline-block; }
.sc-group { margin-top: 18px; }
.sc-gh { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding-bottom: 6px; border-bottom: 1px solid var(--border-strong); }
.sc-gh h3 { font-size: 13px; font-weight: 650; letter-spacing: .02em; text-transform: uppercase; color: var(--text-2); }
.sc-gh p { font-size: 12.5px; color: var(--muted); }
.sc-row { display: grid; grid-template-columns: minmax(150px, 1.5fr) 88px minmax(110px, 1.1fr) minmax(130px, auto); gap: 8px 16px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); }
.sc-row:last-child { border-bottom: 0; }
.sc-label { font-weight: 550; font-size: 14px; }
.sc-note { font-size: 12.5px; color: var(--muted); line-height: 1.4; margin-top: 1px; }
.sc-val { text-align: right; font-weight: 650; font-size: 15px; }
.gz { position: relative; height: 8px; border-radius: 4px; background: var(--surface-3); margin: 4px 6px; }
.gz.none { background: transparent; }
.gz .z { position: absolute; top: 0; height: 100%; opacity: .85; }
.z-good { background: color-mix(in srgb, var(--up) 55%, var(--surface)); } .z-fair { background: color-mix(in srgb, var(--warn) 55%, var(--surface)); } .z-poor { background: color-mix(in srgb, var(--down) 50%, var(--surface)); } .z-neutral { background: var(--surface-3); }
.gz .z:first-child { border-radius: 4px 0 0 4px; } .gz .z:last-of-type { border-radius: 0 4px 4px 0; }
.gz .gm { position: absolute; top: 50%; width: 11px; height: 11px; border-radius: 50%; background: var(--text); transform: translate(-50%, -50%); box-shadow: 0 0 0 2px var(--surface); }
.gz .gm.clip-high { border-radius: 3px 50% 50% 3px; } .gz .gm.clip-low { border-radius: 50% 3px 3px 50%; }
.gz .gb { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text-2); transform: translateX(-1px); text-decoration: none; opacity: .85; }
.sc-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.vchip { display: inline-block; font-size: 12px; font-weight: 650; padding: 2px 10px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
.vchip.v-good { background: var(--up-soft); color: var(--up); } .vchip.v-fair { background: var(--warn-soft); color: var(--warn); } .vchip.v-poor { background: var(--down-soft); color: var(--down); }
.trchip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px 2px 6px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.trchip .ic { width: 12px; height: 12px; stroke-width: 2.4; }
.trchip.tr-improving { background: var(--up-soft); color: var(--up); } .trchip.tr-worsening { background: var(--down-soft); color: var(--down); }
.mb rect { fill: currentColor; opacity: .35; } .mb rect.cur { opacity: 1; }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tcell { background: var(--surface-2); border-radius: 12px; padding: 14px; min-width: 0; }
.tc-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; font-weight: 550; color: var(--text-2); flex-wrap: wrap; }
.tc-v { font-size: 22px; font-weight: 650; letter-spacing: -.02em; margin-top: 6px; }
.tc-s { font-size: 12px; color: var(--muted); min-height: 16px; margin-bottom: 6px; }
.bc { display: block; } .bc .old { fill: color-mix(in srgb, var(--accent) 38%, var(--surface-2)); } .bc .cur { fill: var(--accent); }
.bc rect:hover, .bc rect:focus { filter: brightness(1.12); outline: none; }
.bc .zero { stroke: var(--border-strong); stroke-width: 1; } .bc .ax { fill: var(--muted); font-size: 10px; font-family: Inter, sans-serif; }
@media (max-width: 860px) {
  .sc-row { grid-template-columns: 1fr auto; }
  .sc-gauge { grid-column: 1 / -1; order: 3; } .sc-chips { grid-column: 1 / -1; order: 4; justify-content: flex-start; }
}

/* lit-up zone: the part of the gauge this number falls in glows; the rest dims */
.z-good { --zc: var(--up); } .z-fair { --zc: var(--warn); } .z-poor { --zc: var(--down); }
.gz .z-good, .gz .z-fair, .gz .z-poor { background: color-mix(in srgb, var(--zc) 55%, var(--surface)); opacity: .32; transition: opacity .3s ease, box-shadow .3s ease, background .3s ease; }
.gz .z.on { opacity: 1; background: var(--zc); box-shadow: 0 0 12px color-mix(in srgb, var(--zc) 65%, transparent); animation: zoneGlow 2.6s ease-in-out infinite; }
@keyframes zoneGlow { 50% { box-shadow: 0 0 6px color-mix(in srgb, var(--zc) 40%, transparent); } }

/* sentiment: yellow middle, readable chip text, historical scores */
.lv-very_bearish.lvtag, .lv-very_bearish.lvbig, .lv-very_bullish.lvtag, .lv-very_bullish.lvbig { color: #fff; }
.lv-bearish.lvtag, .lv-bearish.lvbig { color: #2a1204; } .lv-neutral.lvtag, .lv-neutral.lvbig { color: #2b2200; } .lv-bullish.lvtag, .lv-bullish.lvbig { color: #0f2a18; }
:root { --lvt-very_bearish: #c92a2a; --lvt-bearish: #c2620a; --lvt-neutral: #9a7600; --lvt-bullish: #2f8a43; --lvt-very_bullish: #0b7a3b; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) { --lvt-very_bearish: #f27474; --lvt-bearish: #fb923c; --lvt-neutral: #f5c542; --lvt-bullish: #86d36f; --lvt-very_bullish: #3ccf7c; } }
:root[data-theme="dark"] { --lvt-very_bearish: #f27474; --lvt-bearish: #fb923c; --lvt-neutral: #f5c542; --lvt-bullish: #86d36f; --lvt-very_bullish: #3ccf7c; }
.lvt-very_bearish { color: var(--lvt-very_bearish); } .lvt-bearish { color: var(--lvt-bearish); } .lvt-neutral { color: var(--lvt-neutral); } .lvt-bullish { color: var(--lvt-bullish); } .lvt-very_bullish { color: var(--lvt-very_bullish); }
.gbadge { font: 700 11px Inter, sans-serif; fill: var(--text); }
.hist { display: grid; }
.hrow2 { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.hl-wrap { display: grid; gap: 1px; }
.hl { font-size: 13px; color: var(--text-2); } .hl em { font-style: normal; color: var(--muted); margin-left: 4px; }
.hs { font-size: 13px; font-weight: 600; }
.hs:not([class*="lvt-"]) { color: var(--muted); }
.hv { font-size: 30px; font-weight: 650; letter-spacing: -.02em; }
.hchart { display: block; margin-top: 14px; border-radius: 8px; }
.hchart .hb { opacity: .16; } .hchart .hb.lv-very_bearish { fill: var(--lv-very_bearish); } .hchart .hb.lv-bearish { fill: var(--lv-bearish); } .hchart .hb.lv-neutral { fill: var(--lv-neutral); } .hchart .hb.lv-bullish { fill: var(--lv-bullish); } .hchart .hb.lv-very_bullish { fill: var(--lv-very_bullish); }
.hchart .ax { fill: var(--muted); font-size: 10px; font-family: Inter, sans-serif; }

/* fear & greed page additions */
.sectitle { margin-top: 8px; } .sectitle h2 { font-size: 17px; font-weight: 650; } .sectitle p { color: var(--text-2); font-size: 13.5px; margin-top: 2px; }
.drv { display: grid; grid-template-columns: 1fr 1fr; gap: 0 36px; }
@media (max-width: 860px) { .drv { grid-template-columns: 1fr; } }

/* ---------- futures & leverage */
.lsbar { display: flex; height: 30px; border-radius: 8px; overflow: hidden; gap: 2px; }
.lsbar i { display: flex; align-items: center; min-width: 0; font-style: normal; font-size: 12.5px; font-weight: 650; color: #fff; padding: 0 9px; white-space: nowrap; overflow: hidden; }
.lsbar .ls-long { background: var(--up); justify-content: flex-start; } .lsbar .ls-short { background: var(--down); justify-content: flex-end; }
.lsbar.big { height: 40px; font-size: 14px; } .lsbar.big i { font-size: 14px; }
.lsbar.thin { height: 10px; } .lsbar.thin i { padding: 0; }
.ftbl .lsbar { height: 22px; min-width: 130px; } .ftbl .lsbar i { font-size: 11.5px; padding: 0 6px; }
.liqkey { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); margin-top: 6px; flex-wrap: wrap; }
.leantag { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text-2); }
.leantag.lean-long, .leantag.lean-short { background: var(--accent-soft); color: var(--accent-strong); }
.leantag.lean-crowded_long, .leantag.lean-crowded_short { background: var(--warn-soft); color: var(--warn); }
.heat { padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; margin-left: 4px; }
.heat-low { background: var(--up-soft); color: var(--up); } .heat-moderate { background: var(--warn-soft); color: var(--warn); } .heat-high { background: var(--down-soft); color: var(--down); }
.fblock { margin-top: 16px; } .fblock:first-of-type { margin-top: 0; }
.fl { font-size: 12.5px; color: var(--muted); font-weight: 550; margin-bottom: 6px; }
.fv { font-size: 18px; font-weight: 650; } .fs { font-size: 12px; color: var(--muted); margin-top: 2px; }
.fstats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 16px; }
.fstats .fl { margin-bottom: 2px; }
.flags { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.flags li { display: flex; gap: 8px; font-size: 13px; color: var(--text-2); }
.flags .ic { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--warn); }
.liqgrid { display: grid; gap: 14px; }
.tablewrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.ftbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.ftbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
.ftbl td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ftbl td.num, .ftbl th:nth-child(n+3) { white-space: nowrap; }
.ftbl tr:last-child td { border-bottom: 0; }
.ftbl.wide { min-width: 880px; }
.meter.pct { margin: 8px 0 6px; }
@media (max-width: 720px) {
  .ftbl.stack.wide { min-width: 0; } .ftbl.stack thead { display: none; }
  .ftbl.stack, .ftbl.stack tbody, .ftbl.stack tr, .ftbl.stack td { display: block; width: 100%; }
  .ftbl.stack tr { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .ftbl.stack td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; }
  .ftbl.stack td::before { content: attr(data-l); color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; flex: none; }
  .ftbl.stack td.wide { display: block; text-align: left; } .ftbl.stack td.wide::before { display: block; margin-bottom: 4px; }
  .ftbl.stack td[data-l="Coin"], .ftbl.stack td[data-l="Contract"] { font-size: 15px; }
}
.ftbl .cv .fine.inline { display: block; }
@media (max-width: 720px) {
  .ftbl.stack td .cv { text-align: right; }
  .ftbl.stack td.wide .cv { text-align: left; }
}

/* ---------- economic calendar */
.calbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 20px 0 14px; }
.calfilters { display: flex; gap: 10px; flex-wrap: wrap; }
.calday { margin-top: 14px; }
.evlist { display: grid; }
.evt { display: grid; grid-template-columns: 84px 96px minmax(0, 1fr) 300px; gap: 8px 14px; align-items: start; padding: 14px 8px; border-top: 1px solid var(--border); border-radius: 8px; }
.evt:first-child { border-top: 0; }
.evt.done { opacity: .72; }
.evt.next { background: var(--accent-soft); opacity: 1; }
.evt.flash { background: var(--warn-soft); transition: background .3s; }
.et { display: grid; gap: 4px; justify-items: start; font-size: 13.5px; }
.nextchip { font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--accent-strong); }
.ei { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.imp { padding: 1px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650; background: var(--surface-3); color: var(--muted); }
.imp-high.imp { background: var(--down-soft); color: var(--down); } .imp-medium.imp { background: var(--warn-soft); color: var(--warn); }
.cc { font-size: 11.5px; font-weight: 650; color: var(--text-2); border: 1px solid var(--border); border-radius: 6px; padding: 0 6px; }
.en b { font-weight: 600; font-size: 14.5px; }
.why { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.evals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: right; }
.evv small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.evv b { font-size: 14px; font-weight: 650; }
.sur { display: block; font-size: 11px; font-weight: 600; margin-top: 1px; color: var(--accent-strong); white-space: nowrap; }
.uplist { display: grid; }
.up-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); color: inherit; text-decoration: none; }
.up-row:first-child { border-top: 0; } .up-row:hover .up-name { color: var(--accent-strong); }
.up-when b { display: block; font-size: 13px; } .up-when small { color: var(--muted); font-size: 12px; }
.up-name { font-weight: 600; font-size: 14px; } .up-in { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.fomc-date { font-size: 21px; font-weight: 650; letter-spacing: -.01em; margin-top: 4px; }
@media (max-width: 860px) {
  .evt { grid-template-columns: 1fr; gap: 6px; padding: 14px 6px; }
  .et { grid-template-columns: auto auto; justify-content: start; align-items: center; gap: 10px; }
  .evals { text-align: left; max-width: 420px; }
  .up-row { grid-template-columns: 84px minmax(0, 1fr); } .up-in { grid-column: 2; }
}
.evals.none { display: none; }
@media (min-width: 861px) { .evals.none { display: block; } }
/* tablet widths: seven tabs plus search and account buttons need a little less room each */
@media (min-width: 861px) and (max-width: 1040px) {
  .bar { gap: 12px; } .nav button { padding: 0 7px; } .search { width: 120px; } .search:focus-within { width: 170px; } .search kbd { display: none; }
}

/* ---------- password reset */
.dlg [hidden] { display: none !important; } /* the dialog's own display rules would otherwise override the hidden attribute */
.forgot { justify-self: start; font-size: 13px; margin-top: -4px; }
.authpage { display: grid; place-items: start center; padding-top: 24px; }
.authpage .card { width: min(440px, 100%); }
.authpage h1 { font-size: 21px; font-weight: 650; letter-spacing: -.01em; margin-bottom: 8px; }
.authform { display: grid; gap: 14px; margin-top: 16px; }
.authform label { display: grid; gap: 6px; font-size: 13px; font-weight: 550; color: var(--text-2); }
.authform input { height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--bg); outline: none; color: var(--text); }
.authform input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.authpage .btn.block { text-align: center; justify-content: center; display: inline-flex; align-items: center; margin-top: 6px; text-decoration: none; }
