/* Unlock Inner Me — admin dashboard. One stylesheet, no build step: the file you read is
   the file that runs. Tokens first; light is the base, dark overrides via media query and
   the explicit data-theme escape hatch. */

:root {
  --ground: #F3F5F9;
  --surface: #FFFFFF;
  --sunk: #E9EFF7;
  --ink: #101A2B;
  --muted: #54637D;
  --faint: #8593AB;
  --line: #D8E1ED;
  --line-soft: #E5EBF4;
  --accent: #1B57C4;
  --accent-ink: #FFFFFF;
  --accent-soft: #E5EDFB;
  --warn: #8A5A00;
  --warn-soft: #FFF4DB;
  --ok: #1F7A4D;
  --ok-soft: #E2F3EA;
  --danger: #B3261E;
  --danger-soft: #FBE9E7;
  --sidebar: #FBFCFE;
  --shadow: 0 1px 2px rgba(16, 26, 43, .05), 0 8px 24px rgba(16, 26, 43, .06);
  --shadow-pop: 0 4px 12px rgba(16, 26, 43, .12), 0 16px 48px rgba(16, 26, 43, .18);
  --display: "Bricolage Grotesque", "Trebuchet MS", sans-serif;
  --body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0B1119;
    --surface: #131B27;
    --sunk: #1A2432;
    --ink: #E4EBF5;
    --muted: #93A3BC;
    --faint: #64748F;
    --line: #253145;
    --line-soft: #1D2839;
    --accent: #7AACFF;
    --accent-ink: #0B1119;
    --accent-soft: #17263C;
    --warn: #E8C170;
    --warn-soft: #2A2211;
    --ok: #55C88A;
    --ok-soft: #10281C;
    --danger: #F2726B;
    --danger-soft: #331512;
    --sidebar: #0E1520;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
    --shadow-pop: 0 4px 12px rgba(0, 0, 0, .5), 0 16px 48px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  --ground: #0B1119;
  --surface: #131B27;
  --sunk: #1A2432;
  --ink: #E4EBF5;
  --muted: #93A3BC;
  --faint: #64748F;
  --line: #253145;
  --line-soft: #1D2839;
  --accent: #7AACFF;
  --accent-ink: #0B1119;
  --accent-soft: #17263C;
  --warn: #E8C170;
  --warn-soft: #2A2211;
  --ok: #55C88A;
  --ok-soft: #10281C;
  --danger: #F2726B;
  --danger-soft: #331512;
  --sidebar: #0E1520;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
  --shadow-pop: 0 4px 12px rgba(0, 0, 0, .5), 0 16px 48px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
code {
  font-family: var(--mono);
  font-size: .84em;
  background: var(--sunk);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: .08em .38em;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- primitives ---------- */

.btn {
  font: inherit;
  font-weight: 600;
  font-size: .875rem;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  padding: .5rem 1rem;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  transition: filter .12s ease, background .12s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: default; filter: none; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); filter: none; }
.btn.subtle { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn.subtle:hover { border-color: var(--accent); color: var(--accent); filter: none; }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); filter: none; }
.btn.small { font-size: .78rem; padding: .3rem .65rem; border-radius: 6px; }

input[type="email"], input[type="password"], input[type="search"], input[type="text"] {
  padding: .5rem .75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: .9rem;
}
input::placeholder { color: var(--faint); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.15rem 1.3rem;
  box-shadow: var(--shadow);
}
.card > h3:first-child, .card > h2:first-child { margin-top: 0; }

