/* Rack — the private hub. Mobile first; a three-pane layout from 1000px. */

:root {
  --bg: #0b0c0e;
  --bg-2: #101215;
  --card: #15171b;
  --card-2: #1b1e23;
  --press: #22262c;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #eeece8;
  --text-2: #a2a7af;
  --text-3: #6c7179;
  --accent: #f26a1b;
  --accent-2: #ff8b4a;
  --accent-soft: rgba(242, 106, 27, 0.15);
  --ok: #34d07f;
  --ok-soft: rgba(52, 208, 127, 0.14);
  --warn: #f3b13c;
  --warn-soft: rgba(243, 177, 60, 0.14);
  --bad: #ff5b5f;
  --bad-soft: rgba(255, 91, 95, 0.13);
  --idle: #575d65;
  --glass: rgba(14, 15, 18, 0.72);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --r: 16px;
  --r-sm: 11px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --tabbar: 54px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f3f0;
    --bg-2: #eceae6;
    --card: #ffffff;
    --card-2: #f7f6f3;
    --press: #ecebe7;
    --line: rgba(0, 0, 0, 0.07);
    --line-2: rgba(0, 0, 0, 0.12);
    --text: #16171a;
    --text-2: #5d626a;
    --text-3: #8d929a;
    --accent: #e45d10;
    --accent-2: #c94f0b;
    --accent-soft: rgba(228, 93, 16, 0.1);
    --ok: #12a05a;
    --ok-soft: rgba(18, 160, 90, 0.1);
    --warn: #b77700;
    --warn-soft: rgba(183, 119, 0, 0.1);
    --bad: #d93a3e;
    --bad-soft: rgba(217, 58, 62, 0.09);
    --idle: #b3b7bd;
    --glass: rgba(244, 243, 240, 0.78);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.42 var(--font);
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

.boot { position: fixed; inset: 0; display: grid; place-items: center; }
.boot img { border-radius: 15px; animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.55; transform: scale(0.96); } }

/* ── shell ─────────────────────────────────────────────────────────────── */
.shell { min-height: 100dvh; padding-bottom: calc(var(--tabbar) + var(--safe-b) + 24px); }
.page { padding: calc(var(--safe-t) + 10px) var(--gutter) 0; max-width: 760px; margin: 0 auto; }

.titlebar { display: flex; align-items: center; gap: 12px; min-height: 52px; padding-top: 4px; }
.titlebar h1 {
  font: 700 32px/1.1 var(--font-display);
  letter-spacing: -0.025em;
  margin: 0;
  flex: 1;
  min-width: 0;
}
.titlebar .sub { color: var(--text-3); font-size: 13px; font-weight: 500; letter-spacing: 0; }

.sticky {
  position: sticky; top: 0; z-index: 20;
  margin: 0 calc(-1 * var(--gutter));
  padding: calc(var(--safe-t) + 8px) var(--gutter) 10px;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.sticky.scrolled { background: var(--glass); backdrop-filter: saturate(170%) blur(18px); -webkit-backdrop-filter: saturate(170%) blur(18px); border-bottom: 1px solid var(--line); }
.sticky .mini-title { display: none; text-align: center; font-weight: 600; font-size: 16px; margin: -2px 0 8px; }
.sticky.scrolled .mini-title { display: block; }

/* search */
.search {
  position: relative; display: flex; align-items: center;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 13px; height: 44px; padding: 0 10px 0 38px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search:focus-within { border-color: var(--line-2); box-shadow: 0 0 0 4px var(--accent-soft); }
.search svg.lead { position: absolute; left: 12px; width: 18px; height: 18px; color: var(--text-3); }
.search input {
  flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none;
  font-size: 16px; /* never < 16 or iOS zooms */
}
.search input::placeholder { color: var(--text-3); }
.search .kbd { font: 600 11px/1 var(--mono); color: var(--text-3); border: 1px solid var(--line-2); border-radius: 6px; padding: 4px 6px; }
.search .clear { border: 0; background: var(--line-2); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); padding: 0; }
.search .clear svg { width: 12px; height: 12px; }

/* chips */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 10px calc(-1 * var(--gutter)) 0; padding: 0 var(--gutter) 2px; scroll-padding-inline: var(--gutter); }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text-2);
  font-size: 14px; font-weight: 550; white-space: nowrap; 
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}
.chip:active { transform: scale(0.96); }
.chip .n { color: var(--text-3); font-variant-numeric: tabular-nums; font-weight: 500; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip[aria-pressed="true"] .n { color: var(--bg); opacity: 0.6; }
.chip .dot { width: 7px; height: 7px; }

/* mac pill */
.macpill {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 10px;
  border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--text-2);
}
.macpill .dot { width: 8px; height: 8px; }

