/* oofy 管理后台. Colors are the app's 素墨留白 theme (internal/ui/kit),
   light and dark; the chart blue is the dataviz reference slot 1. */
:root {
  color-scheme: light;
  --bg: #fcfcfc;
  --surface: #ffffff;
  --subtle: #f4f4f5;
  --side: #f2f2f2;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --text: #18181b;
  --muted: #71717b;
  --faint: #a1a1aa;
  --accent: #18181b;
  --on-accent: #fcfcfc;
  --link: #1447e6;
  --good: #007a55;
  --good-bg: #edf9f4;
  --warn: #bb4d00;
  --warn-bg: #fdf5e9;
  --bad: #c10007;
  --bad-bg: #fdeced;
  --info: #1b4ed8;
  --info-bg: #eef2fd;
  --hover: rgba(26, 26, 26, 0.045);
  --press: rgba(26, 26, 26, 0.08);
  --series: #2a78d6;
  --grid: #ededf0;
  --axis: #d4d4d8;
  --focus: rgba(42, 120, 214, 0.45);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.08);
  --scrim: rgba(24, 24, 27, 0.32);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000;
    --surface: #111111;
    --subtle: #1a1a1a;
    --side: #0b0b0b;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.13);
    --text: #f5f5f5;
    --muted: #a1a1a1;
    --faint: #737373;
    --accent: #f5f5f5;
    --on-accent: #000000;
    --link: #50a2ff;
    --good: #00d492;
    --good-bg: #06281c;
    --warn: #ffb900;
    --warn-bg: #291900;
    --bad: #ff6467;
    --bad-bg: #280a0c;
    --info: #50a2ff;
    --info-bg: #0b1a33;
    --hover: rgba(228, 228, 228, 0.06);
    --press: rgba(228, 228, 228, 0.1);
    --series: #3987e5;
    --grid: rgba(255, 255, 255, 0.07);
    --axis: rgba(255, 255, 255, 0.16);
    --focus: rgba(80, 162, 255, 0.5);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 12px 32px rgba(0, 0, 0, 0.6);
    --scrim: rgba(0, 0, 0, 0.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --surface: #111111;
  --subtle: #1a1a1a;
  --side: #0b0b0b;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.13);
  --text: #f5f5f5;
  --muted: #a1a1a1;
  --faint: #737373;
  --accent: #f5f5f5;
  --on-accent: #000000;
  --link: #50a2ff;
  --good: #00d492;
  --good-bg: #06281c;
  --warn: #ffb900;
  --warn-bg: #291900;
  --bad: #ff6467;
  --bad-bg: #280a0c;
  --info: #50a2ff;
  --info-bg: #0b1a33;
  --hover: rgba(228, 228, 228, 0.06);
  --press: rgba(228, 228, 228, 0.1);
  --series: #3987e5;
  --grid: rgba(255, 255, 255, 0.07);
  --axis: rgba(255, 255, 255, 0.16);
  --focus: rgba(80, 162, 255, 0.5);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 12px 32px rgba(0, 0, 0, 0.6);
  --scrim: rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
svg.icon { flex: none; display: block; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--side);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  padding: 16px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center; font-weight: 700; font-size: 15px; letter-spacing: -0.02em;
}
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: -0.01em; line-height: 1.2; }
.brand-sub { font-size: 12px; color: var(--muted); line-height: 1.2; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 8px;
  color: var(--muted); font-weight: 500;
}
.nav a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.nav a.on { background: var(--press); color: var(--text); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.who {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-top: 1px solid var(--border); padding-top: 12px; margin-top: 6px;
}
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--subtle); border: 1px solid var(--border);
  display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--muted);
}
.who-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }

.main { min-width: 0; }
.page { max-width: 1240px; margin: 0 auto; padding: 26px 32px 64px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; min-height: 36px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; font-weight: 650; margin: 0; letter-spacing: -0.01em; }
.page-head .spacer { flex: 1; }
.crumb { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--text); }
.busy { opacity: 0.55; transition: opacity 0.15s; pointer-events: none; }
.loading { color: var(--muted); padding: 48px 0; text-align: center; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--surface);
  font-weight: 500; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--subtle); }