h2.section {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -.01em;
  margin: 2.2rem 0 .9rem;
}
h2.section:first-child { margin-top: 0; }
h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: -.005em;
  margin: 0 0 .7rem;
}
.hint { color: var(--muted); font-size: .85rem; }
.mono { font-family: var(--mono); font-size: .8rem; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: .18rem .6rem;
  border: 1px solid var(--line);
  background: var(--sunk);
  color: var(--muted);
  white-space: nowrap;
}
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.chip.info { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.note {
  background: var(--warn-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  border-radius: 8px;
  padding: .75rem 1rem;
  margin: 1rem 0;
  font-size: .88rem;
}
.note.info { background: var(--accent-soft); border-left-color: var(--accent); }
.note.error { background: var(--danger-soft); border-left-color: var(--danger); }

table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th {
  text-align: left;
  font-family: var(--mono);
  font-weight: 400;
  font-size: .64rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 0 .9rem .5rem 0;
  border-bottom: 1px solid var(--line);
}
td { padding: .6rem .9rem .6rem 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tr:last-child td { border-bottom: none; }
.table-scroll { overflow-x: auto; }
tr.rowlink { cursor: pointer; }
tr.rowlink:hover td { background: var(--accent-soft); }
tr.rowlink td:first-child { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
tr.rowlink td:last-child { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }

.grid { display: grid; gap: .9rem; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(24rem, 100%), 1fr)); }
.grid.stats { grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); }

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .9rem 1rem;
  box-shadow: var(--shadow);
}
.stat .n { font-family: var(--display); font-weight: 700; font-size: 1.7rem; line-height: 1.15; }
.stat .k { color: var(--muted); font-size: .78rem; margin-top: .1rem; }
.stat .sub { color: var(--faint); font-size: .72rem; margin-top: .15rem; }

.kv { display: grid; grid-template-columns: minmax(9rem, 12rem) 1fr; gap: .35rem .9rem; font-size: .875rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- sign-in ---------- */

.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(60rem 40rem at 110% -20%, var(--accent-soft), transparent 60%),
    radial-gradient(50rem 36rem at -20% 120%, var(--accent-soft), transparent 55%),
    var(--ground);
}
.gate-card {
  width: min(26rem, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-pop);
  padding: 2rem 2rem 1.7rem;
}
.gate-brand { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.4rem; }
.gate-brand .mark { font-size: 1.6rem; }
.gate-brand .name { font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
.gate-brand .eyebrow {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted); display: block;
}
.gate h1 { font-family: var(--display); font-weight: 700; font-size: 1.5rem; margin: 0 0 .4rem; letter-spacing: -.015em; }
.gate .env-line { margin: 0 0 1.3rem; font-size: .85rem; color: var(--muted); }
.gate .field { display: grid; gap: .55rem; margin-top: .9rem; }
.gate .field input { width: 100%; }
.gate .divider {
  display: flex; align-items: center; gap: .8rem; margin: 1.2rem 0 .3rem;
  color: var(--faint); font-family: var(--mono); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase;
}
.gate .divider::before, .gate .divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
#google-signin { width: 100%; justify-content: center; padding: .65rem 1rem; }
#email-signin { width: 100%; justify-content: center; }

/* ---------- app frame ---------- */

.frame { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); min-height: 100dvh; }

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  padding: 1.1rem .9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
}
.side-brand { display: flex; align-items: center; gap: .6rem; padding: .25rem .55rem .9rem; }
.side-brand .mark { font-size: 1.35rem; }
.side-brand .name { font-family: var(--display); font-weight: 700; font-size: .98rem; line-height: 1.2; letter-spacing: -.01em; }
.side-brand .eyebrow {
  font-family: var(--mono); font-size: .58rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted); display: block;
}
.env-badge {
  margin: 0 .55rem .9rem;
  font-family: var(--mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase;
  border-radius: 6px; padding: .32rem .55rem; text-align: center;
}
.env-badge.prod { background: var(--warn-soft); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
.env-badge.staging { background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }

.nav-group {
  font-family: var(--mono); font-size: .6rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--faint); padding: 1rem .55rem .35rem;
}
.nav-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .45rem .55rem;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: .875rem;
  border-left: 2px solid transparent;
}
.nav-item svg { width: 16px; height: 16px; flex: none; opacity: .75; }
.nav-item:hover { background: var(--sunk); color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); border-left-color: var(--accent); }
.nav-item.active svg { opacity: 1; }
.nav-item .sub { font-weight: 400; font-size: .78rem; }

