/* Sales & Inventory — Gentle Monster USA
   Direction: maison. Black and white, Bodoni for titles and key figures, Jost for text,
   gold only as a fine accent (targets, the active page, moving up). Burgundy for moving down.
   Muted jewel tones only where stores or categories need their own color (no green, no bright red). */

@font-face { font-family: "Bodoni Moda"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/bodoni-moda-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Bodoni Moda"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/bodoni-moda-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Bodoni Moda"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/bodoni-moda-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Bodoni Moda"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/bodoni-moda-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 300; font-display: swap; src: url("fonts/jost-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/jost-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/jost-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/jost-latin-600-normal.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --page: #f4f4f2;
  --plinth: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f6f4;
  --ink: #000000;
  --ink-2: #2e2e2e;
  --ink-3: #6b6b68;
  --muted: #8f8f8b;
  --line: #e4e4e0;
  --line-2: #cdcdc8;
  --grid: #efefec;
  --gold: #a8864e;
  --gold-2: #c8a978;
  --cy: #000000;
  --ly: #d3d0c9;
  --tg: #a8864e;
  --stone: #b8b2a7;
  --shadow: rgba(0, 0, 0, 0.17);
  --good: #86662b;
  --good-bg: rgba(168, 134, 78, 0.13);
  --bad: #8a2a3a;
  --bad-bg: rgba(138, 42, 58, 0.08);
  --warn-bg: #f6efe2;
  --accent-wash: rgba(168, 134, 78, 0.10);
  /* store and category colors: navy, rose, sky, plum, gold, violet, cognac, teal — order checked for color-blind separation */
  --s1: #2e5091; --s2: #cf7786; --s3: #5db2e6; --s4: #7c376f; --s5: #d4ab4f; --s6: #806ab9; --s7: #b05925; --s8: #0091a8;
  /* heatmap: one hue, champagne to deep bronze */
  --heat-lo: #f7f2e8; --heat-hi: #4a3410;
  /* month ramp: light grey to black */
  --r1: #d9d6cf; --r2: #bdb9b0; --r3: #9d988f; --r4: #78746c; --r5: #54514b; --r6: #2c2a27; --r7: #000000;
  --track: #ecebe7;
  --side: #000000;
  --side-ink: #ffffff;
  --side-ink-2: #8d8d89;
  --display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --text: "Jost", "Futura", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0b0b0b; --plinth: #141414; --surface: #141414; --surface-2: #1b1b1a;
    --ink: #ffffff; --ink-2: #e6e5e1; --ink-3: #a3a29d; --muted: #82817c; --line: #262624; --line-2: #3a3a37; --grid: #1f1f1d;
    --gold: #c9a66b; --gold-2: #a8864e; --cy: #ffffff; --ly: #4b4a46; --tg: #c9a66b; --stone: #7e7a72; --shadow: rgba(0, 0, 0, 0.7);
    --good: #d6b47c; --good-bg: rgba(201, 166, 107, 0.14); --bad: #e2939c; --bad-bg: rgba(226, 147, 156, 0.12); --warn-bg: #2b2418; --accent-wash: rgba(201, 166, 107, 0.12);
    --s1: #4367ab; --s2: #c56e7d; --s3: #469bcf; --s4: #8c467e; --s5: #b58d2d; --s6: #806ab9; --s7: #b05925; --s8: #0096a4;
    --heat-lo: #1d1b17; --heat-hi: #ecd3a2;
    --r1: #3a3936; --r2: #57554f; --r3: #77746d; --r4: #9a968e; --r5: #bdb9b0; --r6: #dcd9d2; --r7: #ffffff; --track: #2a2926;
    --side: #000000; --side-ink: #ffffff; --side-ink-2: #7d7d79;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0b0b0b; --plinth: #141414; --surface: #141414; --surface-2: #1b1b1a;
  --ink: #ffffff; --ink-2: #e6e5e1; --ink-3: #a3a29d; --muted: #82817c; --line: #262624; --line-2: #3a3a37; --grid: #1f1f1d;
  --gold: #c9a66b; --gold-2: #a8864e; --cy: #ffffff; --ly: #4b4a46; --tg: #c9a66b; --stone: #7e7a72; --shadow: rgba(0, 0, 0, 0.7);
  --good: #d6b47c; --good-bg: rgba(201, 166, 107, 0.14); --bad: #e2939c; --bad-bg: rgba(226, 147, 156, 0.12); --warn-bg: #2b2418; --accent-wash: rgba(201, 166, 107, 0.12);
  --s1: #4367ab; --s2: #c56e7d; --s3: #469bcf; --s4: #8c467e; --s5: #b58d2d; --s6: #806ab9; --s7: #b05925; --s8: #0096a4;
  --heat-lo: #1d1b17; --heat-hi: #ecd3a2;
  --r1: #3a3936; --r2: #57554f; --r3: #77746d; --r4: #9a968e; --r5: #bdb9b0; --r6: #dcd9d2; --r7: #ffffff; --track: #2a2926;
  --side: #000000; --side-ink: #ffffff; --side-ink-2: #7d7d79;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--page); color: var(--ink-2); font: 400 15px/1.55 var(--text); -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--ink); text-underline-offset: 3px; }
:focus-visible { outline: 1.5px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }
.boot-msg { padding: 56px 4px; color: var(--ink-3); }

/* ---------- layout: side menu */
.app { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 30px 0 22px; }
.brand { display: flex; align-items: center; gap: 13px; padding: 0 28px 34px; }
.brand-name { font: 500 19px/1.1 var(--display); letter-spacing: 0; }
.brand-sub { font-size: 12px; color: var(--side-ink-2); margin-top: 4px; letter-spacing: 0.04em; }
.nav { display: flex; flex-direction: column; flex: 1; overflow-y: auto; }
.nav button { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; padding: 11px 28px; border: 0; background: transparent; color: var(--side-ink-2); cursor: pointer; text-align: left; font-size: 14.5px; font-weight: 400; letter-spacing: 0.01em; transition: color 0.15s; }
.nav button:hover { color: var(--side-ink); }
.nav button[aria-current="page"] { color: var(--side-ink); }
.nav button[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 2px; background: var(--gold); }
.nav .ic svg { width: 17px; height: 17px; display: block; }
.nav .sep { height: 1px; background: #1e1e1e; margin: 14px 28px; }
.side-foot { padding: 18px 28px 0; border-top: 1px solid #1e1e1e; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.side-foot .who { display: flex; align-items: center; gap: 12px; }
.side-foot .who b { display: block; font-weight: 500; font-size: 14px; color: var(--side-ink); }
.side-foot .who span:not(.avatar) { font-size: 12px; color: var(--side-ink-2); }
.avatar { width: 34px; height: 34px; border-radius: 50%; border: 1px solid #3a3a3a; display: grid; place-items: center; font: 400 13px/1 var(--display); color: var(--side-ink); flex: none; }
.side-foot .row { display: flex; gap: 8px; }
.side-foot .row button { display: inline-flex; align-items: center; gap: 7px; background: transparent; border: 1px solid #2c2c2c; color: var(--side-ink-2); padding: 6px 11px; cursor: pointer; font-size: 12.5px; }
.side-foot .row button:hover { color: var(--side-ink); border-color: #555; }
.side-foot .ic svg { width: 14px; height: 14px; display: block; }
.content { min-width: 0; }
.main { max-width: 1480px; margin: 0 auto; padding: 44px 48px 72px; }
.mobile-head, .bottom-nav, .more-sheet { display: none; }

/* ---------- page heading */
.top { margin-bottom: 30px; }
.top h1 { margin: 0; font: 400 clamp(34px, 3.2vw, 48px)/1.02 var(--display); color: var(--ink); letter-spacing: -0.01em; }
.lede { margin: 16px 0 0; font-size: clamp(17px, 1.35vw, 20px); font-weight: 300; line-height: 1.55; color: var(--ink-2); max-width: 64ch; }
.lede .fig { font: 500 1.12em/1 var(--display); color: var(--ink); white-space: nowrap; font-variant-numeric: lining-nums; }
.lede .fig.up { color: var(--good); } .lede .fig.down { color: var(--bad); }
.top .sub { color: var(--muted); font-size: 13px; margin-top: 12px; display: flex; align-items: center; gap: 9px; }
.top .sub .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); flex: none; }
.top .sub .dot.old { background: var(--bad); }

/* ---------- filters */
.filters { display: flex; flex-wrap: wrap; gap: 18px 32px; align-items: flex-start; margin: 0 0 28px; padding: 0 0 26px; border-bottom: 1px solid var(--line); }
.f { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.f > .lbl { height: 18px; line-height: 18px; font-size: 12.5px; font-weight: 500; color: var(--ink-3); letter-spacing: 0.02em; white-space: nowrap; }
.f input[type="date"], .f select, .f input[type="number"], .f input[type="text"] { height: 36px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 0; background: var(--plinth); font-size: 14px; }
.f input[type="number"] { width: 92px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; height: 36px; border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 0; padding: 0 14px; cursor: pointer; font-size: 13.5px; line-height: 1; white-space: nowrap; transition: border-color 0.12s, color 0.12s; }
.chip:hover { border-color: var(--ink-3); color: var(--ink-2); }
.chip.on { background: var(--plinth); border-color: var(--ink); color: var(--ink); box-shadow: inset 0 -2px 0 var(--gold); }
.chip.small { padding: 0 11px; font-size: 13px; min-width: 46px; justify-content: center; }
.seg { display: inline-flex; border: 1px solid var(--line-2); flex-wrap: wrap; align-self: flex-start; }
.seg button { height: 34px; border: 0; background: transparent; padding: 0 15px; cursor: pointer; color: var(--ink-3); font-size: 13.5px; white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--ink); color: var(--page); }
.linkbtn { border: 0; background: none; color: var(--ink); cursor: pointer; padding: 4px 6px; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.chips .linkbtn { height: 36px; padding: 0 6px; }

/* ---------- key figures */
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: var(--plinth); border: 1px solid var(--line); margin-bottom: 22px; }
.tiles.t3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tiles.t4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tiles.t5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tile { padding: 24px 24px 22px; min-width: 0; position: relative; }
.tile + .tile { box-shadow: inset 1px 0 0 var(--line); }
.tile .tl { font-size: 12.5px; color: var(--ink-3); letter-spacing: 0.02em; }
.tile .tv { font: 400 clamp(26px, 2.2vw, 36px)/1.05 var(--display); color: var(--ink); margin-top: 12px; white-space: nowrap; font-variant-numeric: lining-nums; }
.tile .td { font-size: 13px; margin-top: 10px; color: var(--ink-3); }
.meter { height: 2px; background: var(--track); margin-top: 14px; overflow: hidden; }
.meter > div { height: 100%; background: var(--ink); }
.pos { color: var(--good); } .neg { color: var(--bad); }
.pill { display: inline-block; padding: 0 7px; font-size: 12.5px; font-weight: 500; }
.pill.pos { background: var(--good-bg); } .pill.neg { background: var(--bad-bg); }

/* ---------- panels */
.grid { display: grid; gap: 22px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; } .span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; } .span-3 { grid-column: span 3; }
.panel { background: var(--plinth); border: 1px solid var(--line); padding: 28px 30px 24px; min-width: 0; display: flex; flex-direction: column; }
.grid > div > .panel { height: 100%; }
.panel > .btn, .panel > button { align-self: flex-start; }
.panel h2 { font: 400 23px/1.15 var(--display); margin: 0; color: var(--ink); }
.panel .ph { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.panel .note { font-size: 13px; color: var(--ink-3); margin-top: 6px; font-weight: 400; max-width: 86ch; }
.chart-box { position: relative; height: 300px; }
.panel > .chart-box { flex: 1 0 auto; }
.panel > .legend { min-height: 20px; }
.chart-box.tall { height: 360px; }
.chart-box.short { height: 240px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 13px; color: var(--ink-3); margin-bottom: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; display: inline-block; }
.legend i.line { height: 2px; width: 22px; position: relative; }
.legend i.line::after { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; border: 1.8px solid currentColor; background: var(--plinth); box-sizing: border-box; }
.legend i.dot { width: 10px; height: 10px; border-radius: 50%; }
.legend i.dash { height: 0; width: 18px; border-top: 2px dashed var(--tg); background: none !important; }
.legend b { color: var(--ink); font-weight: 500; }

/* ---------- tables */
.tbl-wrap { overflow: auto; max-width: 100%; }
table.t { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; font-variant-numeric: tabular-nums lining-nums; }
table.t th, table.t td { padding: 9px 10px; border-bottom: 1px solid var(--grid); text-align: right; white-space: nowrap; }
table.t th { font-size: 12.5px; font-weight: 500; color: var(--ink-3); background: var(--plinth); position: sticky; top: 0; z-index: 1; vertical-align: bottom; border-bottom: 1px solid var(--ink); }
table.t th.l, table.t td.l { text-align: left; }
table.t td:first-child { color: var(--ink); font-weight: 500; }
table.t tr.sub td { background: var(--surface-2); font-weight: 500; color: var(--ink); }
table.t tr.total td { font-weight: 600; color: var(--ink); border-top: 1px solid var(--ink); border-bottom: 0; background: var(--plinth); }
table.t th.blank { border-bottom: 0; }
table.t th.grp { text-align: center; color: var(--ink-2); border-bottom: 1px solid var(--line-2); font: italic 400 14px/1.2 var(--display); }
table.t td.wrap { white-space: normal; min-width: 200px; text-align: left; color: var(--ink-2); font-weight: 400; }
table.t td.dim { color: var(--muted); }
table.t tbody tr:hover td { background: var(--accent-wash); }
table.t.compact th, table.t.compact td { padding: 9px 7px; }
.bar-cell { position: relative; }
.bar-cell .b { position: absolute; left: 0; top: 8px; bottom: 8px; background: var(--accent-wash); box-shadow: inset 2px 0 0 var(--gold); }
.bar-cell span { position: relative; }

/* ---------- top 10 cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 22px; }
.card { padding: 24px 24px 16px; }
.card h3 { margin: 0; font: 400 24px/1.1 var(--display); color: var(--ink); }
.card .meta { font-size: 13px; color: var(--ink-3); margin-top: 6px; }
.card table.t th, .card table.t td { padding: 8px 5px; }
.card table.t { font-size: 13px; }
table.t td.rank { color: var(--muted); width: 22px; font: italic 400 14px/1 var(--display); }
.itemname { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 3D pie with its numbers */
.donut-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; flex: 1 0 auto; }
.donut-wrap.wide { grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: 36px; align-items: center; }
.donut-box { position: relative; height: 290px; }
table.t td .sw { display: inline-block; width: 10px; height: 10px; margin-right: 10px; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
table.t.mix td:first-child { font-weight: 400; color: var(--ink-2); }
table.t.mix tr.total td:first-child { font-weight: 600; color: var(--ink); }

/* ---------- heatmap */
.heat-ctl { margin: 0 0 16px; }
.heat { position: relative; --heat-lab: 64px; --heat-tot: 86px; --heat-min: 7px; }
.heat-scroll { overflow-x: auto; padding-bottom: 4px; }
.heat-grid { display: grid; column-gap: 2px; row-gap: 2px; align-items: stretch; }
.heat-grid .hh { height: 22px; position: relative; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.heat-grid .hh span { position: absolute; left: 0; bottom: 6px; }
.heat-grid .hh.we::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 3px; height: 3px; margin-left: -1.5px; border-radius: 50%; background: var(--line-2); }
.heat-grid .hh.tot { text-align: right; font-size: 12.5px; font-weight: 500; color: var(--ink-3); padding-top: 2px; }
.heat-grid .hl { display: flex; align-items: center; font-size: 13px; font-weight: 500; color: var(--ink); height: 30px; }
.heat-grid .hc { height: 30px; min-width: 0; cursor: default; transition: box-shadow 0.1s; }
.heat-grid .hc:hover { box-shadow: 0 0 0 1.5px var(--ink); position: relative; z-index: 1; }
.heat-grid .hc.na { background: var(--track); background-image: repeating-linear-gradient(135deg, transparent 0 3px, var(--plinth) 3px 4px); }
.heat-grid .ht { display: flex; align-items: center; justify-content: flex-end; font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums lining-nums; padding-left: 8px; }
.heat-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 14px; font-size: 12.5px; color: var(--ink-3); }
.heat-legend .ramp { width: 160px; height: 8px; display: inline-block; }
.heat-legend .na-key { display: inline-flex; align-items: center; gap: 7px; margin-left: 14px; }
.heat-legend .na-key i { width: 12px; height: 12px; background: var(--track); background-image: repeating-linear-gradient(135deg, transparent 0 3px, var(--plinth) 3px 4px); }
.heat-tip { position: absolute; transform: translate(-50%, -100%); background: var(--ink); color: var(--page); padding: 10px 14px; font-size: 12.5px; line-height: 1.5; pointer-events: none; white-space: nowrap; z-index: 5; }
.heat-tip b { font-weight: 600; display: block; margin-bottom: 2px; }
.heat-tip .ly { opacity: 0.75; }

/* ---------- rank charts (Top 10) */
.rank-key { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 13px; color: var(--ink-3); margin: 0 0 18px; align-items: center; }
.rank-key span { display: inline-flex; align-items: center; gap: 8px; }
.rank-key i { width: 22px; height: 2px; display: inline-block; position: relative; }
.rank-key i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; border: 1.8px solid currentColor; background: var(--page); box-sizing: border-box; }
.card .chart-box.rank { height: 400px; }
.card .meta b { color: var(--ink); font-weight: 500; }

/* ---------- forms, buttons */
.btn { border: 1px solid var(--ink); background: transparent; border-radius: 0; padding: 9px 18px; cursor: pointer; font-weight: 500; font-size: 13.5px; color: var(--ink); letter-spacing: 0.02em; }
.btn:hover { background: var(--ink); color: var(--page); }
.btn.primary { background: var(--ink); color: var(--page); }
.btn.primary:hover { background: var(--gold); border-color: var(--gold); color: #000; }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn:disabled { opacity: 0.45; cursor: default; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 18px; }
.form-grid label, .fl { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.form-grid input, .form-grid select, textarea.code, .fl input, .fl select { padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 0; background: var(--plinth); font-weight: 400; font-size: 14px; }
textarea.code { width: 100%; min-height: 220px; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); padding: 10px; }
pre.cert { white-space: pre-wrap; word-break: break-all; font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace; background: var(--surface-2); padding: 12px; max-height: 220px; overflow: auto; margin: 6px 0 12px; }
.msg { padding: 12px 16px; font-size: 14px; margin: 10px 0; border-left: 2px solid currentColor; }
.msg.ok { background: var(--good-bg); color: var(--good); }
.msg.err { background: var(--bad-bg); color: var(--bad); }
.msg.info { background: var(--accent-wash); color: var(--ink); border-left-color: var(--gold); }
.msg.warn { background: var(--warn-bg); color: var(--ink); border-left-color: var(--gold); }
.tabs { display: flex; gap: 26px; flex-wrap: wrap; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 10px 0; cursor: pointer; color: var(--ink-3); font-size: 14px; border-bottom: 1.5px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--ink); }
.edit-tbl input, .edit-tbl select { width: 100%; min-width: 70px; padding: 6px 8px; border: 1px solid var(--line); background: var(--plinth); font-size: 13px; }
.edit-tbl td { padding: 4px 5px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 7px 20px; font-size: 14px; margin: 0; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; color: var(--ink); }
.steps { margin: 4px 0 0 20px; padding: 0; line-height: 1.7; }
.steps li { margin-bottom: 8px; }
.help { color: var(--ink-3); font-size: 14px; line-height: 1.6; }
.empty { color: var(--ink-3); padding: 30px 6px; text-align: center; font: italic 400 17px/1.4 var(--display); }
.loading { opacity: 0.55; transition: opacity 0.15s; }
.toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); background: var(--ink); color: var(--page); padding: 12px 20px; font-size: 14px; z-index: 60; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25); }
.icon-btn { width: 36px; height: 36px; border: 1px solid #333; background: transparent; display: grid; place-items: center; cursor: pointer; color: #fff; padding: 0; }
.icon-btn svg { width: 17px; height: 17px; }

/* ---------- sign in */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(380px, 1fr); background: var(--plinth); }
.login-art { position: relative; overflow: hidden; background: #000; color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 52px 60px; }
.login-art .mark { font: 400 13px/1 var(--text); letter-spacing: 0.32em; color: #9a9a96; }
.login-art .rule { display: block; width: 64px; height: 1px; background: var(--gold-2); margin-bottom: 30px; }
.login-art .title { position: relative; z-index: 1; }
.login-art .title h1 { margin: 0; font: 400 clamp(52px, 6.4vw, 104px)/0.96 var(--display); letter-spacing: -0.01em; }
.login-art .title h1 i { font-style: italic; color: var(--gold-2); }
.login-art .title p { margin: 18px 0 0; color: #9a9a96; font-size: 15px; font-weight: 300; max-width: 38ch; }
.login-side { display: grid; place-items: center; padding: 40px 28px; background: var(--plinth); }
.login-card { width: 100%; max-width: 340px; }
.login-card h2 { margin: 0 0 6px; font: 400 40px/1.05 var(--display); color: var(--ink); }
.login-card .lead { color: var(--ink-3); font-size: 14px; margin: 0 0 30px; }
.login-card label { display: block; font-size: 12.5px; color: var(--ink-3); margin: 22px 0 4px; letter-spacing: 0.03em; }
.login-card input { width: 100%; padding: 10px 0; border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0; background: transparent; font-size: 16px; color: var(--ink); }
.login-card input:focus { outline: none; border-bottom-color: var(--ink); }
.login-card .btn { width: 100%; margin-top: 34px; padding: 15px; font-size: 14px; letter-spacing: 0.12em; }
.login-card .fine { margin-top: 22px; font-size: 12.5px; color: var(--muted); }
.login-err { margin-top: 18px; color: var(--bad); font-size: 13.5px; border-left: 2px solid var(--bad); padding: 4px 10px; }

/* ---------- tablet */
@media (max-width: 1240px) {
  .app { grid-template-columns: 220px minmax(0, 1fr); }
  .brand { padding: 0 22px 28px; } .nav button { padding: 10px 22px; } .side-foot { padding: 16px 22px 0; }
  .tiles, .tiles.t5, .tiles.t4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tiles .tile:nth-child(3n + 1) { box-shadow: none; }
  .tiles .tile:nth-child(n + 4) { border-top: 1px solid var(--line); }
  .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; }
  .span-3 { grid-column: span 6; }
  .main { padding: 34px 28px 60px; }
}

/* ---------- phone */
@media (max-width: 760px) {
  .app { display: block; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .side { display: none; }
  .mobile-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20; background: #000; color: #fff; padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top)); }
  .mobile-head .mh-title { display: flex; align-items: center; gap: 10px; font: 400 18px/1 var(--display); }
  .main { padding: 26px 16px 30px; }
  .top h1 { font-size: 32px; }
  .lede { font-size: 17px; }
  .filters { gap: 14px 18px; padding-bottom: 20px; margin-bottom: 20px; }
  .tiles, .tiles.t3, .tiles.t4, .tiles.t5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles .tile { box-shadow: none; border-top: 0; }
  .tiles .tile:nth-child(2n) { box-shadow: inset 1px 0 0 var(--line); }
  .tiles .tile:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .tile { padding: 16px 14px 16px; }
  .tile .tv { font-size: 26px; }
  .span-3 { grid-column: span 12; }
  .grid { gap: 14px; }
  .panel { padding: 20px 16px 16px; }
  .panel h2 { font-size: 21px; }
  .chart-box, .chart-box.tall { height: 260px; }
  .donut-wrap, .donut-wrap.wide { grid-template-columns: 1fr; gap: 10px; }
  .donut-box { height: 250px; }
  table.t.mix th, table.t.mix td { padding: 8px 5px; }
  table.t.mix td:first-child { white-space: normal; }
  table.t.mix td .sw { margin-right: 7px; }
  .heat { --heat-lab: 50px; --heat-tot: 64px; --heat-min: 9px; }
  .card .chart-box.rank { height: 380px; }
  .cards { grid-template-columns: 1fr; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #000; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; font-size: 10.5px; color: #8d8d89; cursor: pointer; letter-spacing: 0.02em; }
  .bottom-nav button svg { width: 20px; height: 20px; }
  .bottom-nav button[aria-current="page"] { color: #fff; }
  .bottom-nav button[aria-current="page"] svg { color: var(--gold-2); }
  .more-sheet { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.45); }
  .more-sheet[hidden] { display: none !important; }
  .more-sheet .sheet { position: absolute; left: 0; right: 0; bottom: 0; background: var(--plinth); padding: 12px 12px calc(16px + env(safe-area-inset-bottom)); }
  .more-sheet .sheet button { display: flex; width: 100%; align-items: center; gap: 14px; border: 0; background: none; padding: 14px 12px; font-size: 16px; text-align: left; color: var(--ink); }
  .more-sheet .sheet button svg { width: 20px; height: 20px; color: var(--ink-3); }
  .more-sheet .sheet button[aria-current="page"] { background: var(--surface-2); }
  table.t { font-size: 13px; }
  .login { grid-template-columns: 1fr; }
  .login-art { min-height: 240px; padding: 28px 24px; }
  .login-card h2 { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print {
  .side, .bottom-nav, .mobile-head, .filters .linkbtn { display: none !important; }
  .app { display: block; }
  .panel, .tiles { break-inside: avoid; }
}
