/* ───────────────────────── Theme tokens (warm / beige) ─────────────────── */
/* Consistent with adichoudhary.com: Spectral + Hanken Grotesk, cream + ochre. */
:root {
  --bg: #fcfbf8;
  --surface: #ffffff;
  --surface-warm: #f7f2e9;
  --surface-tan: #f4e7d7;
  --ink: #2b2722;
  --ink-2: #6b6357;
  --muted: #9a9082;
  --line: rgba(43, 39, 34, 0.09);
  --line-soft: rgba(43, 39, 34, 0.06);
  --line-strong: rgba(43, 39, 34, 0.16);
  --accent: #a67c3d;
  --accent-deep: #8a663a;
  --up: #5e7050;
  --up-ink: #46583a;
  --up-soft: #eaefe2;
  --down: #a65a3c;
  --down-ink: #8a4226;
  --down-soft: #f6e8e0;
  --radius: 20px;
  --radius-sm: 14px;
  --pill: 100px;
  --shadow-sm: 0 1px 2px rgba(43, 39, 34, 0.04);
  --shadow-md: 0 1px 2px rgba(43, 39, 34, 0.04), 0 18px 44px -28px rgba(43, 39, 34, 0.3);
  --shadow-pop: 0 1px 2px rgba(43, 39, 34, 0.04), 0 24px 60px -32px rgba(43, 39, 34, 0.22);
  --serif: 'Spectral', Georgia, 'Times New Roman', serif;
  --sans: 'Hanken Grotesk', system-ui, -apple-system, Segoe UI, sans-serif;
  --maxw: 1240px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 88% -8%, #f4ead7 0%, rgba(244, 234, 215, 0) 60%),
    radial-gradient(820px 460px at -4% 2%, #f3ece0 0%, rgba(243, 236, 224, 0) 55%),
    var(--bg);
  background-attachment: fixed;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 500; letter-spacing: -0.02em; color: var(--ink); }

/* Uppercase wide-tracked micro-label — the signature site detail */
.eyebrow {
  display: inline-block;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
}

/* numbers / prices render in the serif for an editorial feel */
.card-price, .big-price, .pulse-tile .v, .res-card .v, .stat .v, .featured-price .big-price {
  font-family: var(--serif); font-feature-settings: 'tnum' 1; letter-spacing: -0.015em;
}

/* ─────────────────────────────── Topbar ───────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 15px clamp(16px, 4vw, 40px);
  background: rgba(252, 251, 248, 0.82);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px;
  background: var(--surface-tan); border: 1px solid var(--line); border-radius: 13px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-family: var(--serif); font-weight: 600; font-size: 1.28rem; letter-spacing: -0.01em; }
.brand-text small { color: var(--muted); font-weight: 600; font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; margin-top: 2px; }

.status { display: flex; align-items: center; gap: 14px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: var(--pill);
  background: var(--surface); border: 1px solid var(--line);
  font-size: 0.78rem; font-weight: 600; color: var(--ink-2); box-shadow: var(--shadow-sm);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.pill.open { color: var(--up-ink); } .pill.open .dot { background: var(--up); box-shadow: 0 0 0 3px var(--up-soft); }
.pill.closed { color: var(--down-ink); } .pill.closed .dot { background: var(--down); box-shadow: 0 0 0 3px var(--down-soft); }
.updated { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
@media (max-width: 600px) { .updated { display: none; } }

/* ──────────────────────────────── Tabs ────────────────────────────────── */
.tabs {
  position: sticky; top: 71px; z-index: 30;
  background: rgba(252, 251, 248, 0.86);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.tabs-inner {
  display: flex; gap: 4px; max-width: var(--maxw); margin: 0 auto;
  padding: 12px clamp(16px, 4vw, 40px);
  overflow-x: auto; scrollbar-width: none;
}
.tabs-inner::-webkit-scrollbar { display: none; }
.tab {
  border: 1px solid transparent; background: transparent;
  padding: 9px 17px; border-radius: var(--pill);
  font-size: 0.9rem; font-weight: 600; color: var(--ink-2); transition: 0.18s;
}
.tab:hover { color: var(--ink); background: rgba(43, 39, 34, 0.04); }
.tab.is-active { color: var(--accent-deep); background: var(--surface-tan); border-color: rgba(166, 124, 61, 0.28); }

main { max-width: var(--maxw); margin: 0 auto; padding: 12px clamp(16px, 4vw, 40px) 64px; }

.demo-banner {
  max-width: var(--maxw); margin: 10px auto -2px;
  padding: 11px 16px; border-radius: var(--radius-sm);
  background: var(--surface-tan); border: 1px solid rgba(166, 124, 61, 0.28); color: var(--accent-deep);
  font-size: 0.86rem;
}

/* ───────────────────────────── View headers ───────────────────────────── */
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 22px 0 22px; flex-wrap: wrap; }
.view-head h1 { font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 500; margin-top: 8px; }
.sub { margin: 8px 0 0; color: var(--ink-2); font-size: 1rem; max-width: 56ch; }
.section-title { margin: 34px 0 16px; font-size: 1.5rem; font-weight: 500; }
.muted { color: var(--muted); }
.t-up { color: var(--up); } .t-down { color: var(--down); }

.sort { display: flex; align-items: center; gap: 9px; }
.sort label { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
select, .input-money input {
  font-family: inherit; font-size: 0.9rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--pill); padding: 9px 14px; outline: none;
}
select { padding-right: 30px; }
select:focus, .input-money input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(166, 124, 61, 0.16); }