.side-foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line-soft); }
.side-user { display: flex; align-items: center; gap: .55rem; padding: .3rem .55rem .6rem; }
.side-user .avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex: none;
}
.side-user .who { font-size: .74rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { padding: 1.4rem clamp(1.1rem, 3vw, 2.4rem) 4rem; min-width: 0; }
.main-inner { max-width: 74rem; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.page-head h1 { font-family: var(--display); font-weight: 700; font-size: 1.6rem; letter-spacing: -.015em; margin: .1rem 0 .2rem; }
.page-head .lede { color: var(--muted); font-size: .9rem; margin: 0; max-width: 58ch; }
.page-head .actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.crumbs { font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.crumbs a { color: var(--accent); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* ---------- loading / empty ---------- */

.skeleton { border-radius: 8px; background: var(--sunk); position: relative; overflow: hidden; min-height: 1rem; }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--surface) 60%, transparent) 50%, transparent 70%);
  animation: shimmer 1.4s infinite;
  transform: translateX(-100%);
}
@keyframes shimmer { to { transform: translateX(100%); } }
.empty { color: var(--faint); font-size: .875rem; padding: 1.2rem 0; text-align: center; }

/* ---------- toasts & modal ---------- */

#toasts { position: fixed; right: 1.2rem; bottom: 1.2rem; display: grid; gap: .5rem; z-index: 60; }
.toast {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--ok);
  border-radius: 10px; box-shadow: var(--shadow-pop); padding: .7rem 1rem; font-size: .875rem;
  max-width: 26rem; animation: toast-in .18s ease;
}
.toast.error { border-left-color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(6, 10, 18, .55);
  display: grid; place-items: center; z-index: 50; padding: 1.2rem;
}
.modal {
  width: min(30rem, 100%); background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-pop); padding: 1.4rem 1.5rem;
}
.modal h3 { margin-top: 0; }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.2rem; }
.lightbox { position: fixed; inset: 0; background: rgba(6, 10, 18, .82); display: grid; place-items: center; z-index: 55; cursor: zoom-out; padding: 2rem; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: var(--shadow-pop); }

/* ---------- overview ---------- */

.bars { display: flex; align-items: flex-end; gap: 3px; height: 72px; }
.bars .bar { flex: 1; background: var(--accent); opacity: .85; border-radius: 3px 3px 0 0; min-height: 2px; }
.bars .bar.zero { background: var(--line); }
.bar-labels { display: flex; justify-content: space-between; color: var(--faint); font-size: .68rem; margin-top: .3rem; font-family: var(--mono); }

/* ---------- users ---------- */

.toolbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar input[type="search"] { flex: 1 1 16rem; max-width: 24rem; }
.filter-chip {
  font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: .28rem .75rem;
}
.filter-chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.user-ident .name { font-weight: 600; }
.user-ident .email { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }

/* ---------- user detail ---------- */

.detail-head { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.1rem; }
.detail-head .avatar {
  width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 1.4rem;
}
.detail-head .titles { min-width: 0; }
.detail-head h1 { font-family: var(--display); font-weight: 700; font-size: 1.45rem; margin: 0; letter-spacing: -.015em; overflow-wrap: anywhere; }
.detail-head .sub { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.uid-chip {
  font-family: var(--mono); font-size: .7rem; color: var(--muted);
  background: var(--sunk); border: 1px solid var(--line-soft); border-radius: 6px;
  padding: .15rem .5rem; cursor: pointer;
}
.uid-chip:hover { color: var(--accent); border-color: var(--accent); }
.badge-row { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .45rem; }

.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  width: 34px; height: 20px; border-radius: 999px; background: var(--line);
  transition: background .15s ease; flex: none;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.25);
  transition: transform .15s ease;
}
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:disabled + .track { opacity: .45; }

