/* Signal Docs: the Signal Board's language (signal-next globals.css + components/board/board.css) for reading.
   The three grounds are the app's: dark = its black home (html.pro), light = paper, teal = its teal dark. The theme follows the app's own
   choice on this origin, else the device. Figures and code in the mono face; headings in the sans, the page title in the serif. */

:root {
  --bg: #000000; --card: #0c0f0e; --pop: #141817; --fg: #eff5f3; --muted: #919b98; --faint: #6f7a77;
  --mint: #3fd9bd; --mint-text: #8ff0dd; --mint-pale: #c8fff2; --ink: #03201c; --warn: #f2b45a;
  --line: rgba(255, 255, 255, 0.07); --line-2: rgba(255, 255, 255, 0.11); --glass: rgba(255, 255, 255, 0.035); --glass-edge: rgba(255, 255, 255, 0.07);
  --hover: rgba(255, 255, 255, 0.045); --sel: rgba(255, 255, 255, 0.08);
  --tint: color-mix(in oklab, var(--mint) 11%, transparent); --tint-edge: color-mix(in oklab, var(--mint) 38%, transparent);
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--glass-edge);
  --sans: "Familjen Grotesk", system-ui, "Segoe UI", sans-serif; --mono: "Spline Sans Mono", ui-monospace, monospace; --serif: "Instrument Serif", Georgia, serif;
  --top: 60px; --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #f3f6f5; --card: #ffffff; --pop: #ffffff; --fg: #0b1f1b; --muted: #5d716b; --faint: #7d8f8a;
    --mint-text: #0a6e5b; --warn: #9a5b00;
    --line: rgba(3, 32, 28, 0.08); --line-2: rgba(3, 32, 28, 0.13); --glass: rgba(255, 255, 255, 0.82); --glass-edge: rgba(3, 32, 28, 0.09);
    --hover: rgba(3, 32, 28, 0.04); --sel: rgba(3, 32, 28, 0.06);
    --tint: color-mix(in oklab, var(--mint) 16%, transparent); --tint-edge: color-mix(in oklab, #0f9f83 45%, transparent);
    --shadow: 0 24px 60px -24px rgba(3, 32, 28, 0.28), 0 0 0 1px var(--glass-edge);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f3f6f5; --card: #ffffff; --pop: #ffffff; --fg: #0b1f1b; --muted: #5d716b; --faint: #7d8f8a;
  --mint-text: #0a6e5b; --warn: #9a5b00;
  --line: rgba(3, 32, 28, 0.08); --line-2: rgba(3, 32, 28, 0.13); --glass: rgba(255, 255, 255, 0.82); --glass-edge: rgba(3, 32, 28, 0.09);
  --hover: rgba(3, 32, 28, 0.04); --sel: rgba(3, 32, 28, 0.06);
  --tint: color-mix(in oklab, var(--mint) 16%, transparent); --tint-edge: color-mix(in oklab, #0f9f83 45%, transparent);
  --shadow: 0 24px 60px -24px rgba(3, 32, 28, 0.28), 0 0 0 1px var(--glass-edge);
  color-scheme: light;
}
:root[data-theme="teal"] {
  --bg: #040c0b; --card: #0b1a18; --pop: #0f211e; --fg: #f2fbf8; --muted: #8ea6a0; --faint: #6c8580; --mint: #5ee6cf;
  --line: rgba(255, 255, 255, 0.08); --glass: rgba(255, 255, 255, 0.058); --glass-edge: rgba(255, 255, 255, 0.085); --sel: rgba(255, 255, 255, 0.10);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--fg); font-family: var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  scroll-padding-top: calc(var(--top) + 20px); -webkit-text-size-adjust: 100%; scrollbar-color: color-mix(in oklab, var(--fg) 18%, transparent) transparent; }
body { margin: 0; min-height: 100dvh; font-size: 16px; line-height: 1.65; font-feature-settings: "ss01", "cv11"; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: 420px; pointer-events: none; z-index: -1;
  background: radial-gradient(60% 70% at 50% -20%, color-mix(in oklab, var(--mint) 9%, transparent), transparent 70%); }
