/* WebView Kit admin panel */
:root {
  --ink: #0c1322;
  --ink-2: #162034;
  --ink-line: #24304a;
  --bg: #f3f5f9;
  --card: #ffffff;
  --line: #e3e7ef;
  --line-strong: #cfd6e2;
  --text: #111827;
  --muted: #647086;
  --faint: #8d97aa;
  --accent: #2f5bea;
  --accent-ink: #1e45c7;
  --accent-soft: #eaf0ff;
  --ok: #0f8a4b;
  --ok-soft: #e4f6ec;
  --warn: #a15c07;
  --warn-soft: #fff4dc;
  --bad: #c8281c;
  --bad-soft: #fde9e7;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
  --sans: "IBM Plex Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14.5px/1.5 var(--sans); color: var(--text); background: var(--bg); }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 600; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.icon { flex: none; vertical-align: -3px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
[hidden] { display: none !important; }

/* Shell */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--ink); color: #c5cde0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 11px; padding: 20px 20px 18px; color: #fff; font-weight: 600; font-size: 16px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(140deg, #4f7cff, #2f5bea 55%, #1b3fb8); display: grid; place-items: center; color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); }
.nav { padding: 6px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #6f7c99; padding: 16px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: #c5cde0; font-weight: 500; }
.nav a:hover { background: var(--ink-2); color: #fff; text-decoration: none; }
.nav a.on { background: var(--ink-2); color: #fff; box-shadow: inset 3px 0 0 #5b84ff; }
.nav a .count { margin-left: auto; font-size: 12px; color: #8793ae; }
.side-foot { border-top: 1px solid var(--ink-line); padding: 12px; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 9px; color: #dfe5f3; }
.me:hover { background: var(--ink-2); text-decoration: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #2a3a5f; color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.me-name { font-weight: 500; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-mail { font-size: 12px; color: #8793ae; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.signout { display: flex; width: 100%; align-items: center; gap: 11px; padding: 8px 10px; margin-top: 2px; border: 0; background: none; color: #9aa6c0; font: inherit; border-radius: 9px; cursor: pointer; }
.signout:hover { background: var(--ink-2); color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.page { padding: 28px 32px 56px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 4px; max-width: 70ch; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-strong); background: #fff; color: var(--text); font: 500 14px var(--sans); cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f7f9fc; text-decoration: none; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(47, 91, 234, .35); }
.btn.primary:hover { background: var(--accent-ink); }
.btn.danger { color: var(--bad); border-color: #f1c4bf; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: #eceff5; color: var(--text); }
.btn.icon-only { width: 32px; padding: 0; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.grid > .card + .card, .split > .card + .card { margin-top: 0; }
.card-head { padding: 18px 22px 0; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.card-head p { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.card-body { padding: 18px 22px 22px; }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; align-items: center; background: #fafbfd; border-radius: 0 0 var(--radius) var(--radius); }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.stack > * + * { margin-top: 18px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat-label { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.stat-value { font-size: 28px; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 8px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; min-width: 0; }
.bar i { display: block; width: 100%; max-width: 34px; background: linear-gradient(#5b84ff, #2f5bea); border-radius: 6px 6px 2px 2px; min-height: 3px; }
.bar i.zero { background: #e3e7ef; }
.bar b { font-size: 12px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar span { font-size: 11px; color: var(--faint); white-space: nowrap; }

/* App tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.tile { display: flex; gap: 14px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: inherit; align-items: center; transition: border-color .15s, box-shadow .15s; }
.tile:hover { text-decoration: none; border-color: #b9c6ee; box-shadow: 0 6px 18px rgba(30, 60, 150, .09); }
.app-icon { width: 52px; height: 52px; border-radius: 14px; object-fit: cover; background: #e8ecf5; flex: none; border: 1px solid rgba(0, 0, 0, .06); }
.app-icon.lg { width: 64px; height: 64px; border-radius: 17px; }
.app-icon.sm { width: 30px; height: 30px; border-radius: 8px; }
.tile-main { min-width: 0; flex: 1; }
.tile-name { font-weight: 600; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.tile-name span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-meta { color: var(--faint); font-size: 12.5px; margin-top: 4px; display: flex; gap: 12px; }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: #eef1f6; color: #4a5568; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--accent-soft); color: var(--accent-ink); }
.pill.live::before { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* Alerts */
.alert { display: flex; gap: 12px; padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; border: 1px solid; align-items: flex-start; }
.alert .icon { margin-top: 2px; }
.alert.ok { background: var(--ok-soft); border-color: #bfe6cf; color: #0a5c33; }
.alert.bad { background: var(--bad-soft); border-color: #f4c7c2; color: #8f1d14; }
.alert.warn { background: var(--warn-soft); border-color: #f1d9a2; color: #7a4504; }
.alert.info { background: var(--accent-soft); border-color: #c9d6fb; color: #1b3a9e; }
.alert ul { margin: 0; padding-left: 18px; }
.alert a { color: inherit; text-decoration: underline; }

/* App header and tabs */
.app-head { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.app-head-main { flex: 1; min-width: 200px; }
.app-head h1 { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 12px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; gap: 8px; align-items: center; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--accent-ink); border-bottom-color: var(--accent); }

/* Forms */
.field { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 6px 24px; padding: 14px 0; border-top: 1px solid #eef1f6; align-items: start; }
.field:first-child { border-top: 0; padding-top: 0; }
.field:last-child { padding-bottom: 0; }
.field.wide { grid-template-columns: 1fr; }
.field > label, .field > .label { font-weight: 500; padding-top: 8px; }
.field.toggle-row > label { padding-top: 2px; }
.help { color: var(--muted); font-size: 13px; margin-top: 5px; }
.err { color: var(--bad); font-size: 13px; margin-top: 5px; font-weight: 500; }
.input, select.input, textarea.input { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; font: 14.5px var(--sans); color: var(--text); background: #fff; }
textarea.input { height: auto; min-height: 84px; padding: 9px 12px; resize: vertical; line-height: 1.45; }
.input.mono, textarea.code { font-family: var(--mono); font-size: 13px; }
textarea.code { min-height: 130px; background: #fbfcfe; tab-size: 2; }
.input:hover { border-color: #b3bccd; }
.input.invalid { border-color: var(--bad); }
.input-group { display: flex; gap: 8px; align-items: center; }
.input-group .input { flex: 1; }
.suffix { color: var(--muted); font-size: 13px; white-space: nowrap; }
.narrow { max-width: 160px; }
.medium { max-width: 320px; }
.stacked label { display: block; font-weight: 500; margin-bottom: 6px; }
.stacked + .stacked { margin-top: 16px; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 44px; height: 24px; margin: 0; cursor: pointer; }
.switch i { width: 44px; height: 24px; border-radius: 999px; background: #c9d0dd; transition: background .15s; position: relative; flex: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch input:checked + i { background: var(--accent); }
.switch.danger input:checked + i { background: var(--bad); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch span { color: var(--muted); font-size: 13px; }

.color { display: flex; gap: 8px; align-items: center; }
.color input[type=color] { width: 38px; height: 38px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; cursor: pointer; flex: none; }
.color .input { max-width: 120px; font-family: var(--mono); font-size: 13px; text-transform: uppercase; }
.image-field { display: flex; gap: 10px; align-items: center; }
.image-field .thumb { width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--line); background: #f3f5f9 center/cover no-repeat; flex: none; }
.checks { display: flex; gap: 18px; flex-wrap: wrap; }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; }
.radio-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.radio-card { border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-card input { margin: 3px 0 0; accent-color: var(--accent); }
.radio-card b { display: block; font-weight: 600; }
.radio-card span { color: var(--muted); font-size: 13px; }

/* Menu item editor */
.items { display: flex; flex-direction: column; gap: 8px; }
.item-row { display: grid; grid-template-columns: 38px minmax(0, 1.1fr) minmax(0, 1.2fr) minmax(0, 1.3fr) auto; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.item-row.layout-row { grid-template-columns: 38px minmax(0, 1.1fr) minmax(0, 2.5fr) auto; }
.item-row .move { display: flex; gap: 2px; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line-strong); background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--text); padding: 0; }
.icon-btn:hover { background: var(--accent-soft); border-color: #b9c6ee; }
.icon-btn.blank { color: var(--faint); border-style: dashed; }
.items-empty { color: var(--muted); font-size: 13.5px; padding: 14px; border: 1px dashed var(--line-strong); border-radius: 12px; text-align: center; }
.items-foot { display: flex; gap: 8px; margin-top: 10px; align-items: center; flex-wrap: wrap; }
.flip { transform: rotate(180deg); }
.picker { position: absolute; z-index: 50; width: 336px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 18px 50px rgba(16, 24, 40, .22); padding: 10px; }
.picker input { margin-bottom: 8px; }
.picker-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 236px; overflow-y: auto; }
.picker-grid button { height: 38px; border: 0; background: none; border-radius: 8px; cursor: pointer; display: grid; place-items: center; color: var(--text); }
.picker-grid button:hover { background: var(--accent-soft); color: var(--accent-ink); }
.picker-grid .none { font-size: 11px; color: var(--muted); grid-column: span 2; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 500; padding: 10px 22px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbfd; }
td { padding: 13px 22px; border-bottom: 1px solid #eef1f6; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td .sub { color: var(--muted); font-size: 13px; }
.cell-app { display: flex; gap: 10px; align-items: center; }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .icon { color: #b3bccd; margin-bottom: 10px; }
.empty h3 { color: var(--text); font-size: 15px; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }
.pager { padding: 14px 22px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* Key/value list */
.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 10px 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.copy { display: flex; gap: 8px; align-items: center; }
.copy code { background: #f3f5f9; padding: 5px 9px; border-radius: 8px; overflow-wrap: anywhere; }

/* Checklist */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid #eef1f6; }
.checklist li:first-child { border-top: 0; padding-top: 0; }
.dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; margin-top: 1px; }
.dot.ok { background: var(--ok-soft); color: var(--ok); }
.dot.bad { background: var(--bad-soft); color: var(--bad); }
.dot.warn { background: var(--warn-soft); color: var(--warn); }

/* Build log */
.log { background: #0c1322; color: #d5dcec; font: 12.5px/1.55 var(--mono); padding: 16px 18px; border-radius: 0 0 var(--radius) var(--radius); height: 460px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }

/* Phone preview */
.preview { position: sticky; top: 24px; }
.preview-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); text-align: center; margin-bottom: 10px; }
.phone { width: 290px; margin: 0 auto; border-radius: 38px; padding: 10px; background: #0c1322; box-shadow: 0 24px 50px rgba(12, 19, 34, .28), inset 0 0 0 2px #2a3550; }
.phone-screen { border-radius: 29px; overflow: hidden; height: 560px; display: flex; flex-direction: column; background: #fff; position: relative; --p: #2563EB; --on: #fff; }
.phone-screen.dark { background: #121418; color: #e8eaf0; }
.p-status { height: 26px; background: var(--bar); display: flex; align-items: center; justify-content: space-between; padding: 0 18px; font-size: 11px; font-weight: 600; color: var(--bar-on); }
.p-bar { height: 50px; background: var(--bar); color: var(--bar-on); display: flex; align-items: center; gap: 12px; padding: 0 14px; font-weight: 600; font-size: 15px; box-shadow: 0 1px 0 rgba(0, 0, 0, .08); }
.p-bar .p-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-bar.center .p-title { text-align: center; }
.p-bar .p-acts { display: flex; gap: 12px; }
.p-progress { height: 3px; background: color-mix(in srgb, var(--p) 22%, transparent); }
.p-progress i { display: block; width: 55%; height: 100%; background: var(--p); }
.p-web { flex: 1; padding: 14px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; position: relative; }
.p-web .sk { background: #eceff5; border-radius: 10px; }
.phone-screen.dark .p-web .sk { background: #23262d; }
.p-url { font: 11px var(--mono); color: var(--faint); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-fab { position: absolute; right: 14px; bottom: 14px; width: 48px; height: 48px; border-radius: 16px; background: var(--p); color: var(--on); display: grid; place-items: center; box-shadow: 0 6px 14px rgba(0, 0, 0, .25); }
.p-tabs { display: flex; border-top: 1px solid rgba(128, 128, 128, .18); background: inherit; }
.p-tab { flex: 1; padding: 8px 2px 7px; text-align: center; font-size: 10px; color: #7b8496; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-tab .ic { display: grid; place-items: center; height: 26px; width: 48px; margin: 0 auto 2px; border-radius: 13px; }
.p-tab.on { color: inherit; font-weight: 600; }
.p-tab.on .ic { background: color-mix(in srgb, var(--p) 18%, transparent); color: var(--p); }
.p-home { height: 18px; display: grid; place-items: center; background: inherit; }
.p-home i { width: 90px; height: 4px; border-radius: 2px; background: currentColor; opacity: .35; }
.p-splash { position: absolute; inset: 0; background: var(--splash); color: var(--splash-on); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 20px; z-index: 3; }
.p-splash img { width: 84px; height: 84px; border-radius: 22px; object-fit: cover; }
.p-splash b { font-size: 18px; }
.p-splash span { font-size: 12.5px; opacity: .85; }
.p-drawer { position: absolute; inset: 0 22% 0 0; background: #fff; z-index: 2; box-shadow: 8px 0 30px rgba(0, 0, 0, .25); display: flex; flex-direction: column; }
.phone-screen.dark .p-drawer { background: #1a1d23; }
.p-drawer-head { background: var(--p); color: var(--on); padding: 40px 16px 16px; }
.p-drawer-head img { width: 44px; height: 44px; border-radius: 12px; margin-bottom: 8px; display: block; }
.p-drawer-head b { display: block; font-size: 15px; }
.p-drawer-head span { font-size: 12px; opacity: .85; }
.p-drawer-items { padding: 8px; overflow: hidden; flex: 1; font-size: 13px; }
.p-drawer-items div { display: flex; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 10px; }
.p-drawer-items div:first-child { background: color-mix(in srgb, var(--p) 14%, transparent); color: var(--p); font-weight: 600; }
.p-drawer-items hr { border: 0; border-top: 1px solid rgba(128, 128, 128, .2); margin: 6px 10px; }
.p-drawer-items small { display: block; padding: 8px 10px 2px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.preview-switch { display: flex; justify-content: center; gap: 4px; margin-top: 14px; }
.preview-switch button { border: 1px solid var(--line-strong); background: #fff; height: 30px; padding: 0 12px; border-radius: 8px; font: 500 12.5px var(--sans); cursor: pointer; color: var(--muted); }
.preview-switch button.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Sign in */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-art { background: radial-gradient(1200px 600px at 10% -10%, #24408f 0%, transparent 60%), var(--ink); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art h1 { font-size: 34px; line-height: 1.15; max-width: 14ch; font-weight: 600; }
.auth-art p { color: #aab6d3; margin-top: 14px; max-width: 44ch; font-size: 16px; }
.auth-points { display: grid; gap: 14px; color: #d6def0; }
.auth-points div { display: flex; gap: 12px; align-items: center; }
.auth-points .icon { color: #7fa0ff; }
.auth-form { display: grid; place-items: center; padding: 32px; }
.auth-box { width: 100%; max-width: 380px; }
.auth-box h2 { font-size: 24px; margin-bottom: 6px; }
.auth-box .btn { width: 100%; height: 42px; margin-top: 20px; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13.5px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); z-index: 99; }
dialog { border: 0; border-radius: 16px; padding: 0; width: min(480px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(12, 19, 34, .4); }
dialog::backdrop { background: rgba(12, 19, 34, .55); }
.dialog-body { padding: 22px; }
.dialog-body p { color: var(--muted); margin-top: 8px; }
.dialog-foot { padding: 14px 22px; background: #fafbfd; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

@media (max-width: 1100px) {
  .split { grid-template-columns: 1fr; }
  .preview { position: static; }
  .stats { 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: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 264px; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  body.menu-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(12, 19, 34, .5); }
  .topbar { display: flex; align-items: center; gap: 12px; height: 54px; padding: 0 16px; background: var(--ink); color: #fff; font-weight: 600; position: sticky; top: 0; z-index: 40; }
  .topbar button { background: none; border: 0; color: #fff; padding: 6px; display: grid; cursor: pointer; }
  .page { padding: 20px 16px 48px; }
  .grid.two, .grid.three, .radio-cards { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field { grid-template-columns: 1fr; gap: 4px; }
  .field > label, .field > .label { padding-top: 0; }
  .item-row, .item-row.layout-row { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .item-row .col-type, .item-row .col-value { grid-column: 1 / -1; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 10px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  th, td { padding-left: 16px; padding-right: 16px; }
  .card-head, .card-body, .card-foot { padding-left: 16px; padding-right: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