/* status dots */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--idle); flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft), 0 0 12px rgba(52, 208, 127, 0.45); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.dot.ring { background: transparent; box-shadow: inset 0 0 0 1.5px var(--idle); }
.dot.pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ── quick grid ───────────────────────────────────────────────────────── */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 8px; margin: 18px 0 6px; }
@media (min-width: 560px) { .quick { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); } }
.tile { display: flex; flex-direction: column; align-items: center; gap: 7px; border: 0; background: none; padding: 0; min-width: 0; }
.tile .icon { width: 60px; height: 60px; font-size: 22px; border-radius: 15px; }
.tile .label { font-size: 12px; font-weight: 500; color: var(--text-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile:active .icon { transform: scale(0.92); }
.tile .icon { transition: transform 0.15s var(--ease); position: relative; }
.tile .badge { position: absolute; right: -3px; top: -3px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--bg); background: var(--ok); }

/* ── app icon ─────────────────────────────────────────────────────────── */
.icon {
  flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px;
  color: #fff; font: 650 15px/1 var(--font-display); letter-spacing: -0.02em;
  background: var(--g, #444);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 -1px 0 rgba(0, 0, 0, 0.18);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
  user-select: none;
}
.icon.xl { width: 72px; height: 72px; border-radius: 17px; font-size: 26px; }

/* ── lists ────────────────────────────────────────────────────────────── */
.group { margin-top: 22px; }
.group-h {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 0 4px 8px; color: var(--text-3); font-size: 13px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase;
}
.group-h .n { font-variant-numeric: tabular-nums; font-weight: 500; }
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.row {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px 10px 12px; min-height: 62px; border: 0; background: none; text-align: left;
  transition: background 0.12s;
}
.row + .row::before { content: ""; position: absolute; top: 0; left: 66px; right: 0; height: 1px; background: var(--line); }
.row:active, .row.sel { background: var(--press); }
@media (hover: hover) { .row:hover { background: var(--card-2); } }
.row .body { flex: 1; min-width: 0; }
.row .t { display: flex; align-items: center; gap: 7px; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.row .t .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .d { color: var(--text-2); font-size: 14px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta { display: flex; align-items: center; gap: 8px; color: var(--text-3); font: 500 12.5px/1 var(--mono); flex: none; }
.row .go {
  flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--accent-soft); color: var(--accent-2);
  display: grid; place-items: center; margin-right: -4px; transition: transform 0.12s;
}
.row .go:active { transform: scale(0.9); }
.row .go svg { width: 17px; height: 17px; }
.row .go.idle { background: var(--line); color: var(--text-2); }

.tag {
  display: inline-flex; align-items: center; height: 19px; padding: 0 6px; border-radius: 6px;
  font: 650 10.5px/1 var(--font); letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--line); color: var(--text-2); flex: none;
}
.tag.live { background: var(--ok-soft); color: var(--ok); }
.tag.wip { background: var(--warn-soft); color: var(--warn); }
.tag.retired, .tag.superseded, .tag.dormant { background: transparent; color: var(--text-3); box-shadow: inset 0 0 0 1px var(--line-2); }
.tag.accent { background: var(--accent-soft); color: var(--accent-2); }

.empty { text-align: center; color: var(--text-2); padding: 48px 20px; }
.empty b { color: var(--text); display: block; font-size: 17px; margin-bottom: 6px; }
.empty code { font: 13px var(--mono); background: var(--card); padding: 2px 6px; border-radius: 6px; }

/* ── detail ───────────────────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 6px;
  margin: 0 calc(-1 * var(--gutter)); padding: calc(var(--safe-t) + 6px) calc(var(--gutter) - 6px) 8px;
  min-height: calc(var(--safe-t) + 50px);
}
.navbar.scrolled { background: var(--glass); backdrop-filter: saturate(170%) blur(18px); -webkit-backdrop-filter: saturate(170%) blur(18px); border-bottom: 1px solid var(--line); }
.navbar .back { display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; color: var(--accent-2); font-size: 17px; height: 40px; padding: 0 6px; }
.navbar .back svg { width: 22px; height: 22px; }
.navbar .ttl { flex: 1; text-align: center; font-weight: 600; opacity: 0; transition: opacity 0.15s; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navbar.scrolled .ttl { opacity: 1; }
.navbar .spacer { width: 80px; }

.hero { display: flex; gap: 16px; align-items: center; margin: 6px 0 14px; }
.hero h2 { font: 700 26px/1.12 var(--font-display); letter-spacing: -0.02em; margin: 0 0 4px; }
.hero .chips-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.desc { color: var(--text-2); font-size: 16px; margin: 0 0 16px; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.actions.three { grid-template-columns: 2fr 1fr 1fr; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 16px; border-radius: 13px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font-size: 16px; font-weight: 600; letter-spacing: -0.01em;
  transition: transform 0.1s, background 0.15s, opacity 0.15s; white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn.primary:active { background: var(--accent-2); }
.btn.danger { color: var(--bad); }
.btn.small { height: 36px; border-radius: 10px; font-size: 14px; padding: 0 12px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn .spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.section { margin-top: 22px; }
.section-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 8px; color: var(--text-3); font-size: 13px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; }
.section-h .act { border: 0; background: none; color: var(--accent-2); font-size: 14px; font-weight: 600; text-transform: none; letter-spacing: 0; padding: 6px 2px; }

.kv { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 52px; }
.kv + .kv::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; height: 1px; background: var(--line); }
.kv .k { color: var(--text-2); font-size: 14px; flex: none; width: 92px; }
.kv .v { flex: 1; min-width: 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv .v.mono, .mono { font-family: var(--mono); font-size: 13.5px; letter-spacing: 0; }
.kv .v.wrap { white-space: normal; word-break: break-word; overflow: visible; }
.kv .tools { display: flex; gap: 4px; flex: none; }
.ibtn {
  width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--text-2);
  display: grid; place-items: center; transition: background 0.12s, color 0.12s, transform 0.1s; flex: none;
}
.ibtn:active { background: var(--press); transform: scale(0.92); }
@media (hover: hover) { .ibtn:hover { background: var(--card-2); color: var(--text); } }
.ibtn svg { width: 18px; height: 18px; }
.ibtn.on { color: var(--accent-2); }

.secret { font-family: var(--mono); letter-spacing: 0.08em; }
.secret.shown { letter-spacing: 0; user-select: all; -webkit-user-select: all; }

.code {
  font: 12.5px/1.5 var(--mono); color: var(--text-2); background: var(--bg-2); border-radius: 10px;
  padding: 10px 12px; margin: 0; white-space: pre-wrap; word-break: break-word; max-height: 300px; overflow: auto;
}
.prose { padding: 14px; color: var(--text-2); font-size: 15px; line-height: 1.55; }
.prose p { margin: 0 0 10px; }
.prose.clamp { max-height: 210px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.more { border: 0; background: none; color: var(--accent-2); font-weight: 600; padding: 0 14px 14px; font-size: 15px; }

.hint { color: var(--text-3); font-size: 13px; padding: 10px 4px 0; }
.hint code, .note code { font: 12.5px var(--mono); }
.note { padding: 12px 14px; color: var(--text-2); font-size: 14px; }
.warnbox { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--warn-soft); color: var(--warn); border-radius: 12px; font-size: 14px; margin-top: 10px; }

/* ── tab bar ──────────────────────────────────────────────────────────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--glass); backdrop-filter: saturate(180%) blur(22px); -webkit-backdrop-filter: saturate(180%) blur(22px);
  border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-3); font-size: 10.5px; font-weight: 600; }
.tabbar a svg { width: 25px; height: 25px; }
.tabbar a[aria-current="page"] { color: var(--accent-2); }
.tabbar a .pip { position: absolute; transform: translate(14px, -10px); width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* ── sheet ────────────────────────────────────────────────────────────── */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.45); opacity: 0; transition: opacity 0.22s; }
.scrim.in { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-height: 92dvh; overflow: auto;
  background: var(--bg-2); border-radius: 22px 22px 0 0; border: 1px solid var(--line);
  padding: 8px var(--gutter) calc(var(--safe-b) + 18px);
  transform: translateY(105%); transition: transform 0.32s var(--ease);
  box-shadow: var(--shadow);
}
.sheet.in { transform: none; }
.sheet .grab { width: 38px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 2px auto 10px; }
.sheet h3 { font: 700 21px/1.2 var(--font-display); letter-spacing: -0.015em; margin: 4px 0 4px; }
.sheet .lead { color: var(--text-2); margin: 0 0 16px; font-size: 15px; }
@media (min-width: 700px) {
  .sheet { left: 50%; right: auto; bottom: 50%; width: 520px; border-radius: 22px; transform: translate(-50%, 60%) scale(0.98); opacity: 0; transition: transform 0.26s var(--ease), opacity 0.2s; padding-bottom: 20px; }
  .sheet.in { transform: translate(-50%, 50%); opacity: 1; }
}

