/* HashRelay design system — dark-first, with a light theme via prefers-color-scheme or [data-theme]. */
:root {
  --bg: #090c13;
  --bg-2: #0d111b;
  --surface: #121826;
  --surface-2: #182033;
  --surface-3: #1f2a42;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e9edf5;
  --text-2: #aab3c6;
  --muted: #6f7b94;
  --accent: #7c6cff;
  --accent-2: #22d3ee;
  --accent-ink: #ffffff;
  --accent-soft: rgba(124, 108, 255, 0.16);
  --glow: rgba(124, 108, 255, 0.45);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.14);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.14);
  --danger: #fb7185;
  --danger-soft: rgba(251, 113, 133, 0.14);
  --code-bg: #0b0f18;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 40px -12px rgba(0, 0, 0, 0.6);
  --radius: 14px;
  --radius-sm: 9px;
  --radius-xs: 6px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --nav-h: 64px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f7fb;
    --bg-2: #ffffff;
    --surface: #ffffff;
    --surface-2: #f1f3f9;
    --surface-3: #e7eaf3;
    --border: rgba(15, 23, 42, 0.08);
    --border-strong: rgba(15, 23, 42, 0.16);
    --text: #0f172a;
    --text-2: #475569;
    --muted: #64748b;
    --accent: #6a5bff;
    --accent-2: #0891b2;
    --accent-soft: rgba(106, 91, 255, 0.12);
    --glow: rgba(106, 91, 255, 0.3);
    --code-bg: #0f172a;
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 12px 40px -16px rgba(15, 23, 42, 0.18);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f6f7fb; --bg-2: #ffffff; --surface: #ffffff; --surface-2: #f1f3f9; --surface-3: #e7eaf3;
  --border: rgba(15, 23, 42, 0.08); --border-strong: rgba(15, 23, 42, 0.16);
  --text: #0f172a; --text-2: #475569; --muted: #64748b; --accent: #6a5bff; --accent-2: #0891b2;
  --accent-soft: rgba(106, 91, 255, 0.12); --glow: rgba(106, 91, 255, 0.3); --code-bg: #0f172a;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 12px 40px -16px rgba(15, 23, 42, 0.18); color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  display: flex; flex-direction: column;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(124, 108, 255, 0.18), transparent 60%),
    radial-gradient(700px 400px at 90% 0%, rgba(34, 211, 238, 0.12), transparent 60%);
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.15; letter-spacing: -0.015em; font-weight: 650; }
h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1rem; color: var(--text-2); }
code, kbd, pre { font-family: var(--mono); font-size: .9em; }
code { background: var(--surface-2); border: 1px solid var(--border); padding: .1em .4em; border-radius: var(--radius-xs); color: var(--text); }
pre { margin: 0; overflow: auto; }
pre code { background: none; border: 0; padding: 0; font-size: 13px; line-height: 1.6; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
img, svg { display: inline-block; vertical-align: middle; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 760px; }
main { flex: 1; }

/* ---------- Top navigation ---------- */
.nav { position: sticky; top: 0; z-index: 50; height: var(--nav-h); backdrop-filter: saturate(140%) blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom: 1px solid var(--border); }
.nav .container { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; letter-spacing: -0.02em; font-size: 1.05rem; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; color: #fff; font-weight: 800; font-family: var(--mono); box-shadow: 0 6px 18px -6px var(--glow); }
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav-links a, .nav-links button.linklike { color: var(--text-2); padding: 8px 12px; border-radius: 8px; font-weight: 500; background: none; border: 0; cursor: pointer; }
.nav-links a:hover, .nav-links button.linklike:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-links a.active { color: var(--text); }
.nav-links a.btn-primary { color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--accent-2))); padding: 0 14px; border-radius: 9px; }
.nav-links a.btn-primary:hover { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--accent-2))); filter: brightness(1.08); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px;
  font-weight: 600; font-size: .95rem; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  cursor: pointer; transition: transform .12s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease; white-space: nowrap; text-decoration: none; }