/* ────────────────────────────── Market pulse ──────────────────────────── */
.market-pulse { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.pulse-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 15px 17px; box-shadow: var(--shadow-sm); }
.pulse-tile .k { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.pulse-tile .v { font-size: 1.55rem; margin-top: 7px; font-weight: 500; display: flex; align-items: baseline; gap: 8px; }
.pulse-tile .v small { font-family: var(--sans); font-size: 0.8rem; font-weight: 600; letter-spacing: 0; }
.breadth { display: flex; gap: 5px; margin-top: 9px; height: 6px; }
.breadth i { display: block; border-radius: 100px; }
.breadth .b-up { background: var(--up); } .breadth .b-dn { background: var(--down); opacity: 0.85; }

/* ─────────────────────────── Featured hero chart ──────────────────────── */
.featured { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 20px 12px; box-shadow: var(--shadow-md); }
.featured-head { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 14px 20px; }
.featured-id .featured-name { font-family: var(--serif); font-size: 1.5rem; margin-top: 6px; }
.featured-price { text-align: right; }
.featured-price .big-price { font-size: 1.9rem; font-weight: 500; }
.featured-price .change { margin-top: 4px; }
.featured .range-tabs { grid-column: 1 / -1; margin: 14px 0 6px; }
.featured .chart-wrap { border: none; box-shadow: none; padding: 0; background: transparent; }
.featured .chart { height: 300px; }

/* ──────────────────────────── Overview cards ──────────────────────────── */
.cards-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(264px, 1fr)); }
.card {
  position: relative; text-align: left; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px;
  box-shadow: var(--shadow-sm); transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex; flex-direction: column; gap: 12px; overflow: hidden;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-id { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cdot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.card-sym { font-weight: 700; font-size: 1rem; letter-spacing: 0.01em; }
.card-name { color: var(--muted); font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-price { font-size: 1.75rem; font-weight: 500; }
.change { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-size: 0.82rem; padding: 4px 10px; border-radius: var(--pill); font-family: var(--sans); letter-spacing: 0; }
.change.up { color: var(--up-ink); background: var(--up-soft); }
.change.down { color: var(--down-ink); background: var(--down-soft); }
.change .arr { font-size: 0.66em; }
.spark { width: 100%; height: 40px; display: block; }
.card-foot { display: flex; flex-direction: column; gap: 7px; border-top: 1px solid var(--line-soft); padding-top: 11px; }
.card-foot .row { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--ink-2); }
.card-foot .ml { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-right: 6px; font-weight: 600; }
.daybar { position: relative; height: 4px; border-radius: 100px; background: var(--surface-warm); }
.daybar i { position: absolute; top: 50%; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); transform: translate(-50%, -50%); }
.card-skel { height: 196px; border-radius: var(--radius); background: linear-gradient(100deg, #f1ece2 30%, #faf7f0 50%, #f1ece2 70%); background-size: 200% 100%; animation: sh 1.4s infinite; border: 1px solid var(--line); }
@keyframes sh { to { background-position: -200% 0; } }

/* ────────────────────────────── Detail ────────────────────────────────── */
.back { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); padding: 8px 16px; border-radius: var(--pill); font-size: 0.85rem; font-weight: 600; box-shadow: var(--shadow-sm); margin-bottom: 18px; }
.back:hover { color: var(--accent-deep); border-color: var(--accent); }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.detail-id { display: flex; align-items: center; gap: 12px; }
.detail-id h1 { font-size: 2.6rem; font-weight: 500; }
.detail-price { text-align: right; }
.big-price { font-size: 2.2rem; font-weight: 500; }
.detail-price .change { font-size: 0.95rem; margin-top: 6px; }

.range-tabs { display: inline-flex; gap: 3px; background: var(--surface-warm); border: 1px solid var(--line); border-radius: var(--pill); padding: 4px; margin: 20px 0; }
.range-tabs button { border: none; background: transparent; padding: 7px 15px; border-radius: var(--pill); font-size: 0.82rem; font-weight: 600; color: var(--ink-2); transition: 0.15s; }
.range-tabs button.is-active { background: var(--surface); color: var(--accent-deep); box-shadow: var(--shadow-sm); }

.chart-wrap { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-md); }
.chart { width: 100%; height: 350px; }
.chart-wrap.tall .chart { height: 430px; }
.chart-tooltip { position: absolute; top: 16px; left: 16px; pointer-events: none; background: rgba(252, 251, 248, 0.9); border: 1px solid var(--line-strong); border-radius: 12px; padding: 9px 12px; box-shadow: var(--shadow-md); font-size: 0.8rem; backdrop-filter: blur(6px); }
.chart-tooltip b { font-family: var(--serif); font-size: 1.05rem; }

.stats-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(152px, 1fr)); margin-top: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 15px 17px; box-shadow: var(--shadow-sm); }
.stat .k { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.stat .v { font-size: 1.12rem; font-weight: 500; margin-top: 5px; }
.rangebar { margin-top: 9px; height: 5px; border-radius: 100px; background: var(--surface-warm); position: relative; }
.rangebar i { position: absolute; top: 50%; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); transform: translate(-50%, -50%); box-shadow: var(--shadow-sm); }