/* forms */
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 13px; color: var(--text-2); margin: 0 0 6px 2px; font-weight: 550; }
.input, .select, .textarea {
  width: 100%; height: 46px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card);
  padding: 0 13px; font-size: 16px; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { height: auto; min-height: 84px; padding: 11px 13px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input.mono { font-family: var(--mono); font-size: 15px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { height: 36px; border: 0; border-radius: 9px; background: none; color: var(--text-2); font-size: 14px; font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--press); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); }
.row-btns { display: flex; gap: 10px; margin-top: 16px; }
.row-btns .btn { flex: 1; }
.err { color: var(--bad); font-size: 14px; margin: 8px 2px 0; min-height: 1em; }

.qr { background: #fff; border-radius: 16px; padding: 14px; width: 220px; margin: 6px auto 12px; }
.qr img, .qr svg { width: 100%; height: auto; image-rendering: pixelated; }
.linkbox { font: 13px/1.4 var(--mono); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; word-break: break-all; color: var(--text-2); }

/* toggles */
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--line-2); transition: background 0.2s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); transition: transform 0.22s var(--ease); }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(20px); }

/* showcase rows */
.thumb { width: 64px; height: 42px; border-radius: 8px; object-fit: cover; background: var(--card-2); flex: none; border: 1px solid var(--line); }

