/* Supplier Desk — Graphite & Signal. See design-system/supplier-desk/MASTER.md */
:root {
  --bg: #F4F4F1; --surface: #FFFFFF; --surface-2: #EEEEEA; --border: #DCDCD6; --border-strong: #C9C9C2;
  --text: #17181A; --muted: #5D6066; --faint: #8A8D93;
  --primary: #3E5200; --on-primary: #FFFFFF; --primary-soft: #E7F2BE; --on-primary-soft: #2E3D00;
  --danger: #C2412D; --on-danger: #FFFFFF;
  --ring: #3E5200;
  --st-pending: #A35F00; --st-accepted: #1F6FB0; --st-in_progress: #6B4FD8;
  --st-delivered: #1E8A55; --st-issue: #C2412D; --st-cancelled: #6B6E75;
  --chart-a: #5E7A00; --chart-b: #7A5CE0; --grid: #E4E4DF;
  --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 8px 24px rgb(0 0 0 / .06);
  --radius: 10px; --radius-sm: 7px;
  --font: "Fira Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Fira Code", ui-monospace, "SFMono-Regular", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111214; --surface: #18191C; --surface-2: #1F2024; --border: #2C2E33; --border-strong: #3A3D43;
    --text: #ECEDEE; --muted: #9A9DA4; --faint: #6E7178;
    --primary: #D4F25A; --on-primary: #141600; --primary-soft: #2B3312; --on-primary-soft: #DDF57A;
    --danger: #FF7A66; --on-danger: #1A0805; --ring: #D4F25A;
    --st-pending: #F5B746; --st-accepted: #7FC4F5; --st-in_progress: #B79CFF;
    --st-delivered: #5BD69A; --st-issue: #FF7A66; --st-cancelled: #8E9198;
    --chart-a: #7D9A14; --chart-b: #8466EA; --grid: #26282C;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 12px 32px rgb(0 0 0 / .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111214; --surface: #18191C; --surface-2: #1F2024; --border: #2C2E33; --border-strong: #3A3D43;
  --text: #ECEDEE; --muted: #9A9DA4; --faint: #6E7178;
  --primary: #D4F25A; --on-primary: #141600; --primary-soft: #2B3312; --on-primary-soft: #DDF57A;
  --danger: #FF7A66; --on-danger: #1A0805; --ring: #D4F25A;
  --st-pending: #F5B746; --st-accepted: #7FC4F5; --st-in_progress: #B79CFF;
  --st-delivered: #5BD69A; --st-issue: #FF7A66; --st-cancelled: #8E9198;
  --chart-a: #7D9A14; --chart-b: #8466EA; --grid: #26282C;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 12px 32px rgb(0 0 0 / .35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 400 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; min-height: 100dvh;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[x-cloak] { display: none !important; }
.mono { font-family: var(--mono); font-feature-settings: "calt" 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.ico { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -4px; }
.ico-sm { width: 15px; height: 15px; vertical-align: -3px; }
.ico-lg { width: 22px; height: 22px; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }

/* ---------- layout shell ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100dvh; }
.side {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 4px;
  padding: 16px 12px; border-right: 1px solid var(--border); background: var(--surface);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; font-weight: 600; letter-spacing: -.01em; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; background: var(--primary); color: var(--on-primary);
  display: grid; place-items: center; font: 700 13px var(--mono);
}
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--muted); font-weight: 500; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--primary-soft); color: var(--on-primary-soft); }
.nav .count { margin-left: auto; font: 500 12px var(--mono); color: var(--muted); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; min-height: 60px;
  padding: 10px 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 18px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.topbar .spacer { flex: 1; }
.content { padding: 20px 24px 40px; display: flex; flex-direction: column; gap: 16px; max-width: 1400px; width: 100%; }
.bottomnav { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .topbar { padding: 10px 16px; }
  .content { padding: 14px 16px calc(96px + env(safe-area-inset-bottom)); }
  .bottomnav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--border); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .bottomnav a, .bottomnav button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 48px;
    text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 500; background: none; border: 0; cursor: pointer; border-radius: 8px;
  }
  .bottomnav [aria-current="page"] { color: var(--text); }
  .bottomnav [aria-current="page"] .ico { color: var(--primary); }
  .bottomnav .fab .ico { width: 22px; height: 22px; padding: 7px; box-sizing: content-box; border-radius: 12px; background: var(--primary); color: var(--on-primary); }
  input, select, textarea { font-size: 16px !important; }
}

/* ---------- primitives ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.card-h h2, .card-h h3 { margin: 0; font-size: 14px; font-weight: 600; }
.card-b { padding: 16px; }
.card-f { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: 2fr 1fr; }
@media (max-width: 1100px) { .grid-3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.between { justify-content: space-between; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 88%, var(--text)); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn-icon { width: 38px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.htmx-request { opacity: .55; pointer-events: none; }
@media (max-width: 900px) { .btn { min-height: 44px; } .btn-sm { min-height: 38px; } .btn-icon { width: 44px; } .btn-sm.btn-icon { width: 38px; } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; text-transform: uppercase; }
.input, .select, .textarea {
  width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 84px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 22%, transparent); }
.help { font-size: 12px; color: var(--muted); }
.error-text { font-size: 13px; color: var(--danger); }
.search { position: relative; flex: 1; max-width: 360px; }
.search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search .input { padding-left: 36px; }

/* chips / segmented / toggles */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: var(--surface-2); color: var(--muted); white-space: nowrap; line-height: 20px;
}
.status { --c: var(--muted); background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); }
.status .ico { width: 13px; height: 13px; vertical-align: -2px; }
.status-pending { --c: var(--st-pending); } .status-accepted { --c: var(--st-accepted); }
.status-in_progress { --c: var(--st-in_progress); } .status-delivered { --c: var(--st-delivered); }
.status-issue { --c: var(--st-issue); } .status-cancelled { --c: var(--st-cancelled); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--muted)); flex: none; }
.urgent { --c: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 9px; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.seg a, .seg button, .seg label {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; min-height: 32px; border-radius: 7px; border: 0; background: none;
  text-decoration: none; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.seg [aria-current="true"], .seg [aria-selected="true"], .seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg .n { font: 500 12px var(--mono); color: var(--faint); }

.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick label span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border: 1px solid var(--border-strong);
  border-radius: 8px; cursor: pointer; transition: background .15s, border-color .15s; background: var(--surface);
}
.pick label span:hover { background: var(--surface-2); }
.pick input:checked + span { background: var(--primary-soft); border-color: var(--primary); color: var(--on-primary-soft); font-weight: 500; }
.pick input:focus-visible + span { outline: 2px solid var(--ring); outline-offset: 2px; }
.pick-domains { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); max-height: 300px; overflow: auto; padding: 2px; }
.pick-domains label span { width: 100%; font-family: var(--mono); font-size: 13px; }

