/* Opportunity Radar console. Visual system from the DJS "Vault" dashboard: near-black frame,
   fixed dark sidebar (232px, 72px rail, drawer on phones), light main area, 12-column grid of
   white cards, lime accent, Plus Jakarta Sans, pills for every control. */
:root {
  --canvas: #1a1a1a; --side: #1c1c1c; --side-fg: #9a9a9a; --side-hover: #262626;
  --main: #f3f3f1; --card: #ffffff; --card-shadow: 0 1px 2px rgb(0 0 0 / .04);
  --inv: #161616; --inv-fg: #ffffff; --inv-muted: #a3a3a3; --inv-tile: #e4f55b; --inv-tile-fg: #111111;
  --lime: #e4f55b; --on-lime: #111111; --lime-soft: #f6fbd2; --olive: #c5cf86; --lime-line: #b8c92a;
  --ink: #111111; --muted: #8a8a8a; --line: #ececec; --field: #f5f5f3;
  --good: #22a35a; --good-soft: rgb(34 163 90 / .12);
  --warn: #f08c1a; --warn-soft: rgb(240 140 26 / .12);
  --bad: #ef4444; --bad-soft: rgb(239 68 68 / .12);
  --btn: #111111; --btn-fg: #ffffff;
  --tile-s: 70%; --tile-bg: 90%; --tile-fg: 28%;
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  --side-w: 248px; --card-border: transparent;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --canvas: #0b0b0b; --main: #121212; --card: #1b1b1b; --card-shadow: 0 1px 2px rgb(0 0 0 / .3);
  --inv: #e4f55b; --inv-fg: #111111; --inv-muted: #4a5112; --inv-tile: #111111; --inv-tile-fg: #e4f55b;
  --lime-soft: #2a2d14; --olive: #8e9650; --lime-line: #d4e34a;
  --ink: #f2f2f2; --muted: #8d8d8d; --line: #262626; --field: #222222;
  --good: #4ade80; --good-soft: rgb(74 222 128 / .14); --warn: #fbbf24; --warn-soft: rgb(251 191 36 / .14); --bad: #f87171; --bad-soft: rgb(248 113 113 / .14);
  --btn: #f2f2f2; --btn-fg: #111111;
  --tile-s: 35%; --tile-bg: 22%; --tile-fg: 80%; --card-border: rgb(255 255 255 / .05);
  color-scheme: dark; } }
:root[data-theme="dark"] {
  --canvas: #0b0b0b; --main: #121212; --card: #1b1b1b; --card-shadow: 0 1px 2px rgb(0 0 0 / .3);
  --inv: #e4f55b; --inv-fg: #111111; --inv-muted: #4a5112; --inv-tile: #111111; --inv-tile-fg: #e4f55b;
  --lime-soft: #2a2d14; --olive: #8e9650; --lime-line: #d4e34a;
  --ink: #f2f2f2; --muted: #8d8d8d; --line: #262626; --field: #222222;
  --good: #4ade80; --good-soft: rgb(74 222 128 / .14); --warn: #fbbf24; --warn-soft: rgb(251 191 36 / .14); --bad: #f87171; --bad-soft: rgb(248 113 113 / .14);
  --btn: #f2f2f2; --btn-fg: #111111;
  --tile-s: 35%; --tile-bg: 22%; --tile-fg: 80%; --card-border: rgb(255 255 255 / .05);
  color-scheme: dark; }

* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 500 14px/1.45 var(--font); font-variant-numeric: tabular-nums;
  padding-block: 16px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; box-shadow: 0 0 0 4px #111; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100%; border-radius: 24px; overflow: hidden; background: var(--side); max-width: 1880px; margin: 0 auto; }
