/* iptvdash design system. Phone first; rail from 720px; sidebar + list/detail from 1024px.
   Colours live in the tokens below — dev/audit.mjs checks text contrast and tap sizes on every screen in both themes. */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --r-s: 9px; --r-m: 12px; --r-l: 16px; --r-xl: 22px;
  --side-w: 244px; --list-w: 392px; --tab-h: 54px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --tap: 44px;
  --alert: #d32f2f;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0c0e; --bg-side: #0f1113; --surface: #16181b; --surface-2: #1f2125; --surface-3: #2b2e33;
  --hover: rgba(255, 255, 255, .05); --press: rgba(255, 255, 255, .09);
  --line: rgba(255, 255, 255, .085); --line-2: rgba(255, 255, 255, .16);
  --text: #f2f3f5; --text-2: #aeb2ba; --text-3: #8c9099;
  --accent: #2b66f7; --accent-hover: #2358e0; --on-accent: #fff; --accent-text: #8cafff; --accent-soft: rgba(70, 120, 255, .2);
  --green: #43d89c; --green-soft: rgba(67, 216, 156, .14); --amber: #f4bd45; --amber-soft: rgba(244, 189, 69, .14); --red: #ff8079; --red-soft: rgba(255, 128, 121, .14);
  --wa: #25d366; --on-wa: #052e12;
  --chart: #5c8dff; --chart-hi: #8fb1ff;
  --glass: rgba(11, 12, 14, .84); --glass-side: rgba(15, 17, 19, .92);
  --shadow: 0 20px 60px rgba(0, 0, 0, .6); --card-shadow: none;
  --av-s: 34%; --av-l: 24%; --av-fg-s: 75%; --av-fg-l: 84%;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23aeb2ba' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2.500 4.500 3.500 3.500 3.500-3.500'/%3E%3C/svg%3E");
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f5f7; --bg-side: #fafafb; --surface: #fff; --surface-2: #f0f0f3; --surface-3: #e3e3e8;
  --hover: rgba(15, 18, 25, .045); --press: rgba(15, 18, 25, .08);
  --line: rgba(15, 18, 25, .09); --line-2: rgba(15, 18, 25, .18);
  --text: #15171a; --text-2: #4e525b; --text-3: #5f636c;
  --accent: #1f5fef; --accent-hover: #174fd0; --on-accent: #fff; --accent-text: #1a55d8; --accent-soft: rgba(31, 95, 239, .1);
  --green: #0a6a40; --green-soft: rgba(16, 150, 95, .12); --amber: #8a5900; --amber-soft: rgba(214, 150, 20, .16); --red: #c22a2a; --red-soft: rgba(210, 50, 50, .1);
  --wa: #25d366; --on-wa: #052e12;
  --chart: #2f6bff; --chart-hi: #1f50c9;
  --glass: rgba(245, 245, 247, .86); --glass-side: rgba(250, 250, 251, .92);
  --shadow: 0 20px 60px rgba(15, 18, 25, .22); --card-shadow: 0 1px 2px rgba(15, 18, 25, .05), 0 0 0 1px rgba(15, 18, 25, .04);
  --av-s: 62%; --av-l: 92%; --av-fg-s: 55%; --av-fg-l: 28%;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23555963' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2.500 4.500 3.500 3.500 3.500-3.500'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; overflow: hidden; overscroll-behavior: none; }