.anchor-photo { width: 100%; max-height: 260px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); cursor: zoom-in; }
.thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; }

.weeks-nav { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .4rem; margin-bottom: 1rem; }
.week-pill {
  font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 10px; padding: .45rem .8rem; text-align: left;
}
.week-pill .pct { display: block; font-family: var(--mono); font-size: .64rem; font-weight: 400; margin-top: .1rem; }
.week-pill.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

details.fold { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: .6rem .9rem; margin: .6rem 0; }
details.fold[open] { padding-bottom: .9rem; }
details.fold summary {
  cursor: pointer; font-family: var(--mono); font-size: .7rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent);
}

/* ---------- re-engagement ---------- */

.pipeline { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr)); counter-reset: step; }
.pipe-step { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .8rem .95rem; position: relative; }
.pipe-step::before {
  counter-increment: step; content: counter(step);
  font-family: var(--mono); font-size: .66rem; color: var(--accent);
  background: var(--accent-soft); border-radius: 999px; padding: .1rem .5rem;
  position: absolute; top: .65rem; right: .65rem;
}
.pipe-step .t { font-weight: 600; font-size: .85rem; padding-right: 2rem; }
.pipe-step .d { color: var(--muted); font-size: .78rem; margin-top: .2rem; }

.nudge-card { border-left: 3px solid var(--accent); }
.nudge-card .push {
  background: var(--sunk); border: 1px solid var(--line-soft); border-radius: 10px;
  padding: .65rem .85rem; margin-top: .55rem; font-size: .85rem;
}
.nudge-card .push .pt { font-weight: 700; }

/* ---------- documentation surface ----------
   Documentation is read, not operated, so it keeps the format the standalone admin site
   used before the dashboard existed: 17px on a narrow column, display headings with a
   rule above each section, and squarer cards. Everything here is scoped to `.docsurface`
   — the operational pages stay at their denser scale, because mixing the two makes both
   look accidental (#396). */

.docsurface { max-width: 62rem; font-size: 17px; line-height: 1.6; }
.docsurface.reading { max-width: 52rem; line-height: 1.65; }
.docsurface p { margin: 0 0 1rem; }

.docsurface .crumb {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 1.4rem; display: block; text-decoration: none;
}
.docsurface .crumb:hover { text-decoration: underline; }

.docsurface header { border-bottom: 1px solid var(--line); padding-bottom: 1.8rem; margin-bottom: 2.5rem; }
.docsurface .eyebrow {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 .9rem;
}
.docsurface header h1 {
  font-family: var(--display); font-weight: 700; font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.05; letter-spacing: -.02em; margin: 0 0 .8rem;
}
.docsurface .standfirst { color: var(--muted); max-width: 52ch; margin: 0; }

.docsurface section { margin-top: 3rem; }
.docsurface section > h2 {
  font-family: var(--display); font-weight: 700; font-size: 1.35rem;
  letter-spacing: -.015em; margin: 0 0 1rem; padding: 0; border: none;
}
.docsurface .section-lede { color: var(--muted); max-width: 60ch; margin: -.5rem 0 1.2rem; }

.docsurface .grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); }
.docsurface .card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 5px;
  padding: 1.15rem 1.25rem 1.3rem; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: .5rem;
  text-decoration: none; color: inherit;
  transition: border-color .15s ease, transform .15s ease;
}
.docsurface a.card:hover { border-color: var(--accent); transform: translateY(-1px); }
.docsurface .card .tag {
  font-family: var(--mono); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin: 0;
}
.docsurface .card h3 {
  font-family: var(--display); font-weight: 500; font-size: 1.05rem;
  letter-spacing: -.01em; margin: 0;
}
.docsurface .card p { font-size: .9rem; color: var(--muted); margin: 0; }

