/* LudoAPI — shared stylesheet. Dark-only product UI. */
:root {
  --bg: #0a0b12;
  --bg-2: #0e1120;
  --surface: #11152a;
  --surface-2: #161b33;
  --surface-3: #1c2240;
  --border: #222842;
  --border-strong: #2e3558;
  --text: #e8eaf4;
  --text-2: #c3c7da;
  --muted: #959bb5;
  --faint: #6a7091;
  --accent: #7c6cf0;
  --accent-hover: #8e80f6;
  --accent-press: #6a5ae0;
  --accent-soft: rgba(124, 108, 240, 0.14);
  --accent-line: rgba(124, 108, 240, 0.45);
  --lavender: #b3a6ff;
  --ok: #3ecf8e;
  --ok-soft: rgba(62, 207, 142, 0.13);
  --warn: #f5b44a;
  --warn-soft: rgba(245, 180, 74, 0.13);
  --err: #f26d6d;
  --err-soft: rgba(242, 109, 109, 0.13);
  --info: #6cb6f0;
  --info-soft: rgba(108, 182, 240, 0.13);

  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;
  --r-xl: 16px;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;

  --shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.6);
  --ring: 0 0 0 3px rgba(124, 108, 240, 0.45);
  --container: 1200px;
  --gutter: 16px;
  color-scheme: dark;
}
@media (min-width: 768px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--lavender); text-decoration: none; }
a:hover { color: #cdc4ff; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.02em; font-weight: 650; }
p { margin: 0; }
code, pre, kbd, .mono { font-family: var(--mono); font-size: 0.88em; }
code, pre, kbd, .mono, .input-mono, .path { font-variant-ligatures: none; font-feature-settings: "calt" 0, "liga" 0; }
::selection { background: rgba(124, 108, 240, 0.4); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -40px; z-index: 100; background: var(--accent); color: #fff; padding: 8px 12px; border-radius: var(--r); }
.skip-link:focus { top: 8px; color: #fff; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.container-narrow { max-width: 820px; }
.section { padding: var(--s8) 0; }
@media (min-width: 900px) { .section { padding: var(--s9) 0; } }
.divider { border: 0; border-top: 1px solid var(--border); margin: 0; }
.stack > * + * { margin-top: var(--s4); }
.row { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.grid { display: grid; gap: var(--s4); }
.grid-2 { display: grid; gap: var(--s4); grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: var(--s3); grid-template-columns: 1fr; }
.grid-4 { display: grid; gap: var(--s3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Typography helpers ---------- */
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--lavender); }
.display { font-size: clamp(38px, 7vw, 64px); line-height: 1.05; letter-spacing: -0.035em; font-weight: 700; }
.h1 { font-size: clamp(28px, 4.5vw, 40px); letter-spacing: -0.03em; }
.h2 { font-size: clamp(22px, 3vw, 28px); }
.h3 { font-size: 18px; letter-spacing: -0.01em; }
.hl { color: var(--lavender); }
.lead { font-size: clamp(15px, 1.6vw, 17px); color: var(--text-2); line-height: 1.7; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.ok-text { color: var(--ok); } .err-text { color: var(--err); } .warn-text { color: var(--warn); }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }
.section-head { max-width: 680px; margin-bottom: var(--s6); }
.section-head .eyebrow { margin-bottom: var(--s3); display: block; }
.section-head .lead { margin-top: var(--s3); }

/* ---------- Logo ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; font-size: 18px; letter-spacing: -0.02em; }
.brand:hover { color: var(--text); }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand .tld { color: var(--faint); font-weight: 500; }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(10, 11, 18, 0.82); backdrop-filter: saturate(140%) blur(12px); -webkit-backdrop-filter: saturate(140%) blur(12px); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: var(--s4); }
.nav-links { display: none; align-items: center; gap: var(--s1); }
.nav-links a:not(.btn) { color: var(--text-2); font-size: 14px; padding: 8px 12px; border-radius: var(--r); }
.nav-links a:not(.btn):hover, .nav-links a:not(.btn)[aria-current="page"] { color: var(--text); background: var(--surface); }
.nav-links .btn { margin-left: var(--s2); }
.nav .nav-toggle { display: inline-flex; }
.nav-mobile { display: none; border-top: 1px solid var(--border); padding: var(--s3) 0 var(--s4); }
.nav-mobile.open { display: block; }
.nav-mobile a:not(.btn) { display: block; padding: 10px 4px; color: var(--text-2); border-bottom: 1px solid var(--border); }
.nav-mobile .row { margin-top: var(--s4); }
.nav-mobile .btn { flex: 1; }
@media (min-width: 860px) {
  .nav-links { display: flex; }
  .nav .nav-toggle { display: none; }
  .nav-mobile, .nav-mobile.open { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  -webkit-appearance: none; appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--r); border: 1px solid transparent; font: inherit; font-size: 14px; font-weight: 550;
  cursor: pointer; white-space: nowrap; text-decoration: none; transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
  line-height: 1;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 20px -8px rgba(124, 108, 240, 0.7), inset 0 1px 0 rgba(255,255,255,0.12); }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-primary:active { background: var(--accent-press); }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-3); color: var(--text); border-color: #3a4270; }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface); color: var(--text); }
.btn-danger { background: var(--err-soft); color: var(--err); border-color: rgba(242, 109, 109, 0.35); }
.btn-danger:hover { background: rgba(242, 109, 109, 0.22); color: #ff8c8c; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn-lg { height: 46px; padding: 0 20px; font-size: 15px; }
.btn-icon { width: 40px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; pointer-events: none; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--lavender); cursor: pointer; }
.link-btn:hover { color: #cdc4ff; }
.link-btn[disabled] { color: var(--faint); cursor: not-allowed; }

/* ---------- Cards ---------- */
.card { background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s5); }
.card-flat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s5); }
.card-sm { padding: var(--s4); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); flex-wrap: wrap; }
.card-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.card + .card { margin-top: var(--s4); }

