/* Nebulm ops console. The app's design tokens (client/src/index.css, DESIGN_CONTRACT.md):
   warm paper neutrals, the violet accent, Plus Jakarta Sans, soft layered shadows, motion
   that explains what happened. Phones (< 768px): a bottom tab bar, bottom sheets, 44px
   targets, 16px inputs, nothing wider than the screen. */
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-display: swap; font-weight: 200 800; src: url(/fonts/plus-jakarta-sans-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-display: swap; font-weight: 200 800; src: url(/fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-display: swap; font-weight: 500; src: url(/fonts/jetbrains-mono-latin-500-normal.woff2) format('woff2'); }

:root {
  color-scheme: light;
  --bg: #f7f6f3; --surface: #fff; --surface-2: #f2f0eb; --surface-3: #e8e5de;
  --border: #e6e2da; --border-strong: #d2ccc1; --text: #1c1a17; --muted: #68635b; --subtle: #757067;
  --primary: #6d5efc; --on-primary: #fff; --primary-soft: color-mix(in srgb, var(--primary) 11%, transparent); --primary-text: #5a4be8;
  --success: #15a34a; --success-soft: color-mix(in srgb, #15a34a 12%, transparent); --success-text: #11803a;
  --danger: #e5484d; --danger-soft: color-mix(in srgb, #e5484d 11%, transparent); --danger-text: #c62a2f;
  --warning: #e8930c; --warning-soft: color-mix(in srgb, #e8930c 14%, transparent); --warning-text: #a35f00;
  --info: #0b8ad9; --overlay: rgba(28, 26, 23, .42); --hover: color-mix(in srgb, #000 4%, transparent);
  --shadow-sm: 0 1px 2px rgba(40, 30, 10, .05), 0 1px 3px rgba(40, 30, 10, .04);
  --shadow: 0 1px 2px rgba(40, 30, 10, .04), 0 6px 16px -4px rgba(40, 30, 10, .09);
  --shadow-md: 0 2px 4px rgba(40, 30, 10, .04), 0 12px 28px -8px rgba(40, 30, 10, .14);
  --shadow-lg: 0 4px 8px rgba(40, 30, 10, .04), 0 24px 56px -16px rgba(40, 30, 10, .24);
  --r-sm: 8px; --r: 10px; --r-md: 14px; --r-lg: 20px; --r-pill: 999px;
  --dur-instant: 90ms; --dur-quick: 140ms; --dur-base: 200ms; --dur-gentle: 300ms; --dur-sheet: 420ms;
  --ease-out: cubic-bezier(.22, 1, .36, 1); --ease-in: cubic-bezier(.4, 0, .9, .4); --ease-pop: cubic-bezier(.18, 1.22, .4, 1); --ease-sheet: cubic-bezier(.32, .72, 0, 1); --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #171513; --surface: #201e1b; --surface-2: #292622; --surface-3: #34302b;
    --border: #36322c; --border-strong: #4a453d; --text: #f3efe8; --muted: #b3ab9f; --subtle: #a39b8f;
    --primary: #8b7dff; --on-primary: #fff; --primary-text: #a99fff;
    --success-text: #4ade80; --danger-text: #ff8a8d; --warning-text: #f5b648; --overlay: rgba(0, 0, 0, .58); --hover: color-mix(in srgb, #fff 6%, transparent);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 20px -6px rgba(0, 0, 0, .45);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, .3), 0 14px 32px -8px rgba(0, 0, 0, .55); --shadow-lg: 0 24px 56px -16px rgba(0, 0, 0, .7);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; min-height: 100dvh; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--primary-text); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: .88em; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 24px; }

/* ---- boot / auth ---- */
.boot { min-height: 100dvh; display: grid; place-items: center; gap: 12px; align-content: center; color: var(--muted); font-weight: 600; }
.boot-mark, .brand-mark { width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(135deg, #8b7dff, #6d5efc 60%, #5b4bf0); box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--primary) 70%, transparent); display: inline-grid; place-items: center; color: #fff; flex: none; }
.boot-mark { animation: breathe 1.6s var(--ease-out) infinite alternate; }
@keyframes breathe { from { transform: scale(.92); opacity: .7; } to { transform: scale(1); opacity: 1; } }
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px calc(24px + var(--safe-b));
  background: radial-gradient(900px 500px at 10% -10%, color-mix(in srgb, var(--primary) 16%, transparent), transparent 60%), radial-gradient(700px 420px at 110% 110%, color-mix(in srgb, #f59e0b 12%, transparent), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 28px; animation: rise var(--dur-gentle) var(--ease-out); }
.auth-card h1 { font-size: 24px; line-height: 1.25; letter-spacing: -.02em; margin: 18px 0 4px; font-weight: 750; }
.auth-card .lead { color: var(--muted); margin: 0 0 20px; }
.auth-foot { margin-top: 18px; color: var(--subtle); font-size: 13px; text-align: center; }
.qr { display: grid; place-items: center; margin: 4px 0 12px; }
.qr img { width: 184px; height: 184px; border-radius: 12px; border: 1px solid var(--border); background: #fff; padding: 6px; }
.secret { font-family: var(--mono); font-size: 13px; letter-spacing: .06em; overflow-wrap: anywhere; background: var(--surface-2); padding: 8px 10px; border-radius: var(--r-sm); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---- forms ---- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13px; font-weight: 650; }
.field .hint { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.input, textarea.input { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--border-strong); background: var(--surface); transition: border-color var(--dur-quick), box-shadow var(--dur-quick); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea.input { min-height: 96px; font-family: var(--mono); font-size: 12.5px; resize: vertical; }
.input.code { font-family: var(--mono); font-size: 22px; letter-spacing: .4em; text-align: center; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--danger); flex: none; }
.form-error { color: var(--danger-text); font-size: 13.5px; margin: -4px 0 12px; min-height: 0; }
@media (max-width: 767px) { .input, textarea.input, select { font-size: 16px; } }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: var(--surface);
  font-weight: 650; font-size: 14px; cursor: pointer; transition: transform var(--dur-instant) var(--ease-out), background var(--dur-quick), box-shadow var(--dur-quick), opacity var(--dur-quick); white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--primary); border-color: transparent; color: var(--on-primary); box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--primary) 80%, transparent); }
.btn.primary:hover { background: color-mix(in srgb, var(--primary) 88%, #000); }
.btn.danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 88%, #000); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.block { width: 100%; min-height: 46px; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn .spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 767px) { .btn { min-height: 44px; } .btn.sm { min-height: 40px; } }
.iconbtn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; transition: background var(--dur-quick), transform var(--dur-instant); flex: none; }
.iconbtn:hover { background: var(--hover); color: var(--text); }
.iconbtn:active { transform: scale(.94); }
@media (max-width: 767px) { .iconbtn { width: 44px; height: 44px; } }
.info { width: 26px; height: 26px; margin: -4px 0; vertical-align: middle; color: var(--subtle); }
@media (max-width: 767px) { .info { width: 36px; height: 36px; margin: -8px -4px; } }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 55%, var(--bg)); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; font-weight: 750; letter-spacing: -.01em; font-size: 16px; }
.brand small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--r); color: var(--muted); font-weight: 600; font-size: 14.5px; text-decoration: none; transition: background var(--dur-quick), color var(--dur-quick); }
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary-text); }
.nav .badge { margin-left: auto; }
.side-foot { margin-top: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.side-foot .lockchip { justify-self: start; }
.who { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r); min-width: 0; }
.who .avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; flex: none; }
.who .meta { min-width: 0; flex: 1; }
.who .meta div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.who .meta small { color: var(--muted); font-size: 12px; }
.main { min-width: 0; padding: 28px 32px 48px; max-width: 1120px; width: 100%; }
.topbar { display: none; }
.tabbar { display: none; }
@media (max-width: 767px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 20; align-items: center; gap: 10px; padding: calc(8px + var(--safe-t)) 12px 8px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
  .topbar .brand { padding: 0; font-size: 15px; flex: 1; min-width: 0; }
  .topbar .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
  .main { padding: 18px 16px calc(96px + var(--safe-b)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 6px 4px calc(6px + var(--safe-b)); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--border); }
  .tabbar a, .tabbar button { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; min-height: 52px; border: 0; background: none; color: var(--muted); font-size: 11.5px; font-weight: 650; border-radius: 12px; text-decoration: none; cursor: pointer; position: relative; }
  .tabbar [aria-current="page"] { color: var(--primary-text); }
  .tabbar [aria-current="page"] svg { transform: translateY(-1px); }
  .tabbar .dot { position: absolute; top: 5px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--surface); }
}