.btn:hover { text-decoration: none; background: var(--surface-3); border-color: var(--border-strong); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--accent-2))); border-color: transparent; color: var(--accent-ink);
  box-shadow: 0 10px 24px -10px var(--glow); }
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 14px 30px -10px var(--glow); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: var(--danger-soft); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 24%, transparent); }
.btn-sm { height: 32px; padding: 0 12px; font-size: .85rem; border-radius: 8px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 1.02rem; border-radius: 12px; }
.btn-block { width: 100%; }
.btn .icon { width: 18px; height: 18px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: .88rem; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: .8rem; color: var(--muted); margin: 0; }
.input, select.input, textarea.input { height: 42px; width: 100%; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--bg-2); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; padding: 10px 12px; min-height: 96px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input::placeholder { color: var(--muted); }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text); font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.error-text { color: var(--danger); font-size: .85rem; margin: 4px 0 0; }
.alert { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); margin-bottom: 16px; color: var(--text); }
.alert-danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.alert-success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 35%, transparent); }
.alert-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }

/* ---------- Cards, tables, badges ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 22px; }
.card-header { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.card-header h3 { margin: 0; }
.card-header .spacer { flex: 1; }
.card + .card { margin-top: 18px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: .78rem; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; }
.badge-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.dot.pulse { box-shadow: 0 0 0 0 currentColor; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 60%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 6px; font-family: var(--mono); font-size: .78rem;
  background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.tags { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.tag .x { margin-left: 4px; opacity: .7; background: none; border: 0; cursor: pointer; color: inherit; padding: 0 2px; font-size: .9rem; line-height: 1; }
.tag .x:hover { opacity: 1; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); }
.text-right { text-align: right; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .icon { width: 44px; height: 44px; color: var(--muted); margin-bottom: 10px; opacity: .8; }
.empty h3 { color: var(--text); }
.kbd { font-family: var(--mono); font-size: .8rem; background: var(--surface-2); border: 1px solid var(--border-strong); border-bottom-width: 2px; padding: 1px 6px; border-radius: 6px; }

/* ---------- Code blocks ---------- */
.code { position: relative; background: var(--code-bg); color: #e6edf3; border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius-sm); padding: 14px 16px; overflow: auto; }
.code .copy { position: absolute; top: 8px; right: 8px; height: 28px; padding: 0 10px; border-radius: 7px; font-size: .78rem; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); color: #e6edf3; cursor: pointer; }
.code .copy:hover { background: rgba(255,255,255,.14); }
.code .copy.done { color: #34d399; }
.code .prompt { color: #6f7b94; user-select: none; }
.code .cmd { color: #c4b5fd; }
.code .str { color: #86efac; }
.code .tag-tok { color: #67e8f9; }
.code .cm { color: #6f7b94; font-style: italic; }
.code-title { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.secret-box { display: flex; gap: 8px; align-items: center; background: var(--code-bg); border: 1px solid rgba(255,255,255,.1); border-radius: 10px; padding: 10px 12px; color: #e6edf3; }
.secret-box code { flex: 1; background: none; border: 0; padding: 0; word-break: break-all; color: #e6edf3; font-size: .9rem; }

/* ---------- Hero / marketing ---------- */
.hero { padding: 84px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } .hero { padding: 48px 0 32px; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 600; letter-spacing: .04em; color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent-2) 30%, transparent); padding: 4px 10px; border-radius: 999px; margin-bottom: 18px; }
.gradient-text { background: linear-gradient(90deg, #c4b5fd, var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.15rem; max-width: 560px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.hero-meta { margin-top: 18px; color: var(--muted); font-size: .85rem; }
.demo { position: relative; }
.terminal { background: #0b0f18; border: 1px solid rgba(255,255,255,.1); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.terminal-bar { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.06); background: rgba(255,255,255,.02); }
.terminal-bar span { width: 10px; height: 10px; border-radius: 50%; background: #2b3245; }
.terminal-bar span:nth-child(1) { background: #fb7185; } .terminal-bar span:nth-child(2) { background: #fbbf24; } .terminal-bar span:nth-child(3) { background: #34d399; }
.terminal pre { padding: 16px 18px; color: #e6edf3; font-size: 13px; }
.toast-demo { position: absolute; right: -8px; bottom: -36px; width: 340px; background: #1c1c1c; color: #fff; border-radius: 10px; padding: 14px 16px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.08);
  display: grid; grid-template-columns: 36px 1fr; gap: 12px; animation: float-in .9s cubic-bezier(.2,.8,.2,1) .4s both; }
@media (max-width: 900px) { .toast-demo { position: static; width: 100%; margin-top: 16px; } }
@keyframes float-in { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
.toast-demo .app { width: 36px; height: 36px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: grid; place-items: center; font-family: var(--mono); font-weight: 800; }
.toast-demo .t { font-weight: 600; font-size: .95rem; }
.toast-demo .b { color: #c9c9c9; font-size: .88rem; }
.toast-demo .a { color: #9a9a9a; font-size: .78rem; margin-top: 6px; }
.section { padding: 56px 0; }
.section-title { text-align: center; max-width: 640px; margin: 0 auto 36px; }
.section-title p { font-size: 1.05rem; }
.feature { padding: 22px; }
.feature .icon { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 14px; }
.feature .icon svg { width: 22px; height: 22px; }
.feature h3 { font-size: 1.02rem; }
.feature p { margin: 0; font-size: .92rem; }
.step { display: grid; grid-template-columns: 40px 1fr; gap: 14px; }
.step .n { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border-strong); display: grid; place-items: center; font-weight: 700; font-family: var(--mono); color: var(--accent); }
.cta { text-align: center; padding: 56px 24px; border-radius: 20px; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 14%, var(--surface)), var(--surface)); border: 1px solid var(--border); }
footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--muted); font-size: .85rem; margin-top: 40px; }
footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer a { color: var(--text-2); }

/* ---------- Auth ---------- */
.auth { display: grid; place-items: center; padding: 56px 20px; }
.auth .card { width: 100%; max-width: 440px; }
.auth h1 { font-size: 1.7rem; margin-bottom: 4px; }
.auth .sub { margin-bottom: 22px; }
.auth .alt { text-align: center; margin: 18px 0 0; font-size: .9rem; }

/* ---------- Dashboard ---------- */
.dash { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; padding-top: 28px; padding-bottom: 48px; align-items: start; }
.dash > main, .dash > section { min-width: 0; }
@media (max-width: 900px) { .dash { grid-template-columns: 1fr; } .sidebar { position: static; } }
.sidebar { position: sticky; top: calc(var(--nav-h) + 24px); }
.ws { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.ws .label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.ws select { width: 100%; height: 36px; border-radius: 8px; padding: 0 8px; background: var(--bg-2); border: 1px solid var(--border-strong); color: var(--text); }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; color: var(--text-2); font-weight: 500; }
.side-nav a svg { width: 18px; height: 18px; opacity: .8; }
.side-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.side-nav a.active { background: var(--accent-soft); color: var(--text); }
.side-nav a.active svg { color: var(--accent); opacity: 1; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.7rem; margin: 0; }
.page-head p { margin: 4px 0 0; }
.page-head .spacer { flex: 1; }
.stat { padding: 18px 20px; }
.stat .k { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.stat .v { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .s { font-size: .82rem; color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: 0; }
.timeline .t { font-weight: 600; }
.timeline .b { color: var(--text-2); font-size: .9rem; }
.timeline time { color: var(--muted); font-size: .82rem; white-space: nowrap; }

/* ---------- Modal ---------- */
dialog.modal { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: 16px; padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow); }
dialog.modal::backdrop { background: rgba(0,0,0,.55); backdrop-filter: blur(4px); }
dialog.modal .card-body { padding: 24px; }
dialog.modal h3 { margin-bottom: 4px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* ---------- Docs ---------- */
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; padding-top: 36px; padding-bottom: 64px; }
.docs-body { min-width: 0; } /* let wide code blocks scroll instead of widening the column */
.docs-body table { width: 100%; }
@media (max-width: 900px) { .docs { grid-template-columns: minmax(0, 1fr); } .docs-nav { position: static; } }
.docs-nav { position: sticky; top: calc(var(--nav-h) + 24px); display: flex; flex-direction: column; gap: 2px; font-size: .92rem; }
.docs-nav a { color: var(--text-2); padding: 6px 10px; border-radius: 7px; }
.docs-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.docs-body h2 { margin-top: 44px; padding-top: 8px; }
.docs-body h2:first-child { margin-top: 0; }
.docs-body h3 { margin-top: 28px; }
.docs-body .code { margin: 12px 0 18px; }
.docs-body table { margin: 10px 0 18px; }
.endpoint { display: flex; align-items: center; gap: 10px; margin-top: 22px; }
.method { font-family: var(--mono); font-size: .75rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.method.get { background: var(--success-soft); color: var(--success); }
.method.del { background: var(--danger-soft); color: var(--danger); }
.endpoint code { font-size: .95rem; background: none; border: 0; padding: 0; }

/* ---------- Downloads ---------- */
.dl { display: grid; grid-template-columns: 56px 1fr auto; gap: 18px; align-items: center; padding: 22px; }
@media (max-width: 600px) { .dl { grid-template-columns: 1fr; } }
.dl .icon { width: 56px; height: 56px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.dl .icon svg { width: 28px; height: 28px; }
.dl h3 { margin-bottom: 2px; }
.dl p { margin: 0; font-size: .92rem; }

/* ---------- Pairing ---------- */
.pair-code { font-family: var(--mono); font-size: 2rem; letter-spacing: .12em; font-weight: 700; text-align: center; padding: 14px; border-radius: 12px; background: var(--bg-2); border: 1px dashed var(--border-strong); }
.device-card { display: grid; grid-template-columns: 48px 1fr; gap: 14px; align-items: center; padding: 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.device-card .icon { width: 48px; height: 48px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.device-card .icon svg { width: 24px; height: 24px; }

.toasted { position: fixed; bottom: 20px; right: 20px; background: var(--surface-3); border: 1px solid var(--border-strong); border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow); z-index: 100; animation: float-in .3s ease both; }
.fade-in { animation: fade .4s ease both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Notification detail (/n/{id}) ---------- */
.container.narrow { max-width: 860px; }
.crumbs { color: var(--muted); font-size: .85rem; margin-bottom: 14px; display: flex; gap: 8px; }
.crumbs a { color: var(--text-2); }
a.plain { color: inherit; text-decoration: none; }
a.plain:hover { color: var(--accent); }
.notification .card-body { padding: 28px 32px; }
.notification-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.notification-title { font-size: 1.7rem; line-height: 1.2; margin: 0 0 12px; }
.notification .lead { color: var(--text-2); font-size: 1.05rem; }
.notification-image img { max-width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #fff; }
.tags .badge { margin-left: 4px; }
.diagram { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; margin: 16px 0; overflow: auto; text-align: center; }
.diagram pre.mermaid { font-family: var(--mono); font-size: .85rem; white-space: pre-wrap; text-align: left; color: var(--muted); }
.diagram pre.mermaid svg { max-width: 100%; height: auto; }
.md { line-height: 1.65; color: var(--text); }
.md > :first-child { margin-top: 0; }
.md h1, .md h2, .md h3, .md h4 { margin: 1.4em 0 .5em; line-height: 1.25; }
.md h1 { font-size: 1.4rem; } .md h2 { font-size: 1.2rem; } .md h3 { font-size: 1.05rem; }
.md p, .md ul, .md ol, .md blockquote, .md table { margin: 0 0 1em; }
.md ul, .md ol { padding-left: 1.4em; }
.md li + li { margin-top: .25em; }
.md li.task-list-item { list-style: none; margin-left: -1.4em; }
.md blockquote { border-left: 3px solid var(--accent); padding: .2em 1em; color: var(--text-2); }
.md pre { background: var(--code-bg); color: #e6edf3; border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius-sm); padding: 14px 16px; margin: 0 0 1em; overflow: auto; }
.md pre code { font-size: 13px; }
.md table { border-collapse: collapse; width: 100%; font-size: .92rem; }
.md th, .md td { border: 1px solid var(--border); padding: 7px 10px; text-align: left; }
.md th { background: var(--surface-2); }
.md img { max-width: 100%; border-radius: var(--radius-xs); }
.md a { color: var(--accent); }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 1.5em 0; }

/* ---------- Small screens: keep the top bar on one line ---------- */
@media (max-width: 600px) {
  .nav .container { gap: 10px; }
  .nav-links { gap: 0; white-space: nowrap; }
  .nav-links a, .nav-links button.linklike { padding: 8px 8px; font-size: .92rem; }
  .nav-links a.btn-primary { padding: 0 10px; }
  .brand span:not(.logo) { display: none; }
}