/* ---------- Badges / tags ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 550; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.9; }
.badge.plain::before { display: none; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-err { background: var(--err-soft); color: var(--err); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-accent { background: var(--accent-soft); color: var(--lavender); }
.method { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 5px; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; background: var(--accent-soft); color: var(--lavender); border: 1px solid rgba(124,108,240,0.25); }
.method-get { background: var(--ok-soft); color: var(--ok); border-color: rgba(62,207,142,0.25); }
.path { font-family: var(--mono); font-size: 13px; color: var(--text-2); word-break: break-all; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.chip svg { width: 15px; height: 15px; color: var(--lavender); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field { margin-top: var(--s4); }
.label { font-size: 13px; font-weight: 550; color: var(--text-2); }
.label .opt { color: var(--faint); font-weight: 400; }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 12px; background: var(--bg-2); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: var(--r); font: inherit; font-size: 14.5px; transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23959bb5' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input-sm, .select-sm { height: 34px; font-size: 13.5px; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { border-color: #3a4270; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--err); }
.input[readonly] { background: var(--surface); color: var(--text-2); }
.input-mono { font-family: var(--mono); font-size: 13.5px; }
.input-group { display: flex; gap: var(--s2); }
.input-group .input { flex: 1; min-width: 0; }
.input-prefix { position: relative; }
.input-prefix > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14.5px; pointer-events: none; }
.input-prefix .input { padding-left: 46px; }
.input-prefix.rupee .input { padding-left: 28px; }
.hint { font-size: 12.5px; color: var(--faint); }
.field-error { font-size: 12.5px; color: var(--err); min-height: 0; }
.field-error:empty { display: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; color: var(--text-2); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 36px; height: 20px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-strong); position: relative; transition: background 0.15s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform 0.15s, background 0.15s; }
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); background: #fff; }
.switch input:focus-visible + .track { box-shadow: var(--ring); }
.form-actions { display: flex; gap: var(--s2); justify-content: flex-end; margin-top: var(--s5); flex-wrap: wrap; }

/* ---------- Segmented / tabs ---------- */
.tabs { display: flex; gap: 2px; padding: 3px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 1; -webkit-appearance: none; appearance: none; background: none; border: 0; color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 550; padding: 8px 12px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 1px 2px rgba(0,0,0,0.3); }
.term-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); max-width: 680px; }
@media (min-width: 560px) { .term-picker { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.term-opt { -webkit-appearance: none; appearance: none; background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); border-radius: var(--r); padding: 10px 8px; font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: border-color .15s, background .15s; }
.term-opt strong { font-size: 14px; font-weight: 600; }
.term-opt span { font-size: 12px; color: var(--muted); }
.term-opt:hover { border-color: #3a4270; }
.term-opt[aria-checked="true"] { background: var(--accent-soft); border-color: var(--accent); }
.term-opt[aria-checked="true"] span { color: var(--lavender); }

/* ---------- Tables ---------- */
.table-wrap { position: relative; width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--bg-2); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: rgba(255, 255, 255, 0.015); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.mono, .table td .mono { font-size: 12.5px; }
.table tr.clickable { cursor: pointer; }
.table .input, .table .select { height: 34px; font-size: 13px; min-width: 80px; }
.table-empty td { text-align: center; padding: var(--s7) var(--s4) !important; color: var(--muted); }
.empty { text-align: center; padding: var(--s7) var(--s4); color: var(--muted); }
.empty svg { width: 32px; height: 32px; margin: 0 auto var(--s3); color: var(--faint); }
.empty strong { display: block; color: var(--text); font-weight: 600; margin-bottom: 4px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: var(--s3); flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.filters { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s3); }
.filters .input, .filters .select { width: auto; min-width: 150px; flex: 1 1 150px; max-width: 260px; }

/* ---------- Skeleton ---------- */
.skel { display: block; height: 12px; border-radius: 4px; background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s ease-in-out infinite; }
.skel-lg { height: 26px; width: 60%; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel, .btn.loading::after { animation: none; } html { scroll-behavior: auto; } }

/* ---------- Notices ---------- */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--border-strong); background: var(--surface); font-size: 13.5px; color: var(--text-2); }
.notice svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.notice-info { border-color: rgba(108,182,240,0.3); background: var(--info-soft); }
.notice-info svg { color: var(--info); }
.notice-warn { border-color: rgba(245,180,74,0.3); background: var(--warn-soft); }
.notice-warn svg { color: var(--warn); }
.notice-err { border-color: rgba(242,109,109,0.3); background: var(--err-soft); }
.notice-err svg { color: var(--err); }
.notice-ok { border-color: rgba(62,207,142,0.3); background: var(--ok-soft); }
.notice-ok svg { color: var(--ok); }