/* ---- page ---- */
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head > div { flex: 1; min-width: 0; }
.page-head h1 { font-size: 28px; line-height: 1.2; letter-spacing: -.025em; margin: 0; font-weight: 750; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
@media (max-width: 767px) { .page-head h1 { font-size: 23px; } .page-head { margin-bottom: 14px; } }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.section-head h2 { font-size: 17px; font-weight: 650; margin: 0; letter-spacing: -.01em; }
.section-head .desc { color: var(--muted); font-size: 13.5px; margin: 2px 0 0; }
.section-head > div { flex: 1; min-width: 0; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }

.card { background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 18px; min-width: 0; animation: rise var(--dur-gentle) var(--ease-out) both; }
.card.flat { box-shadow: none; border: 1px solid var(--border); }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-head .sub { color: var(--muted); font-size: 13px; }
.card-head > div { flex: 1; min-width: 0; }
.tile { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary-text); }
.tile.ok { background: var(--success-soft); color: var(--success-text); }
.tile.bad { background: var(--danger-soft); color: var(--danger-text); }
.tile.warn { background: var(--warning-soft); color: var(--warning-text); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); min-width: 0; }
.list > li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.list .meta { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.empty { text-align: center; padding: 36px 16px; }
.empty .blob { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 22px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); }
.empty h3 { margin: 0 0 4px; font-size: 16px; }
.empty p { margin: 0 auto 14px; color: var(--muted); max-width: 420px; }
.empty-line { color: var(--muted); font-size: 13.5px; padding: 8px 0; }

