/* =============================================================================
   trade.ai — desk shell
   Design language adapted from Talvo: floating dark sidebar, citron accent,
   soft large-radius cards, Manrope + Geist Mono, light/dark themes.
   Everything is token-driven: edit :root / [data-theme] to reskin.
   ========================================================================== */

@font-face {
  font-family: "ManropeVar";
  src: url("https://cdn.jsdelivr.net/fontsource/fonts/manrope:vf@latest/latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 200 800; font-display: swap;
}
@font-face {
  font-family: "GeistMono";
  src: url("https://cdn.jsdelivr.net/fontsource/fonts/geist-mono@latest/latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "GeistMono";
  src: url("https://cdn.jsdelivr.net/fontsource/fonts/geist-mono@latest/latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-display: swap;
}

/* ------------------------------------------------------------------ tokens */
:root {
  --sans: "ManropeVar", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "GeistMono", ui-monospace, "SF Mono", Menlo, monospace;

  --r-lg: 26px; --r-md: 18px; --r-sm: 12px; --r-pill: 999px;
  --ease: cubic-bezier(.16, 1, .3, 1);

  --fs-2xs: .688rem; --fs-xs: .75rem; --fs-sm: .8125rem; --fs-md: .9375rem;
  --fs-lg: 1.0625rem; --fs-xl: 1.25rem; --fs-2xl: 1.75rem; --fs-3xl: 2.5rem;
}

/* dark (default) */
html[data-theme="dark"] {
  --bg: #0c0e0c;
  --canvas: #0c0e0c;
  --surface: #141714;
  --surface-2: #191c19;
  --raised: #1e221e;
  --well: rgba(255,255,255,.07);
  --line: rgba(255,255,255,.09);
  --line-2: rgba(255,255,255,.18);
  --text: #e9ede7;
  --muted: rgba(233,237,231,.74);
  --faint: rgba(233,237,231,.58);
  --side-bg: #121512;
  --side-line: rgba(255,255,255,.08);
  --citron: #d4f15a;
  --on-citron: #141a02;
  --lavender: #a99cff;
  --sky: #73adf0;
  --teal: #3cc6b4;
  --amber: #f0b740;
  --rose: #f37c91;
  --mint: #5dd39a;
  --good: #5fd28e;
  --warn: #f0b740;
  --bad: #ff8577;
  --shadow-lift: 0 22px 44px -24px rgba(0,0,0,.85);
  --shadow-pop: 0 24px 60px -18px rgba(0,0,0,.78), 0 0 0 1px rgba(255,255,255,.06);
  --grid: rgba(255,255,255,.055);
}

/* light */
html[data-theme="light"] {
  --bg: #e9ece5;
  --canvas: #e9ece5;
  --surface: #ffffff;
  --surface-2: #f5f7f0;
  --raised: #eef1e8;
  --well: rgba(19,23,20,.05);
  --line: rgba(19,23,20,.1);
  --line-2: rgba(19,23,20,.2);
  --text: #131714;
  --muted: rgba(19,23,20,.7);
  --faint: rgba(19,23,20,.56);
  --side-bg: #121512;
  --side-line: rgba(255,255,255,.09);
  --citron: #cbea3f;
  --on-citron: #141a02;
  --lavender: #7f6fe0;
  --sky: #3f7fd0;
  --teal: #159b8c;
  --amber: #b57c10;
  --rose: #d6536c;
  --mint: #22915f;
  --good: #1f8a55;
  --warn: #a9760c;
  --bad: #cf4a3d;
  --shadow-lift: 0 20px 40px -26px rgba(19,23,20,.3);
  --shadow-pop: 0 24px 50px -24px rgba(19,23,20,.24), 0 0 0 1px rgba(19,23,20,.06);
  --grid: rgba(19,23,20,.07);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0; background:
    radial-gradient(1100px 620px at 12% -10%, rgba(212,241,90,.055), transparent 60%),
    radial-gradient(900px 520px at 96% 4%, rgba(169,156,255,.06), transparent 62%),
    var(--canvas);
  color: var(--text);
  font-family: var(--sans); font-size: var(--fs-md); line-height: 1.5;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  transition: background .4s var(--ease), color .3s var(--ease);
}
::selection { background: rgba(212,241,90,.35); color: var(--text); }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { letter-spacing: -.02em; margin: 0; }

/* -------------------------------------------------------------- glowfield */
.glowfield { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; }
.glow.g1 { width: 46vmax; height: 46vmax; top: -18vmax; left: 6vw;
  background: radial-gradient(circle, rgba(212,241,90,.16), transparent 65%); animation: float 26s var(--ease) infinite alternate; }
.glow.g2 { width: 40vmax; height: 40vmax; bottom: -16vmax; right: 2vw;
  background: radial-gradient(circle, rgba(169,156,255,.16), transparent 65%); animation: float 32s var(--ease) infinite alternate-reverse; }
.glow.g3 { width: 30vmax; height: 30vmax; top: 34%; left: 46%;
  background: radial-gradient(circle, rgba(115,173,240,.1), transparent 65%); animation: float 38s var(--ease) infinite alternate; }
html[data-theme="light"] .glow { opacity: .5; filter: blur(80px); }
@keyframes float { to { transform: translate3d(2vw, -2vh, 0) scale(1.08); } }

/* --------------------------------------------------------------- sidebar */
.sidebar {
  position: fixed; z-index: 20;
  top: 12px; left: 12px; bottom: 12px; width: 254px;
  display: flex; flex-direction: column;
  padding: 18px 14px 14px;
  background: var(--side-bg);
  border: 1px solid var(--side-line);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 60px -30px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.06);
  color: #e9ede7;
  transition: transform .35s var(--ease);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 16px; }
.mark {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--citron); color: var(--on-citron);
  font-family: var(--mono); font-weight: 600; font-size: 13px; letter-spacing: -.02em;
  box-shadow: 0 8px 20px -10px rgba(212,241,90,.8);
}
.mark span { opacity: .55; }
.brandmeta { display: flex; flex-direction: column; line-height: 1.2; }
.brandmeta b { font-size: var(--fs-sm); font-weight: 700; letter-spacing: -.01em; }
.brandmeta small { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: rgba(233,237,231,.45); }

.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1 1 auto;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.16) transparent; }
.nav::-webkit-scrollbar { width: 5px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 99px; }
.nav:hover::-webkit-scrollbar-thumb { background: rgba(255,255,255,.24); }
.navgroup {
  margin: 14px 8px 6px; font-family: var(--mono); font-size: 9.5px;
  letter-spacing: .16em; text-transform: uppercase; color: rgba(233,237,231,.36);
}
.navitem {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 12px; font-size: var(--fs-sm); font-weight: 500;
  color: rgba(233,237,231,.8); transition: background .2s, color .2s, transform .2s var(--ease);
}
.navitem svg { width: 17px; height: 17px; flex: 0 0 auto; opacity: .8; }
.navitem:hover { background: rgba(255,255,255,.06); color: #fff; transform: translateX(2px); }
.navitem:focus-visible { outline: 2px solid var(--citron); outline-offset: 2px; }
.navitem.active {
  background: var(--citron); color: var(--on-citron); font-weight: 700;
  box-shadow: 0 10px 22px -14px rgba(212,241,90,.9);
}
.navitem.active svg { opacity: 1; }
.ndot { width: 6px; height: 6px; border-radius: 50%; margin-left: auto; background: rgba(233,237,231,.3); }
.ndot.long { background: #5fd28e; box-shadow: 0 0 8px rgba(95,210,142,.8); }
.ndot.short { background: #ff8577; box-shadow: 0 0 8px rgba(255,133,119,.8); }

.sidefoot { margin-top: 12px; display: grid; gap: 10px; }
.mini-status {
  padding: 11px 12px; border-radius: 14px;
  background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.07);
}
.mini-row { display: flex; justify-content: space-between; gap: 8px; font-family: var(--mono); font-size: 10.5px; padding: 3px 0; }
.mini-row .k { color: rgba(233,237,231,.45); letter-spacing: .06em; }
.mini-row b { color: #e9ede7; font-weight: 500; }
.mini-row b.good { color: #5fd28e; }
.mini-row b.bad { color: #ff8577; }

.themeBtn {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 10px 12px; border-radius: var(--r-pill); cursor: pointer;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  color: #e9ede7; font-family: var(--sans); font-size: var(--fs-xs); font-weight: 600;
  transition: background .2s, transform .2s var(--ease), border-color .2s;
}
.themeBtn:hover { background: rgba(255,255,255,.1); transform: translateY(-1px); }
.themeBtn svg { width: 15px; height: 15px; }
.themeBtn:focus-visible { outline: 2px solid var(--citron); outline-offset: 3px; }
html[data-theme="dark"] .ico-sun { display: none; }
html[data-theme="light"] .ico-moon { display: none; }

/* --------------------------------------------------------------- content */
.content {
  position: relative; z-index: 2;
  margin-left: 278px; padding: 12px 16px 40px 0;
  min-height: 100vh; display: flex; flex-direction: column;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  height: 56px; padding: 0 6px; margin-bottom: 8px;
}
.crumb { font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: .06em; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.crumb i { font-style: normal; opacity: .4; }
.crumb b { color: var(--text); font-weight: 500; }
.topright { display: flex; align-items: center; gap: 12px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px;
  border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); }
.status-pill.down i { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.status-pill em { font-style: normal; text-transform: none; letter-spacing: .03em; }
.clock { font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: .06em; color: var(--muted); }

.view { flex: 1 1 auto; }

/* page entrance */
.page { animation: pageIn .55s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ cards */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 18px 20px;
  box-shadow: 0 1px 0 rgba(255,255,255,.03) inset;
  transition: border-color .25s, transform .25s var(--ease), box-shadow .25s;
}
.card.hoverable:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--line-2); }
.card.dark {
  background: linear-gradient(160deg, #161916, #101310);
  border-color: rgba(255,255,255,.1); color: #e9ede7;
}
html[data-theme="light"] .card.dark { background: linear-gradient(160deg, #171b16, #0f120f); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title { font-size: var(--fs-md); font-weight: 700; letter-spacing: -.01em; }
.card-sub { margin: 2px 0 0; font-family: var(--mono); font-size: 10.5px; letter-spacing: .05em; color: var(--muted); }
.card.dark .card-sub { color: rgba(233,237,231,.55); }
.card.dark .card-title { color: #fff; }

.grid { display: grid; gap: 14px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: 1.6fr .9fr; }
.mb { margin-bottom: 14px; }

/* hero */
.hero { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; margin-bottom: 14px; }
.hero-l, .hero-r { display: grid; gap: 14px; }
.hero-big { padding: 22px 24px; }
.symrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.symrow h1 { font-size: var(--fs-2xl); font-weight: 700; }
.tfchip {
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em; padding: 4px 9px;
  border-radius: var(--r-pill); border: 1px solid var(--line-2); color: var(--muted);
}
.sigchip {
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  padding: 5px 11px; border-radius: var(--r-pill); border: 1px solid var(--line-2); color: var(--muted);
}
.sigchip[data-side="LONG"] { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); background: color-mix(in srgb, var(--good) 12%, transparent); }
.sigchip[data-side="SHORT"] { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: color-mix(in srgb, var(--bad) 12%, transparent); }

.bigprice { font-family: var(--mono); font-size: clamp(2rem, 3.6vw, 2.75rem); font-weight: 600; letter-spacing: -.03em; margin: 10px 0 4px; }
.delta { font-family: var(--mono); font-size: var(--fs-sm); padding: 3px 10px; border-radius: var(--r-pill); }
.delta.up { color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); }
.delta.down { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.note { color: var(--muted); font-size: var(--fs-sm); margin: 6px 0 14px; }

.chips { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.chip {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 9px 12px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
  transition: transform .2s var(--ease), border-color .2s;
}
.chip:hover { transform: translateY(-1px); border-color: var(--line-2); }
.chip b { color: var(--text); font-weight: 600; }
.chip.up b { color: var(--good); } .chip.down b { color: var(--bad); }

.kpi { padding: 15px 16px; }
.kpi .k { font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.kpi .v { font-family: var(--mono); font-size: var(--fs-xl); font-weight: 600; margin-top: 6px; }
.kpi .s { font-size: var(--fs-2xs); color: var(--faint); margin-top: 2px; }
.kpi .v.up { color: var(--good); } .kpi .v.down { color: var(--bad); }

/* inline CTA strip inside the hero card */
.herocta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.1); }
.herocta .txt { font-size: var(--fs-xs); color: rgba(233,237,231,.6); }
.minibtn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--r-pill);
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: #e9ede7;
  font-size: var(--fs-2xs); font-weight: 600; cursor: pointer; transition: background .2s, transform .2s var(--ease);
}
.minibtn:hover { background: rgba(255,255,255,.14); transform: translateY(-1px); }
.minibtn.accent { background: var(--citron); color: var(--on-citron); border-color: transparent; }
.minibtn.accent:hover { background: color-mix(in srgb, var(--citron) 88%, white); }

/* --------------------------------------------------------------- chart */
.chartcard { display: flex; flex-direction: column; }
.chartbox { position: relative; flex: 1 1 auto; display: flex; flex-direction: column; min-height: 300px; }
#chart { width: 100%; height: 100%; min-height: 300px; flex: 1 1 auto; display: block; }
.tip {
  position: absolute; z-index: 4; pointer-events: none; padding: 8px 10px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop);
  font-family: var(--mono); font-size: 10.5px; line-height: 1.6;
  transform: translate(-50%, -118%); white-space: nowrap;
}
.legend { display: flex; gap: 16px; margin-top: 10px; font-family: var(--mono); font-size: 10px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; }
.dot.f { background: var(--citron); } .dot.s { background: var(--lavender); } .dot.p { background: var(--teal); }

/* segmented control */
.seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: var(--r-pill); background: var(--well); border: 1px solid var(--line); }
.seg button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em;
  padding: 6px 12px; border-radius: var(--r-pill); transition: all .22s var(--ease);
}
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--citron); color: var(--on-citron); font-weight: 600; }
.seg button:focus-visible { outline: 2px solid var(--citron); outline-offset: 2px; }