h1, h2, h3, h4, p, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; border-radius: 6px; }
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.i-fill { fill: currentColor; stroke: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.mono { font-family: var(--mono); font-size: .93em; letter-spacing: -.01em; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.spacer { flex: 1; min-width: 0; }
.wide-only { display: none; }
@media (min-width: 720px) { .phone-only { display: none !important; } .wide-only { display: inline; } }
@media (min-width: 1024px) { .site-chips { display: none; } }

/* ── Shell ─────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: minmax(0, 1fr); height: 100vh; height: 100dvh; }
.pane {
  grid-column: 1; grid-row: 1; min-width: 0; height: 100vh; height: 100dvh; overflow: hidden auto;
  overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; container-type: inline-size;
  scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent;
}
[data-layout="single"] #pane-list { display: none; }
[data-layout="split"][data-focus="list"] #pane-main { display: none; }
[data-layout="split"][data-focus="detail"] #pane-list { display: none; }

.pane-head {
  position: sticky; top: 0; z-index: 5; padding: calc(var(--safe-t) + 10px) 16px 10px;
  background: var(--glass); -webkit-backdrop-filter: saturate(170%) blur(18px); backdrop-filter: saturate(170%) blur(18px);
  border-bottom: 1px solid transparent; transition: border-color .15s;
}
.pane[data-scrolled] .pane-head { border-bottom-color: var(--line); }
.pane-head:empty { display: none; }
.pane-body { padding: 6px 16px calc(var(--tab-h) + var(--safe-b) + 48px); }
.toolbar { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.title { font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -.024em; }
.subtitle { color: var(--text-2); font-size: 14px; margin-top: 1px; }
.back { display: inline-flex; align-items: center; gap: 2px; margin-left: -6px; padding: 6px 8px 6px 0; min-height: 40px; color: var(--accent-text); font-size: 16px; }
.back .i { width: 24px; height: 24px; }
.toolbar-title { font-size: 16px; font-weight: 650; min-width: 0; }
.content { max-width: 1160px; margin: 0 auto; }
.content.narrow { max-width: 680px; }
.stack > * + * { margin-top: 12px; }

/* ── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 16px;
  border-radius: var(--r-m); font-weight: 600; font-size: 15px; white-space: nowrap; transition: background-color .12s, opacity .12s, transform .08s;
  background: var(--surface-2); color: var(--text); text-align: center;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.good { background: var(--green-soft); color: var(--green); }
.btn.wa { background: var(--wa); color: var(--on-wa); }
.btn.wa:hover { background: var(--wa); filter: brightness(.95); }
.btn.link { background: none; color: var(--accent-text); padding: 0 6px; }
.btn.link:hover { background: var(--hover); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: var(--r-s); }
.btn.block { display: flex; width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn .i { width: 18px; height: 18px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 auto; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--text); flex: none; transition: background-color .12s; }
.icon-btn:hover { background: var(--surface-3); }
.icon-btn .i { width: 19px; height: 19px; }
.icon-btn.plain { background: none; color: var(--text-2); }
.icon-btn.plain:hover { background: var(--hover); color: var(--text); }
.icon-btn.small { width: 32px; height: 32px; }
.icon-btn.small .i { width: 16px; height: 16px; }
.spin .i, .i.spin { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
a.text-link, button.text-link { color: var(--accent-text); font-weight: 550; display: inline-block; padding: 7px 0; margin: -7px 0; }

/* ── Chips, badges ─────────────────────────────────── */
.chips { display: flex; gap: 6px; overflow-x: auto; margin: 8px -16px 0; padding: 0 16px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 0 12px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 14px; font-weight: 550; transition: background-color .12s, color .12s; }
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.chip .n { font-weight: 450; font-variant-numeric: tabular-nums; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--text-2); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--accent-soft); color: var(--accent-text); }
.dot-status { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--text-3); }
.dot-status.green { background: var(--green); }
.dot-status.amber { background: var(--amber); }
.dot-status.red { background: var(--red); }
.count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--surface-3); color: var(--text); font-size: 12px; line-height: 20px; font-weight: 650; text-align: center; font-variant-numeric: tabular-nums; }