.docsurface table { font-size: .95rem; margin: 1.4rem 0; }
.docsurface th { font-size: .68rem; letter-spacing: .1em; padding: 0 1rem .6rem 0; }
.docsurface td { padding: .8rem 1rem .8rem 0; border-bottom: 1px solid var(--line); }
.docsurface .scroller { overflow-x: auto; }

.docsurface .note {
  background: none; border: none; border-left: 2px solid var(--accent); border-radius: 0;
  padding: .1rem 0 .1rem 1.1rem; margin: 1.4rem 0; max-width: 65ch;
  color: var(--muted); font-size: inherit;
}
.docsurface .note strong { color: var(--ink); font-weight: 600; }
.docsurface .warn-card {
  background: var(--warn-soft); border: 1px solid var(--line); border-radius: 4px;
  padding: 1.1rem 1.3rem; max-width: 65ch;
}
.docsurface .warn-card p { margin: 0; }
.docsurface .warn-card strong { color: var(--warn); }

.docsurface footer {
  margin-top: 4rem; padding-top: 1.4rem; border-top: 1px solid var(--line);
  color: var(--muted); font-size: .88rem;
}
.docsurface footer p { margin: 0; max-width: 68ch; }

article.doc h1, article.doc h2, article.doc h3, article.doc h4 {
  font-family: var(--display); letter-spacing: -.015em; line-height: 1.15; text-wrap: balance;
}
article.doc h1 { font-weight: 700; font-size: clamp(2rem, 5vw, 2.9rem); margin: 0 0 1.5rem; }
article.doc h2 { font-weight: 700; font-size: 1.5rem; margin: 3rem 0 .8rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
/* Several docs put a `---` before a heading, which drew two stacked rules. The heading's
   own rule is the section break; the horizontal rule before it is redundant. */
article.doc hr + h2 { border-top: none; padding-top: 0; margin-top: 1.6rem; }
article.doc h3 { font-weight: 500; font-size: 1.15rem; margin: 2rem 0 .6rem; }
article.doc h4 { font-weight: 500; font-size: 1rem; margin: 1.5rem 0 .5rem; }
article.doc p, article.doc li { max-width: 68ch; }
article.doc pre {
  background: var(--sunk); border: 1px solid var(--line); border-radius: 5px;
  padding: 1rem 1.1rem; overflow-x: auto; font-size: .84rem; line-height: 1.55;
}
article.doc pre code { background: none; border: none; padding: 0; font-size: inherit; }
article.doc blockquote { border-left: 2px solid var(--accent); margin: 1.4rem 0; padding: .1rem 0 .1rem 1.1rem; color: var(--muted); }
article.doc blockquote p { margin: .4rem 0; }
article.doc hr { border: none; border-top: 1px solid var(--line); margin: 2.5rem 0; }
article.doc details {
  border: 1px solid var(--line); border-radius: 5px; background: var(--surface);
  padding: .7rem 1rem; margin: 1.2rem 0;
}
article.doc details[open] { padding-bottom: 1rem; }
article.doc summary {
  cursor: pointer; font-family: var(--mono); font-size: .78rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent);
}
article.doc summary:hover { text-decoration: underline; }
article.doc details > *:not(summary) { font-size: .95rem; }
article.doc img { max-width: 100%; }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .frame { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center;
    border-right: none; border-bottom: 1px solid var(--line); gap: .15rem; padding: .7rem .8rem;
  }
  .side-brand { padding: 0 .4rem 0 0; }
  .env-badge { margin: 0 .4rem 0 0; }
  .nav-group { display: none; }
  .nav-item { padding: .35rem .55rem; border-left: none; }
  .nav-item .sub { display: none; }
  .side-foot { margin: 0 0 0 auto; border: none; padding: 0; }
  .side-user { padding: 0 .4rem 0 0; }
  .side-user .who { display: none; }
  .kv { grid-template-columns: 1fr; gap: .1rem .9rem; }
  .kv dt { margin-top: .5rem; }
}