::selection { background: color-mix(in oklab, var(--mint) 35%, transparent); }
:focus-visible { outline: 2px solid color-mix(in oklab, var(--mint) 70%, transparent); outline-offset: 2px; border-radius: 8px; }
a { color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.mono { font-family: var(--mono); font-size: .92em; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 50; padding: 8px 14px; border-radius: 999px; background: var(--mint); color: var(--ink); font-weight: 600; text-decoration: none; }
.skip:focus { top: 10px; }

/* ---- the top bar ---- */
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; height: var(--top); padding: 0 20px;
  background: color-mix(in oklab, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; margin-right: 10px; flex: 0 0 auto; }
.brand img { width: 28px; height: 28px; }
.brand .word { font-family: var(--serif); font-size: 30px; line-height: 1; letter-spacing: -.01em; margin-top: -3px; }
.brand-docs { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--mint-text); padding: 3px 8px; border-radius: 999px;
  background: var(--tint); border: 1px solid var(--tint-edge); margin-left: 2px; }
.ghost { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 999px; border: 0; background: none;
  color: var(--muted); cursor: pointer; transition: color .15s, background .15s; flex: 0 0 auto; }
.ghost:hover { color: var(--fg); background: var(--hover); }
.menu-btn { display: none; margin-left: -8px; }
.cta { display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border-radius: 999px; background: var(--mint); color: var(--ink); font-size: 14px;
  font-weight: 600; text-decoration: none; white-space: nowrap; transition: filter .15s; flex: 0 0 auto; }
.cta:hover { filter: brightness(1.08); }
.theme-btn .sun { display: none; }
:root[data-theme="light"] .theme-btn .sun { display: block; }
:root[data-theme="light"] .theme-btn .moon { display: none; }
@media (prefers-color-scheme: light) { :root:not([data-theme]) .theme-btn .sun { display: block; } :root:not([data-theme]) .theme-btn .moon { display: none; } }

/* search: the board's filter capsule */
.find { position: relative; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 14px; flex: 1 1 auto; min-width: 0; max-width: 460px; margin-left: auto;
  border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-edge); color: var(--muted); transition: border-color .15s, box-shadow .15s; }
.find:focus-within { border-color: color-mix(in oklab, var(--mint) 55%, transparent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--mint) 14%, transparent); }
.find input { flex: 1; min-width: 0; width: 100%; height: 100%; background: transparent; border: 0; outline: 0; color: var(--fg); font: inherit; font-size: 14px; }
.find input::placeholder { color: var(--muted); }
.find input::-webkit-search-cancel-button { display: none; }
.find kbd { font: 500 11px var(--mono); padding: 1px 7px; border-radius: 6px; border: 1px solid var(--glass-edge); color: var(--muted); }
.results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; min-width: min(520px, calc(100vw - 32px)); max-height: min(70vh, 560px); overflow: auto;
  padding: 6px; border-radius: 18px; background: var(--pop); box-shadow: var(--shadow); z-index: 40; overscroll-behavior: contain; }
.results a { display: block; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--fg); }
.results a[aria-selected="true"], .results a:hover { background: var(--sel); }
.results .r-path { display: block; font-size: 12px; color: var(--muted); }
.results .r-head { display: block; font-weight: 600; font-size: 15px; line-height: 1.35; margin-top: 1px; }
.results .r-snip { display: block; font-size: 13px; color: var(--muted); line-height: 1.5; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.results mark { background: var(--tint); color: var(--mint-text); border-radius: 4px; padding: 0 2px; }
.results .r-none { padding: 14px 12px; font-size: 14px; color: var(--muted); }

/* ---- the shell: contents · page · on this page ---- */
.shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); max-width: 1440px; margin: 0 auto; }
.nav { position: sticky; top: var(--top); height: calc(100dvh - var(--top)); overflow-y: auto; padding: 22px 14px 40px 20px; border-right: 1px solid var(--line);
  overscroll-behavior: contain; scrollbar-width: thin; }
