/* ---------- fonts (Poppins, self-hosted) ---------- */
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/poppins-400-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/poppins-400-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/poppins-500-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/poppins-500-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/poppins-600-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/poppins-600-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/poppins-700-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/poppins-700-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- tokens (colours are set by JS from theme + hue; these are dark defaults for first paint) ---------- */
:root {
  --bg: #0B1211; --panel: oklch(0.31 0.055 172); --panel2: rgba(0,0,0,0.22); --card: #121C1A; --card2: #1B2825;
  --ink: #E9F1EE; --mute: #93A69F; --line: rgba(255,255,255,0.07); --line2: rgba(255,255,255,0.18);
  --accent: oklch(0.82 0.13 172); --onAccent: #03201A;
  --pos: oklch(0.79 0.17 150); --neg: oklch(0.71 0.18 25); --posBg: oklch(0.79 0.17 150 / 0.14); --negBg: oklch(0.71 0.18 25 / 0.15);
  --onPos: #04210F; --onNeg: #2A0806; --nav: #111B19; --hover: rgba(255,255,255,0.05); --scrim: rgba(0,0,0,0.6);
  --ease: cubic-bezier(.2,.8,.2,1);
  --t-fast: 150ms; --t-med: 240ms;
  --side-w: 248px;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font-family: Poppins, system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 15px; line-height: 1.45;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
  transition: background-color var(--t-med) ease;
}
body.modal-open { overflow: hidden; }
h1, h2, h3, p, dl, dd, ul, fieldset { margin: 0; padding: 0; }
ul { list-style: none; }
fieldset { border: 0; min-width: 0; }
button, input, textarea { font: inherit; color: inherit; }
button, a, label, [data-act] { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
a { color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--mute); opacity: .85; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.main:focus { outline: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 12px; top: -64px; z-index: 100; padding: 10px 16px; border-radius: 12px; background: var(--accent); color: var(--onAccent); font-weight: 600; text-decoration: none; transition: top var(--t-fast); }
.skip:focus { top: 12px; }

/* colour utilities */
.c-pos { color: var(--pos); } .c-neg { color: var(--neg); } .c-mute { color: var(--mute); } .c-accent { color: var(--accent); }
.bg-pos { background: var(--pos); } .bg-neg { background: var(--neg); } .bg-mute { background: var(--mute); }
.strong { font-weight: 700; } .nowrap { white-space: nowrap; } .ta-r { text-align: right; }

/* ---------- shell ---------- */
.shell { min-height: 100dvh; }
.main { padding-bottom: 40px; }
.shell.with-bnav .main { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
.shell.with-savebar .main { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
.view { max-width: 760px; margin: 0 auto; }

/* header panel + overlapping sheet (the design's signature layering) */
.hero {
  background: var(--panel); color: var(--ink);
  padding: calc(28px + env(safe-area-inset-top)) 22px 70px;
  display: flex; flex-direction: column; gap: 20px;
  transition: background-color var(--t-med) ease;
}
.hero-trades { gap: 16px; padding-bottom: 64px; }
.hero-detail { gap: 14px; padding: calc(16px + env(safe-area-inset-top)) 18px 66px; }
.hero-form { padding: calc(16px + env(safe-area-inset-top)) 18px 58px; }
.sheet {
  position: relative; margin-top: -44px; background: var(--bg);
  border-radius: 44px 44px 0 0; padding: 22px 16px 0;
  display: flex; flex-direction: column; gap: 14px;
  transition: background-color var(--t-med) ease;
}
.hero-form + .sheet { margin-top: -34px; border-radius: 34px 34px 0 0; }
@media (min-width: 760px) and (max-width: 1023px) {
  .view { padding: 16px 16px 0; }
  .hero { border-radius: 36px; }
}

.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hero-top.align-end { align-items: flex-end; }
.h1 { font-size: 23px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.h1.big { font-size: 26px; font-weight: 700; }
.h2 { font-size: 16px; font-weight: 600; }
.h3 { font-size: 15px; font-weight: 600; }
.sub { font-size: 13px; color: var(--mute); }
.meta { font-size: 12px; color: var(--mute); }
.hero-net { font-size: 24px; font-weight: 700; white-space: nowrap; }

.icon-btn {
  width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0;
  background: var(--panel2); color: var(--ink); display: grid; place-items: center;
  transition: transform var(--t-fast) var(--ease), background-color var(--t-fast);
}
.icon-btn:hover { background: color-mix(in oklab, var(--panel2), var(--ink) 10%); }
.icon-btn:active { transform: scale(.94); }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.bar-title { font-size: 17px; font-weight: 600; }
.bar-spacer { width: 44px; }
.bar-end { width: 74px; display: flex; justify-content: flex-end; }
.pill-btn.sm { padding: 0 12px; font-size: 13px; border: 0; }
.brand-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { flex: none; display: block; }
.brand-h { font-size: 18px; font-weight: 700; letter-spacing: .02em; line-height: 1.15; text-transform: uppercase; }
.pill-btn { height: 44px; padding: 0 18px; border-radius: 999px; background: var(--panel2); color: var(--ink); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; text-decoration: none; transition: background-color var(--t-fast); }
.pill-btn:hover { background: color-mix(in oklab, var(--panel2), var(--ink) 10%); }

/* KPI block */
.kpi { display: grid; grid-template-columns: minmax(0, 1.35fr) 1px minmax(0, 1fr); gap: 18px; align-items: center; }
.kpi-div { height: 64px; background: var(--line2); }
.kpi-k { font-size: 13px; color: var(--mute); font-weight: 500; }
.kpi-k2 { font-size: 12px; color: var(--mute); }
.kpi-big { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; line-height: 1.2; }
.kpi-sub { font-size: 12px; color: var(--mute); }
.kpi-side { display: flex; flex-direction: column; gap: 8px; }
.kpi-mid { font-size: 20px; font-weight: 600; line-height: 1.3; }
.lots { display: flex; align-items: baseline; gap: 6px; }
.lots-v { font-size: 44px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.lots-u { font-size: 16px; font-weight: 600; color: var(--mute); }
.wl { display: flex; height: 32px; border-radius: 999px; overflow: hidden; background: var(--panel2); font-size: 12px; font-weight: 600; }
.wl-w { background: var(--pos); color: var(--onPos); display: flex; align-items: center; padding-left: 12px; white-space: nowrap; transition: width var(--t-med) var(--ease); }
.wl-l { flex: 1; display: flex; align-items: center; justify-content: flex-end; padding-right: 12px; color: var(--neg); white-space: nowrap; }

/* ---------- segmented controls & chips ---------- */
.seg { display: flex; background: var(--card2); border-radius: 999px; padding: 4px; gap: 4px; }
.seg.on-panel { background: var(--panel2); }
.seg-btn {
  flex: 1; min-width: 0; height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--ink);
  font-size: 13px; font-weight: 500; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background-color var(--t-fast), color var(--t-fast);
}
.seg.on-panel .seg-btn, .hero-seg .seg-btn { font-size: 14px; }
.seg.strong .seg-btn { font-weight: 600; font-size: 14px; }
.seg.tall .seg-btn { height: 44px; }
.seg-btn:hover:not(.on) { background: var(--hover); }
.seg-btn.on { background: var(--accent); color: var(--onAccent); }
.seg-btn.on.tone-win { background: var(--pos); color: var(--onPos); }
.seg-btn.on.tone-loss { background: var(--neg); color: var(--onNeg); }
.seg-btn.on.tone-be { background: var(--mute); color: var(--bg); }
.seg.invalid { box-shadow: 0 0 0 1.5px var(--neg); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll-x { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
.chips.scroll-x::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid transparent;
  background: var(--card2); color: var(--ink); font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.chip:hover:not(.on) { border-color: var(--line2); }
.chip.outline { background: var(--card); border-color: var(--line); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--onAccent); }
.chip.dashed { background: transparent; border: 1.5px dashed var(--accent); color: var(--accent); font-weight: 600; padding: 0 14px 0 10px; }
.round-btn { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--accent); display: grid; place-items: center; transition: border-color var(--t-fast); }
.round-btn:hover { border-color: var(--line2); }
.round-btn.plain { border: 0; background: var(--card2); color: var(--ink); }
.pill { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--card2); color: var(--mute); white-space: nowrap; }
.pill.on-panel { font-size: 12px; padding: 4px 10px; background: var(--panel2); color: var(--ink); }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 16px; transition: background-color var(--t-med), border-color var(--t-med); }
.card-lg { border-radius: 28px; padding: 18px 16px 14px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.section-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 4px 8px; }
.link { border: 0; background: none; color: var(--accent); font-size: 13px; font-weight: 600; padding: 8px 0; text-decoration: none; }
.link:hover { text-decoration: underline; }
.link.sm { font-size: 12px; }
.note.grow { flex: 1; }
.empty { padding: 40px 12px; text-align: center; color: var(--mute); font-size: 14px; line-height: 1.7; }
.empty a { font-weight: 600; }
.empty-sm { padding: 16px 2px; font-size: 13px; color: var(--mute); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 14px 12px; min-width: 0; }
.stat-k { font-size: 11px; color: var(--mute); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-v { font-size: 18px; font-weight: 700; margin-top: 4px; white-space: nowrap; }

/* equity chart */
.eq { position: relative; height: 150px; margin: 4px 0; cursor: crosshair; touch-action: pan-y; border-radius: 8px; }
.eq svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.eq-zero { stroke: var(--mute); stroke-opacity: .35; stroke-dasharray: 3 4; }
.eq-area { fill-opacity: .13; } .eq-area.pos { fill: var(--pos); } .eq-area.neg { fill: var(--neg); }
.eq-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; } .eq-line.pos { stroke: var(--pos); } .eq-line.neg { stroke: var(--neg); }
.eq-max, .eq-min { position: absolute; left: 0; font-size: 11px; color: var(--mute); pointer-events: none; }
.eq-max { top: -2px; } .eq-min { bottom: -2px; }
.eq-dot { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--ink); border: 3px solid var(--card); pointer-events: none; }
.eq-tip { position: absolute; z-index: 2; pointer-events: none; padding: 6px 10px; border-radius: 12px; background: var(--ink); color: var(--bg); font-size: 12px; line-height: 1.35; white-space: nowrap; display: flex; flex-direction: column; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.eq-tip span { opacity: .8; }
.eq [hidden] { display: none !important; }
.eq-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--mute); margin-top: 8px; }