/* ---------- Code ---------- */
.code { position: relative; background: #080a12; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.code pre { margin: 0; padding: var(--s4); overflow-x: auto; font-size: 12.8px; line-height: 1.65; color: #d4d7e8; tab-size: 2; }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: 0 var(--s2) 0 var(--s3); border-bottom: 1px solid var(--border); background: var(--bg-2); min-height: 42px; }
.code-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.code-tabs::-webkit-scrollbar { display: none; }
.code-tab { -webkit-appearance: none; appearance: none; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 550; padding: 11px 10px 9px; cursor: pointer; white-space: nowrap; }
.code-tab:hover { color: var(--text); }
.code-tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.code-label { font-size: 12px; color: var(--muted); font-weight: 550; }
.copy-btn { flex: none; }
.tok-k { color: #c3a6ff; } .tok-s { color: #9fe0b8; } .tok-n { color: #f5c07a; } .tok-c { color: #6a7091; } .tok-p { color: #8fc6ff; }
.inline-code { font-family: var(--mono); font-size: 0.86em; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 5px; color: var(--text); }

/* ---------- Toast ---------- */
.toasts { position: fixed; z-index: 200; bottom: 16px; left: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (min-width: 600px) { .toasts { left: auto; right: 24px; bottom: 24px; align-items: flex-end; } }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; max-width: 420px; width: 100%; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border-strong); border-left: 3px solid var(--accent); border-radius: var(--r); box-shadow: var(--shadow); font-size: 13.5px; color: var(--text); animation: toast-in 0.2s ease-out; }
@media (min-width: 600px) { .toast { width: auto; min-width: 260px; } }
.toast.ok { border-left-color: var(--ok); } .toast.err { border-left-color: var(--err); } .toast.warn { border-left-color: var(--warn); }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Modal (native <dialog>) ---------- */
dialog.modal { border: 1px solid var(--border-strong); border-radius: var(--r-xl); background: var(--surface); color: var(--text); padding: 0; width: calc(100% - 32px); max-width: 440px; box-shadow: 0 30px 80px -20px rgba(0,0,0,0.8); }
dialog.modal::backdrop { background: rgba(5, 6, 12, 0.72); backdrop-filter: blur(3px); }
.modal-body { padding: var(--s5); }
.modal-body h2 { font-size: 18px; margin-bottom: 6px; }
.modal-body > p { color: var(--muted); font-size: 14px; margin-bottom: var(--s4); }
.modal-foot { display: flex; justify-content: flex-end; gap: var(--s2); padding: var(--s4) var(--s5); border-top: 1px solid var(--border); background: var(--bg-2); border-radius: 0 0 var(--r-xl) var(--r-xl); }

/* ---------- Drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(5, 6, 12, 0.6); }
.drawer { position: fixed; z-index: 91; top: 0; right: 0; bottom: 0; width: 100%; max-width: 520px; background: var(--bg-2); border-left: 1px solid var(--border-strong); display: flex; flex-direction: column; box-shadow: var(--shadow); animation: drawer-in .2s ease-out; }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--border); }
.drawer-body { flex: 1; overflow-y: auto; padding: var(--s5); }
.drawer-body .card-flat + .card-flat { margin-top: var(--s4); }

/* ---------- Key/value lists ---------- */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px var(--s4); font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; color: var(--text); word-break: break-word; }
.kv-rows > div { display: flex; justify-content: space-between; gap: var(--s3); padding: 11px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.kv-rows > div:first-child { border-top: 0; }
.kv-rows span:first-child { color: var(--muted); }

/* ---------- Stats ---------- */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s4) var(--s4); min-width: 0; }
@media (min-width: 720px) { .stat { padding: var(--s5); } }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 550; display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: clamp(20px, 3vw, 28px); font-weight: 650; letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-sub { font-size: 12.5px; color: var(--faint); margin-top: 2px; }