/* ── Rows & lists ──────────────────────────────────── */
.list { background: var(--surface); border-radius: var(--r-l); overflow: hidden; box-shadow: var(--card-shadow); }
.row {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 62px; padding: 10px 14px;
  text-align: left; color: inherit; transition: background-color .1s;
}
.row::before { content: ''; position: absolute; top: 0; right: 0; left: 66px; height: 1px; background: var(--line); }
.row:first-child::before { display: none; }
.row.plain::before { left: 14px; }
.row.plain { min-height: 52px; }
a.row:hover, button.row:hover, label.row:hover { background: var(--hover); }
a.row:active, button.row:active { background: var(--press); }
.row[aria-current="true"] { background: var(--accent-soft); }
.row-main { flex: 1; min-width: 0; display: block; }
.row-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.row-title { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row-sub { display: block; color: var(--text-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.row-bottom { display: flex; align-items: center; gap: 8px; min-width: 0; margin-top: 1px; }
.row-bottom .row-sub { flex: 1; min-width: 0; margin-top: 0; }
.row-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.row-end { flex: none; display: flex; align-items: center; gap: 6px; margin-left: 4px; }
.time { color: var(--text-3); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.unread { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-text); }
.warn-mark { flex: none; color: var(--amber); display: inline-flex; }
.warn-mark .i { width: 15px; height: 15px; }
.site-tag { flex: none; display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); font-size: 12px; font-weight: 550; }
.site-tag i { width: 7px; height: 7px; border-radius: 50%; }
.row-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--text-2); }
.row-icon .i { width: 18px; height: 18px; }
.chev { color: var(--text-3); flex: none; }
.chev .i { width: 16px; height: 16px; }
.avatar {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-weight: 650; font-size: 14px; letter-spacing: .01em;
  background: hsl(var(--h, 220) var(--av-s) var(--av-l)); color: hsl(var(--h, 220) var(--av-fg-s) var(--av-fg-l));
}
.avatar.large { width: 60px; height: 60px; font-size: 21px; }
.group-label { font-size: 13px; font-weight: 600; color: var(--text-2); padding: 16px 4px 7px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.group-label:first-child { padding-top: 4px; }
.group-label a, .group-label button { font-weight: 550; color: var(--accent-text); display: inline-block; padding: 7px 0; margin: -7px 0; }
.check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; display: grid; place-items: center; color: transparent; }
.check .i { width: 14px; height: 14px; stroke-width: 3; }
[aria-checked="true"] .check { background: var(--accent); border-color: var(--accent); color: #fff; }
.bulk-bar {
  position: sticky; bottom: calc(var(--tab-h) + var(--safe-b) + 10px); z-index: 4; display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 8px 8px 8px 14px;
  background: var(--surface-2); border-radius: var(--r-l); box-shadow: var(--shadow); font-weight: 600; font-size: 14px;
}

/* ── Cards ─────────────────────────────────────────── */
.card { background: var(--surface); border-radius: var(--r-l); padding: 16px; box-shadow: var(--card-shadow); }
.card + .card { margin-top: 12px; }
.card-title { font-size: 16px; font-weight: 650; letter-spacing: -.005em; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; min-height: 28px; }
.hint { color: var(--text-2); font-size: 14px; line-height: 1.45; }
.hint.small { font-size: 13px; }
.hint b { color: var(--text); font-weight: 600; }
.card .hint + .btn, .card .hint + form, .card .hint + .btn-row { margin-top: 12px; }
.primary-card { box-shadow: inset 0 0 0 1.5px var(--accent-soft), var(--card-shadow); }
.notice { display: flex; gap: 9px; align-items: flex-start; padding: 11px 13px; border-radius: var(--r-m); font-size: 14px; line-height: 1.4; background: var(--surface-2); color: var(--text); }
.notice .i { width: 18px; height: 18px; margin-top: 1px; }
.notice.warn { background: var(--amber-soft); }
.notice.warn .i { color: var(--amber); }
.notice.err { background: var(--red-soft); }
.notice.err .i { color: var(--red); }
.notice.ok { background: var(--green-soft); }
.notice.ok .i { color: var(--green); }
.notice a { display: inline-block; padding: 7px 0; margin: -7px 0; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.notice.info { background: var(--accent-soft); }
.notice.info .i { color: var(--accent-text); }
.notice a { font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.notices:empty { display: none; }
.notices > * { margin-bottom: 10px; }
.empty { text-align: center; color: var(--text-2); padding: 48px 20px; font-size: 14.5px; }
.empty .i { width: 30px; height: 30px; color: var(--text-3); margin-bottom: 10px; }
.empty b { display: block; color: var(--text); font-size: 17px; font-weight: 650; margin-bottom: 3px; }
.empty .btn { margin-top: 14px; }

/* Key/value rows */
.kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.kv > div:first-child { border-top: 0; padding-top: 2px; }
.kv > div:last-child { padding-bottom: 2px; }
.kv dt { color: var(--text-2); flex: none; }
.kv dd { text-align: right; min-width: 0; overflow-wrap: anywhere; }
.kv dd button, .kv dd a { color: var(--accent-text); text-align: right; overflow-wrap: anywhere; display: inline-block; padding: 6px 0; margin: -6px 0; }

/* Forms */
.field { display: block; }
.field + .field, .fields > * + * { margin-top: 12px; }
.field > span, .field-label { display: block; font-size: 13px; font-weight: 550; color: var(--text-2); margin: 0 0 5px 1px; }
.input, .field input:not([type="checkbox"]):not([type="radio"]), .field textarea, .field select, .select {
  width: 100%; min-height: var(--tap); font-size: 16px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-m); transition: border-color .12s, box-shadow .12s;
}
[data-theme="light"] .input, [data-theme="light"] .field input:not([type="checkbox"]):not([type="radio"]), [data-theme="light"] .field textarea, [data-theme="light"] .field select, [data-theme="light"] .select { background: var(--surface-2); border-color: transparent; }
.input:focus, .field input:focus, .field textarea:focus, .field select:focus, .select:focus { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft); }
.field textarea { resize: vertical; min-height: 84px; line-height: 1.45; display: block; }
.field select, .select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: var(--select-arrow); background-repeat: no-repeat; background-position: right 12px center; }
.field small { display: block; color: var(--text-3); font-size: 13px; margin: 5px 1px 0; line-height: 1.4; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.two .field + .field { margin-top: 0; }
::placeholder { color: var(--text-3); opacity: 1; }

/* Segmented control (radio inputs or buttons) */
.seg { display: flex; padding: 2px; background: var(--surface-2); border-radius: 10px; gap: 2px; }
.seg label, .seg button { flex: 1; display: grid; place-items: center; min-height: 34px; padding: 0 10px; border-radius: 8px; font-size: 14px; font-weight: 550; color: var(--text-2); cursor: pointer; white-space: nowrap; transition: background-color .12s, color .12s; position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg label:has(input:checked), .seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
[data-theme="dark"] .seg label:has(input:checked), [data-theme="dark"] .seg button[aria-pressed="true"] { background: var(--surface-3); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--accent-text); outline-offset: 1px; }
.seg.inline { display: inline-flex; }
.seg.inline label, .seg.inline button { flex: none; min-height: 30px; padding: 0 12px; }

/* Switch */
.switch { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 50px; height: 30px; margin: 0; border-radius: 15px; background: var(--surface-3); cursor: pointer; transition: background-color .18s; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); transition: transform .18s var(--ease); }
.switch:checked { background: #1fb76f; }
.switch:checked::after { transform: translateX(20px); }
.switch-row { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.switch-row > span:first-child { flex: 1; min-width: 0; }
.switch-row b { display: block; font-weight: 650; font-size: 15.5px; }
.tick-row { display: flex; align-items: flex-start; gap: 11px; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; font-size: 14.5px; }
.tick-row:first-of-type { border-top: 0; }
.tick-row input { flex: none; width: 21px; height: 21px; margin: 0; accent-color: var(--accent); }
.tick-row small { display: block; color: var(--text-2); font-size: 13px; }

/* ── Detail ────────────────────────────────────────── */
.detail { max-width: 1020px; margin: 0 auto; }
.person { display: flex; align-items: center; gap: 14px; margin: 2px 0 14px; }
.person h2 { font-size: 22px; font-weight: 700; letter-spacing: -.018em; line-height: 1.2; overflow-wrap: anywhere; }
.person p { color: var(--text-2); font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 3px; }
.contact-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; margin-bottom: 12px; }
.contact-btn { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 2px 8px; border-radius: var(--r-m); background: var(--surface); color: var(--accent-text); font-size: 12px; font-weight: 600; box-shadow: var(--card-shadow); transition: background-color .12s; }
.contact-btn:hover { background: var(--surface-2); }
.contact-btn .i { width: 21px; height: 21px; }
.contact-btn[aria-disabled="true"] { color: var(--text-3); opacity: .55; pointer-events: none; }
.detail-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.detail-cols > div { min-width: 0; }
@container (min-width: 780px) {
  .detail-cols { grid-template-columns: minmax(0, 1.45fr) minmax(280px, 1fr); align-items: start; }
}
.creds { border-radius: var(--r-m); background: var(--bg); margin-top: 10px; overflow: hidden; }
[data-theme="light"] .creds { background: var(--surface-2); }
.cred-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 12px; min-height: 44px; border-top: 1px solid var(--line); }
.cred-row:first-child { border-top: 0; }
.cred-row span { color: var(--text-2); font-size: 13px; width: 76px; flex: none; }
.cred-row code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-family: var(--mono); font-size: 14px; }
.msg-text { width: 100%; font-size: 14.5px; line-height: 1.5; padding: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-m); resize: vertical; min-height: 120px; max-height: 340px; display: block; margin: 10px 0; }
[data-theme="light"] .msg-text { background: var(--surface-2); border-color: transparent; }
.msg-text:focus { outline: none; border-color: var(--accent-text); }
.reply-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.reply-chips .chip { min-height: 32px; font-size: 13px; }
.bubble { background: var(--bg); border-radius: 4px 16px 16px 16px; padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.5; }
[data-theme="light"] .bubble { background: var(--surface-2); }
.steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 12px; }
.steps li { position: relative; text-align: center; font-size: 13px; font-weight: 600; }
.steps li::before { content: ''; position: absolute; top: 12px; left: -50%; width: 100%; height: 2px; background: var(--surface-3); }
.steps li:first-child::before { display: none; }
.steps li.done::before { background: var(--green); }
.steps .step-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 26px; height: 26px; margin: 0 auto 5px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); }
.steps .step-dot .i { width: 14px; height: 14px; stroke-width: 2.5; }
.steps li.done .step-dot { background: var(--green); color: var(--surface); }
.steps li.next .step-dot { background: var(--accent); color: #fff; }
.steps small { display: block; font-weight: 450; font-size: 12px; color: var(--text-2); }
.line-card { padding: 12px 0; border-top: 1px solid var(--line); }
.line-card:first-of-type { border-top: 0; padding-top: 0; }
.line-card:last-child { padding-bottom: 0; }
.line-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.line-top code { font-family: var(--mono); font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.line-sub { color: var(--text-2); font-size: 13.5px; margin-top: 2px; }
.timeline li { position: relative; padding: 0 0 12px 22px; font-size: 14px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ''; position: absolute; left: 4px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.timeline li::after { content: ''; position: absolute; left: 7px; top: 18px; bottom: -3px; width: 1px; background: var(--line-2); }
.timeline li:last-child::after { display: none; }
.timeline li.t-reply::before, .timeline li.t-trial::before, .timeline li.t-line::before, .timeline li.t-renew::before { background: var(--accent-text); }
.timeline time { display: block; color: var(--text-3); font-size: 12.5px; }

/* ── Today ─────────────────────────────────────────── */
.today-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.today-grid > div { min-width: 0; }
@container (min-width: 840px) {
  .today-grid { grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); grid-template-areas: "main hero" "main extra"; grid-template-rows: auto 1fr; align-items: start; gap: 14px 18px; }
  .t-main { grid-area: main; }
  .t-hero { grid-area: hero; }
  .t-extra { grid-area: extra; }
}
.hero-money { display: flex; align-items: flex-end; gap: 16px; }
.hero-money > div:first-child { flex: none; max-width: 62%; }
.hero-money b { display: block; font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -.03em; margin: 2px 0 3px; }
.hero-label { font-size: 13.5px; font-weight: 550; color: var(--text-2); }
.delta { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); }
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }
.spark { flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 2px; height: 56px; }
.spark i { flex: 1; min-height: 2px; background: var(--chart); border-radius: 2px 2px 0 0; }
.spark i.zero { background: var(--surface-3); }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tile { display: block; background: var(--surface); border-radius: var(--r-m); padding: 11px 12px; box-shadow: var(--card-shadow); min-width: 0; }
a.tile:hover { background: var(--surface-2); }
.tile b { display: block; font-size: 21px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; }
.tile span { display: block; color: var(--text-2); font-size: 12.5px; line-height: 1.3; }
.tiles.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@container (min-width: 700px) { .tiles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.queue-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; position: relative; min-height: 62px; }
.queue-row::before { content: ''; position: absolute; top: 0; right: 0; left: 66px; height: 1px; background: var(--line); }
.queue-row:first-child::before { display: none; }
.queue-row > a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.queue-row .btn { flex: none; }
.queue-row:hover { background: var(--hover); }
.clear-state { text-align: center; padding: 34px 20px; }
.clear-state .btn { margin-top: 16px; }
.clear-state b { display: block; font-size: 19px; font-weight: 700; margin: 12px 0 3px; letter-spacing: -.01em; }
.setup-strip { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 14px; margin-bottom: 4px; border-radius: var(--r-l); background: var(--surface); box-shadow: var(--card-shadow); font-weight: 550; text-align: left; transition: background-color .1s; }
.setup-strip:hover { background: var(--surface-2); }
.ring { flex: none; width: 22px; height: 22px; border-radius: 50%; background: conic-gradient(var(--accent-text) calc(var(--p) * 1turn), var(--surface-3) 0); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px)); }
.setup-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.setup-item:first-of-type { border-top: 0; }
.setup-item .tick { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 2px solid var(--line-2); }
.setup-item.done .tick { background: var(--green); border-color: var(--green); color: var(--surface); }
.setup-item .tick .i { width: 13px; height: 13px; stroke-width: 3; }
.setup-item.done > span { color: var(--text-2); }
.autos { display: flex; flex-wrap: wrap; gap: 6px; }
.auto-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 11px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 550; color: var(--text-2); }
.auto-pill.on { color: var(--text); }
a.auto-pill:hover { background: var(--surface-3); }