.nav-top { display: none; }
.nav-group { margin-bottom: 18px; }
.nav-head { margin: 0 0 4px; }
.nav-head a { font-size: 11.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); padding: 6px 12px; }
.nav-head a:hover { color: var(--fg); }
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav a { display: block; padding: 6px 12px; border-radius: 10px; font-size: 14.5px; line-height: 1.4; color: var(--muted); text-decoration: none; transition: color .15s, background .15s; }
.nav a:hover { color: var(--fg); background: var(--hover); }
.nav a[aria-current="page"] { color: var(--fg); background: linear-gradient(180deg, color-mix(in oklab, var(--mint) 13%, transparent), color-mix(in oklab, var(--mint) 9%, transparent));
  box-shadow: inset 0 0 0 1px var(--tint-edge); font-weight: 500; }
.nav-solo > a { font-weight: 500; color: var(--fg); }
.nav-head a[aria-current="page"] { color: var(--fg); }
.scrim { display: none; }
.nav .nav-app { display: none; }

.main { min-width: 0; padding: 40px 56px 72px; }
.doc { max-width: 760px; }
.toc { display: none; }

/* ---- the page ---- */
.eyebrow { margin: 0 0 10px; font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--mint-text); }
.doc h1 { font-family: var(--serif); font-weight: 400; font-size: 52px; line-height: 1.02; letter-spacing: -.015em; margin: 0 0 14px; text-wrap: balance; }
.lead { font-size: 19px; line-height: 1.55; color: var(--muted); margin: 0 0 30px; text-wrap: pretty; }
.doc h2 { font-size: 26px; line-height: 1.25; letter-spacing: -.02em; font-weight: 600; margin: 52px 0 14px; padding-top: 4px; }
.doc h3 { font-size: 19px; line-height: 1.35; letter-spacing: -.01em; font-weight: 600; margin: 34px 0 10px; }
.doc h4 { font-size: 16px; font-weight: 600; margin: 26px 0 8px; }
.doc h2, .doc h3, .doc h4 { position: relative; text-wrap: balance; }
.anchor { position: absolute; left: -28px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--faint); opacity: 0; transition: opacity .15s; border-radius: 6px; }
.anchor svg { width: 15px; height: 15px; }
.doc h2:hover .anchor, .doc h3:hover .anchor, .anchor:focus-visible { opacity: 1; }
.anchor:hover { color: var(--mint-text); }
.doc p, .doc li { text-wrap: pretty; }
.doc p { margin: 0 0 16px; }
.doc ul, .doc ol { padding-left: 1.3em; margin: 0 0 18px; }
.doc li { margin: 5px 0; }
.doc li::marker { color: var(--faint); }
.doc strong { font-weight: 600; }
.doc a { color: var(--mint-text); text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--mint-text) 35%, transparent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.doc a:hover { text-decoration-color: currentColor; }
.doc a .ic-out, .doc a.file svg { width: 13px; height: 13px; margin-left: 2px; vertical-align: -1px; }
.doc h2 a:not(.anchor), .doc h3 a:not(.anchor) { color: inherit; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.doc blockquote { margin: 0 0 18px; padding: 14px 18px; border-radius: 14px; background: var(--glass); border: 1px solid var(--glass-edge); border-left: 3px solid var(--mint); color: var(--fg); }
.doc blockquote p:last-child { margin-bottom: 0; }
.doc figure { margin: 6px 0 30px; }
.doc img { display: block; max-width: 100%; height: auto; border-radius: 18px; }
.doc figure img { width: 100%; max-height: 380px; object-fit: cover; background: var(--card); border: 1px solid var(--line); }

.doc code { font-family: var(--mono); font-size: .86em; padding: .12em .4em; border-radius: 6px; background: var(--glass); border: 1px solid var(--glass-edge); overflow-wrap: anywhere; }
.code { margin: 0 0 20px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.code-bar { display: flex; align-items: center; justify-content: space-between; height: 38px; padding: 0 8px 0 14px; border-bottom: 1px solid var(--line); font: 500 11.5px var(--mono); color: var(--faint); text-transform: lowercase; }
.copy { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; border: 0; background: none; color: var(--muted); font: 500 12px var(--sans); cursor: pointer; }
.copy svg { width: 14px; height: 14px; }
.copy:hover { color: var(--fg); background: var(--hover); }
.copy.done { color: var(--mint-text); }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font: 13.5px/1.65 var(--mono); tab-size: 4; }
.code pre code { padding: 0; border: 0; background: none; font-size: inherit; overflow-wrap: normal; }

.table { margin: 0 0 22px; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in oklab, var(--card) 60%, transparent); scrollbar-width: thin; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
.doc th, .doc td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.doc th { font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--glass); white-space: nowrap; }
.doc tbody tr:last-child td { border-bottom: 0; }
.doc tbody tr:hover td { background: var(--hover); }
.doc td code { white-space: nowrap; }
.doc .a-center { text-align: center; } .doc .a-right { text-align: right; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 760px; margin: 56px 0 0; }
.pager a { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; border-radius: 16px; border: 1px solid var(--line); text-decoration: none; transition: border-color .15s, background .15s; }
.pager a:hover { border-color: var(--tint-edge); background: var(--hover); }
.pager span { font-size: 12.5px; color: var(--muted); }
.pager b { font-weight: 600; font-size: 15.5px; }
.pager-next { grid-column: 2; text-align: right; }
.foot { max-width: 760px; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); line-height: 1.6; }
.foot p { margin: 0 0 6px; }
.foot a { color: var(--muted); text-underline-offset: 3px; }
.foot a:hover { color: var(--fg); }