/* cone / bars */
.rows { display: grid; gap: 9px; }
.rowline { display: flex; justify-content: space-between; gap: 10px; font-family: var(--mono); font-size: var(--fs-xs); color: var(--muted); }
.rowline b { color: var(--text); font-weight: 600; }
.bar { position: relative; height: 28px; border-radius: var(--r-pill); overflow: hidden; background: var(--well); border: 1px solid var(--line); }
.bar .fill { position: absolute; top: 3px; bottom: 3px; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--teal), var(--citron)); transition: width .8s var(--ease), left .8s var(--ease); }
.bar .mid { position: absolute; top: 0; bottom: 0; width: 1px; left: 50%; background: var(--line-2); }
.scale { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 9.5px; color: var(--faint); margin-top: -3px; }

/* indicator grid */
.indgrid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.ind { padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); transition: border-color .2s, transform .2s var(--ease); }
.ind:hover { border-color: var(--line-2); transform: translateY(-2px); }
.ind .k { font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ind .v { font-family: var(--mono); font-size: var(--fs-sm); font-weight: 600; margin-top: 3px; }
.ind .v.up { color: var(--good); } .ind .v.down { color: var(--bad); }

/* stats / kv */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.stat { padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); }
.stat .k { font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.stat .v { font-family: var(--mono); font-size: var(--fs-lg); font-weight: 600; margin-top: 4px; }
.stat .v.ok { color: var(--good); } .stat .v.bad { color: var(--bad); }

.kv { display: grid; gap: 7px; font-family: var(--mono); font-size: var(--fs-xs); color: var(--muted); }
.kv > div { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.kv b { color: var(--text); font-weight: 600; }
.kv b.on { color: var(--good); } .kv b.off { color: var(--bad); }

/* ----------------------------------------------------------------- forms */
.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.sidepanel { position: sticky; top: 16px; display: grid; gap: 6px; padding: 10px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.sidelink {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px; border-radius: 10px; font-size: var(--fs-sm); color: var(--muted);
  cursor: pointer; border: 1px solid transparent; background: transparent; text-align: left;
  transition: background .2s, color .2s, border-color .2s;
}
.sidelink:hover { background: var(--surface-2); color: var(--text); }
.sidelink.active { background: color-mix(in srgb, var(--citron) 18%, transparent); color: var(--text); border-color: color-mix(in srgb, var(--citron) 40%, transparent); font-weight: 600; }
.sidelink:focus-visible { outline: 2px solid var(--citron); outline-offset: 2px; }

.formgrid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.field { display: grid; gap: 6px; }
.field label, .flabel {
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
}
.field .hint { font-size: 11px; color: var(--faint); }
.inp {
  width: 100%; padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  font-family: var(--mono); font-size: var(--fs-sm); outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.inp:hover { border-color: var(--line-2); }
.inp:focus { border-color: color-mix(in srgb, var(--citron) 70%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--citron) 18%, transparent); }
select.inp { appearance: none; cursor: pointer; }

.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .track {
  width: 44px; height: 26px; border-radius: var(--r-pill); background: var(--well);
  border: 1px solid var(--line-2); position: relative; transition: background .25s, border-color .25s;
}
.toggle .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--muted); transition: transform .3s var(--ease), background .25s;
}
.toggle input:checked + .track { background: color-mix(in srgb, var(--citron) 30%, transparent); border-color: color-mix(in srgb, var(--citron) 60%, transparent); }
.toggle input:checked + .track::after { transform: translateX(18px); background: var(--citron); }
.toggle input:focus-visible + .track { outline: 2px solid var(--citron); outline-offset: 3px; }
.toggle .lbl { font-size: var(--fs-sm); color: var(--muted); }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 11px 20px; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font-family: var(--sans); font-size: var(--fs-sm); font-weight: 600;
  transition: transform .2s var(--ease), background .2s, border-color .2s, box-shadow .25s;
}
.btn:hover { transform: translateY(-1px); background: var(--raised); }
.btn:active { transform: translateY(0) scale(.99); }
.btn:focus-visible { outline: 2px solid var(--citron); outline-offset: 3px; }
.btn.primary { background: var(--citron); color: var(--on-citron); border-color: transparent; box-shadow: 0 12px 26px -16px rgba(212,241,90,.9); }
.btn.primary:hover { background: color-mix(in srgb, var(--citron) 88%, white); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.loading { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .65; } }