/* ── Charts & stats ────────────────────────────────── */
.chart { position: relative; padding-left: 38px; }
.chart .plot { position: relative; height: 136px; margin-top: 12px; }
.chart .gl { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.chart .gl span, .chart .x-labels span { position: absolute; color: var(--text-3); font-size: 11.5px; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chart .gl span { right: 100%; margin-right: 7px; transform: translateY(-50%); }
.chart .cols { position: absolute; inset: 0; display: flex; touch-action: pan-y; }
.chart .col { flex: 1; min-width: 0; display: flex; align-items: flex-end; justify-content: center; padding: 0 1px; }
.chart .col i { display: block; width: 100%; max-width: 24px; background: var(--chart); border-radius: 4px 4px 0 0; }
.chart .col.on i { background: var(--chart-hi); }
.chart .x-labels { position: relative; height: 22px; }
.chart-empty { display: grid; place-items: center; height: 120px; margin-top: 8px; border-radius: var(--r-m); background: var(--surface-2); color: var(--text-2); font-size: 14px; }
.chart .x-labels span { top: 8px; transform: translateX(-50%); }
.chart .x-labels .first { transform: translateX(-30%); }
.chart .x-labels .last { transform: translateX(-70%); }
.chart .tip { position: absolute; top: -8px; padding: 4px 9px; border-radius: 8px; background: var(--text); color: var(--bg); font-size: 12.5px; font-weight: 600; white-space: nowrap; pointer-events: none; z-index: 2; }
details.data { margin-top: 8px; }
details.data summary { color: var(--accent-text); font-size: 13px; font-weight: 550; cursor: pointer; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table th { color: var(--text-2); font-weight: 550; font-size: 13px; text-align: right; padding: 0 6px 7px; }
.table td { text-align: right; padding: 8px 6px; border-top: 1px solid var(--line); }
.table th:first-child, .table td:first-child { text-align: left; padding-left: 0; }
.table th:last-child, .table td:last-child { padding-right: 0; }
details.data .table { margin-top: 6px; }
.hbars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 7px 0; font-size: 14px; }
.hbars li > i { grid-column: 1 / -1; height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; display: block; }
.hbars li > i > i { display: block; height: 100%; background: var(--chart); border-radius: 3px; }
.funnel li { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; }
.funnel b { font-weight: 650; min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.funnel i { display: block; flex: 1; height: 26px; background: var(--surface-2); border-radius: 7px; overflow: hidden; }
.funnel i i { display: block; height: 100%; background: var(--chart); border-radius: 7px; min-width: 2px; }
.funnel span { width: 96px; flex: none; color: var(--text-2); }
.chart-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.chart-grid .card + .card { margin-top: 0; }
@container (min-width: 760px) { .chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.uptime { display: grid; grid-template-columns: repeat(48, minmax(0, 1fr)); gap: 2px; height: 26px; margin: 10px 0 5px; }
.uptime i { background: var(--surface-3); border-radius: 2px; }
.uptime i.ok { background: var(--green); opacity: .85; }
.uptime i.part { background: var(--amber); }
.uptime i.bad { background: var(--red); }
.uptime-foot { display: flex; justify-content: space-between; color: var(--text-3); font-size: 12px; }
.progress { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; background: var(--chart); border-radius: 3px; transition: width .3s; }
.preview-frame { width: 100%; height: 520px; border: 1px solid var(--line); border-radius: var(--r-m); background: #f4f5f7; display: block; }

/* ── Navigation: phone tabs ────────────────────────── */
.sidebar { display: none; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; padding-bottom: var(--safe-b);
  background: var(--glass); -webkit-backdrop-filter: saturate(170%) blur(18px); backdrop-filter: saturate(170%) blur(18px); border-top: 1px solid var(--line);
  view-transition-name: tabbar;
}
.tabbar a { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: var(--tab-h); color: var(--text-3); font-size: 11px; font-weight: 550; transition: color .12s; }
.tabbar a[aria-current="page"] { color: var(--accent-text); }
.tabbar .i { width: 24px; height: 24px; }
.tabbar .count { position: absolute; top: 4px; left: calc(50% + 5px); background: var(--alert); color: #fff; min-width: 18px; height: 18px; line-height: 18px; font-size: 11px; padding: 0 5px; border-radius: 9px; }
.keyboard-open .tabbar { display: none; }
.keyboard-open .pane-body { padding-bottom: 52px; }

/* ── Navigation: rail + sidebar ────────────────────── */
.brand { display: flex; align-items: center; gap: 9px; min-height: 32px; font-weight: 700; font-size: 16px; letter-spacing: -.015em; }
.bars { display: inline-flex; width: 22px; height: 16px; border-radius: 4px; overflow: hidden; flex: none; }
.bars i { flex: 1; }
.bars i:nth-child(1) { background: #f2f2f2; }
.bars i:nth-child(2) { background: #f5d90a; }
.bars i:nth-child(3) { background: #19d3e6; }
.bars i:nth-child(4) { background: #2ed573; }
.bars i:nth-child(5) { background: #e83fd0; }
.bars i:nth-child(6) { background: #ff4d4d; }
.bars i:nth-child(7) { background: #2f6bff; }
[data-theme="light"] .bars i:nth-child(1) { background: #d9d9de; }
.bars.big { width: 58px; height: 42px; border-radius: 10px; }
.colour-strip { display: flex; height: 3px; border-radius: 2px; overflow: hidden; }
.colour-strip i { flex: 1; }

@media (min-width: 720px) {
  :root { --side-w: 78px; }
  .tabbar { display: none; }
  .shell { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .pane { grid-column: 2; }
  .pane-body { padding-bottom: 52px; }
  .bulk-bar { bottom: 12px; }
  .sidebar {
    grid-column: 1; grid-row: 1; display: flex; flex-direction: column; height: 100vh; height: 100dvh; padding: calc(var(--safe-t) + 14px) 8px 12px; background: var(--bg-side); border-right: 1px solid var(--line); overflow-y: auto; scrollbar-width: none; gap: 2px;
  }
  .sidebar .brand { justify-content: center; margin-bottom: 12px; }
  .sidebar .brand-name, .side-label, .side-search span, .side-search kbd, .side-credits { display: none; }
  .side-search { display: grid; place-items: center; min-height: 40px; color: var(--text-2); border-radius: var(--r-m); background: var(--surface-2); margin-bottom: 8px; }
  .side-link { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border-radius: var(--r-m); color: var(--text-2); font-size: 10.5px; font-weight: 550; text-align: center; transition: background-color .1s, color .1s; }
  .side-link:hover { background: var(--hover); color: var(--text); }
  .side-link[aria-current="page"] { background: var(--surface-2); color: var(--text); }
  .side-link[aria-current="page"] .i { color: var(--accent-text); }
  .side-link .count { position: absolute; top: 3px; right: 8px; min-width: 17px; height: 17px; line-height: 17px; font-size: 10.5px; padding: 0 4px; background: var(--alert); color: #fff; }
  .side-foot { margin-top: auto; padding-top: 8px; display: flex; flex-direction: column; gap: 2px; }
}

@media (min-width: 1024px) {
  :root { --side-w: 244px; --tap: 40px; }
  body { font-size: 14.5px; }
  .shell { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  [data-layout="split"] .shell { grid-template-columns: var(--side-w) var(--list-w) minmax(0, 1fr); }
  [data-layout="split"] #pane-list { display: block !important; grid-column: 2; border-right: 1px solid var(--line); background: var(--bg-side); }
  [data-layout="split"] #pane-main { display: block !important; grid-column: 3; }
  [data-layout="single"] #pane-main { grid-column: 2; }
  .sidebar { padding: 16px 10px 12px; }
  .sidebar .brand { justify-content: flex-start; margin: 2px 8px 14px; }
  .sidebar .brand-name { display: inline; }
  .side-label { display: block; padding: 14px 10px 5px; font-size: 12px; font-weight: 600; color: var(--text-3); }
  .side-search { display: flex; align-items: center; gap: 8px; padding: 0 10px; min-height: 36px; font-size: 14px; color: var(--text-2); margin: 0 0 4px; }
  .side-search:hover { color: var(--text); background: var(--surface-3); }
  .side-search .i { width: 16px; height: 16px; }
  .side-search span { display: inline; flex: 1; text-align: left; }
  .side-search kbd { display: inline; font: inherit; font-size: 12px; color: var(--text-3); }
  .side-link { flex-direction: row; gap: 10px; padding: 7px 10px; font-size: 14px; text-align: left; border-radius: var(--r-s); min-height: 34px; }
  .side-link .i { width: 18px; height: 18px; }
  .side-link span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-link .count { position: static; min-width: 20px; height: 20px; line-height: 20px; font-size: 12px; padding: 0 6px; background: var(--surface-3); color: var(--text); }
  .side-credits { display: flex; align-items: center; gap: 8px; padding: 7px 10px; font-size: 13px; color: var(--text-2); border-radius: var(--r-s); }
  .side-credits:hover { background: var(--hover); }
  .pane-head { padding: 14px 20px 10px; }
  .pane-body { padding: 8px 20px 32px; }
  .chips { margin: 8px -20px 0; padding: 0 20px 2px; }
  .title { font-size: 24px; }
  .chip { min-height: 30px; font-size: 13.5px; padding: 0 11px; }
  .row { min-height: 56px; padding: 8px 12px; border-radius: 0; }
  .row-title { font-size: 14.5px; }
  .row-sub { font-size: 13.5px; }
  .avatar { width: 36px; height: 36px; font-size: 13px; }
  .row::before, .queue-row::before { left: 60px; }
  .row.plain::before { left: 12px; }
  .avatar.large { width: 60px; height: 60px; font-size: 21px; }
  .btn { font-size: 14.5px; }
  /* List pane: flush rows, selection instead of cards */
  #pane-list .pane-body { padding: 0 8px 24px; }
  #pane-list .list { background: none; box-shadow: none; border-radius: 0; overflow: visible; }
  #pane-list .row { border-radius: var(--r-s); }
  #pane-list .row::before { left: 56px; right: 8px; }
  #pane-list .row[aria-current="true"]::before, #pane-list .row[aria-current="true"] + .row::before { display: none; }
  #pane-list .group-label { padding: 14px 12px 5px; }
  #pane-list .list-filter { display: block; }
  [data-layout="split"] #pane-main .back:not(.keep) { display: none; }
  [data-layout="split"] #pane-main .toolbar:empty { display: none; }
  .detail-placeholder { display: grid !important; }
}
.list-filter { display: none; margin-top: 8px; }
.list-filter .input { min-height: 34px; padding: 5px 10px; font-size: 14px; border-radius: var(--r-s); }
.detail-placeholder { display: none; place-items: center; height: 70vh; text-align: center; color: var(--text-3); }
.detail-placeholder .i { width: 34px; height: 34px; margin-bottom: 8px; }
@media (pointer: fine) {
  .btn.small { min-height: 32px; }
  .row-actions { opacity: 0; transition: opacity .1s; }
  .row:hover .row-actions, .queue-row:hover .row-actions, .row-actions:focus-within { opacity: 1; }
}

@media (min-width: 720px) { .tools-phone { display: none; } }
@media (min-width: 1024px) { [data-layout="split"] #pane-main .toolbar:not(:has(.icon-btn, .btn, .keep)) { display: none; } }
.queue-row:has(a[aria-current="true"]) { background: var(--accent-soft); }

/* ── More hub ──────────────────────────────────────── */
.hub-section + .hub-section { margin-top: 4px; }
.install-steps { margin-top: 8px; counter-reset: s; }
.install-steps li { counter-increment: s; display: flex; gap: 10px; padding: 5px 0; font-size: 14.5px; align-items: center; }
.install-steps li::before { content: counter(s); width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); font-size: 12px; font-weight: 650; }

/* ── Sheet, palette, toast ─────────────────────────── */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); opacity: 0; transition: opacity .2s; }
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 6px 16px calc(var(--safe-b) + 16px); box-shadow: var(--shadow);
  transform: translateY(102%); transition: transform .28s var(--ease);
}
.sheet-wrap.open .sheet { transform: none; }
.sheet-head { position: sticky; top: -6px; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0 8px; background: var(--surface); }
.sheet-head h2 { font-size: 18px; font-weight: 700; letter-spacing: -.012em; min-width: 0; }
.sheet-text { color: var(--text-2); font-size: 15px; margin-bottom: 14px; }
.sheet-text b { color: var(--text); font-weight: 600; }
.sheet-actions { display: flex; gap: 8px; margin-top: 16px; }
.sheet-actions .btn { flex: 1; }
.sheet-menu { margin: 0 -6px; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 8px 8px; border-radius: var(--r-m); font-size: 15px; text-align: left; }
.menu-item:hover { background: var(--hover); }
.menu-item.danger { color: var(--red); }
.menu-item .i { color: var(--text-2); }
.menu-item.danger .i { color: var(--red); }
@media (min-width: 720px) {
  .sheet { left: 50%; right: auto; top: 50%; bottom: auto; width: 460px; max-width: calc(100vw - 40px); max-height: 86dvh; border-radius: var(--r-xl); padding-bottom: 18px; transform: translate(-50%, calc(-50% + 12px)) scale(.98); opacity: 0; transition: transform .18s var(--ease), opacity .15s; }
  .sheet-wrap.open .sheet { transform: translate(-50%, -50%); opacity: 1; }
  .sheet.wide { width: 640px; }
}
.palette-wrap { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: var(--bg); padding-top: var(--safe-t); }
.palette { display: flex; flex-direction: column; flex: 1; min-height: 0; background: var(--bg); }
.palette-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); }
.palette-head .i { color: var(--text-2); }
.palette-head input { flex: 1; min-width: 0; min-height: 40px; border: 0; background: none; font-size: 17px; padding: 0; }
.palette-head input:focus { outline: none; }
.palette-list { flex: 1; overflow-y: auto; padding: 6px 8px calc(var(--safe-b) + 16px); }
.palette-group { padding: 12px 8px 4px; font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.palette-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 7px 8px; border-radius: var(--r-m); text-align: left; }
.palette-item[aria-selected="true"] { background: var(--accent-soft); }
.palette-item .i { color: var(--text-2); margin: 0 8px; }
.palette-item .avatar { width: 32px; height: 32px; font-size: 12px; }
.palette-item span.main { flex: 1; min-width: 0; }
.palette-item small { display: block; color: var(--text-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-foot { display: none; }
@media (min-width: 720px) {
  .palette-wrap { background: rgba(0, 0, 0, .45); align-items: center; padding-top: 12vh; }
  .palette { flex: none; width: 620px; max-width: calc(100vw - 40px); max-height: 66vh; background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow); overflow: hidden; }
  .palette-list { padding-bottom: 8px; }
  .palette-foot { display: flex; gap: 14px; padding: 8px 16px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 12px; }
  .palette-foot kbd { font: inherit; font-weight: 600; color: var(--text-2); }
}
.kbd-list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 14px; border-top: 1px solid var(--line); }
.kbd-list li:first-child { border-top: 0; }
.kbd-list kbd { font: 600 12.5px var(--font); background: var(--surface-2); border-radius: 6px; padding: 2px 7px; }
#toasts { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 14px); z-index: 70; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
.toast { padding: 10px 16px; border-radius: 14px; background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px; text-align: center; box-shadow: var(--shadow); animation: toast-in .22s var(--ease); }
.toast.err { background: #d32f2f; color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@media (min-width: 720px) { #toasts { bottom: 24px; } }
#ptr { position: fixed; top: calc(var(--safe-t) + 10px); left: 50%; z-index: 30; width: 36px; height: 36px; margin-left: -18px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); box-shadow: var(--shadow); color: var(--text-2); opacity: 0; pointer-events: none; }
.offline-bar { position: fixed; top: var(--safe-t); left: 50%; transform: translateX(-50%); z-index: 40; margin-top: 8px; padding: 6px 14px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 13px; font-weight: 600; }

/* ── Login ─────────────────────────────────────────── */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; overflow-y: auto; }
.login-card { width: 100%; max-width: 360px; text-align: center; }
.login-card .bars { margin-bottom: 18px; }
.login-card h1 { font-size: 28px; font-weight: 700; letter-spacing: -.024em; }
.login-card > p { color: var(--text-2); margin: 3px 0 24px; }
.login-card .field { text-align: left; margin-bottom: 10px; }
.login-card .or { margin: 16px 0 12px; color: var(--text-3); font-size: 13px; }
.login-card .notice { text-align: left; margin-bottom: 12px; }

/* ── Skeleton ──────────────────────────────────────── */
.skel { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; }
.skel-row .a { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.skel-row .l1 { height: 13px; width: 45%; margin-bottom: 7px; }
.skel-row .l2 { height: 11px; width: 70%; }

/* ── Motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .fade-in { animation: fade-in .16s ease-out; }
  @keyframes fade-in { from { opacity: 0; transform: translateY(3px); } }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 719px) {
  ::view-transition-group(tabbar) { animation: none; }
  ::view-transition-old(root) { animation: vt-out .2s var(--ease) both; }
  ::view-transition-new(root) { animation: vt-in .26s var(--ease) both; }
  [data-nav="back"]::view-transition-old(root) { animation: vt-back-out .22s var(--ease) both; z-index: 2; }
  [data-nav="back"]::view-transition-new(root) { animation: vt-back-in .24s var(--ease) both; }
  [data-nav="tab"]::view-transition-old(root) { animation: vt-fade-out .12s linear both; }
  [data-nav="tab"]::view-transition-new(root) { animation: vt-fade-in .14s linear both; }
  @keyframes vt-out { to { transform: translateX(-22%); opacity: .6; } }
  @keyframes vt-in { from { transform: translateX(100%); } }
  @keyframes vt-back-out { to { transform: translateX(100%); } }
  @keyframes vt-back-in { from { transform: translateX(-22%); opacity: .6; } }
  @keyframes vt-fade-out { to { opacity: 0; } }
  @keyframes vt-fade-in { from { opacity: 0; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