/* ──────────────────────────────── Chips ───────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); padding: 8px 14px; border-radius: var(--pill); font-size: 0.84rem; font-weight: 600; box-shadow: var(--shadow-sm); transition: 0.15s; }
.chip .swatch { width: 9px; height: 9px; border-radius: 50%; }
.chip.is-on { color: var(--ink); border-color: var(--accent); background: var(--surface-tan); }
.chip:hover { border-color: var(--accent); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; }
.legend .li { display: flex; align-items: center; gap: 8px; font-size: 0.86rem; }
.legend .li b { font-weight: 700; }
.legend .swatch { width: 13px; height: 3px; border-radius: 2px; }

/* ──────────────────────────── Calculator ──────────────────────────────── */
.calc { display: grid; gap: 18px; }
.calc-form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-md); }
.calc-form label { display: flex; flex-direction: column; gap: 8px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.input-money { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--pill); padding-left: 14px; }
.input-money:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(166, 124, 61, 0.16); }
.input-money span { color: var(--muted); font-weight: 600; }
.input-money input { border: none; box-shadow: none !important; width: 100%; }
.calc-result { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.res-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.res-card .k { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.res-card .v { font-size: 1.95rem; font-weight: 500; margin-top: 6px; }
.res-card.accent { background: linear-gradient(165deg, #b08a4e, #8a663a); border: none; color: #fdf8ef; box-shadow: var(--shadow-md); }
.res-card.accent .k { color: rgba(253, 248, 239, 0.78); }
.calc-note { color: var(--muted); font-size: 0.84rem; margin-top: 8px; }
.res-card.accent .calc-note { color: rgba(253, 248, 239, 0.82); }

/* ──────────────────────────────── News ────────────────────────────────── */
.news-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.news { display: flex; gap: 14px; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px; box-shadow: var(--shadow-sm); transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s; }
.news:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.news .thumb { width: 80px; height: 80px; border-radius: 13px; object-fit: cover; flex: none; background: var(--surface-warm); }
.news .thumb.ph { display: grid; place-items: center; color: var(--accent-deep); background: var(--surface-tan); font-weight: 700; font-family: var(--serif); }
.news .body { display: flex; flex-direction: column; min-width: 0; }
.news .ttl { font-weight: 500; font-size: 0.96rem; line-height: 1.36; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news .meta { margin-top: auto; padding-top: 9px; display: flex; align-items: center; gap: 8px; font-size: 0.76rem; color: var(--muted); }
.news .src { font-weight: 600; color: var(--ink-2); }
.tag { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.04em; color: var(--accent-deep); background: var(--surface-tan); padding: 3px 8px; border-radius: 7px; }

/* ─────────────────── Floating translucent news widget ─────────────────── */
.news-widget {
  position: fixed; right: clamp(14px, 2.5vw, 28px); bottom: clamp(14px, 2.5vw, 28px);
  z-index: 60; width: 348px; max-height: min(62vh, 560px);
  display: flex; flex-direction: column;
  background: rgba(252, 251, 248, 0.55);
  backdrop-filter: blur(22px) saturate(135%); -webkit-backdrop-filter: blur(22px) saturate(135%);
  border: 1px solid rgba(43, 39, 34, 0.12); border-radius: var(--radius);
  box-shadow: 0 28px 60px -30px rgba(43, 39, 34, 0.5);
  overflow: hidden; transition: max-height 0.3s ease, width 0.3s ease;
}
.nw-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.nw-head .eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--accent-deep); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(166, 124, 61, 0.5); animation: pulse 2.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(166, 124, 61, 0.5); } 70% { box-shadow: 0 0 0 7px rgba(166, 124, 61, 0); } 100% { box-shadow: 0 0 0 0 rgba(166, 124, 61, 0); } }
.nw-toggle { border: none; background: transparent; color: var(--ink-2); font-size: 1.1rem; line-height: 1; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; }
.nw-toggle:hover { background: rgba(43, 39, 34, 0.06); }
.nw-body { overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.nw-item { display: block; text-decoration: none; color: inherit; padding: 11px 12px; border-radius: 13px; transition: background 0.14s; }
.nw-item:hover { background: rgba(255, 255, 255, 0.55); }
.nw-item + .nw-item { border-top: 1px solid var(--line-soft); }
.nw-item .nw-ttl { font-size: 0.86rem; font-weight: 500; line-height: 1.34; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nw-item .nw-meta { display: flex; align-items: center; gap: 7px; margin-top: 6px; font-size: 0.7rem; color: var(--muted); }
.nw-item .nw-tag { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.04em; color: var(--accent-deep); background: rgba(166, 124, 61, 0.14); padding: 2px 6px; border-radius: 6px; }
.news-widget.collapsed { max-height: 50px; width: 200px; }
.news-widget.collapsed .nw-body { display: none; }
.news-widget.collapsed .nw-head { border-bottom: none; }
@media (max-width: 560px) {
  .news-widget { left: 12px; right: 12px; width: auto; max-height: 42vh; }
  .news-widget.collapsed { width: 180px; left: auto; }
}

/* ─────────────────────── Watchlist stars + tools ──────────────────────── */
.card { cursor: pointer; }
.card:focus-visible, .news:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card-top-right { display: flex; align-items: center; gap: 8px; }
.star { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 1.05rem; line-height: 1; padding: 2px; transition: transform 0.15s, color 0.15s; }
.star:hover { color: var(--accent); transform: scale(1.15); }
.star.on { color: var(--accent); }
#detail-star { font-size: 1.45rem; align-self: center; }
#wl-filter { cursor: pointer; }

.detail-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 18px 0; }
.detail-controls .range-tabs { margin: 0; }
.chart-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; gap: 3px; background: var(--surface-warm); border: 1px solid var(--line); border-radius: var(--pill); padding: 4px; }
.seg button { border: none; background: transparent; padding: 6px 13px; border-radius: var(--pill); font-size: 0.8rem; font-weight: 600; color: var(--ink-2); transition: 0.15s; }
.seg button.is-active { background: var(--surface); color: var(--accent-deep); box-shadow: var(--shadow-sm); }

/* ────────────────────────────── Screener ──────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-md); }
table.screener { width: 100%; border-collapse: collapse; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.screener th { padding: 14px 14px; text-align: right; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); cursor: pointer; white-space: nowrap; user-select: none; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.screener th.l { text-align: left; }
.screener th:hover { color: var(--ink); }
.screener th.sorted { color: var(--accent-deep); }
.screener th.c-star { width: 40px; cursor: default; }
.caret { margin-left: 3px; font-size: 0.8em; }
.screener td { padding: 13px 14px; text-align: right; border-bottom: 1px solid var(--line-soft); white-space: nowrap; color: var(--ink); }
.screener tbody tr { cursor: pointer; transition: background 0.12s; }
.screener tbody tr:hover { background: var(--surface-warm); }
.screener tbody tr:last-child td { border-bottom: none; }
.screener .c-sym { text-align: left; }
.screener .c-sym .cdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.screener .c-sym b { font-weight: 700; }
.screener .c-star { text-align: center; }
.rsi-badge { display: inline-block; min-width: 36px; padding: 3px 8px; border-radius: 8px; font-weight: 700; background: var(--surface-warm); color: var(--ink-2); }
.rsi-badge.t-up { background: var(--up-soft); }
.rsi-badge.t-down { background: var(--down-soft); }
.screener .empty { text-align: center; }
.screener-note { font-size: 0.8rem; margin-top: 12px; }

/* ───────────────────── Alerts (bell, form, toasts) ────────────────────── */
.bell { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; color: var(--ink-2); box-shadow: var(--shadow-sm); cursor: pointer; transition: 0.15s; }
.bell:hover { color: var(--accent-deep); border-color: var(--accent); }
.bell-badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: #fffaf2; font-size: 0.66rem; font-weight: 700; display: grid; place-items: center; }
.bell-badge[hidden] { display: none; }

.alert-add { border: 1px solid var(--line-strong); background: var(--surface); color: var(--accent-deep); font-size: 0.74rem; font-weight: 700; padding: 5px 12px; border-radius: var(--pill); cursor: pointer; align-self: center; transition: 0.15s; }
.alert-add:hover { border-color: var(--accent); background: var(--surface-tan); }
.btn-primary { border: none; background: var(--accent); color: #fffaf2; font-weight: 600; font-size: 0.9rem; padding: 11px 22px; border-radius: var(--pill); cursor: pointer; box-shadow: var(--shadow-sm); transition: 0.15s; }
.btn-primary:hover { background: var(--accent-deep); }

.alert-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-md); }
.alert-form label { display: flex; flex-direction: column; gap: 8px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.alert-form select, .alert-form .input-money { min-width: 160px; }
.alert-hint { margin: 12px 2px 0; font-size: 0.86rem; }
.alerts-list { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.alert-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.alert-row.done { opacity: 0.72; }
.alert-row .cdot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.alert-main { flex: 1; min-width: 0; }
.alert-cond { font-size: 0.96rem; }
.alert-sub { font-size: 0.78rem; color: var(--muted); margin-top: 3px; }
.alert-status { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 4px 10px; border-radius: var(--pill); }
.alert-status.t-up { background: var(--up-soft); }
.alert-status.t-down { background: var(--down-soft); }
.alert-del { border: none; background: none; color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 6px; border-radius: 8px; }
.alert-del:hover { color: var(--down); background: var(--down-soft); }

.toasts { position: fixed; top: 16px; right: 16px; z-index: 80; display: flex; flex-direction: column; gap: 10px; max-width: 340px; }
.toast { display: flex; align-items: flex-start; gap: 10px; background: rgba(252, 251, 248, 0.93); backdrop-filter: blur(14px); border: 1px solid var(--accent); border-left-width: 3px; border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow-pop); font-size: 0.84rem; transition: opacity 0.3s, transform 0.3s; animation: toast-in 0.3s ease; }
.toast.out { opacity: 0; transform: translateX(20px); }
.toast .live-dot { margin-top: 5px; flex: none; }
.toast-body { flex: 1; } .toast-body b { color: var(--accent-deep); }
.toast-x { border: none; background: none; color: var(--muted); font-size: 1.1rem; line-height: 1; cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ──────────────────── Analysis (correlation + scatter) ─────────────────── */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-md); overflow-x: auto; }
.analysis-note { margin: -4px 0 14px; font-size: 0.9rem; }
.corr-grid { display: grid; gap: 4px; min-width: 580px; }
.corr-c { height: 44px; display: grid; place-items: center; border-radius: 9px; font-size: 0.82rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.corr-lbl { background: transparent; color: var(--ink-2); font-weight: 700; }
.scatter { width: 100%; }
.scatter-svg { width: 100%; height: auto; display: block; }
.sc-lbl { font-family: var(--sans); font-size: 12px; font-weight: 600; fill: var(--ink); }
.sc-axis { font-family: var(--sans); font-size: 11px; font-weight: 600; fill: var(--muted); letter-spacing: 0.04em; }

/* ─────────────────────────────── Trade risk ───────────────────────────── */
.ml { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.risk-form { display: flex; flex-wrap: wrap; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-md); margin-bottom: 18px; }
.risk-form label { display: flex; flex-direction: column; gap: 8px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.risk-form select, .risk-form .input-money { min-width: 160px; }
.risk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 880px) { .risk-grid { grid-template-columns: 1fr; } }
.risk-panel { display: flex; flex-direction: column; }
.risk-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.risk-head .muted { font-size: 0.78rem; }
.risk-score { display: flex; align-items: center; gap: 16px; }
.risk-big { font-family: var(--serif); font-size: 2.7rem; font-weight: 500; line-height: 1; letter-spacing: -0.02em; }
.risk-100 { font-size: 1.05rem; color: var(--muted); }
.risk-verdict { font-weight: 700; font-size: 0.96rem; }
.risk-lo { color: var(--up); } .risk-mod { color: var(--accent-deep); } .risk-hi { color: var(--down); }
.gauge { position: relative; height: 8px; border-radius: 100px; margin: 18px 0 4px; background: linear-gradient(90deg, var(--up) 0%, var(--accent) 52%, var(--down) 100%); opacity: 0.9; }
.gauge i { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; transform: translate(-50%, -50%); border: 2px solid var(--surface); box-shadow: var(--shadow-sm); background: var(--accent); }
.gauge i.risk-lo { background: var(--up); } .gauge i.risk-mod { background: var(--accent); } .gauge i.risk-hi { background: var(--down); }
.risk-rows { margin-top: 16px; display: flex; flex-direction: column; gap: 9px; }
.rrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 0.88rem; border-bottom: 1px solid var(--line-soft); padding-bottom: 9px; }
.rrow:last-child { border-bottom: none; padding-bottom: 0; }
.drivers-h { margin: 18px 0 10px; }
.drivers { display: flex; flex-direction: column; gap: 8px; }
.driver { display: flex; gap: 10px; align-items: flex-start; text-decoration: none; color: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; transition: 0.15s; }
.driver:hover { border-color: var(--accent); background: var(--surface-warm); }
.driver .tag { flex: none; }
.driver .tag.t-up { color: var(--up-ink); background: var(--up-soft); }
.driver .tag.t-down { color: var(--down-ink); background: var(--down-soft); }
.driver-ttl { font-size: 0.85rem; line-height: 1.34; }
.factors { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.factor-top { display: flex; align-items: center; justify-content: space-between; font-size: 0.88rem; font-weight: 600; margin-bottom: 6px; }
.factor-score { font-variant-numeric: tabular-nums; }
.fbar { height: 7px; border-radius: 100px; background: var(--surface-warm); overflow: hidden; }
.fbar i { display: block; height: 100%; border-radius: 100px; background: var(--accent); }
.fbar i.risk-lo { background: var(--up); } .fbar i.risk-mod { background: var(--accent); } .fbar i.risk-hi { background: var(--down); }
.factor-detail { font-size: 0.78rem; margin-top: 5px; }
.method { font-size: 0.76rem; color: var(--muted); margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft); }

/* ─────────────────────────────── Footer ───────────────────────────────── */
.footer { max-width: var(--maxw); margin: 0 auto; padding: 30px clamp(16px, 4vw, 40px) 96px; color: var(--muted); font-size: 0.8rem; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px solid var(--line); }
.footer a { color: var(--accent-deep); text-decoration: none; font-weight: 600; }
.dotsep { color: var(--line-strong); }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }

@media (max-width: 760px) { .market-pulse { grid-template-columns: repeat(2, 1fr); } .featured-head { grid-template-columns: 1fr; } .featured-price { text-align: left; } }
@media (max-width: 620px) {
  .calc-form, .calc-result { grid-template-columns: 1fr; }
  .detail-id h1 { font-size: 2rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