.switch { position: relative; display: inline-flex; width: 38px; height: 22px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--border-strong); transition: background .15s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); transition: transform .18s; box-shadow: 0 1px 2px rgb(0 0 0 / .25); }
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::after { transform: translateX(16px); background: var(--on-primary); }
.switch input:focus-visible + i { outline: 2px solid var(--ring); outline-offset: 2px; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; transition: border-color .15s; }
a.kpi:hover { border-color: var(--border-strong); }
.kpi .k { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi .v { font: 600 28px/1.15 var(--mono); letter-spacing: -.02em; }
.kpi .s { font-size: 12px; color: var(--muted); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
.t td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background .12s; }
.t tbody tr:hover { background: var(--surface-2); }
.t tr.is-selected { background: var(--primary-soft); }
.t .num { text-align: right; font-family: var(--mono); }
.t a.rowlink { text-decoration: none; font-weight: 500; }
.t a.rowlink:hover { text-decoration: underline; }
.t input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .ico { width: 28px; height: 28px; color: var(--faint); }

/* mobile: tables -> cards */
@media (max-width: 700px) {
  .t-cards thead { display: none; }
  .t-cards, .t-cards tbody, .t-cards tr, .t-cards td { display: block; width: 100%; }
  .t-cards tr { padding: 12px 14px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; }
  .t-cards td { padding: 0; border: 0; }
  .t-cards td[data-hide-sm] { display: none; }
  .t-cards td.c-main { grid-column: 2 / 3; }
  .t-cards td.c-side { grid-column: 3; grid-row: 1 / span 2; text-align: right; }
  .t-cards td.c-sub { grid-column: 2 / 3; color: var(--muted); font-size: 13px; }
}

/* ---------- board (supplier) ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 12px; align-items: start; }
.col { background: var(--surface-2); border-radius: var(--radius); padding: 8px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.col-h { display: flex; align-items: center; gap: 8px; padding: 6px 6px 4px; font-weight: 600; font-size: 13px; }
.col-h .n { margin-left: auto; font: 500 12px var(--mono); color: var(--muted); }
.ocard {
  display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 9px; cursor: pointer; text-align: left; width: 100%; transition: border-color .15s, transform .15s, box-shadow .15s;
}
.ocard:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.ocard .top { display: flex; align-items: center; gap: 8px; }
.ocard .code { font: 600 13px var(--mono); }
.ocard .dom { font: 500 14px var(--mono); word-break: break-all; }
.ocard .meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.ocard .qty { margin-left: auto; font: 600 18px var(--mono); }
.ocard.is-new { animation: pop .6s ease-out; }
@keyframes pop { from { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 60%, transparent); } to { box-shadow: 0 0 0 0 transparent; } }
.board-tabs { display: none; }
@media (max-width: 1000px) {
  .board { grid-template-columns: minmax(0, 1fr); }
  .board-tabs { display: inline-flex; }
  .board .col { display: none; background: none; padding: 0; }
  .board .col.is-active { display: flex; }
  .board .col-h { display: none; }
}

/* ---------- drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgb(0 0 0 / .45); z-index: 50; animation: fade .2s; }
.drawer {
  position: fixed; z-index: 51; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--surface);
  border-left: 1px solid var(--border); display: flex; flex-direction: column; animation: slide .22s ease-out; box-shadow: var(--shadow);
}
.drawer-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.drawer-b { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 18px; }
.drawer-f { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); display: flex; gap: 8px; flex-wrap: wrap; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@media (max-width: 700px) {
  .drawer { top: auto; width: 100vw; max-height: 92dvh; border-radius: 16px 16px 0 0; border-left: 0; border-top: 1px solid var(--border); animation-name: up; }
  @keyframes up { from { transform: translateY(32px); opacity: 0; } }
}

.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; }
.facts dt { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.facts dd { margin: 0; font-weight: 500; word-break: break-word; }
.big-domain { font: 600 20px/1.3 var(--mono); word-break: break-all; }
.big-qty { font: 600 32px/1 var(--mono); }
.note { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; }

/* dropzone */
.drop {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 20px 16px; text-align: center; display: flex; flex-direction: column;
  align-items: center; gap: 6px; transition: border-color .15s, background .15s; cursor: pointer; position: relative;
}
.drop:hover, .drop.is-over { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, transparent); }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop .ico { width: 26px; height: 26px; color: var(--muted); }
.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--primary); width: 0; transition: width .15s; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.file-row .grow { flex: 1; min-width: 0; }
.file-row .name { font: 500 13px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* timeline / chat */
.timeline { display: flex; flex-direction: column; gap: 10px; }
.tl { display: flex; gap: 10px; font-size: 13px; }
.tl .ic { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; flex: none; color: var(--muted); }
.tl .ic .ico { width: 14px; height: 14px; }
.tl .body { flex: 1; min-width: 0; padding-top: 3px; }
.tl .when { color: var(--faint); font-size: 12px; margin-left: 6px; }
.bubble { margin-top: 4px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); white-space: pre-wrap; word-break: break-word; }
.tl.me .bubble { background: var(--primary-soft); color: var(--on-primary-soft); }
.chatbox { display: flex; gap: 8px; }
.chatbox .input { flex: 1; }