/* breakdown */
.bd-seg { margin: 12px 0 6px; }
.bd-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); align-items: center; }
.bd-row:last-child { border-bottom: 0; }
.bd-name { font-size: 14px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.bd-pl { font-size: 14px; font-weight: 700; text-align: right; white-space: nowrap; }
.bd-meta { font-size: 12px; color: var(--mute); }
.bd-bar { width: 92px; height: 6px; border-radius: 3px; background: var(--card2); overflow: hidden; justify-self: end; }
.bd-bar span { display: block; height: 100%; border-radius: 3px; }

/* trade rows */
.tlist { display: flex; flex-direction: column; gap: 10px; }
.trow {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 12px; border-radius: 22px; background: var(--card); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none;
  transition: border-color var(--t-fast), transform var(--t-fast) var(--ease), background-color var(--t-med);
}
.trow:hover { border-color: var(--line2); }
.trow:active { transform: scale(.985); }
.badge { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--card2); color: var(--mute); }
.badge.pos { background: var(--posBg); color: var(--pos); } .badge.neg { background: var(--negBg); color: var(--neg); }
.badge-sm { width: 30px; height: 30px; border-radius: 10px; font-size: 10px; flex: none; }
.trow-mid { min-width: 0; display: flex; flex-direction: column; }
.trow-top { display: flex; gap: 8px; align-items: center; min-width: 0; overflow: hidden; }
.trow-ins { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.trow-sub { font-size: 12px; color: var(--mute); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow-end { text-align: right; display: flex; flex-direction: column; }
.trow-pl { font-weight: 700; font-size: 15px; white-space: nowrap; }

.filters { display: flex; flex-direction: column; gap: 12px; }

/* table (desktop) */
.table-card { padding: 6px 8px; overflow-x: auto; }
.ttable { width: 100%; border-collapse: collapse; font-size: 14px; }
.ttable th { text-align: left; font-size: 12px; font-weight: 500; color: var(--mute); padding: 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ttable th:not(:has(button)) { padding: 12px 12px; }
.th-btn { border: 0; background: none; color: inherit; font: inherit; padding: 12px; display: inline-flex; gap: 6px; align-items: center; border-radius: 8px; }
.th-btn:hover { color: var(--ink); }
.ttable th.num, .ttable td.num { text-align: right; }
.ttable th.num .th-btn { flex-direction: row-reverse; }
.sort-ind { font-size: 9px; color: var(--accent); min-width: 8px; }
.ttable td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ttable tbody tr { cursor: pointer; transition: background-color var(--t-fast); }
.ttable tbody tr:hover { background: var(--hover); }
.ttable tbody tr:last-child td { border-bottom: 0; }
.ttable td { white-space: nowrap; }
.ttable td.col-setup { white-space: normal; min-width: 110px; }
.t-link { color: var(--ink); text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; gap: 10px; }
.t-link:hover { color: var(--accent); }
.res-pill { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--card2); color: var(--mute); }
.res-pill.pos { background: var(--posBg); color: var(--pos); } .res-pill.neg { background: var(--negBg); color: var(--neg); }
.flag-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--neg); flex: none; vertical-align: middle; }