/* ── login / enroll ───────────────────────────────────────────────────── */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: calc(var(--safe-t) + 24px) var(--gutter) calc(var(--safe-b) + 24px); }
.gate-card { width: min(400px, 100%); text-align: center; }
.gate-card .logo { width: 92px; height: 92px; border-radius: 21px; margin: 0 auto 22px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--line); }
.gate-card h1 { font: 700 34px/1.1 var(--font-display); letter-spacing: -0.03em; margin: 0 0 8px; }
.gate-card p { color: var(--text-2); margin: 0 0 26px; font-size: 16px; }
.gate-card .btn { width: 100%; height: 54px; font-size: 17px; border-radius: 15px; }
.gate-card .small { color: var(--text-3); font-size: 13px; margin-top: 18px; }
.gate-card .small code { font: 12.5px var(--mono); color: var(--text-2); }

/* toast */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar) + var(--safe-b) + 16px); z-index: 80;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 999px;
  font-size: 15px; font-weight: 600; box-shadow: var(--shadow); transition: opacity 0.2s, transform 0.25s var(--ease);
  max-width: calc(100vw - 32px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#toast.in { opacity: 1; transform: translate(-50%, 0); }

/* palette (desktop ⌘K) */
.palette { position: fixed; inset: 0; z-index: 70; display: grid; place-items: start center; padding-top: 12vh; background: rgba(0, 0, 0, 0.4); }
.palette .box { width: min(620px, calc(100vw - 32px)); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.palette input { width: 100%; height: 56px; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 0 18px; font-size: 18px; outline: none; }
.palette .res { max-height: 52vh; overflow: auto; padding: 6px; }
.palette .row { border-radius: 10px; min-height: 52px; }
.palette .row + .row::before { display: none; }

/* ── desktop: sidebar · list · inspector ─────────────────────────────── */
.side, .inspector { display: none; }
@media (min-width: 1000px) {
  .tabbar { display: none; }
  .shell { display: grid; grid-template-columns: 236px minmax(380px, 1fr) minmax(420px, 520px); height: 100dvh; padding: 0; }
  .shell.wide { grid-template-columns: 236px 1fr; }
  .side {
    display: flex; flex-direction: column; gap: 2px; padding: 18px 12px; border-right: 1px solid var(--line); background: var(--bg-2);
    overflow: auto;
  }
  .side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font: 700 19px var(--font-display); letter-spacing: -0.02em; }
  .side .brand img { width: 30px; height: 30px; border-radius: 8px; }
  .side a, .side button.nav {
    display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 9px; color: var(--text-2);
    font-size: 14.5px; font-weight: 550; border: 0; background: none; width: 100%; text-align: left;
  }
  .side a svg, .side button.nav svg { width: 18px; height: 18px; }
  .side a:hover, .side button.nav:hover { background: var(--card); color: var(--text); }
  .side a[aria-current="page"] { background: var(--card-2); color: var(--text); }
  .side .n { margin-left: auto; color: var(--text-3); font: 500 12px var(--mono); }
  .side .sep { height: 1px; background: var(--line); margin: 10px 6px; }
  .side .foot { margin-top: auto; padding: 10px 8px 0; color: var(--text-3); font-size: 12px; }
  .col-main { overflow: auto; height: 100dvh; }
  .col-main .page { max-width: none; padding: 14px 22px 40px; }
  .col-main .sticky { margin: 0 -22px; padding: 12px 22px 10px; }
  .inspector { display: block; overflow: auto; height: 100dvh; border-left: 1px solid var(--line); background: var(--bg-2); }
  .inspector .page { padding: 10px 22px 40px; max-width: none; }
  .inspector .navbar { display: none; }
  .inspector .blank { height: 100%; display: grid; place-items: center; color: var(--text-3); font-size: 15px; text-align: center; padding: 30px; }
  #toast { bottom: 24px; }
  .titlebar h1 { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.18s; }

@media (max-width: 520px) { .row .meta .hide-sm { display: none; } }
.tile { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