/* toasts */
.toasts { position: fixed; z-index: 80; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
@media (max-width: 900px) { .toasts { left: 16px; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); max-width: none; } }
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; background: var(--text); color: var(--bg); border-radius: 10px;
  box-shadow: var(--shadow); font-weight: 500; animation: toastIn .2s ease-out;
}
.toast .ico { margin-top: 1px; }
.toast.err .ico { color: var(--st-issue); }
.toast.ok .ico { color: var(--primary); }
:root:not([data-theme="dark"]) .toast.ok .ico { color: #C9E86A; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } }

/* chart */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-l { stroke: var(--grid); stroke-width: 1; }
.chart .axis { fill: var(--muted); font: 11px var(--mono); }
.chart .bar-a { fill: var(--chart-a); }
.chart .bar-b { fill: var(--chart-b); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + g rect, .chart g.day:hover rect.bar-a, .chart g.day:hover rect.bar-b { opacity: 1; }
.chart g.day:hover .hover-bg { fill: var(--surface-2); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tip {
  position: absolute; pointer-events: none; background: var(--text); color: var(--bg); padding: 8px 10px; border-radius: 8px; font-size: 12px;
  box-shadow: var(--shadow); white-space: nowrap; transform: translate(-50%, -100%); z-index: 5;
}
.tip b { font-family: var(--mono); }

/* drag reorder */
.sortable [draggable="true"] { cursor: grab; }
.sortable .is-dragging { opacity: .4; }
.handle { color: var(--faint); cursor: grab; display: inline-flex; }

/* matrix */
.matrix th.rot { height: 140px; white-space: nowrap; vertical-align: bottom; }
.matrix th.rot > div { transform: rotate(-50deg); width: 24px; transform-origin: left bottom; translate: 12px -4px; font: 500 12px var(--mono); }
.matrix td.cell { text-align: center; }

/* auth */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth .card { width: min(380px, 100%); }
.auth h1 { margin: 0 0 4px; font-size: 20px; }

.flash { padding: 10px 14px; border-radius: 8px; background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); font-weight: 500; }
.flash.ok { background: var(--primary-soft); color: var(--on-primary-soft); }
.divider { height: 1px; background: var(--border); border: 0; margin: 0; }
.kbd { font: 500 12px var(--mono); padding: 1px 6px; border: 1px solid var(--border-strong); border-radius: 5px; color: var(--muted); }
.feed { display: flex; flex-direction: column; }
.feed a { display: flex; gap: 10px; padding: 10px 16px; text-decoration: none; border-bottom: 1px solid var(--border); font-size: 13px; transition: background .12s; }
.feed a:last-child { border-bottom: 0; }
.feed a:hover { background: var(--surface-2); }
.feed .t1 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-list { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.bar-list .r { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 13px; }
.bar-list .r .name { font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-list .r .track { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar-list .r .track i { display: block; height: 100%; background: var(--chart-a); border-radius: 99px; }

/* Telegram Mini App: tighten chrome */
html.tg .topbar { padding-top: max(10px, env(safe-area-inset-top)); }

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

/* --- fixes from screenshot review --- */
.seg label, .pick label { position: relative; }
.topbar h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 600px) {
  .search { flex: 1 1 100%; max-width: none; }
  .row > .select { flex: 1 1 0; min-width: 0; }
  .topbar .btn > span { display: none; }
  .topbar .btn:has(> span) { width: 44px; padding: 0; }
}