.note-box {
  margin-top: 16px; padding: 12px 14px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 11.5px; line-height: 1.6; color: var(--muted);
}
.note-box code { font-family: var(--mono); color: var(--teal); }

/* banner */
.banner {
  display: flex; align-items: center; gap: 10px; padding: 11px 15px; border-radius: var(--r-pill);
  font-size: var(--fs-sm); margin-bottom: 14px; border: 1px solid;
}
.banner.warn { background: color-mix(in srgb, var(--warn) 12%, transparent); border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--text); }
.banner.good { background: color-mix(in srgb, var(--good) 12%, transparent); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.banner svg { width: 16px; height: 16px; flex: 0 0 auto; }

/* toasts */
.toasts { position: fixed; top: 16px; right: 16px; z-index: 60; display: flex; flex-direction: column; gap: 9px; width: min(340px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  position: relative; overflow: hidden; padding: 11px 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop);
  font-size: var(--fs-sm); transform: translateX(22px); opacity: 0;
  transition: transform .4s var(--ease), opacity .4s; pointer-events: auto;
}
.toast.in { transform: none; opacity: 1; }
.toast.error { border-color: color-mix(in srgb, var(--bad) 55%, transparent); }
.toast.success { border-color: color-mix(in srgb, var(--good) 55%, transparent); }
.toast .bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--citron); transform-origin: left; animation: drain 3.2s linear forwards; }
.toast.error .bar { background: var(--bad); }
.toast.success .bar { background: var(--good); }
@keyframes drain { to { transform: scaleX(0); } }