/* ---------- detail ---------- */
.detail-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-top: 6px; }
.detail-ins { display: flex; gap: 8px; align-items: center; }
.detail-pl { font-size: 30px; font-weight: 700; white-space: nowrap; line-height: 1.2; }
.flags { display: flex; flex-direction: column; gap: 8px; }
.flag { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--negBg); color: var(--neg); font-size: 13px; font-weight: 600; }
.detail-grid { display: flex; flex-direction: column; gap: 12px; }
.detail-grid .h3 { margin-bottom: 12px; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
.kv-i.span { grid-column: 1 / -1; }
.kv dt { font-size: 11px; color: var(--mute); font-weight: 500; }
.kv dd { font-size: 15px; font-weight: 600; margin-top: 2px; text-wrap: pretty; overflow-wrap: anywhere; }
.kv dd.notes { font-weight: 400; white-space: pre-wrap; line-height: 1.6; }
.shot { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: contain; border-radius: 14px; background: var(--card2); }

/* ---------- buttons ---------- */
.btn {
  height: 52px; padding: 0 20px; border-radius: 18px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none;
  transition: transform var(--t-fast) var(--ease), filter var(--t-fast), background-color var(--t-fast), border-color var(--t-fast);
}
.btn:hover { border-color: var(--line2); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--onAccent); border: 0; }
.btn-primary:hover { filter: brightness(1.07); }
.btn-xl { height: 58px; border-radius: 20px; font-size: 16px; width: 100%; }
.btn-ghost { background: transparent; color: var(--mute); }
.btn-ghost-danger { background: transparent; color: var(--neg); }
.btn.armed { background: var(--neg); color: var(--onNeg); border-color: var(--neg); }
.btn-sm-h { height: 48px; border-radius: 16px; font-size: 14px; cursor: pointer; }
.btn-sm-h:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.grow { flex: 1; }
.btn-sm { height: 46px; padding: 0 16px; border-radius: 14px; border: 0; font-size: 14px; font-weight: 600; }
.btn-sq { width: 46px; height: 46px; flex: none; border-radius: 14px; border: 1px solid var(--line); background: transparent; color: var(--mute); display: grid; place-items: center; }