@media (min-width: 1280px) {
  .shell { grid-template-columns: 272px minmax(0, 1fr) 232px; }
  .toc { display: block; position: sticky; top: var(--top); height: calc(100dvh - var(--top)); overflow-y: auto; padding: 40px 20px 40px 0; font-size: 13px; scrollbar-width: thin; }
  .toc p { margin: 0 0 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
  .toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
  .toc a { display: block; padding: 4px 0 4px 14px; margin-left: -1px; border-left: 1px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.4; }
  .toc .d3 a { padding-left: 26px; }
  .toc a:hover { color: var(--fg); }
  .toc a[aria-current="true"] { color: var(--mint-text); border-left-color: var(--mint); }
}

/* ---- phones and tablets: contents in a sheet ---- */
@media (max-width: 1023px) {
  .shell { display: block; }
  .menu-btn { display: inline-flex; }
  .nav { position: fixed; top: 0; left: 0; bottom: 0; height: 100dvh; width: min(330px, 88vw); z-index: 60; background: var(--pop); border-right: 1px solid var(--line);
    transform: translateX(-102%); transition: transform .26s var(--ease); padding-top: 0; box-shadow: var(--shadow); visibility: hidden; }
  .nav-open .nav { transform: none; visibility: visible; }
  .nav-top { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; height: var(--top); margin: 0 -14px 10px -20px; padding: 0 10px 0 32px;
    background: var(--pop); border-bottom: 1px solid var(--line); font-weight: 600; }
  .nav-open .scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .5); }
  .nav-open { overflow: hidden; }
  .main { padding: 28px 24px 64px; }
}
@media (max-width: 640px) {
  :root { --top: 56px; }
  .top { padding: 0 12px; gap: 6px; }
  .brand { margin-right: 4px; }
  .brand .word { font-size: 26px; }
  .brand-docs { display: none; }
  .cta { display: none; }
  .nav .nav-app { display: inline-flex; align-items: center; gap: 4px; margin: 8px 0 0; padding: 0 16px; height: 40px; border-radius: 999px; background: var(--mint); color: var(--ink); font-weight: 600; }
  .nav .nav-app:hover { background: var(--mint); color: var(--ink); filter: brightness(1.08); }
  .nav-app svg { width: 15px; height: 15px; }
  .find { height: 38px; padding: 0 12px; }
  .find kbd { display: none; }
  .results { position: fixed; top: calc(var(--top) + 6px); left: 12px; right: 12px; min-width: 0; }
  body { font-size: 16px; }
  .main { padding: 22px 16px 56px; }
  .doc h1 { font-size: 40px; }
  .lead { font-size: 17px; margin-bottom: 24px; }
  .doc h2 { font-size: 23px; margin-top: 42px; }
  .doc h3 { font-size: 18px; }
  .anchor { display: none; }
  .doc table { font-size: 14px; }
  .doc th, .doc td { padding: 9px 12px; }
  .pager { grid-template-columns: 1fr; }
  .pager-next { grid-column: 1; }
  .doc figure img { max-height: 240px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } html { scroll-behavior: auto; } }
@media print { .top, .nav, .toc, .pager, .scrim { display: none !important; } .shell { display: block; } body::before { display: none; } }