.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 24px; padding: 0 6px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .06em; color: var(--faint); }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(140,140,140,.4) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(140,140,140,.34); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(160,160,160,.55); background-clip: content-box; }

/* --------------------------------------------------------------- dialog */
.authdlg {
  border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 0;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop);
  max-width: 380px; width: calc(100vw - 32px);
}
.authdlg::backdrop { background: rgba(0,0,0,.55); backdrop-filter: blur(6px); }
.authcard { padding: 22px 22px 20px; display: grid; gap: 12px; }
.authcard h3 { font-size: var(--fs-lg); font-weight: 700; }
.authsub { margin: 0; font-size: var(--fs-sm); color: var(--muted); line-height: 1.5; }
.autherr { margin: 0; font-size: var(--fs-xs); color: var(--bad); }

/* ------------------------------------------------------------------ a11y */
:focus-visible { outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  .glow, .page, .btn.loading, .toast .bar { animation: none !important; }
  * { transition-duration: .01ms !important; }
}

/* ------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .hero, .g-main, .g-4 { grid-template-columns: 1fr; }
  .g-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-110%); }
  .sidebar.open { transform: none; }
  .content { margin-left: 0; padding: 12px 14px 40px; }
  .settings { grid-template-columns: 1fr; }
  .sidepanel { position: static; display: flex; overflow-x: auto; }
  .formgrid { grid-template-columns: 1fr; }
  .g-2, .g-3, .stats { grid-template-columns: 1fr; }
  .chips { grid-template-columns: repeat(2, minmax(0,1fr)); }
}