/* ---------- forms ---------- */
.form-grid { display: flex; flex-direction: column; gap: 14px; }
.form-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.fs { display: flex; flex-direction: column; gap: 16px; }
.fs > legend { float: left; width: 100%; padding: 0; }
.fs > legend + * { clear: both; }
.legend-note { font-size: 12px; color: var(--mute); font-weight: 400; }
.fs-gap { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: 12px; color: var(--mute); font-weight: 500; }
.req { color: var(--neg); }
.help { font-size: 12px; color: var(--mute); line-height: 1.5; }
.help.pad { padding: 12px 0; }
.note { font-size: 12px; color: var(--mute); }
.err { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--neg); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid-split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px; }
.date-row { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.input {
  height: 50px; width: 100%; border-radius: 16px; border: 1.5px solid var(--line); background: var(--card2); color: var(--ink);
  font-size: 16px; font-weight: 500; padding: 0 14px; outline: none; min-width: 0;
  transition: border-color var(--t-fast), background-color var(--t-med);
}
.input:focus { border-color: var(--accent); }
.input.lg { height: 52px; font-size: 17px; font-weight: 600; }
.input.xl { height: 54px; font-size: 18px; font-weight: 600; }
.input.md { font-size: 16px; }
.input.invalid, .input.warn { border-color: var(--neg); }
.input.warn { color: var(--neg); }
.input.accent { border-color: var(--accent); }
.input-sm { height: 46px; border-radius: 14px; flex: 1; }
.textarea { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.5; min-height: 110px; }
input[type="date"], input[type="time"] { font-size: 15px; }

.instr-btn {
  display: flex; align-items: center; gap: 12px; height: 58px; width: 100%; border-radius: 18px;
  border: 1.5px solid var(--line); background: var(--card2); padding: 0 14px; text-align: left; color: var(--ink);
  transition: border-color var(--t-fast);
}
.instr-btn:hover { border-color: var(--line2); }
.instr-btn.invalid { border-color: var(--neg); }
.instr-ic { width: 36px; height: 36px; flex: none; border-radius: 12px; background: var(--accent); color: var(--onAccent); display: grid; place-items: center; }
.instr-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.instr-sym { font-size: 16px; font-weight: 600; }
.instr-sym.muted { color: var(--mute); }
.instr-name { font-size: 12px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.toggle-grid { border-radius: 18px; }
.toggle-grid.invalid { outline: 1.5px solid var(--neg); outline-offset: 2px; }
.big-toggle {
  height: 54px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--card2); color: var(--ink);
  font-size: 16px; font-weight: 600; transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.fs .toggle-grid .big-toggle[data-key="followed"] { height: 50px; font-size: 14px; border-radius: 16px; }
.big-toggle:hover:not(.on) { border-color: var(--line2); }
.big-toggle.on { background: var(--accent); border-color: var(--accent); color: var(--onAccent); }
.big-toggle.on.tone-loss { background: var(--neg); border-color: var(--neg); color: var(--onNeg); }

.add-row { display: flex; gap: 8px; }
.preset-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.preset-row .chip { height: 38px; font-weight: 600; padding: 0 16px; }

.pl-input { display: flex; align-items: center; height: 60px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--card2); padding: 0 16px; gap: 6px; transition: border-color var(--t-fast); }
.pl-input:focus-within { border-color: var(--accent); }
.pl-input.invalid { border-color: var(--neg); }
.pl-pre { font-size: 24px; font-weight: 700; }
.pl-input input { flex: 1; min-width: 0; border: 0; background: transparent; color: inherit; font-size: 24px; font-weight: 700; outline: none; padding: 0; }
.calc-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; background: var(--card2); border-radius: 16px; padding: 12px; }
.mini-k { font-size: 11px; color: var(--mute); }
.mini-v { font-size: 15px; font-weight: 600; }