.btn:active { background: var(--press); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.primary:hover { opacity: 0.88; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.icon-only { width: 32px; padding: 0; }
.btn.sm.icon-only { width: 28px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.danger:hover { background: var(--bad-bg); color: var(--bad); }

.input, .select, textarea.input {
  height: 32px; padding: 0 10px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--surface);
  min-width: 0; font-size: 13px;
}
textarea.input { height: auto; min-height: 72px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus { outline: none; border-color: var(--series); box-shadow: 0 0 0 3px var(--focus); }
.input::placeholder { color: var(--faint); }
.input.mono { font-size: 12.5px; }
.search { position: relative; display: flex; align-items: center; }
.search .icon { position: absolute; left: 9px; color: var(--faint); pointer-events: none; }
.search .input { padding-left: 30px; width: 260px; }
.affix { display: flex; align-items: stretch; }
.affix .input { border-radius: 8px 0 0 8px; flex: 1; width: 100%; }
.affix .unit {
  display: flex; align-items: center; padding: 0 10px; font-size: 12.5px; color: var(--muted);
  border: 1px solid var(--border-strong); border-left: 0; border-radius: 0 8px 8px 0; background: var(--subtle);
  white-space: nowrap;
}
.affix.pre .unit { order: -1; border-left: 1px solid var(--border-strong); border-right: 0; border-radius: 8px 0 0 8px; }
.affix.pre .input { border-radius: 0 8px 8px 0; }

.seg {
  display: inline-flex; padding: 2px; border-radius: 9px; background: var(--subtle);
  border: 1px solid var(--border);
}
.seg button {
  border: 0; background: transparent; padding: 3px 10px; border-radius: 7px;
  font-size: 12.5px; color: var(--muted); cursor: pointer; font-weight: 500; white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }

.switch { position: relative; display: inline-flex; width: 34px; height: 20px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; border-radius: 10px; background: var(--border-strong); transition: background 0.15s; }
.switch .knob {
  position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.15s;
}
.switch input:checked + .track { background: var(--good); }
.switch input:checked + .track + .knob { transform: translateX(14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch input:disabled ~ * { opacity: 0.5; }

.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }

/* ---------- cards, tiles ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  min-width: 0;
}
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px 0; min-height: 44px; flex-wrap: wrap; }
.card-head h2 { font-size: 14px; font-weight: 600; margin: 0; }
.card-head .spacer { flex: 1; }
.card-body { padding: 14px 18px 18px; }
.card-body.flush { padding: 8px 0 4px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }

.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.tile { padding: 16px 18px; }
.tile-label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.tile-value { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; margin-top: 6px; line-height: 1.2; white-space: nowrap; }
.tile-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px;
  border-radius: 6px; font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--subtle); color: var(--muted);
}
.badge.good { background: var(--good-bg); color: var(--good); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.outline { background: transparent; border: 1px solid var(--border-strong); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-weight: 500; color: var(--muted); font-size: 12px;
  padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
  background: var(--surface); position: sticky; top: 0; z-index: 1;
}
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table th .arrow { display: inline-block; margin-left: 2px; color: var(--text); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr.click:hover td { background: var(--hover); }
.table tbody tr.sel td { background: var(--info-bg); }
.table .r { text-align: right; }
.table th.r { text-align: right; }
.table td:first-child, .table th:first-child { padding-left: 18px; }
.table td:last-child, .table th:last-child { padding-right: 18px; }
.table .w-check { width: 34px; padding-right: 0; }
.table .name { font-weight: 550; }
.table .sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.table .err { color: var(--bad); font-size: 12px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table tr.detail td { background: var(--subtle); font-size: 12.5px; }
.empty { padding: 40px 18px; text-align: center; color: var(--muted); }
.empty .btn { margin-top: 12px; }
.more { display: flex; justify-content: center; padding: 14px; }
.sums { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); padding: 0 2px 12px; }
.sums b { color: var(--text); font-weight: 600; }

/* ---------- toolbar, bulk bar ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.bulk {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 16px; margin-bottom: 12px;
  border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow);
  position: sticky; top: 12px; z-index: 5; flex-wrap: wrap;
}
.bulk .count { font-weight: 600; margin-right: 6px; }

/* ---------- meters, rank bars ---------- */
.meter { --m: var(--series); }
.meter.warn { --m: var(--warn); }
.meter.bad { --m: var(--bad); }
.meter-track { height: 8px; border-radius: 4px; background: color-mix(in oklab, var(--m) 16%, transparent); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 4px; background: var(--m); min-width: 0; }
.meter-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.meter-label { color: var(--muted); font-size: 12.5px; }
.meter-value { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; }
.meter-limit { color: var(--muted); font-size: 12.5px; }
.meter-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.meter-foot .state { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.meter.warn .state { color: var(--warn); }
.meter.bad .state { color: var(--bad); }
.mini-meter { width: 72px; height: 4px; border-radius: 2px; background: color-mix(in oklab, var(--m) 16%, transparent); overflow: hidden; margin-top: 5px; }
.mini-meter > div { height: 100%; background: var(--m); border-radius: 2px; }

.rank { display: flex; flex-direction: column; }
.rank-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center;
  padding: 9px 18px; color: inherit;
}
a.rank-row:hover { background: var(--hover); text-decoration: none; }
.rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.rank-value { text-align: right; font-weight: 600; }
.rank-bar { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }
.rank-track { flex: 1; height: 8px; border-radius: 4px; background: color-mix(in oklab, var(--series) 12%, transparent); }
.rank-fill { height: 100%; border-radius: 4px; background: var(--series); }
.rank-sub { font-size: 12px; color: var(--muted); white-space: nowrap; min-width: 116px; text-align: right; }

/* ---------- chart ---------- */
.chart { position: relative; }
.chart svg { display: block; overflow: visible; }
.chart .axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart .bar { fill: var(--series); transition: opacity 0.1s; }
.chart .bar.dim { opacity: 0.45; }
.chart .peak { fill: var(--text); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hover-band { fill: var(--hover); }
.chart svg:focus { outline: none; }
.chart svg:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 4px; }
.tip {
  position: absolute; pointer-events: none; z-index: 10;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--shadow);
  padding: 8px 10px; font-size: 12px; min-width: 150px; white-space: nowrap;
  opacity: 0; transform: translateY(2px); transition: opacity 0.08s, transform 0.08s;
}
.tip.show { opacity: 1; transform: none; }
.tip-title { color: var(--muted); margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 8px; }
.tip-row b { font-weight: 650; font-size: 13px; font-variant-numeric: tabular-nums; }
.tip-row .key { width: 10px; height: 2px; border-radius: 1px; background: var(--series); }
.tip-row span { color: var(--muted); }
.chart-table { max-height: 260px; overflow: auto; }

/* ---------- forms, modal ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .label { font-size: 12.5px; font-weight: 500; }
.field .hint { font-size: 12px; color: var(--muted); }
.field .input, .field .select { width: 100%; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.fields.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.limit-row { display: grid; grid-template-columns: 104px 34px minmax(0, 1fr); gap: 10px; align-items: center; min-height: 32px; }
.limit-row .label { font-size: 13px; }
.limit-row .off { color: var(--faint); font-size: 12.5px; }
.model-picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; max-height: 200px; overflow: auto; }
.model-picks .check { font-size: 13px; min-width: 0; }
.model-picks .check span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-error { color: var(--bad); font-size: 12.5px; min-height: 18px; }
.section-title { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: none; margin: 6px 0 -4px; }

.scrim {
  position: fixed; inset: 0; background: var(--scrim); z-index: 50;
  display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 24px; overflow: auto;
  animation: fade 0.12s ease-out;
}
.dialog {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow);
  width: 100%; max-width: 520px; animation: rise 0.14s ease-out;
}
.dialog.wide { max-width: 720px; }
.dialog-head { display: flex; align-items: center; gap: 8px; padding: 16px 20px 0; }
.dialog-head h3 { margin: 0; font-size: 15px; font-weight: 600; flex: 1; }
.dialog-body { padding: 16px 20px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 18px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) {
  .scrim, .dialog, .tip { animation: none; transition: none; }
}

.secret {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px;
  background: var(--subtle); border: 1px solid var(--border); word-break: break-all;
}
.secret code { flex: 1; font-size: 13px; }
.snippet { position: relative; }
.snippet pre {
  margin: 0; padding: 10px 12px; padding-right: 44px; border-radius: 8px; background: var(--subtle); border: 1px solid var(--border);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-all;
}
.snippet .icon-btn { position: absolute; top: 6px; right: 6px; }
.note {
  display: flex; gap: 10px; padding: 10px 12px; border-radius: 8px; font-size: 12.5px;
  background: var(--subtle); color: var(--muted);
}
.note.warn { background: var(--warn-bg); color: var(--warn); }
.note.bad { background: var(--bad-bg); color: var(--bad); }
.note.good { background: var(--good-bg); color: var(--good); }
.note .icon { margin-top: 1px; }

.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 10px;
  background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow); font-size: 13px;
  animation: rise 0.14s ease-out; max-width: 420px;
}
.toast.bad { background: var(--bad); color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 6px;
  border: 1px solid var(--border-strong); background: var(--surface); font-size: 12px; cursor: pointer;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.chip:hover { background: var(--subtle); }
.chip.have { color: var(--faint); cursor: default; }

.kv { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login .card { width: 100%; max-width: 380px; padding: 28px; }
.login .brand { padding: 0 0 22px; }
.login h1 { font-size: 18px; margin: 0 0 4px; }
.login .btn.primary { height: 36px; width: 100%; margin-top: 4px; }

/* ---------- narrow ---------- */
@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 10px 12px; overflow-x: auto; }
  .brand { padding: 0 8px 0 4px; }
  .brand-sub { display: none; }
  .nav { flex-direction: row; }
  .nav a span { white-space: nowrap; }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; }
  .who { border: 0; margin: 0; padding: 0 4px; }
  .who-name { display: none; }
  .page { padding: 18px 16px 48px; }
  .tiles, .grid.two, .grid.three { grid-template-columns: minmax(0, 1fr); }
  .fields, .fields.four { grid-template-columns: minmax(0, 1fr); }
  .search .input { width: 100%; }
  .search { flex: 1; }
}
.tip-row .key { display: inline-block; flex: none; }
.sr-submit { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.form { position: relative; }
/* Cells keep to one line; a wide table scrolls inside its card. */
.table td { white-space: nowrap; }
.table .sub { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table.wide { min-width: 860px; }
.field .seg, .form > .seg { align-self: flex-start; }
.limit-row { grid-template-columns: 104px 34px minmax(0, 300px); }
.tiles { display: flex; flex-wrap: wrap; }
.tiles .tile { flex: 1 1 172px; min-width: 0; }
.table:not(.wide) .err { max-width: 300px; }