/* ---- pills, dots, bars ---- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 650; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--success-soft); color: var(--success-text); }
.pill.bad { background: var(--danger-soft); color: var(--danger-text); }
.pill.warn { background: var(--warning-soft); color: var(--warning-text); }
.pill.brand { background: var(--primary-soft); color: var(--primary-text); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--subtle); flex: none; display: inline-block; }
.dot.ok { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.dot.bad { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); animation: pulse 1.8s var(--ease-out) infinite; }
.dot.warn { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 45%, transparent); } 100% { box-shadow: 0 0 0 9px transparent; } }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 750; background: var(--danger); color: #fff; }
.beats { display: flex; gap: 2px; align-items: flex-end; height: 18px; }
.beats i { width: 4px; height: 100%; border-radius: 2px; background: var(--success); opacity: .85; }
.beats i.down { background: var(--danger); }
.beats i.pending { background: var(--warning); }
.beats i.maintenance, .beats i.unknown { background: var(--surface-3); }
.bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; display: flex; }
.bar > span { display: block; height: 100%; background: var(--primary); transition: width var(--dur-gentle) var(--ease-out); }
.bar > span.steal { background: var(--warning); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 120px), 1fr)); gap: 10px 14px; margin: 12px 0; }
.fact small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.fact b { font-size: 15px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* ---- hero ---- */
.hero { position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 24px; color: #fff; box-shadow: var(--shadow-md); background: linear-gradient(135deg, #7a6cff 0%, #6d5efc 45%, #5141e6 100%); animation: rise var(--dur-gentle) var(--ease-out); }
.hero.ok { background: linear-gradient(135deg, #22b45e 0%, #15a34a 50%, #0f8a3e 100%); }
.hero.bad { background: linear-gradient(135deg, #f0646a 0%, #e5484d 50%, #c9353a 100%); }
.hero.warn { background: linear-gradient(135deg, #f3a633 0%, #e8930c 55%, #c97a05 100%); }
.hero::after { content: ''; position: absolute; width: 260px; height: 260px; right: -80px; top: -120px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.hero h2 { margin: 0; font-size: 24px; letter-spacing: -.02em; font-weight: 750; position: relative; }
.hero p { margin: 6px 0 0; opacity: .92; position: relative; max-width: 640px; }
.hero ul { margin: 12px 0 0; padding: 0; list-style: none; position: relative; display: grid; gap: 6px; }
.hero li { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; font-size: 14px; }
.hero li svg { flex: none; margin-top: 2px; }
.hero .greet { font-size: 13px; font-weight: 650; opacity: .85; margin-bottom: 4px; position: relative; }
@media (max-width: 767px) { .hero { padding: 18px; } .hero h2 { font-size: 20px; } }

/* ---- nodes ---- */
.node-card .problems { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.node-card .problems li { display: flex; gap: 6px; color: var(--danger-text); font-size: 13px; }
.node-card .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.node-card .drained { margin-top: 10px; padding: 10px 12px; border-radius: var(--r); background: var(--warning-soft); color: var(--warning-text); font-size: 13.5px; }
.job { margin-top: 10px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); font-size: 13px; }
.job ol { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
@media (max-width: 767px) { .node-card .actions .btn { flex: 1 1 calc(50% - 8px); } }

/* ---- runbooks ---- */
.doc { line-height: 1.65; }
.doc h2 { font-size: 19px; margin: 26px 0 8px; letter-spacing: -.01em; }
.doc h3 { font-size: 16px; margin: 20px 0 6px; }
.doc h4, .doc h5, .doc h6 { font-size: 15px; margin: 16px 0 4px; }
.doc p, .doc ul, .doc ol { margin: 0 0 12px; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin: 4px 0; }
.doc pre { background: #1c1a17; color: #f3efe8; padding: 12px 14px; border-radius: var(--r); overflow-x: auto; font-size: 12.5px; line-height: 1.5; margin: 8px 0 14px; max-width: 100%; }
.doc pre code { font-size: inherit; }
.doc :not(pre) > code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
.doc .table { overflow-x: auto; margin: 0 0 14px; }
.doc table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.doc th, .doc td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.doc th { font-weight: 700; background: var(--surface-2); }
.doc blockquote { margin: 0 0 12px; padding: 8px 14px; border-left: 3px solid var(--primary); background: var(--primary-soft); border-radius: 0 var(--r) var(--r) 0; }
.toc { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.toc a { font-size: 13px; padding: 6px 12px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--text); font-weight: 600; }
.toc a:hover { text-decoration: none; background: var(--surface-3); }
.rb-list a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-sm); color: var(--text); text-decoration: none; transition: transform var(--dur-quick) var(--ease-out), box-shadow var(--dur-quick); }
.rb-list a:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.rb-list .code { font-family: var(--mono); font-size: 12px; color: var(--primary-text); background: var(--primary-soft); padding: 2px 8px; border-radius: 6px; flex: none; }
.rb-list span.t { min-width: 0; font-weight: 600; font-size: 14px; }

/* ---- alerts ---- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline .day { font-size: 12px; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 16px 0 6px; }
.timeline .ev { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-sm); margin-bottom: 6px; }
.timeline .ev .grow { flex: 1; min-width: 0; }
.timeline .ev .title { font-weight: 650; font-size: 14px; overflow-wrap: anywhere; }
.timeline .ev .meta { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.timeline .ev time { color: var(--subtle); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---- unlock chip ---- */
.lockchip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; font-weight: 650; cursor: pointer; color: var(--muted); transition: background var(--dur-quick), transform var(--dur-instant); }
.lockchip:active { transform: scale(.96); }
.lockchip.open { background: var(--success-soft); border-color: transparent; color: var(--success-text); }
@media (max-width: 767px) { .lockchip { height: 40px; } }

/* ---- dialogs: centered on desktop, a bottom sheet on phones ---- */
.scrim { position: fixed; inset: 0; z-index: 50; background: var(--overlay); display: grid; place-items: center; padding: 16px; animation: fade var(--dur-base) var(--ease-out); }
.scrim.closing { animation: fadeout var(--dur-quick) var(--ease-in) forwards; }
.dialog { width: 100%; max-width: 460px; max-height: calc(100dvh - 32px); overflow: auto; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 22px; animation: pop var(--dur-gentle) var(--ease-pop); }
.closing .dialog { animation: popout var(--dur-quick) var(--ease-in) forwards; }
.dialog h2 { margin: 0 0 6px; font-size: 19px; letter-spacing: -.01em; }
.dialog .lead { color: var(--muted); margin: 0 0 16px; }
.dialog .buttons { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.grab { display: none; }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeout { to { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.97); } }
@keyframes popout { to { opacity: 0; transform: translateY(6px) scale(.98); } }
@media (max-width: 767px) {
  .scrim { place-items: end stretch; padding: 0; }
  .dialog { max-width: none; border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 10px 18px calc(18px + var(--safe-b)); max-height: 92dvh; animation: sheet var(--dur-sheet) var(--ease-sheet); }
  .closing .dialog { animation: sheetout var(--dur-gentle) var(--ease-in) forwards; }
  .grab { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: 0 auto 14px; }
  .dialog .buttons { flex-direction: column-reverse; }
  .dialog .buttons .btn { width: 100%; min-height: 48px; }
}
@keyframes sheet { from { transform: translateY(100%); } }
@keyframes sheetout { to { transform: translateY(100%); } }

/* ⓘ popover (desktop) */
.pop { position: fixed; z-index: 60; max-width: min(340px, calc(100vw - 24px)); background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 14px 16px; font-size: 13.5px; animation: pop var(--dur-base) var(--ease-pop); border: 1px solid var(--border); }
.pop h4 { margin: 0 0 4px; font-size: 14px; }
.pop p { margin: 0; color: var(--muted); }

/* ---- toasts ---- */
.toasts { position: fixed; z-index: 70; right: 16px; bottom: 16px; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; background: var(--text); color: var(--bg); padding: 12px 14px; border-radius: var(--r-md); box-shadow: var(--shadow-lg); font-size: 14px; animation: pop var(--dur-gentle) var(--ease-pop); }
.toast.bad { background: var(--danger); color: #fff; }
.toast.ok svg { color: #4ade80; }
.toast.leaving { animation: popout var(--dur-quick) var(--ease-in) forwards; }
@media (max-width: 767px) { .toasts { left: 16px; right: 16px; width: auto; bottom: calc(80px + var(--safe-b)); } }

.skeleton { border-radius: var(--r-md); background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; min-height: 120px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: var(--warning-soft); color: var(--warning-text); font-size: 14px; margin-bottom: 14px; }
.notice.bad { background: var(--danger-soft); color: var(--danger-text); }
.notice.brand { background: var(--primary-soft); color: var(--primary-text); }
.notice svg { flex: none; margin-top: 2px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.codebox { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border-radius: var(--r); padding: 8px 8px 8px 12px; }
.codebox code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 12.5px; }
.table-wrap { overflow-x: auto; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; } }
[hidden] { display: none !important; }
.content { min-width: 0; }
.hero a { color: #fff; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .5); text-underline-offset: 3px; }
.hero a:hover { text-decoration-color: #fff; }
.grow { flex: 1; min-width: 0; }