.drop {
  height: 120px; border-radius: 16px; border: 1.5px dashed var(--mute); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  cursor: pointer; color: var(--mute); background: repeating-linear-gradient(135deg, transparent 0 10px, var(--card2) 10px 11px);
  transition: border-color var(--t-fast);
}
.drop:hover { border-color: var(--accent); }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop-t { font-size: 14px; font-weight: 600; color: var(--ink); }
.drop-s { font-size: 12px; }
.shot-wrap { position: relative; }
.shot-rm { position: absolute; top: 8px; right: 8px; height: 36px; padding: 0 14px; border-radius: 999px; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 12px; font-weight: 600; }

.savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--bg); border-top: 1px solid var(--line); padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); }
.savebar-in { display: flex; gap: 10px; max-width: 728px; margin: 0 auto; }
.savebar .btn { height: 56px; border-radius: 20px; }

/* calculator */
.calc-grid { display: flex; flex-direction: column; gap: 14px; }
.calc-side { display: flex; flex-direction: column; gap: 14px; }
.pct-box { position: relative; }
.input.pct { height: 54px; text-align: center; padding: 0 26px 0 12px; font-weight: 600; }
.input.pct.on { background: var(--accent); border-color: var(--accent); color: var(--onAccent); }
.input.pct.on + .pct-sign { color: var(--onAccent); }
.input.pct.custom.invalid { color: var(--neg); }
.pct-sign { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; font-weight: 600; pointer-events: none; }
.rows-card { padding: 6px 16px; }
.kv-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }

/* settings */
.settings-grid { display: flex; flex-direction: column; gap: 14px; }
.set-col { display: flex; flex-direction: column; gap: 14px; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; font-weight: 500; }
.set-in { width: 130px; height: 48px; border-radius: 14px; text-align: right; font-weight: 600; flex: none; }
.tag { height: 38px; padding: 0 4px 0 14px; border-radius: 999px; background: var(--card2); display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 500; }
.tag-x { width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; color: var(--mute); display: grid; place-items: center; transition: background-color var(--t-fast), color var(--t-fast); }
.tag-x:hover { background: var(--negBg); color: var(--neg); }
.swatches { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.sw { border: 0; background: none; padding: 4px 0; display: flex; flex-direction: column; align-items: center; gap: 6px; border-radius: 12px; }
.sw-c { width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 0 0 2px var(--card), 0 0 0 4px transparent; transition: box-shadow var(--t-fast); }
.sw-c.round { border-radius: 50%; border: 0; }
.sw.on .sw-c { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }
.sw-l { font-size: 11px; color: var(--mute); }
.sw.on .sw-l { color: var(--ink); font-weight: 600; }
.preview { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; background: var(--panel); }
.preview-l { flex: 1; font-size: 13px; font-weight: 500; }
.preview-btn { height: 34px; padding: 0 14px; border-radius: 999px; background: var(--accent); color: var(--onAccent); display: flex; align-items: center; font-size: 13px; font-weight: 600; }

/* statistics */
.fav { font-size: 36px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.stats-grid { display: flex; flex-direction: column; gap: 14px; }
.h3.mb { margin-bottom: 12px; }
.xlist { margin-top: 4px; }
.xrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.xrow:last-child { border-bottom: 0; padding-bottom: 2px; }
.xrow dt { grid-column: 1 / -1; font-size: 11px; color: var(--mute); font-weight: 500; }
.xrow-v { font-size: 15px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.xrow-pl { font-size: 14px; font-weight: 700; text-align: right; white-space: nowrap; }
.xrow-m { grid-column: 1 / -1; font-size: 12px; color: var(--mute); }
.tiles { display: grid; gap: 10px; }
.tiles.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tiles.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tile { background: var(--card2); border-radius: 16px; padding: 12px; min-width: 0; }
.cols-3 .tile { padding: 12px 10px; }
.tile-k { font-size: 11px; color: var(--mute); font-weight: 500; }
.cols-3 .tile-k { min-height: 30px; }
.tile-v { font-size: 20px; font-weight: 700; margin-top: 2px; overflow-wrap: anywhere; line-height: 1.3; }
.cols-3 .tile-v { font-size: 22px; }
.tile-v.big { margin-top: 6px; }
.tile-s { font-size: 11px; color: var(--mute); }
.strong-sm { font-size: 14px; font-weight: 600; }
.ls-bar { height: 10px; border-radius: 5px; overflow: hidden; background: var(--card2); }
.ls-bar span { display: block; height: 100%; background: var(--accent); }
.wk { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.wk-col { display: flex; flex-direction: column; min-width: 0; }
.wk-bar-area { height: 130px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.wk-v { font-size: 11px; font-weight: 600; white-space: nowrap; }
.wk-bar { width: 28px; max-width: 100%; border-radius: 8px 8px 3px 3px; opacity: .9; }
.wk-d { display: flex; flex-direction: column; align-items: center; padding-top: 8px; font-size: 12px; font-weight: 600; }
.wk-d small { font-size: 10px; color: var(--mute); font-weight: 400; }

/* reminders */
.card-head.flush { margin: 0; align-items: center; flex-wrap: wrap; }
.rem-status { font-size: 12px; font-weight: 600; }
.rem { display: flex; flex-direction: column; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.rem.last { border-bottom: 0; padding-bottom: 0; }
.rem-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.rem-t { font-size: 14px; font-weight: 500; }
.rem-d { font-size: 12px; color: var(--mute); }
.rem-opts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rem-mins { font-size: 13px; color: var(--mute); flex-wrap: nowrap; }
.input.time-in { width: 118px; height: 44px; border-radius: 14px; flex: none; font-weight: 600; padding: 0 10px; }
.input.mins-in { width: 70px; height: 44px; border-radius: 14px; flex: none; text-align: center; font-weight: 600; padding: 0 8px; }
.days { display: flex; gap: 4px; flex: 1 1 220px; }
.day { flex: 1; min-width: 28px; height: 38px; border-radius: 10px; border: 0; background: var(--card2); color: var(--mute); font-size: 11px; font-weight: 600; padding: 0; transition: background-color var(--t-fast), color var(--t-fast); }
.day.on { background: var(--accent); color: var(--onAccent); }
.seg.grow { flex: 1; min-width: 150px; }
.seg.grow .seg-btn { height: 36px; }
.switch { position: relative; flex: none; width: 48px; height: 28px; border-radius: 999px; border: 0; padding: 4px; background: var(--card2); transition: background-color var(--t-fast); }
.switch::before { content: ''; position: absolute; inset: -8px -4px; } /* larger hit area */
.switch-knob { display: block; width: 20px; height: 20px; border-radius: 50%; background: var(--mute); transition: transform var(--t-fast) var(--ease), background-color var(--t-fast); }
.switch.on { background: var(--accent); }
.switch.on .switch-knob { transform: translateX(20px); background: var(--onAccent); }
.chip.center { justify-content: center; font-weight: 600; font-size: 12px; }

/* draft resume pill */
.draft-pill {
  position: fixed; z-index: 25; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom));
  max-width: calc(100vw - 32px); height: 44px; padding: 0 7px 0 16px; border-radius: 999px; border: 1px solid var(--accent);
  background: var(--card); color: var(--ink); font-size: 13px; font-weight: 600; text-decoration: none;
  display: flex; align-items: center; gap: 10px; white-space: nowrap; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  animation: up 300ms var(--ease);
}
.with-bnav .draft-pill { bottom: calc(100px + env(safe-area-inset-bottom)); }
.draft-l { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.draft-go { flex: none; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--accent); color: var(--onAccent); display: flex; align-items: center; font-size: 12px; }
.draft-pill:hover .draft-go { filter: brightness(1.07); }
.shell.with-draft .main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.shell.with-draft.with-bnav .main { padding-bottom: calc(168px + env(safe-area-inset-bottom)); }

/* reminder banner */
.banner {
  position: fixed; z-index: 70; top: calc(12px + env(safe-area-inset-top)); left: 50%; width: min(420px, calc(100vw - 20px));
  display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 22px;
  background: var(--card); border: 1px solid var(--line2); color: var(--ink); box-shadow: 0 12px 32px rgba(0,0,0,.35);
  cursor: pointer; opacity: 0; pointer-events: none; transform: translate(-50%, -24px);
  transition: opacity var(--t-fast) ease, transform var(--t-med) var(--ease);
}
.banner.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.banner-ic { width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--accent); color: var(--onAccent); display: grid; place-items: center; }
.banner-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.banner-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.banner-top .c-mute { font-size: 11px; font-weight: 400; }
.banner-b { font-size: 13px; color: var(--mute); line-height: 1.4; margin-top: 2px; text-wrap: pretty; }

/* ---------- navigation ---------- */
.bnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(88px + env(safe-area-inset-bottom)); padding: 0 12px env(safe-area-inset-bottom);
  background: var(--nav); border-radius: 32px 32px 0 0; box-shadow: 0 -6px 24px rgba(0,0,0,.12);
  display: flex; justify-content: space-around; align-items: center;
}
.bnav-i { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; color: var(--mute); text-decoration: none; font-size: 11px; font-weight: 500; border-radius: 16px; transition: color var(--t-fast); }
.bnav-i .nav-ic { width: 46px; height: 32px; border-radius: 16px; display: grid; place-items: center; transition: background-color var(--t-fast); }
.bnav-i .nav-l { white-space: nowrap; }
.bnav-i:hover { color: var(--ink); }
.bnav-i[aria-current="page"] { color: var(--accent); font-weight: 600; }
.bnav-i[aria-current="page"] .nav-ic { background: var(--card2); }
.bnav { padding-left: 6px; padding-right: 6px; }
.bnav-add { flex: none; margin: 0 4px; width: 56px; height: 56px; border-radius: 20px; background: var(--accent); color: var(--onAccent); display: grid; place-items: center; transition: transform var(--t-fast) var(--ease), filter var(--t-fast); }
.bnav-add:hover { filter: brightness(1.07); }
.bnav-add:active { transform: scale(.94); }

/* ---------- picker ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; animation: fade var(--t-med) ease; }
.psheet { width: 100%; height: 84dvh; background: var(--bg); border-radius: 32px 32px 0 0; display: flex; flex-direction: column; overflow: hidden; animation: up 300ms var(--ease); }
.pk-top { padding: 10px 18px 12px; display: flex; flex-direction: column; gap: 12px; }
.pk-top .card-head { margin: 0; align-items: center; }
.grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line2); align-self: center; }
.search { display: flex; align-items: center; gap: 10px; height: 52px; border-radius: 16px; background: var(--card2); padding: 0 14px; border: 1.5px solid var(--accent); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 16px; font-weight: 500; outline: none; padding: 0; }
.search input::-webkit-search-cancel-button { filter: grayscale(1); }
.pk-top .chips.scroll-x { margin: 0 -18px; padding: 2px 18px; }
.pk-top .chip { height: 36px; border: 0; }
.pk-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 10px calc(24px + env(safe-area-inset-bottom)); }
.pk-head { padding: 14px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
.pk-item { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 10px; border-radius: 14px; border: 0; background: transparent; color: var(--ink); text-align: left; transition: background-color var(--t-fast); }
.pk-item:hover { background: var(--hover); }
.pk-item.on { background: var(--card2); }
.pk-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pk-s { font-size: 15px; font-weight: 600; }
.pk-n { font-size: 12px; color: var(--mute); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(108px + env(safe-area-inset-bottom)); z-index: 60;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  padding: 12px 18px; border-radius: 999px; background: var(--ink); color: var(--bg);
  font-size: 13px; font-weight: 600; white-space: nowrap; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  transition: opacity var(--t-fast) ease, transform var(--t-med) var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- desktop ---------- */
@media (min-width: 1024px) {
  .shell.desk { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .shell.desk .main { padding: 24px 32px 48px; min-width: 0; }
  .shell.desk.with-savebar .main { padding-bottom: 120px; }
  .view { max-width: 1180px; }

  .side {
    position: sticky; top: 0; height: 100dvh; padding: 24px 16px; display: flex; flex-direction: column; gap: 8px;
    background: var(--nav); border-right: 1px solid var(--line);
  }
  .brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 20px; color: var(--ink); text-decoration: none; font-size: 16px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
  .brand .logo { border-radius: 10px; }
  .side-new { height: 50px; border-radius: 16px; margin-bottom: 14px; font-size: 15px; }
  .side-links { display: flex; flex-direction: column; gap: 4px; }
  .side-link {
    display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 12px; border-radius: 14px; border: 0; background: transparent;
    color: var(--mute); font-size: 14px; font-weight: 500; text-decoration: none; text-align: left; width: 100%;
    transition: background-color var(--t-fast), color var(--t-fast);
  }
  .side-link .nav-ic { display: grid; place-items: center; width: 24px; }
  .side-link:hover { background: var(--hover); color: var(--ink); }
  .side-link[aria-current="page"] { background: var(--card2); color: var(--accent); font-weight: 600; }
  .side-theme { margin-top: auto; }

  .hero { border-radius: 32px; padding: 28px 32px 80px; }
  .hero-detail, .hero-form { padding: 20px 24px 72px; }
  .hero-form { padding-bottom: 64px; }
  .sheet { margin: -52px 20px 0; border-radius: 32px 32px 0 0; padding: 22px 20px 0; gap: 16px; }
  .hero-form + .sheet { margin-top: -44px; border-radius: 32px 32px 0 0; }
  .hero-seg { max-width: 440px; }
  .hero-theme { display: none; }
  .kpi { max-width: 760px; grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr); }
  .kpi-side { flex-direction: row; gap: 40px; }
  .kpi-big { font-size: 40px; }
  .hero .wl { max-width: 760px; }

  .dash-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(330px, 1fr); grid-template-areas: "stats stats" "eq recent" "bd recent"; gap: 16px; align-items: start; }
  .area-stats { grid-area: stats; grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .area-eq { grid-area: eq; } .area-bd { grid-area: bd; } .area-recent { grid-area: recent; }
  .area-recent .section-head { padding-top: 0; }
  .eq { height: 220px; }

  .filters { flex-direction: row; align-items: center; justify-content: space-between; }
  .filters .chips.scroll-x { margin: 0; padding: 2px; flex-wrap: wrap; }
  .res-seg { width: 320px; flex: none; }

  .detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
  .detail-grid .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet > .btn-ghost-danger { align-self: flex-start; min-width: 220px; }
  .detail-pl { font-size: 36px; }

  .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
  .savebar { left: var(--side-w); padding: 14px 32px; }
  .savebar-in { max-width: 1140px; justify-content: flex-end; }
  .savebar .grow { flex: 0 0 280px; }

  .calc-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
  .calc-side { position: sticky; top: 24px; }

  .settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }

  .stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
  .fav { font-size: 44px; }
  .draft-pill { left: calc(50% + var(--side-w) / 2); bottom: 28px; }
  .shell.desk.with-draft .main { padding-bottom: 100px; }
  .banner { top: 20px; left: auto; right: 24px; transform: translateY(-24px); }
  .banner.show { transform: none; }

  .scrim { align-items: center; padding: 24px; }
  .psheet { width: 560px; height: min(720px, 86vh); border-radius: 28px; animation: pop 220ms var(--ease); box-shadow: 0 30px 80px rgba(0,0,0,.35); }
  .grab { display: none; }
  .toast { bottom: 32px; left: calc(50% + var(--side-w) / 2); }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .area-recent .pill { display: none; }
  .ttable .col-session { display: none; }
  .ttable td { padding: 10px 8px; }
  .th-btn { padding: 12px 8px; }
  .ttable th:not(:has(button)) { padding: 12px 8px; }
  .filters { flex-direction: column; align-items: stretch; }
  .res-seg { width: auto; }
}

@media (max-width: 380px) {
  .hero { padding-left: 18px; padding-right: 18px; }
  .kpi-big { font-size: 28px; }
  .stat-v { font-size: 16px; }
  .seg-btn { font-size: 12px; }
  .swatches .sw-c { width: 38px; height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