/* ---------- App shell (dashboard / admin / docs) ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { position: fixed; z-index: 60; inset: 0 auto 0 0; width: 260px; background: var(--bg-2); border-right: 1px solid var(--border); display: flex; flex-direction: column; transform: translateX(-100%); transition: transform 0.2s ease; }
.sidebar.open { transform: none; box-shadow: var(--shadow); }
.sidebar-head { height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 var(--s4); border-bottom: 1px solid var(--border); flex: none; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: var(--s3); }
.sidebar-group { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); padding: var(--s4) 10px 6px; }
.side-link { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: var(--r); color: var(--text-2); font: inherit; font-size: 14px; font-weight: 500; background: none; border: 0; cursor: pointer; text-align: left; }
.side-link svg { width: 17px; height: 17px; color: var(--faint); flex: none; }
.side-link:hover { background: var(--surface); color: var(--text); }
.side-link[aria-current="page"], .side-link.active { background: var(--accent-soft); color: var(--text); }
.side-link[aria-current="page"] svg, .side-link.active svg { color: var(--lavender); }
.sidebar-foot { padding: var(--s3); border-top: 1px solid var(--border); flex: none; }
.user-pill { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r); min-width: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--lavender); display: grid; place-items: center; font-weight: 650; font-size: 13px; flex: none; text-transform: uppercase; }
.user-pill .meta { min-width: 0; }
.user-pill .meta div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.scrim { position: fixed; inset: 0; z-index: 55; background: rgba(5, 6, 12, 0.6); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 40; height: 64px; display: flex; align-items: center; gap: var(--s3); padding: 0 var(--gutter); background: rgba(10, 11, 18, 0.85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar-title { font-weight: 600; font-size: 15px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.content { padding: var(--s5) var(--gutter) var(--s8); width: 100%; max-width: 1160px; }
.page-head { margin-bottom: var(--s5); }
.page-head h1 { font-size: 24px; }
.page-head p { color: var(--muted); margin-top: 4px; font-size: 14px; }
.menu-btn { display: inline-flex; }
@media (min-width: 1024px) {
  .sidebar { position: sticky; top: 0; height: 100vh; transform: none; box-shadow: none; flex: none; }
  .sidebar .close-btn, .menu-btn, .scrim { display: none !important; }
  .content { padding-top: var(--s6); }
}

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: var(--s7) var(--gutter); }
.auth-card { width: 100%; max-width: 440px; }
.auth-card .card { padding: var(--s6) var(--s5); }
@media (min-width: 560px) { .auth-card .card { padding: var(--s6); } }
.auth-card h1 { font-size: 24px; }
.auth-card .sub { color: var(--muted); margin-top: 6px; font-size: 14px; }
.auth-foot { text-align: center; margin-top: var(--s4); font-size: 14px; color: var(--muted); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: var(--s6) 0; margin-top: auto; }
.footer-inner { display: flex; flex-direction: column; gap: var(--s4); }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); font-size: 13.5px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }
@media (min-width: 760px) { .footer-inner { flex-direction: row; align-items: center; justify-content: space-between; } }

/* ---------- Prose (legal / docs text) ---------- */
.prose { color: var(--text-2); font-size: 15px; line-height: 1.75; }
.prose h2 { font-size: 20px; color: var(--text); margin: var(--s7) 0 var(--s3); scroll-margin-top: 84px; }
.prose h3 { font-size: 16px; color: var(--text); margin: var(--s5) 0 var(--s2); }
.prose p, .prose ul, .prose ol { margin: 0 0 var(--s4); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 6px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose code { font-family: var(--mono); font-size: 0.86em; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 5px; color: var(--text); }
.placeholder { background: var(--warn-soft); color: var(--warn); padding: 0 4px; border-radius: 4px; font-weight: 550; }

/* Programmatic focus targets (skip link, section switch) should not draw a ring. */
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; box-shadow: none; }