.shell.is-rail { --side-w: 72px; }
.side { background: var(--side); color: var(--side-fg); display: flex; flex-direction: column; gap: 6px; padding: 22px 14px; position: relative; height: 100%; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.side::-webkit-scrollbar { display: none; }
@media (min-width: 768px) {
  html, body { overflow: hidden; }
  .shell { height: calc(100vh - 32px); height: calc(100dvh - 32px); min-height: 0; }
  .main { height: 100%; overflow-y: auto; overscroll-behavior: contain; }
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 18px; }
.brand .mark { width: 30px; height: 30px; border-radius: 9px; background: var(--lime); color: #111; display: grid; place-items: center; flex: none; }
.brand .mark svg { width: 18px; height: 18px; stroke-width: 2.2; }
.brand b { color: #fff; font-size: 18px; font-weight: 700; flex: 1; white-space: nowrap; }
.icon-btn-side { background: none; border: 0; color: var(--side-fg); padding: 4px; border-radius: 8px; display: grid; place-items: center; }
.icon-btn-side:hover { color: #fff; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #6b6b6b; padding: 14px 10px 6px; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 10px; min-width: 0; border-radius: 10px; text-decoration: none; color: var(--side-fg); font-weight: 500; white-space: nowrap; }
.nav a:hover { background: var(--side-hover); color: #ddd; }
.nav a[aria-current="page"] { color: var(--lime); background: var(--side-hover); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--lime); }
.nav .nlbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav a svg { flex: none; }
.nav .badge { flex: none; margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; background: #2c2c2c; color: #cfcfcf; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.nav .badge.lime { background: var(--lime); color: #111; }
.nav .badge.bad { background: var(--bad); color: #fff; }
.nav .dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: #4ade80; }
.runner { margin-top: 14px; display: grid; gap: 10px; padding: 12px; border-radius: 14px; border: 1px solid #2a2a2a; color: #9a9a9a; text-decoration: none; transition: background .15s, border-color .15s; }
.runner:hover { background: var(--side-hover); border-color: #333; }
.runner .r-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.runner .r-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #6b6b6b; }
.runner .r-top svg { width: 14px; height: 14px; color: #6b6b6b; transition: transform .2s cubic-bezier(.2,.8,.2,1), color .15s; }
.runner:hover .r-top svg { color: #ddd; transform: translate(2px, -2px); }
.runner .r-status { display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 2px 10px; align-items: center; }
.runner .r-dot { width: 8px; height: 8px; border-radius: 50%; background: #6b6b6b; }
.runner .r-dot.good { background: #4ade80; } .runner .r-dot.warn { background: #fbbf24; } .runner .r-dot.bad { background: #f87171; }
.runner .r-dot.live { background: var(--lime); }
.runner .r-status b { color: #f2f2f2; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.runner .r-status small { grid-column: 2; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.runner .r-status small em { font-style: normal; font-weight: 600; }
.runner .r-status small em.warn { color: #fbbf24; } .runner .r-status small em.bad { color: #f87171; }
.r-bar { height: 3px; border-radius: 99px; background: #2c2c2c; overflow: hidden; position: relative; }
.r-bar i { position: absolute; top: 0; bottom: 0; left: 0; width: 35%; border-radius: 99px; background: var(--lime); }
@media (prefers-reduced-motion: no-preference) {
  .runner .r-dot.live { animation: pulse-lime 1.6s ease-out infinite; }
  @keyframes pulse-lime { 0% { box-shadow: 0 0 0 0 rgb(228 245 91 / .5); } 100% { box-shadow: 0 0 0 7px rgb(228 245 91 / 0); } }
  .r-bar i { animation: r-slide 1.4s ease-in-out infinite; }
  @keyframes r-slide { from { left: -35%; } to { left: 100%; } }
}
.promo { margin-top: auto; background: #fff; color: #111; border-radius: 16px; padding: 16px; display: grid; gap: 8px; }
.promo .tile { width: 36px; height: 36px; border-radius: 10px; background: var(--lime); color: #111; display: grid; place-items: center; }
.promo b { font-size: 15px; }
.promo p { font-size: 12px; color: #6b6b6b; }
.promo .btn { justify-content: center; background: #111; color: #fff; }
.me { display: flex; align-items: center; gap: 10px; padding: 14px 6px 0; border-top: 1px solid #2a2a2a; margin-top: auto; }
.promo:not([hidden]) + .me { margin-top: 12px; }
.me .av { width: 36px; height: 36px; border-radius: 50%; background: #333; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.me b { color: #fff; display: block; font-size: 13px; }
.me span { font-size: 12px; }
.is-rail .side { padding-inline: 12px; align-items: center; }
.is-rail .nlbl, .is-rail .nav-label, .is-rail .promo, .is-rail .runner, .is-rail .me .who, .is-rail .brand b { display: none; }
.is-rail .nav a { justify-content: center; padding: 10px; }
.is-rail .nav .badge, .is-rail .nav .dot { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; font-size: 10px; }
.is-rail .nav .dot { width: 8px; height: 8px; min-width: 0; }
.is-rail .brand { flex-direction: column; padding-inline: 0; }
.is-rail .nav a[aria-current="page"]::before { left: -12px; }
@media (max-height: 1000px) and (min-width: 768px) {
  .side { gap: 4px; padding-block: 16px; }
  .nav a { padding-block: 7px; } .nav-label { padding: 8px 10px 4px; } .brand { padding-bottom: 8px; }
  .side .promo { padding: 12px; gap: 6px; } .side .promo .tile, .side .promo p { display: none; } .side .promo b { font-size: 13px; }
  .runner { margin-top: 8px; gap: 8px; }
  .side .me { padding-top: 10px; }
}
@media (max-height: 820px) and (min-width: 768px) { .side .me { display: none; } }

.main { background: var(--main); border-radius: 24px 0 0 24px; padding: 22px 24px 40px; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: start; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; position: sticky; top: -22px; z-index: 25; margin: -22px -24px 0; padding: 22px 24px 12px;
  background: color-mix(in srgb, var(--main) 86%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.topbar .title-block { flex: 1 1 0; min-width: 150px; display: grid; gap: 2px; }
.topbar .title-block p { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ibtn.menu-btn { display: none; }
.search { position: relative; flex: 0 1 340px; min-width: 200px; }
.search input { width: 100%; border: 0; background: var(--card); border-radius: 999px; padding: 10px 14px 10px 40px; box-shadow: var(--card-shadow); }
.search > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font: 600 11px/1 var(--font); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; pointer-events: none; }
.search input:focus + kbd, .search input:not(:placeholder-shown) + kbd { display: none; }
.results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--card); border-radius: 16px; box-shadow: 0 12px 32px rgb(0 0 0 / .14); padding: 8px; z-index: 30; max-height: 420px; overflow-y: auto; }
.results .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 10px 4px; }
.results button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 10px; }
.results button:hover, .results button:focus-visible { background: var(--field); }
.results button b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.results small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ibtn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; position: relative; flex: none; }
.ibtn:hover { background: var(--field); }
.ibtn:disabled { opacity: .5; cursor: default; }
.ibtn .reddot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); border: 2px solid var(--card); }
.ibtn.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.add-pill { display: inline-flex; align-items: center; gap: 10px; border: 0; background: var(--card); border-radius: 999px; padding: 6px 6px 6px 16px; font-weight: 600; box-shadow: var(--card-shadow); white-space: nowrap; }
.add-pill .plus { width: 26px; height: 26px; border-radius: 50%; background: var(--btn); color: var(--btn-fg); display: grid; place-items: center; transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.add-pill .plus svg { width: 14px; height: 14px; }
.add-pill:hover { box-shadow: 0 0 0 1px var(--line), var(--card-shadow); }
.add-pill:hover .plus { transform: rotate(90deg); }

/* ---------- primitives ---------- */
.card { background: var(--card); border-radius: 18px; padding: 18px; box-shadow: var(--card-shadow); border: 1px solid var(--card-border); display: grid; gap: 14px; align-content: start; min-width: 0; position: relative; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.card-head h2 { flex: 1 1 auto; }
.card-head .note { font-size: 12px; color: var(--muted); }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 9px 16px; font-weight: 600; font-size: 13px; background: var(--btn); color: var(--btn-fg); white-space: nowrap; text-decoration: none; }
.btn svg { width: 15px; height: 15px; }
.btn.out { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.out:hover { background: var(--field); }
.btn.lime { background: var(--lime); color: var(--on-lime); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.sm { padding: 6px 12px; font-size: 12px; }
.btn.block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .45; cursor: default; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; display: inline-flex; align-items: center; }
.chip:hover { background: var(--field); }
.chip[aria-pressed="true"] { background: var(--btn); color: var(--btn-fg); border-color: transparent; }
.chip .n { margin-left: 6px; font-size: 11px; font-weight: 700; opacity: .55; }
.chip .sw { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--field); color: var(--ink); }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.lime { background: var(--lime); color: var(--on-lime); }
.pill.dark { background: var(--btn); color: var(--btn-fg); }
.sel-pill { appearance: none; border: 1px solid var(--line); background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 14px; border-radius: 999px; padding: 6px 30px 6px 12px; font-size: 12px; font-weight: 600; max-width: 100%; }
.tile { width: 40px; height: 40px; border-radius: 12px; background: var(--lime-soft); color: var(--ink); display: grid; place-items: center; flex: none; }
.co { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; letter-spacing: .02em;
  background: hsl(var(--h, 70) var(--tile-s) var(--tile-bg)); color: hsl(var(--h, 70) 45% var(--tile-fg)); transition: transform .2s cubic-bezier(.2,.8,.2,1); }
.field { width: 100%; border: 1px solid var(--line); background: var(--field); border-radius: 12px; padding: 10px 12px; }
textarea.field { min-height: 90px; resize: vertical; line-height: 1.45; }
label.f { display: grid; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.empty { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 14px; background: var(--field); color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.empty .tile { background: var(--card); color: var(--muted); }
.empty span:not(.tile) { flex: 1 1 160px; }
.sk { border-radius: 12px; background: linear-gradient(90deg, var(--field), var(--line), var(--field)); background-size: 200% 100%; height: 16px; }
.sk.tall { height: 120px; } .sk.mid { height: 44px; }
.sk-stack { display: grid; gap: 10px; }
@media (prefers-reduced-motion: no-preference) { .sk { animation: sk 1.4s linear infinite; } @keyframes sk { to { background-position: -200% 0; } } }
.link-btn { border: 0; background: none; padding: 0; font-weight: 700; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; color: var(--ink); cursor: pointer; }
.banner { display: flex; gap: 10px; align-items: start; padding: 12px 14px; border-radius: 12px; background: var(--bad-soft); color: var(--bad); font-size: 13px; font-weight: 600; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.info { background: var(--lime-soft); color: var(--ink); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.pulse.on { background: var(--good); }
@media (prefers-reduced-motion: no-preference) { .pulse.on { animation: pulse 1.6s ease-out infinite; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgb(34 163 90 / .5); } 100% { box-shadow: 0 0 0 8px rgb(34 163 90 / 0); } }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { min-height: 150px; grid-template-rows: auto 1fr auto; transition: background-color .2s ease; }
.kpi .top { display: flex; justify-content: space-between; align-items: start; }
.kpi .go { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: transparent; display: grid; place-items: center; color: inherit; text-decoration: none; }
.kpi .go svg { width: 15px; height: 15px; transition: transform .2s cubic-bezier(.2,.8,.2,1); }
.kpi:hover .go svg { transform: translate(2px, -2px); }
.kpi .go:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.kpi .lbl { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .body { align-self: end; display: grid; gap: 2px; min-width: 0; }
.kpi .num { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; white-space: nowrap; }
.kpi .num small { font-size: 18px; font-weight: 600; }
.kpi .foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: nowrap; }
.kpi .foot span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1 1 0; }
.kpi:not(.inv):hover { background: color-mix(in srgb, var(--card) 94%, var(--ink)); }
.delta { display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; flex: none; }
.delta.up { background: var(--good-soft); color: var(--good); }
.delta.down { background: var(--bad-soft); color: var(--bad); }
.delta.flat { background: var(--field); color: var(--muted); }
.kpi.inv { background: var(--inv); color: var(--inv-fg); }
.kpi.inv .tile { background: var(--inv-tile); color: var(--inv-tile-fg); }
.kpi.inv .lbl, .kpi.inv .foot { color: var(--inv-muted); }
.kpi.inv .go { border-color: color-mix(in srgb, var(--inv-fg) 22%, transparent); }
.kpi.inv .delta { background: color-mix(in srgb, var(--inv-fg) 12%, transparent); color: var(--inv-fg); }
.kpi.with-gauge .mid { display: flex; align-items: end; justify-content: space-between; gap: 8px; min-width: 0; }
.kpi { container-type: inline-size; }
@container (max-width: 250px) {
  .kpi .gauge { display: none; }
  .kpi .foot { flex-wrap: wrap; row-gap: 4px; }
  .kpi .foot span:last-child { flex-basis: 100%; white-space: normal; }
}
.gauge { width: clamp(78px, 42%, 112px); flex: none; position: relative; }
.gauge svg { width: 100%; display: block; }
.gauge .g-track { stroke: var(--line); }
.gauge .g-val { transition: stroke-dasharray 1s cubic-bezier(.2,.8,.2,1); }
.gauge .g-txt { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; line-height: 1.1; }
.gauge .g-txt b { font-size: 15px; display: block; }
.gauge .g-txt span { font-size: 10px; color: var(--muted); }

/* ---------- grid ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }

/* chart */
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); align-items: center; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.legend .lg-rel { background: var(--lime-line); } .legend .lg-rev { background: var(--olive); }
.chart-card { align-content: stretch; grid-template-rows: auto minmax(0, 1fr) auto; }
.chart-box { position: relative; min-height: 260px; }
.chart-wrap { position: absolute; inset: 0; }
.chart-wrap svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart-wrap .ylab { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart-wrap .gridline { stroke: var(--line); stroke-dasharray: 3 4; }
.chart-wrap .guide { stroke: var(--ink); stroke-dasharray: 4 4; opacity: .5; }
.chart-wrap .s-rel { stroke: var(--lime-line); } .chart-wrap .s-rev { stroke: var(--olive); }
.chart-wrap .f-rel-top { stop-color: var(--lime); stop-opacity: .55; } .chart-wrap .f-rel-bot { stop-color: var(--lime); stop-opacity: 0; }
.chart-wrap .dot-rel { fill: var(--lime-line); stroke: var(--card); } .chart-wrap .dot-rev { fill: var(--olive); stroke: var(--card); }
.chart-tip { position: absolute; transform: translate(-50%, calc(-100% - 14px)); background: #111; color: #fff; border-radius: 12px; padding: 7px 12px; font-size: 12px; white-space: nowrap; pointer-events: none; text-align: center; line-height: 1.3; z-index: 2; }
.chart-tip b { color: var(--lime); font-size: 14px; display: block; }
.chart-tip::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: #111; transform: translateX(-50%) rotate(45deg); }
:root[data-theme="dark"] .chart-tip, :root[data-theme="dark"] .chart-tip::after { background: #2a2a2a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chart-tip, :root:not([data-theme="light"]) .chart-tip::after { background: #2a2a2a; } }
@media (prefers-reduced-motion: no-preference) { .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.2s ease-out forwards; } @keyframes draw { to { stroke-dashoffset: 0; } } }
.chart-foot { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px; white-space: nowrap; background: var(--card); }
.tbl td { padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:hover { background: var(--field); }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.sel { background: var(--lime-soft); }
.tbl .num, .tbl th.num { text-align: right; }
.tbl .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tbl .who > div { min-width: 0; flex: 1; }
.tbl .who b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px; }
.tbl .who small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px; }
.tbl.compact { table-layout: fixed; }
.tbl.compact .who b, .tbl.compact .who small { max-width: 100%; }
.tbl .acts { display: flex; gap: 2px; justify-content: flex-end; }
.tbl .acts a, .tbl .acts button, .icon-act { width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; display: grid; place-items: center; color: var(--muted); text-decoration: none; }
.tbl .acts a:hover, .tbl .acts button:hover, .icon-act:hover { background: var(--field); color: var(--ink); }
.tbl .acts svg, .icon-act svg { width: 16px; height: 16px; }
.tbl .wrap { white-space: pre-line; font-size: 12px; max-width: 260px; }
.tbl tbody tr.click:hover .co { transform: scale(1.06); }
.tbl input[type="checkbox"], .chk { width: 16px; height: 16px; accent-color: var(--ink); cursor: pointer; }
.th-sort { border: 0; background: none; padding: 0; font-weight: 600; color: inherit; display: inline-flex; gap: 4px; align-items: center; }
.th-sort svg { width: 12px; height: 12px; }
.th-sort[aria-sort="none"] svg { opacity: 0; }
.th-sort:hover svg { opacity: .6; }
.sticky th { position: sticky; top: 0; z-index: 1; }
.scroll-x { overflow-x: auto; }
.scroll-y { max-height: 68vh; overflow-y: auto; }
.days { font-weight: 700; white-space: nowrap; }
.days.soon { color: var(--warn); } .days.now { color: var(--bad); }
.days small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; }
.score { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.meter { height: 6px; border-radius: 99px; background: var(--field); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--lime-line); border-radius: 99px; }
.meter.bad i { background: var(--bad); } .meter.warn i { background: var(--warn); } .meter.good i { background: var(--good); }
.score .meter { width: 48px; }
.funnel { display: flex; height: 8px; border-radius: 99px; overflow: hidden; gap: 2px; background: var(--field); }
.funnel i { display: block; height: 100%; min-width: 4px; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; font-size: 12px; color: var(--muted); }

/* lists */
.row-list { display: grid; }
.row-item { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.row-item:first-child { border-top: 0; }
.row-item b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item .end { display: grid; justify-items: end; gap: 2px; font-size: 12px; }
.row-item.click { cursor: pointer; border-radius: 12px; padding-inline: 8px; margin-inline: -8px; }
.row-item.click:hover, .row-item.click:focus-visible { background: var(--field); }
.row-item.click:hover .co { transform: scale(1.06); }
.ages { display: grid; gap: 9px; }
.age { display: grid; grid-template-columns: minmax(72px, 36%) minmax(0, 1fr) 30px 32px; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); padding: 3px 6px; margin-inline: -6px; border-radius: 8px; }
.age small { text-align: right; font-size: 11px; }
.age.zero { opacity: .45; }
button.age { border: 0; background: none; font: inherit; font-size: 12px; text-align: left; cursor: pointer; width: calc(100% + 12px); }
button.age:hover, button.age:focus-visible { background: var(--field); color: var(--ink); }
.age > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.age .bar { height: 10px; border-radius: 99px; background: var(--field); overflow: hidden; }
.age .bar i { display: block; height: 100%; border-radius: 99px; background: var(--lime-line); }
.age b { color: var(--ink); text-align: right; font-size: 12px; }
@media (prefers-reduced-motion: no-preference) { .age .bar i, .meter i { animation: grow .9s cubic-bezier(.2,.8,.2,1) both; transform-origin: left; } @keyframes grow { from { transform: scaleX(0); } } }

/* "Waiting on you" */
#todo { display: grid; container-type: inline-size; }
.todo { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 8px; margin-inline: -8px; border-radius: 12px; border-top: 1px solid var(--line); cursor: pointer; }
.todo:first-child { border-top-color: transparent; }
.todo:hover, .todo:focus-visible { background: var(--field); }
.todo:hover + .todo { border-top-color: transparent; }
.todo .t-body { display: grid; gap: 3px; min-width: 0; }
.todo small, .row-item small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.t-title b { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.row-item .t-title b { font-size: 13px; font-weight: 600; }
.tag { flex: none; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: var(--field); color: var(--muted); white-space: nowrap; }
.tag.warn { background: var(--warn-soft); color: var(--warn); } .tag.good { background: var(--good-soft); color: var(--good); }
.todo .t-acts { display: flex; gap: 8px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--card); }
.seg button { border: 0; background: transparent; padding: 6px 12px; font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { background: var(--field); color: var(--ink); }
.seg button.pass:hover { color: var(--bad); }
.todo .chev { width: 28px; height: 28px; display: grid; place-items: center; color: var(--muted); }
.todo .chev svg { width: 15px; height: 15px; transition: transform .2s cubic-bezier(.2,.8,.2,1); }
.todo:hover .chev { color: var(--ink); } .todo:hover .chev svg { transform: translate(2px, -2px); }
.link-btn.more { justify-self: start; margin-top: 8px; }
.row-item .end b.price { font-size: 13px; font-weight: 700; }
.row-item .end small { font-size: 11px; }
@container (max-width: 620px) {
  .todo { grid-template-columns: 36px minmax(0, 1fr); }
  .todo .t-acts { grid-column: 2; flex-wrap: wrap; }
  .todo .chev { display: none; }
}
.caught { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 28px 16px; border-radius: 14px; background: var(--field); }
.caught .tile { width: 48px; height: 48px; border-radius: 50%; background: var(--good-soft); color: var(--good); }
.caught p { color: var(--muted); font-size: 13px; max-width: 360px; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters .field { width: auto; flex: 1 1 240px; border-radius: 999px; padding: 8px 14px; }
.count-line { font-size: 12px; color: var(--muted); }

/* discovery */
.disc { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px 8px; margin-inline: -8px; border-top: 1px solid var(--line); border-radius: 12px; }
.disc:first-child { border-top: 0; }
.disc:hover { background: var(--field); }
.disc .d-main { min-width: 0; display: grid; gap: 4px; }
.disc .d-main b { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.disc .d-main small { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.disc .snip { font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.disc .d-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.disc .d-acts { display: flex; gap: 4px; align-items: center; }
.icon-act.yes:hover { background: var(--good-soft); color: var(--good); }
.icon-act.no:hover { background: var(--bad-soft); color: var(--bad); }
.icon-act[aria-pressed="true"].yes { background: var(--good-soft); color: var(--good); }
.icon-act[aria-pressed="true"].no { background: var(--bad-soft); color: var(--bad); }

/* recent runs */
.run-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 8px; }
.run-sum .rs { background: var(--field); border-radius: 14px; padding: 12px 14px; display: grid; gap: 2px; min-width: 0; }
.run-sum .rs span, .run-sum .rs small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-sum .rs b { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.run-sum .rs.good b { color: var(--good); } .run-sum .rs.bad b { color: var(--bad); }
.runs-tbl td.num { font-weight: 600; }
.runs-tbl .zero { color: var(--muted); font-weight: 500; }
.runs-tbl .err { color: var(--bad); }
.runs-tbl .when b { display: block; font-weight: 600; white-space: nowrap; }
.runs-tbl .when small { display: block; color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; }
.runs-tbl .notes { color: var(--muted); font-size: 12px; }
.runs-tbl .clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.runs-tbl .ok-note { display: inline-flex; gap: 6px; align-items: center; color: var(--good); font-weight: 600; white-space: nowrap; }
.runs-tbl .ok-note svg { width: 14px; height: 14px; }
.pill .pdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
@media (min-width: 768px) {
  .runs-tbl th, .runs-tbl td { padding-inline: 14px; }
  .runs-tbl th:first-child, .runs-tbl td:first-child { padding-left: 4px; }
  .runs-tbl .num { width: 1%; white-space: nowrap; }
  .runs-tbl .notes { min-width: 200px; padding-left: 28px; }
}
@media (max-width: 767px) {
  .run-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .runs-tbl .when { text-align: right; }
}

/* jobs */
.job { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.job:first-child { border-top: 0; }
.job b { font-size: 13px; font-weight: 700; display: block; }
.job small { display: block; font-size: 12px; color: var(--muted); }
.job .opts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.job .opts input { width: 130px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 12px; font-size: 12px; }
.job .tile.spend { background: var(--warn-soft); color: var(--warn); }
.log { margin: 0; background: #111; color: #d9d9d9; border-radius: 14px; padding: 14px; font: 12px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; min-height: 160px; overflow-y: auto; }
.log-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.log-head code { font: 600 12px var(--mono); background: var(--field); border-radius: 8px; padding: 4px 8px; overflow-wrap: anywhere; }

/* slide-over, bulk, toast, dialog */
.backdrop { position: fixed; inset: 0; background: rgb(0 0 0 / .35); z-index: 40; }
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--card); z-index: 41; padding: 22px; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 16px; box-shadow: -12px 0 40px rgb(0 0 0 / .2); border-left: 1px solid var(--card-border); }
.panel .sheet-body { display: grid; gap: 18px; align-content: start; overflow-y: auto; padding: 2px; }
.panel .sheet-foot { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.panel .sheet-foot .muted { margin-right: auto; font-size: 12px; }
.sheet-top { display: flex; align-items: center; gap: 10px; }
.sheet-top .pills { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
@media (prefers-reduced-motion: no-preference) { .panel { animation: slide-in .22s cubic-bezier(.2,.8,.2,1); } .backdrop { animation: fade-in .2s ease-out; } @keyframes slide-in { from { transform: translateX(32px); opacity: 0; } } @keyframes fade-in { from { opacity: 0; } } }
.sheet-hero { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 14px; align-items: center; }
.sheet-hero .co { width: 52px; height: 52px; font-size: 14px; }
.sheet-hero h2 { font-size: 18px; line-height: 1.3; overflow-wrap: anywhere; }
.sheet-hero p { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fact { background: var(--field); border-radius: 12px; padding: 10px 12px; display: grid; gap: 4px; min-width: 0; }
.fact.wide { grid-column: 1 / -1; }
.fact > span:first-child { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.fact b { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; white-space: pre-line; }
.sec { display: grid; gap: 10px; }
.sec h3 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.sec ul { margin: 0; padding-left: 18px; font-size: 13px; display: grid; gap: 4px; overflow-wrap: anywhere; }
.next { background: var(--lime-soft); border-radius: 12px; padding: 12px 14px; font-size: 13px; }
.next b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 2px; }
.review-box { display: grid; gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); }
.review-box .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bulk { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); background: #111; color: #fff; border-radius: 999px; padding: 8px 8px 8px 18px; display: flex; gap: 10px; align-items: center; z-index: 35; box-shadow: 0 10px 30px rgb(0 0 0 / .3); flex-wrap: wrap; max-width: calc(100% - 32px); }
.bulk select { background: #222; color: #fff; border: 1px solid #333; border-radius: 999px; padding: 6px 10px; font-size: 12px; }
.bulk .btn { background: var(--lime); color: #111; }
.bulk .btn.out { background: transparent; color: #fff; border-color: #444; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); background: var(--lime); color: #111; padding: 8px 8px 8px 18px; min-height: 40px; border-radius: 999px; font-weight: 600; z-index: 60; box-shadow: 0 8px 24px rgb(0 0 0 / .25); display: flex; align-items: center; gap: 12px; max-width: calc(100% - 32px); animation: toast-in .28s cubic-bezier(.2,.8,.2,1); }
.toast.err { background: var(--bad); color: #fff; }
.toast:not(:has(button)) { padding-right: 18px; }
.toast span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast button { border: 0; border-radius: 999px; background: #111; color: var(--lime); font-weight: 700; font-size: 12px; padding: 6px 14px; flex: none; }
body:has(#bulk:not([hidden])) .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
@keyframes toast-in { from { transform: translate(-50%, 16px); opacity: 0; } }
.confirm { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgb(0 0 0 / .4); }
.confirm .card { width: min(420px, 100%); box-shadow: 0 20px 60px rgb(0 0 0 / .3); }
.confirm .acts { display: flex; gap: 8px; justify-content: flex-end; }
.drawer-bg { display: none; }

/* Grid children default to min-width: auto, so one wide table would widen its card and the
   page. Every card part may shrink; tables scroll inside .scroll-x instead. */
.card > *, .view > *, .grid > *, .main > * { min-width: 0; }

/* views */
.view[hidden] { display: none !important; }
.view { display: grid; gap: 16px; align-content: start; }

/* ---------- motion ---------- */
.btn, .chip, .ibtn, .add-pill, .kpi .go, .nav a, .tbl tbody tr, .row-item, .todo, .field, .search input, .results button, .link-btn, .icon-act, .disc {
  transition: background-color .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s cubic-bezier(.2,.8,.2,1), opacity .16s ease; }
.btn:not(:disabled):hover { filter: brightness(1.08); }
.btn.out:not(:disabled):hover { filter: none; }
.btn:not(:disabled):active, .chip:active, .ibtn:active, .add-pill:active, .kpi .go:active, .icon-act:active { transform: scale(.96); }
.nav a svg { transition: transform .2s cubic-bezier(.2,.8,.2,1); }
.nav a:hover svg { transform: translateX(2px); }
.field:focus, .search input:focus, .sel-pill:focus, .job .opts input:focus { outline: none; border-color: var(--lime-line); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lime) 35%, transparent); }
.search input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--lime) 35%, transparent), var(--card-shadow); }
.results { animation: pop-in .16s cubic-bezier(.2,.8,.2,1); transform-origin: top; }
@keyframes pop-in { from { transform: scale(.97) translateY(-4px); opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .view.enter { animation: view-in .32s cubic-bezier(.2,.8,.2,1); }
  .view.enter .card { animation: card-in .45s cubic-bezier(.2,.8,.2,1) both; }
  .view.enter .kpis > .card:nth-child(2) { animation-delay: .04s; } .view.enter .kpis > .card:nth-child(3) { animation-delay: .08s; } .view.enter .kpis > .card:nth-child(4) { animation-delay: .12s; }
  .view.enter .grid > .card:nth-child(2) { animation-delay: .1s; } .view.enter .grid > .card:nth-child(3) { animation-delay: .14s; }
  .view.enter .grid > .card:nth-child(4) { animation-delay: .18s; } .view.enter .grid > .card:nth-child(n+5) { animation-delay: .22s; }
  @keyframes view-in { from { opacity: .4; } }
  @keyframes card-in { from { opacity: 0; transform: translateY(8px); } }
  .side { transition: padding .2s ease, transform .28s cubic-bezier(.2,.8,.2,1); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- responsive ---------- */
@media (max-width: 1279px) {
  .c7, .c5, .c8 { grid-column: span 12; }
  .c3, .c4 { grid-column: span 6; }
  .gauge { width: 84px; }
  .gauge .g-txt b { font-size: 13px; }
  .kpi.with-gauge .mid { align-items: center; }
}
@media (max-width: 1023px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tbl .who b, .tbl .who small { max-width: 260px; }
}
@media (max-width: 767px) {
  body { padding: 0; }
  .shell { grid-template-columns: minmax(0, 1fr); border-radius: 0; --side-w: 260px; }
  .side { position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; width: 260px; height: auto; transform: translateX(-100%); padding-top: calc(22px + env(safe-area-inset-top, 0px)); }
  .shell.drawer-open .side { transform: none; }
  .shell.drawer-open .drawer-bg { display: block; position: fixed; inset: 0; background: rgb(0 0 0 / .45); z-index: 45; }
  .main { border-radius: 0; padding: 16px 16px 32px; }
  .ibtn.menu-btn { display: grid; }
  .topbar { top: 0; margin: -16px -16px 0; padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 10px; gap: 8px; }
  .topbar h1 { font-size: 20px; }
  .search { order: 5; flex: 1 1 100%; }
  .search kbd { display: none; }
  .add-pill .lbl-add { display: none; }
  .add-pill { padding: 6px; }
  .grid, .kpis { gap: 12px; }
  .kpis { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(250px, 82%); overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .kpis::-webkit-scrollbar { display: none; }
  .kpi { scroll-snap-align: start; }
  .c3, .c4 { grid-column: span 12; }
  .card { padding: 16px; border-radius: 16px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
  .chips::-webkit-scrollbar { display: none; }
  .stack thead { display: none; }
  .stack, .stack tbody, .stack tr, .stack td { display: block; width: 100%; }
  .stack tr { border-top: 1px solid var(--line); padding: 12px 0; }
  .stack td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
  .stack td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 600; }
  .stack td.who-cell { padding-bottom: 6px; }
  .stack .who b, .stack .who small { max-width: 100%; }
  .stack .wrap { max-width: 60%; text-align: right; }
  .tbl .acts a, .tbl .acts button { width: 40px; height: 40px; }
  .review-box .two { grid-template-columns: 1fr; }
  .panel { padding: calc(18px + env(safe-area-inset-top, 0px)) 18px calc(18px + env(safe-area-inset-bottom, 0px)); }
  .panel .sheet-foot .btn { flex: 1 1 auto; justify-content: center; }
  .disc { grid-template-columns: minmax(0, 1fr); } .disc > .co { display: none; }
  .job { grid-template-columns: minmax(0, 1fr); } .job > .tile { display: none; }
  .bulk { border-radius: 18px; }
  .ibtn, .add-pill { min-height: 40px; }
}

/* ---------- small additions ---------- */
.gauge .g-val { stroke: var(--lime-line); }
.gauge .g-val.warn { stroke: var(--warn); } .gauge .g-val.bad { stroke: var(--bad); }
.nowrap { white-space: nowrap; }
.tbl small.sub-warn { color: var(--warn); white-space: normal; }
.tbl td code { font: 12px var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.review-box h3 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); flex: 1; }
.review-box .sheet-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.review-box .sheet-foot .muted { margin-right: auto; font-size: 12px; }
.tbl .who .tile { width: 36px; height: 36px; border-radius: 10px; }
.tbl .who .tile svg { width: 16px; height: 16px; }
.chart-wrap .ylab.clip { fill: var(--ink); font-weight: 700; }

/* ---------- STG Lead Radar additions ---------- */
.mono { font-family: var(--mono, ui-monospace, Consolas, monospace); font-size: 12.5px; letter-spacing: .02em; }
.mono.flag { color: var(--warn); }
.none { color: var(--muted); font-style: italic; font-size: 12.5px; }
.phone-link { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 700; text-decoration: none; white-space: nowrap; }
.phone-link svg { width: 14px; height: 14px; color: var(--good); }
.phone-link:hover { text-decoration: underline; }
.btn.lime { background: var(--lime); color: var(--on-lime); }
.btn.lime svg, .btn.out svg { width: 14px; height: 14px; }
.copy-btn { border: 0; background: var(--field); color: var(--muted); border-radius: 8px; padding: 3px 5px; margin-left: 6px; display: inline-grid; place-items: center; vertical-align: middle; }
.copy-btn svg { width: 13px; height: 13px; }
.copy-btn:hover { color: var(--ink); }
.seller { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--field); font: 500 13px/1.5 var(--font); max-height: 300px; overflow-y: auto; }


/* ---------- dropdowns ---------- */
.dd { position: relative; display: inline-flex; min-width: 0; }
.dd-btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 10px 7px 14px; min-height: 34px; font-size: 12px; font-weight: 600; white-space: nowrap; max-width: 100%;
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease; }
.dd-btn:hover { background: var(--field); }
.dd-btn .dd-val { overflow: hidden; text-overflow: ellipsis; }
.dd-btn svg { width: 14px; height: 14px; color: var(--muted); transition: transform .25s cubic-bezier(.2,.8,.2,1), color .16s ease; }
.dd.open .dd-btn { border-color: var(--lime-line); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lime) 30%, transparent); }
.dd.open .dd-btn svg { transform: rotate(180deg); color: var(--ink); }
.dd.active .dd-btn { background: var(--lime-soft); border-color: color-mix(in srgb, var(--lime-line) 55%, transparent); }
.dd.active .dd-btn svg { color: var(--ink); }
.dd-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: max(100%, 184px); max-height: 330px; overflow-y: auto; overscroll-behavior: contain; padding: 6px; display: grid; gap: 1px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 44px rgb(0 0 0 / .2); transform-origin: top left; animation: dd-in .18s cubic-bezier(.2,.8,.2,1); }
.dd-menu.up { top: auto; bottom: calc(100% + 6px); transform-origin: bottom left; }
.dd-menu.right { left: auto; right: 0; transform-origin: top right; }
.dd-menu.leaving { animation: dd-out .14s ease-in forwards; pointer-events: none; }
.dd-opt { display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 0; background: none; color: var(--ink); text-align: left; padding: 8px 10px; border-radius: 9px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.dd-opt:hover, .dd-opt:focus-visible { background: var(--field); outline: none; box-shadow: none; }
.dd-opt svg { width: 15px; height: 15px; color: var(--lime-line); opacity: 0; transform: scale(.5); transition: opacity .16s ease, transform .22s cubic-bezier(.2,.8,.2,1.4); }
.dd-opt[aria-selected="true"] { font-weight: 700; }
.dd-opt[aria-selected="true"] svg { opacity: 1; transform: none; }
.dd-back { position: fixed; inset: 0; z-index: 80; background: rgb(0 0 0 / .45); animation: dd-fade .2s ease-out; }
.dd-back.leaving { animation: dd-fade-out .18s ease-in forwards; }
.dd-menu.sheet { position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 81; min-width: 0; max-height: 72dvh; gap: 2px; padding: 8px 12px calc(14px + env(safe-area-inset-bottom, 0px));
  border-radius: 24px 24px 0 0; border-bottom: 0; animation: sheet-up .3s cubic-bezier(.2,.8,.2,1); }
.dd-menu.sheet.leaving { animation: sheet-down .2s ease-in forwards; }
.dd-head { position: sticky; top: -8px; z-index: 1; display: grid; justify-items: center; gap: 10px; padding: 6px 0 10px; background: var(--card); }
.dd-head .grab { width: 40px; height: 4px; border-radius: 99px; background: var(--line); }
.dd-head b { font-size: 14px; }
.dd-menu.sheet .dd-opt { padding: 14px 12px; font-size: 15px; border-radius: 12px; }
.dd-menu.sheet .dd-opt[aria-selected="true"] { background: var(--lime-soft); }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px) scale(.97); } }
@keyframes dd-out { to { opacity: 0; transform: translateY(-4px) scale(.98); } }
@keyframes dd-fade { from { opacity: 0; } }
@keyframes dd-fade-out { to { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@media (min-width: 768px) { .dd.only-phone { display: none; } }

/* ---------- micro-interactions ---------- */
.btn, .add-pill, .seg button, .chip, .dd-btn, .tab { position: relative; overflow: hidden; -webkit-tap-highlight-color: transparent; }
.ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .2; transform: scale(0); pointer-events: none; animation: ripple .6s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
.toast { overflow: hidden; }
.toast .toast-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: currentColor; opacity: .3; transform-origin: left; animation: toast-life var(--life, 3.5s) linear forwards; }
.toast.out { animation: toast-out .2s ease-in forwards; }
@keyframes toast-life { to { transform: scaleX(0); } }
@keyframes toast-out { to { transform: translate(-50%, 14px); opacity: 0; } }
.copy-btn.done { color: var(--good); background: var(--good-soft); }
.topbar { transition: box-shadow .2s ease; }
.topbar.scrolled { box-shadow: 0 1px 0 var(--line), 0 8px 18px -12px rgb(0 0 0 / .35); }
.kpi { cursor: pointer; }
.chart-wrap .hit { touch-action: pan-y; }
@media (prefers-reduced-motion: no-preference) {
  .view.enter .todo, .view.enter .row-item, .view.enter .age, .view.enter #leads-tbl tbody tr { animation: rise .45s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 40ms + 140ms); }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } }
  #leads-tbl tbody { animation: dd-fade .22s ease-out; }
  .dd-menu .dd-opt { animation: rise .26s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 18ms); }
  .todo.leaving { animation: row-out .26s cubic-bezier(.4,0,.2,1) forwards; pointer-events: none; }
  @keyframes row-out { to { opacity: 0; transform: translateX(28px); } }
  .badge.bump { animation: bump .55s cubic-bezier(.2,.8,.2,1.4); }
  @keyframes bump { 35% { transform: scale(1.35); } }
  .copy-btn.done svg { animation: pop .3s cubic-bezier(.2,.8,.2,1.6); }
  @keyframes pop { from { transform: scale(.4); } }
  .kpi { transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s ease, background-color .2s ease; }
  .kpi:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -12px rgb(0 0 0 / .35); }
  .kpi:active { transform: translateY(-1px) scale(.99); }
  .btn.lime[href^="tel:"]:hover svg, .phone-link:hover svg { animation: ring .65s ease-in-out; }
  @keyframes ring { 15% { transform: rotate(-16deg); } 30% { transform: rotate(14deg); } 45% { transform: rotate(-10deg); } 60% { transform: rotate(6deg); } 75% { transform: rotate(-3deg); } }
  .ibtn.turn svg { animation: turn .5s cubic-bezier(.2,.8,.2,1); }
  @keyframes turn { from { transform: rotate(-120deg) scale(.5); opacity: 0; } }
  .row-item.click:hover .end b.price { color: var(--lime-line); }
  .age.pick:hover .bar i { filter: brightness(1.1); }
  .todo:hover .co, .row-item.click:hover .co { transform: scale(1.08) rotate(-4deg); }
  .seg button:active, .dd-opt:active { transform: scale(.96); }
}

/* ---------- phone tab bar ---------- */
.tabbar { display: none; }
@media (max-width: 767px) {
  .tabbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 36; padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--side) 90%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-top: 1px solid #2a2a2a; }
  .tab { display: grid; justify-items: center; gap: 3px; padding: 5px 0 3px; border: 0; background: none; color: #8a8a8a; text-decoration: none; font: inherit; font-size: 10.5px; font-weight: 600; border-radius: 14px; }
  .tab .t-ic { position: relative; width: 54px; height: 30px; border-radius: 999px; display: grid; place-items: center; transition: background-color .22s ease, color .22s ease; }
  .tab svg { width: 20px; height: 20px; transition: transform .3s cubic-bezier(.2,.8,.2,1.5); }
  .tab[aria-current="page"] { color: #fff; }
  .tab[aria-current="page"] .t-ic { background: var(--lime); color: #111; }
  .tab[aria-current="page"] svg { transform: translateY(-1px) scale(1.06); }
  .tab .badge { position: absolute; top: -5px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #333; color: #ddd; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--side); }
  .tab .badge.lime { background: var(--lime); color: #111; }
  .tab[aria-current="page"] .badge { background: #111; color: var(--lime); }
  .tab .dot { position: absolute; top: 2px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: #4ade80; }
  .main { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }

  /* top bar: one row; Collect is the lime action, More in the tab bar opens the menu */
  .ibtn.menu-btn, #btn-reload { display: none; }
  .topbar .title-block { min-width: 0; }
  .add-pill { width: 40px; height: 40px; padding: 0; justify-content: center; background: var(--lime); }
  .add-pill .plus { background: transparent; color: #111; }
  .add-pill .plus svg { width: 18px; height: 18px; }

  /* KPIs: all four at a glance, 2 x 2 */
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row; grid-auto-columns: auto; overflow: visible; margin-inline: 0; padding: 0; }
  .kpi { min-height: 0; padding: 14px; gap: 10px; }
  .kpi .tile { width: 32px; height: 32px; border-radius: 10px; }
  .kpi .tile svg { width: 16px; height: 16px; }
  .kpi .go { width: 28px; height: 28px; }
  .kpi .lbl { font-size: 12px; }
  .kpi .num { font-size: 24px; }
  .kpi .num small { font-size: 15px; }

  /* filters: search on its own row, dropdowns two per row */
  .filters .field { flex: 1 1 100%; }
  .filters .dd { flex: 1 1 calc(50% - 4px); }
  .filters .dd-btn { width: 100%; min-height: 40px; }
  .filters #f-clear { flex: 1 1 100%; text-align: center; padding: 6px; }

  /* lead lists: one card per car instead of label rows */
  #leads-tbl.stack tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: center; padding: 14px 0;
    grid-template-areas: "who who score" "miles price where" "phone phone stage" "vin vin posted"; }
  #leads-tbl.stack td { display: block; padding: 0; min-width: 0; text-align: left; }
  #leads-tbl.stack td::before { content: none; }
  #leads-tbl.stack td[colspan] { grid-column: 1 / -1; }
  #leads-tbl .who-cell { grid-area: who; }
  #leads-tbl .c-score { grid-area: score; justify-self: end; }
  #leads-tbl .c-miles { grid-area: miles; } #leads-tbl .c-price { grid-area: price; } #leads-tbl .c-where { grid-area: where; }
  #leads-tbl .c-miles, #leads-tbl .c-price, #leads-tbl .c-where { background: var(--field); border-radius: 12px; padding: 8px 10px; overflow: hidden; }
  #leads-tbl.stack .c-miles::before, #leads-tbl.stack .c-price::before, #leads-tbl.stack .c-where::before { content: attr(data-label); display: block; font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 2px; }
  #leads-tbl .c-miles > div, #leads-tbl .c-price > div, #leads-tbl .c-where > div { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #leads-tbl .c-miles small, #leads-tbl .c-where small { display: block; font-size: 11px; }
  #leads-tbl .c-phone { grid-area: phone; }
  #leads-tbl .c-phone .phone-link { padding: 9px 16px; border-radius: 999px; background: var(--lime); color: var(--on-lime); text-decoration: none; }
  #leads-tbl .c-phone .phone-link svg { color: var(--on-lime); }
  #leads-tbl .c-stage { grid-area: stage; justify-self: end; }
  #leads-tbl .c-vin { grid-area: vin; overflow: hidden; }
  #leads-tbl .c-posted { grid-area: posted; justify-self: end; color: var(--muted); font-size: 12px; }

  /* pipeline: car and miles fit; the score is in the lead panel */
  #pipe-tbl { table-layout: auto; }
  #pipe-tbl col, #pipe-tbl th:nth-child(3), #pipe-tbl td:nth-child(3) { display: none; }

  /* lead panel: a bottom sheet */
  .panel { top: auto; left: 0; width: 100%; height: min(92dvh, 900px); border-radius: 24px 24px 0 0; border-left: 0; padding-top: 26px; box-shadow: 0 -16px 44px rgb(0 0 0 / .35); }
  .panel::before { content: ""; position: absolute; top: 10px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 99px; background: var(--line); }
}
@media (max-width: 767px) and (prefers-reduced-motion: no-preference) {
  .panel { animation: sheet-up .32s cubic-bezier(.2,.8,.2,1); }
}

/* "Waiting on you" on narrow cards: full-width call button, stage buttons share a row */
@container (max-width: 460px) {
  .todo .t-acts { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .todo .t-acts .btn { justify-content: center; padding-block: 10px; font-size: 13px; }
  .todo .seg { display: flex; }
  .todo .seg button { flex: 1; padding-block: 9px; }
}
.chips > .chip { flex: none; }
@media (max-width: 767px) {
  #leads-tbl.stack td { width: auto; }
  #leads-tbl .c-score, #leads-tbl .c-stage, #leads-tbl .c-posted { text-align: right; }
}

/* snapshot mode (standalone dashboard): nothing to collect, no runs or source health */
[data-mode="snapshot"] #btn-run, [data-mode="snapshot"] #btn-bell, [data-mode="snapshot"] #leads-xlsx { display: none !important; }

/* ---------- accounts (snapshot mode) ---------- */
.me.click { cursor: pointer; border-radius: 12px; margin-inline: -6px; padding-inline: 6px; padding-bottom: 6px; transition: background-color .16s ease; }
.me.click:hover, .me.click[aria-expanded="true"] { background: var(--side-hover); }
.me .who { flex: 1; min-width: 0; }
.me .who span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me > svg { width: 16px; height: 16px; color: #6b6b6b; flex: none; transition: transform .2s ease; }
.me[aria-expanded="true"] > svg { transform: rotate(180deg); }
.av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 12px; font-weight: 800; letter-spacing: .02em;
  background: linear-gradient(135deg, var(--lime), #b9d23a); color: #111; }
.me .av { background: linear-gradient(135deg, var(--lime), #b9d23a); color: #111; }
.av.lg { width: 44px; height: 44px; font-size: 14px; }
.av.xl { width: 72px; height: 72px; font-size: 22px; box-shadow: 0 0 0 4px var(--card), 0 0 0 6px color-mix(in srgb, var(--lime) 55%, transparent); }
.avatar-btn { position: relative; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: none; flex: none; }
.avatar-btn .av { width: 40px; height: 40px; transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s ease; }
.avatar-btn:hover .av, .avatar-btn[aria-expanded="true"] .av { transform: scale(1.06); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lime) 35%, transparent); }
.avatar-btn .u-dot { position: absolute; right: 1px; bottom: 1px; width: 11px; height: 11px; border-radius: 50%; background: var(--good); border: 2px solid var(--main); }
.dd-menu.acct { position: fixed; top: auto; left: auto; z-index: 90; min-width: 260px; padding: 8px; transform-origin: top right; }
.dd-menu.acct.up-fixed { transform-origin: bottom left; }
.acct-head { display: flex; gap: 12px; align-items: center; padding: 8px 8px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.acct-head b { display: block; font-size: 14px; }
.acct-head small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.acct-item > span { display: inline-flex; align-items: center; gap: 10px; }
.acct-item svg { width: 16px; height: 16px; opacity: 1; transform: none; color: var(--muted); }
.acct-item.danger, .acct-item.danger svg { color: var(--bad); }
.acct-sep { height: 1px; background: var(--line); margin: 4px 6px; }
.role-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--warn-soft); color: var(--warn); white-space: nowrap; }
.role-pill svg { width: 12px; height: 12px; }
.role-pill.admin { background: var(--good-soft); color: var(--good); }
.ro-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px dashed var(--line); color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.ro-chip svg { width: 13px; height: 13px; }
.ro-box .card-head { justify-content: space-between; }
.ro-note { background: var(--field); border-radius: 10px; padding: 10px 12px; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.modal .card { justify-items: start; }
.modal .card h2 { font-size: 17px; }
.modal .card .acts { width: 100%; }
.lock-tile { background: var(--warn-soft); color: var(--warn); }
.modal.leaving { animation: dd-fade-out .18s ease-in forwards; }
@media (prefers-reduced-motion: no-preference) { .modal { animation: dd-fade .2s ease-out; } .modal .card { animation: pop-in .26s cubic-bezier(.2,.8,.2,1); } }

/* profile */
.p-card { gap: 18px; }
.p-hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.p-id { flex: 1; min-width: 200px; display: grid; gap: 4px; }
.p-id h2 { font-size: 22px; }
.p-id .pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.p-card .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.upgrade { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--lime) 16%, var(--card)), var(--card) 70%); border: 1px solid color-mix(in srgb, var(--lime-line) 35%, transparent); }
.upgrade .tile { background: var(--lime); color: #111; }
.upgrade b { font-size: 15px; }
.upgrade p { color: var(--muted); font-size: 13px; margin-top: 2px; max-width: 720px; }
.feats { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.feat { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px; border-radius: 14px; background: var(--field); border: 1px solid transparent; text-align: left; font: inherit; color: inherit; }
.feat b { display: block; font-size: 13px; }
.feat small { display: block; font-size: 12px; color: var(--muted); }
.feat .f-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--lime-soft); color: var(--ink); }
.feat .f-st { position: absolute; top: 14px; right: 14px; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.feat b { padding-right: 76px; }
.feat .f-st svg { width: 13px; height: 13px; }
.feat .f-st.ok { color: var(--good); } .feat .f-st.lock { color: var(--muted); }
.feat.locked { cursor: pointer; background: transparent; border: 1px dashed var(--line); }
.feat.locked .f-ic { background: var(--field); color: var(--muted); }
.feat.locked b { color: var(--muted); }
.feat.locked:hover { border-color: var(--lime-line); }
.feat.locked:hover .f-st.lock { color: var(--ink); }
@media (prefers-reduced-motion: no-preference) {
  .view.enter .feat { animation: rise .45s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 40ms + 140ms); }
  .feat.locked:hover .f-st.lock svg { animation: ring .6s ease-in-out; }
}

/* sign-in: form on the left, Datafarm artwork on the right */
body.signed-out { padding: 0; }
body.signed-out .shell, body.signed-out .toast { display: none; }
.login { position: fixed; inset: 0; z-index: 100; display: grid; grid-template-columns: minmax(420px, 46fr) 54fr; gap: 24px; padding: 24px; background: var(--main); overflow-y: auto; }
.login-side { display: grid; grid-template-rows: auto 1fr auto; padding: 16px clamp(16px, 6vw, 96px); min-height: 0; }
.login-top { display: flex; align-items: center; justify-content: space-between; }
.lg-brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; }
.lg-brand .mark { width: 36px; height: 36px; border-radius: 11px; background: var(--lime); color: #111; display: grid; place-items: center; }
.lg-brand .mark svg { width: 20px; height: 20px; stroke-width: 2.2; }
.login-form { align-self: center; width: min(460px, 100%); display: grid; gap: 22px; padding-block: 32px; }
.login-form h1 { font-size: clamp(40px, 4.4vw, 64px); font-weight: 500; letter-spacing: -.035em; line-height: 1.02; }
.lg-sub { color: var(--muted); font-size: 16px; margin-top: -10px; }
.lg-field { display: grid; gap: 10px; font-size: 14px; font-weight: 500; color: color-mix(in srgb, var(--ink) 78%, transparent); }
.lg-field input { width: 100%; height: 58px; padding: 0 20px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 500 15px var(--font);
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease; }
.lg-field input::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
.lg-field input:hover { border-color: color-mix(in srgb, var(--ink) 22%, transparent); }
.lg-field input:focus { outline: none; border-color: var(--lime-line); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lime) 22%, transparent); }
.pw { position: relative; display: block; }
.pw input { padding-right: 56px; }
.pw-eye { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 10px; background: none; color: var(--muted); display: grid; place-items: center; }
.pw-eye:hover { color: var(--ink); background: var(--field); }
.lg-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lg-check { display: inline-flex; align-items: center; gap: 12px; font-size: 14px; cursor: pointer; user-select: none; }
.lg-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lg-check .box { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid color-mix(in srgb, var(--ink) 30%, transparent); display: grid; place-items: center; transition: background-color .16s ease, border-color .16s ease; }
.lg-check .box::after { content: ""; width: 10px; height: 6px; border: 2px solid #111; border-top: 0; border-right: 0; transform: rotate(-45deg) scale(0); margin-top: -2px; transition: transform .2s cubic-bezier(.2,.8,.2,1.5); }
.lg-check input:checked + .box { background: var(--lime); border-color: var(--lime); }
.lg-check input:checked + .box::after { transform: rotate(-45deg) scale(1); }
.lg-check input:focus-visible + .box { outline: 2px solid var(--lime); outline-offset: 2px; }
.lg-link { border: 0; background: none; padding: 0; font: 600 14px var(--font); color: var(--lg-link); cursor: pointer; background-image: linear-gradient(currentColor, currentColor); background-size: 0 1.5px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size .25s ease; }
.lg-link:hover { background-size: 100% 1.5px; }
.lg-help { font-size: 13px; color: var(--muted); background: var(--field); border-radius: 12px; padding: 12px 14px; margin-top: -8px; }
.login-err { background: var(--bad-soft); color: var(--bad); border-radius: 12px; padding: 12px 14px; font-size: 14px; font-weight: 600; margin-top: -6px; }
.lg-submit { position: relative; overflow: hidden; height: 58px; border: 0; border-radius: 16px; background: var(--lime); color: #111; font: 700 16px var(--font); cursor: pointer;
  box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--lime) 70%, transparent); transition: transform .16s cubic-bezier(.2,.8,.2,1), box-shadow .2s ease, filter .16s ease; }
.lg-submit:hover { filter: brightness(1.04); box-shadow: 0 16px 40px -14px color-mix(in srgb, var(--lime) 85%, transparent); }
.lg-submit:active { transform: scale(.985); }
.lg-submit:disabled { cursor: default; }
.lg-submit.busy span { opacity: .55; }
.lg-submit.busy::after { content: ""; position: absolute; right: 22px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; border: 2.5px solid rgb(17 17 17 / .25); border-top-color: #111; animation: spin .7s linear infinite; }
.lg-or { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 13px; }
.lg-or::before, .lg-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.lg-note { text-align: center; color: var(--muted); font-size: 14px; }
.login-foot { color: var(--muted); font-size: 13px; }
.login-art { position: relative; overflow: hidden; border-radius: 28px; background: var(--la-base); min-height: 520px; isolation: isolate; }
.la-bg { position: absolute; inset: -2%; background-size: cover; background-position: center; opacity: 0; transition: opacity 1.2s ease; }
#la-bg-a { background-image: var(--art-1); }
#la-bg-b { background-image: var(--art-2); }
.la-bg.on { opacity: 1; }
.la-shade { position: absolute; inset: 0; background: var(--la-shade); transition: background .4s ease; }
.la-content { position: absolute; left: clamp(24px, 4vw, 56px); right: clamp(24px, 4vw, 56px); bottom: clamp(24px, 4vw, 56px); display: grid; gap: 20px; color: var(--la-fg); }
.la-content h2 { font-size: clamp(34px, 3.6vw, 60px); font-weight: 500; letter-spacing: -.035em; line-height: 1.02; text-shadow: var(--la-glow); }
.la-card { max-width: 520px; padding: 20px 24px; border-radius: 18px; background: var(--la-card); border: 1px solid var(--la-card-line); box-shadow: var(--la-card-shadow); -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2); }
.la-card b { display: block; font-size: 17px; margin-bottom: 6px; }
.la-card p { color: var(--la-muted); font-size: 15px; line-height: 1.55; }
.la-dots { display: flex; gap: 8px; }
.la-dots button { position: relative; width: 56px; height: 4px; padding: 0; border: 0; border-radius: 99px; background: var(--la-track); overflow: hidden; cursor: pointer; }
.la-dots button i { position: absolute; inset: 0; width: 0; background: var(--la-bar); border-radius: 99px; }
.la-dots button.seen i { width: 100%; }
.la-dots button[aria-selected="true"] i { width: 100%; }
.login.leaving { animation: dd-fade-out .32s ease-in forwards; }
@media (prefers-reduced-motion: no-preference) {
  .login-form > * { animation: rise .6s cubic-bezier(.2,.8,.2,1) both; }
  .login-form > *:nth-child(2) { animation-delay: .05s; } .login-form > *:nth-child(3) { animation-delay: .1s; }
  .login-form > *:nth-child(4) { animation-delay: .15s; } .login-form > *:nth-child(5) { animation-delay: .2s; }
  .login-form > *:nth-child(n+6) { animation-delay: .25s; }
  .la-bg.on { animation: drift 16s ease-in-out infinite alternate; }
  @keyframes drift { from { transform: scale(1.02); } to { transform: scale(1.09) translate(-1%, -1%); } }
  .la-card.swap { animation: card-swap .5s cubic-bezier(.2,.8,.2,1); }
  @keyframes card-swap { from { opacity: 0; transform: translateY(10px); } }
  .la-dots button[aria-selected="true"] i { width: 0; animation: fillbar var(--slide, 6s) linear forwards; }
  @keyframes fillbar { to { width: 100%; } }
  .login-form.shake { animation: shake .42s cubic-bezier(.36,.07,.19,.97); }
  @keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
}
@media (max-width: 1023px) {
  .login { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; gap: 0; padding: 0; }
  .login-art { order: -1; min-height: 240px; border-radius: 0 0 28px 28px; }
  .la-content h2 { font-size: 30px; }
  .la-card, .la-dots { display: none; }
  .login-side { padding: 20px 20px 28px; }
  .login-top { position: absolute; top: 16px; left: 20px; right: 20px; z-index: 2; color: var(--la-fg); }
  .login-top .ibtn { background: var(--la-card); border-color: var(--la-card-line); color: var(--la-fg); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
  .login-form { padding-block: 24px 16px; gap: 18px; }
  .login-form h1 { font-size: 38px; }
  .login-foot { text-align: center; }
}
@media (max-width: 767px) {
  .p-card .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upgrade { grid-template-columns: minmax(0, 1fr); }
  .upgrade .tile { display: none; }
  .feats { grid-template-columns: minmax(0, 1fr); }
  .avatar-btn, .avatar-btn .av { width: 38px; height: 38px; }
}

/* sign-in artwork per theme: bright sunrise in light mode, the night Datafarm in dark mode */
:root {
  --art-1: url("/login-light-1.jpg"); --art-2: url("/login-light-2.jpg"); --la-base: #f1efe6;
  --la-shade: linear-gradient(180deg, rgb(255 255 255 / 0) 38%, rgb(255 255 255 / .42) 66%, rgb(250 250 246 / .86));
  --la-fg: #111111; --la-muted: rgb(17 17 17 / .7); --la-glow: 0 1px 24px rgb(255 255 255 / .55);
  --la-card: rgb(255 255 255 / .62); --la-card-line: rgb(255 255 255 / .75); --la-card-shadow: 0 10px 40px -18px rgb(0 0 0 / .25);
  --la-track: rgb(17 17 17 / .14); --la-bar: #9fb10f; --lg-link: #5f6b00;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --art-1: url("/login-dark-1.jpg"); --art-2: url("/login-dark-2.jpg"); --la-base: #070707;
  --la-shade: linear-gradient(180deg, rgb(0 0 0 / 0) 34%, rgb(0 0 0 / .5) 66%, rgb(0 0 0 / .86));
  --la-fg: #ffffff; --la-muted: rgb(255 255 255 / .76); --la-glow: 0 2px 30px rgb(0 0 0 / .45);
  --la-card: rgb(12 12 12 / .45); --la-card-line: rgb(255 255 255 / .12); --la-card-shadow: none;
  --la-track: rgb(255 255 255 / .22); --la-bar: var(--lime); --lg-link: var(--lime); } }
:root[data-theme="dark"] {
  --art-1: url("/login-dark-1.jpg"); --art-2: url("/login-dark-2.jpg"); --la-base: #070707;
  --la-shade: linear-gradient(180deg, rgb(0 0 0 / 0) 34%, rgb(0 0 0 / .5) 66%, rgb(0 0 0 / .86));
  --la-fg: #ffffff; --la-muted: rgb(255 255 255 / .76); --la-glow: 0 2px 30px rgb(0 0 0 / .45);
  --la-card: rgb(12 12 12 / .45); --la-card-line: rgb(255 255 255 / .12); --la-card-shadow: none;
  --la-track: rgb(255 255 255 / .22); --la-bar: var(--lime); --lg-link: var(--lime);
}

/* ---------- DSC Suite: locked tools in the sidebar (snapshot mode) ---------- */
.suite { margin-top: 10px; padding-top: 12px; border-top: 1px solid #262626; display: grid; gap: 2px; }
.suite-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 10px 8px; }
.suite-title { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: #f2f2f2; letter-spacing: .01em; }
.suite-title svg { width: 15px; height: 15px; color: var(--lime); }
.suite-sub { font-size: 11px; color: #7a7a7a; font-weight: 600; }
.suite-label { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: none; padding: 9px 10px 5px; color: #6b6b6b; font: 600 11px var(--font); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.suite-label .n { font-size: 10px; letter-spacing: 0; color: #555; }
.suite-label svg { width: 12px; height: 12px; margin-left: auto; transition: transform .2s ease; }
.suite-label[aria-expanded="false"] svg { transform: rotate(-90deg); }
.suite-label:hover { color: #9a9a9a; }
.suite-list { display: grid; gap: 1px; }
.suite-item { position: relative; display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: #8a8a8a; font: 500 13.5px var(--font); text-align: left; cursor: pointer; white-space: nowrap;
  transition: background-color .16s ease, color .16s ease; }
.suite-item > svg:first-child { width: 17px; height: 17px; flex: none; transition: color .16s ease, transform .2s cubic-bezier(.2,.8,.2,1); }
.suite-item .nlbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.suite-item:hover, .suite-item:focus-visible { background: var(--side-hover); color: #f2f2f2; }
.suite-item:hover > svg:first-child { color: var(--lime); transform: scale(1.08); }
.s-tag { flex: none; font-size: 9.5px; font-weight: 800; letter-spacing: .06em; padding: 2px 6px; border-radius: 6px; background: var(--lime); color: #111; }
.s-state { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: #5a5a5a; transition: color .16s ease, background-color .16s ease; }
.s-state svg { width: 12px; height: 12px; }
.suite-item:hover .s-state { color: var(--lime); background: rgb(228 245 91 / .12); }
.s-state.ok { color: #111; background: var(--lime); }
.suite-item.requested { color: #cfcfcf; }
.is-rail .suite-top, .is-rail .suite-label, .is-rail .suite-item .nlbl, .is-rail .s-tag, .is-rail .s-state { display: none; }
.is-rail .suite-item { justify-content: center; }

.suite-tip { position: fixed; z-index: 95; width: 320px; padding: 16px; border-radius: 16px; background: #141414; color: #f2f2f2; border: 1px solid #2c2c2c; box-shadow: 0 24px 60px -20px rgb(0 0 0 / .6); pointer-events: none; display: grid; gap: 12px; }
.suite-tip::before { content: ""; position: absolute; left: -6px; top: calc(var(--ay, 24px) - 6px); width: 12px; height: 12px; background: #141414; border-left: 1px solid #2c2c2c; border-bottom: 1px solid #2c2c2c; transform: rotate(45deg); }
.st-head { display: flex; align-items: center; gap: 12px; }
.st-head small { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #8a8a8a; }
.st-head b { font-size: 15px; }
.st-head .s-tag { margin-left: auto; }
.st-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; color: #111; background: linear-gradient(135deg, var(--lime), #b9d23a); }
.st-ic svg { width: 19px; height: 19px; }
.st-row em { display: block; font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--lime); margin-bottom: 3px; }
.st-row p { font-size: 13px; line-height: 1.5; color: #cfcfcf; }
.st-foot { display: flex; align-items: center; gap: 7px; padding-top: 10px; border-top: 1px solid #262626; font-size: 12px; color: #8a8a8a; }
.st-foot svg { width: 13px; height: 13px; color: var(--lime); }
@media (prefers-reduced-motion: no-preference) {
  .suite-tip.in { animation: tip-in .18s cubic-bezier(.2,.8,.2,1); }
  @keyframes tip-in { from { opacity: 0; transform: translateX(-6px); } }
  .suite-item:hover .s-state svg { animation: ring .6s ease-in-out; }
  .fp-check { animation: pop .45s cubic-bezier(.2,.8,.2,1.6); }
  .fp-done { animation: rise .4s cubic-bezier(.2,.8,.2,1); }
}

/* feature preview */
.feature-modal .card { width: min(580px, 100%); gap: 18px; padding: 22px; }
.fp-head { display: flex; align-items: center; gap: 14px; width: 100%; }
.fp-ic { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; flex: none; color: #111; background: linear-gradient(135deg, var(--lime), #b9d23a); box-shadow: 0 10px 30px -12px rgb(228 245 91 / .8); }
.fp-ic svg { width: 26px; height: 26px; }
.fp-group { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.fp-head h2 { display: flex; align-items: center; gap: 8px; font-size: 22px; letter-spacing: -.01em; margin-top: 2px; }
.fp-x { margin-left: auto; align-self: flex-start; }
.fp-preview { position: relative; width: 100%; height: 170px; border-radius: 16px; overflow: hidden; background: var(--field); border: 1px solid var(--line); }
.fp-art { position: absolute; inset: 0; padding: 18px; filter: blur(5px); opacity: .9; }
.look-chart .fp-art { display: flex; align-items: flex-end; gap: 10px; }
.look-chart .fp-art i { flex: 1; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--lime), color-mix(in srgb, var(--lime) 30%, transparent)); }
.look-map .fp-art i { position: absolute; width: var(--s); height: var(--s); border-radius: 50%; background: radial-gradient(circle, var(--lime), transparent 70%); }
.look-ask .fp-art { display: grid; gap: 10px; align-content: center; }
.fp-art .bubble { height: 26px; border-radius: 13px; background: var(--card); width: 70%; }
.fp-art .bubble.q { justify-self: end; width: 55%; background: var(--lime); }
.fp-art .bubble.s { width: 45%; }
.fp-art .row { display: flex; align-items: center; gap: 10px; height: 22px; margin-bottom: 8px; }
.fp-art .row i { width: 22px; height: 22px; border-radius: 50%; background: var(--lime); flex: none; }
.fp-art .row b { height: 10px; flex: 1; border-radius: 6px; background: var(--muted); opacity: .45; }
.fp-art .row u { height: 10px; width: 18%; border-radius: 6px; background: var(--lime-line); opacity: .7; }
.fp-art .row.doc i { border-radius: 6px; }
.fp-veil { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; background: color-mix(in srgb, var(--card) 35%, transparent); }
.fp-veil b { font-size: 13px; }
.fp-lockbig { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--card); color: var(--ink); box-shadow: 0 8px 24px -10px rgb(0 0 0 / .4); }
.fp-lockbig svg { width: 20px; height: 20px; }
.fp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; }
.fp-cols em { display: block; font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.fp-cols p { font-size: 14px; line-height: 1.55; }
.fp-cta { display: flex; align-items: center; gap: 12px; justify-content: space-between; width: 100%; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.fp-note { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.fp-note svg { width: 14px; height: 14px; }
.fp-req { padding: 11px 18px; }
.fp-req.busy { opacity: .75; }
.fp-done { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 14px; background: var(--lime-soft); }
.fp-done b { display: block; font-size: 14px; }
.fp-done small { font-size: 12.5px; color: var(--muted); }
.fp-check { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--lime); color: #111; }
.fp-check svg { width: 18px; height: 18px; stroke-width: 2.4; }
.req-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 10px 8px; margin-inline: -8px; border: 0; border-top: 1px solid var(--line); border-radius: 12px; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.req-row:first-child { border-top-color: transparent; }
.req-row:hover { background: var(--field); }
.req-row .f-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--lime-soft); }
.req-row b { display: block; font-size: 13px; }
.req-row small { color: var(--muted); font-size: 12px; }
@media (max-width: 767px) {
  .fp-cols { grid-template-columns: minmax(0, 1fr); }
  .feature-modal { align-items: end; padding: 0; }
  .feature-modal .card { border-radius: 24px 24px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px)); max-height: 92dvh; overflow-y: auto; }
}
