/* Vennt: violet and lime, from the original mark (crates/brand).
   Violet carries actions and links; lime is the brand ground (hero, logo disc, calls to action on violet).
   Paper and night are tinted toward violet so no neutral reads as plain grey.
   Wristband yellow stays for privacy/caution moments, teal for "verified". */

/* Atkinson Hyperlegible Next (SIL OFL), served from this site so no third party sees who's reading. */
/* latin-ext */
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url(/fonts/atkinson-next-italic-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url(/fonts/atkinson-next-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/fonts/atkinson-next-normal-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/fonts/atkinson-next-normal-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #f6f5fa;
  --surface: #ffffff;
  --sunken: #eeecf5;
  --ink: #1b1530;
  --ink-2: #4a4363;
  --ink-3: #6b6485;
  --line: #dedaea;
  --line-strong: #c3bdd6;
  --accent: #5e17eb;
  --accent-ink: #ffffff;
  --accent-soft: #ece5fd;
  --violet: #5e17eb;
  --lime: #c1ff72;
  --lime-ink: #1b1530;
  --night: #120c22;
  --band: #f2c14e;
  --band-soft: #fff4d4;
  --band-ink: #5c4300;
  --verified: #1f7a64;
  --verified-soft: #dcf1ea;
  --danger: #b3261e;
  --danger-soft: #fbe5e3;
  --focus: #5e17eb;
  --shadow: 0 1px 0 rgba(27, 21, 48, 0.06), 0 6px 20px -12px rgba(27, 21, 48, 0.25);

  --font: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5625rem;
  --step-3: clamp(1.75rem, 1.3rem + 2vw, 2.4rem);
  --step-hero: clamp(2.9rem, 1.6rem + 7.5vw, 6.25rem);

  --gutter: 16px;
  --radius-s: 8px;
  --radius: 12px;
  --tap: 44px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #110c1f;
    --surface: #1a1430;
    --sunken: #0c0817;
    --ink: #eeebf7;
    --ink-2: #bdb6d4;
    --ink-3: #8f88a8;
    --line: #2d2648;
    --line-strong: #40375f;
    --accent: #b9a2ff;
    --accent-ink: #110c1f;
    --accent-soft: #2a1f4d;
    --band: #e9b949;
    --band-soft: #2c2412;
    --band-ink: #f3d68f;
    --verified: #5cc3a5;
    --verified-soft: #12302b;
    --danger: #f08a80;
    --danger-soft: #3a1818;
    --focus: #b9a2ff;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 10px 24px -14px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #110c1f;
  --surface: #1a1430;
  --sunken: #0c0817;
  --ink: #eeebf7;
  --ink-2: #bdb6d4;
  --ink-3: #8f88a8;
  --line: #2d2648;
  --line-strong: #40375f;
  --accent: #b9a2ff;
  --accent-ink: #110c1f;
  --accent-soft: #2a1f4d;
  --band: #e9b949;
  --band-soft: #2c2412;
  --band-ink: #f3d68f;
  --verified: #5cc3a5;
  --verified-soft: #12302b;
  --danger: #f08a80;
  --danger-soft: #3a1818;
  --focus: #b9a2ff;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 10px 24px -14px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

/* ---- Base ------------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; outline: none; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; font-weight: 750; letter-spacing: -0.01em; text-wrap: balance; }
p { margin: 0 0 0.85em; }
p:last-child { margin-bottom: 0; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }
svg { flex: none; }
ul, ol { padding: 0; margin: 0; list-style: none; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--lime); color: var(--lime-ink); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute; left: var(--gutter); top: -100px; z-index: 50;
  background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: var(--radius-s);
}
.skip:focus { top: 8px; }

.wrap { width: 100%; max-width: 70rem; margin: 0 auto; padding: 0 var(--gutter); }
.wrap.narrow { max-width: 44rem; }
.page-pad { padding-top: 28px; padding-bottom: 56px; }
@media (min-width: 720px) { :root { --gutter: 28px; } .page-pad { padding-top: 44px; } }

.page-title { font-size: var(--step-3); font-weight: 800; letter-spacing: -0.02em; }
.section-title { font-size: var(--step-1); font-weight: 750; }
.lede { font-size: var(--step-1); color: var(--ink-2); max-width: 38em; line-height: 1.45; }
.hint { color: var(--ink-3); font-size: var(--step--1); max-width: 60ch; }
.opt { color: var(--ink-3); font-weight: 400; }
.empty { color: var(--ink-2); padding: 20px 0; }
.crumb { font-size: var(--step--1); margin-bottom: 12px; }
.crumb a { display: inline-flex; align-items: center; min-height: var(--tap); gap: 6px; text-decoration: none; font-weight: 600; }
.crumb a::before { content: ""; width: 7px; height: 7px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }

/* ---- Buttons ------------------------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px;
  font: inherit; font-weight: 700; font-size: var(--step-0); line-height: 1.1;
  color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-s);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color 0.12s, border-color 0.12s;
}
.btn:hover { border-color: var(--ink-3); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--sunken); border-color: transparent; }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-danger-strong { background: var(--danger); color: var(--surface); border-color: var(--danger); }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: var(--step-1); }
.btn-sm { min-height: var(--tap); padding: 0 12px; font-size: var(--step--1); font-weight: 650; }
.btn svg { width: 20px; height: 20px; fill: currentColor; }
.icon-btn {
  display: inline-grid; place-items: center; width: var(--tap); height: var(--tap);
  border-radius: 50%; border: 0; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--sunken); color: var(--ink); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---- Header --------------------------------------------------------------------------------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
  padding-top: env(safe-area-inset-top);
}
.header-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "brand tools" "nav nav";
  align-items: center;
}
.brand {
  grid-area: brand; display: inline-flex; align-items: center; gap: 8px;
  min-height: 52px; color: var(--ink); text-decoration: none; justify-self: start;
}
.brand-word { font-weight: 800; font-size: 1.35rem; letter-spacing: -0.03em; }
.logo { width: 36px; height: 36px; display: inline-flex; flex: none; }
.logo svg { width: 100%; height: 100%; }
.header-tools { grid-area: tools; display: flex; align-items: center; gap: 4px; }
.admin-link { font-size: var(--step--1); font-weight: 700; padding: 0 10px; min-height: var(--tap); display: inline-flex; align-items: center; text-decoration: none; }
.main-nav {
  grid-area: nav;
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin: 0 calc(var(--gutter) * -1);
  border-top: 1px solid var(--line);
}
.main-nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 56px; padding: 6px 4px;
  color: var(--ink-2); text-decoration: none; font-size: 0.8125rem; font-weight: 650;
  border-bottom: 3px solid transparent;
}
.main-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.main-nav a:hover { color: var(--ink); }
.nav-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 760px) {
  .header-row { grid-template-columns: auto 1fr auto; grid-template-areas: "brand nav tools"; gap: 24px; }
  .main-nav { display: flex; margin: 0; border-top: 0; gap: 4px; }
  .main-nav a { flex-direction: row; gap: 8px; min-height: 64px; padding: 0 12px; font-size: var(--step-0); }
}

.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}

/* ---- Footer --------------------------------------------------------------------------------- */

.site-footer {
  margin-top: 40px; background: var(--sunken); border-top: 1px solid var(--line);
  padding: 32px 0 calc(32px + env(safe-area-inset-bottom));
  font-size: var(--step--1); color: var(--ink-2);
}
.footer-grid { display: grid; gap: 28px; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.1fr 1fr; } }
.footer-crisis h2 { font-size: var(--step-1); color: var(--ink); margin-bottom: 4px; }
.footer-crisis .crisis-lines { margin-top: 12px; }
.footer-brand { display: flex; align-items: center; gap: 4px; font-weight: 800; color: var(--ink); font-size: var(--step-0); }
.footer-brand { gap: 8px; }
.footer-brand .logo { width: 28px; height: 28px; }
.footer-about nav { display: flex; flex-wrap: wrap; gap: 0 18px; margin-top: 8px; }
.footer-about nav a { min-height: var(--tap); display: inline-flex; align-items: center; }
.crisis-lines { display: grid; gap: 10px; }
.crisis-lines li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.crisis-lines a { font-weight: 750; font-size: var(--step-0); min-height: var(--tap); display: inline-flex; align-items: center; }

/* ---- Hero ----------------------------------------------------------------------------------- */

/* The hero is always the lime brand ground, in both themes, so it carries its own light tokens. */
.hero {
  --paper: #f6f5fa; --surface: #ffffff; --sunken: #eeecf5;
  --ink: #1b1530; --ink-2: #3b2f5c; --ink-3: #574a80;
  --line: #d6d0e6; --line-strong: #b9b1d1;
  --accent: #5e17eb; --accent-ink: #ffffff; --accent-soft: #ece5fd; --focus: #5e17eb;
  color-scheme: light;
  background: var(--lime); color: var(--ink);
  padding: 40px 0 48px;
}
.tagline {
  font-size: var(--step-hero); font-weight: 800; line-height: 0.95; letter-spacing: -0.045em;
  margin: 0 0 28px; display: flex; flex-direction: column; text-wrap: initial;
}
.tagline span:nth-child(1) { color: color-mix(in srgb, var(--violet) 62%, var(--lime)); }
.tagline span:nth-child(2) { color: color-mix(in srgb, var(--violet) 80%, var(--lime)); padding-left: 0.6em; }
.tagline span:nth-child(3) { color: var(--violet); }
.hero-lede { font-size: var(--step-1); line-height: 1.45; max-width: 34em; color: var(--ink-2); margin-bottom: 32px; }
.hero-search {
  background: var(--surface); border: 2px solid var(--violet); border-radius: var(--radius);
  padding: 18px; box-shadow: 6px 6px 0 var(--violet); max-width: 52rem;
}
.hero-search-title { font-size: var(--step-0); font-weight: 750; margin-bottom: 10px; }
.hero-search .hint { margin-top: 12px; }
@media (min-width: 760px) {
  .hero { padding: 72px 0 72px; }
  .hero-search { padding: 22px 24px; }
}
@media (prefers-reduced-motion: no-preference) {
  .tagline span { animation: settle 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .tagline span:nth-child(2) { animation-delay: 0.12s; }
  .tagline span:nth-child(3) { animation-delay: 0.24s; }
}
@keyframes settle { from { opacity: 0; transform: translateY(0.18em); } to { opacity: 1; transform: none; } }

/* ---- Search & filters ---------------------------------------------------------------------- */

.label { display: block; font-weight: 700; font-size: var(--step--1); margin-bottom: 6px; color: var(--ink); }
input[type="text"], input[type="search"], select, textarea {
  width: 100%; min-height: var(--tap);
  font: inherit; font-size: max(16px, var(--step-0)); color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--radius-s);
  padding: 9px 12px;
}
textarea { resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 12px) 55%; background-size: 6px 6px; background-repeat: no-repeat; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 0.8; }

.search, .filters { display: grid; gap: 12px; align-items: end; }
@media (min-width: 640px) {
  .search { grid-template-columns: 1fr 10rem auto; }
  .filters { grid-template-columns: 1fr 10rem auto; max-width: 48rem; }
}
.page-pad > .search, .page-pad > .filters { margin: 8px 0 24px; }
.result-count { color: var(--ink-3); font-size: var(--step--1); margin: 0 0 4px; }

/* ---- Rows (lists, not cards) ---------------------------------------------------------------- */

.rows { border-top: 1px solid var(--line); }
.row { border-bottom: 1px solid var(--line); }
.row-link {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 4px; min-height: 64px; color: inherit; text-decoration: none;
}
.row-link:hover { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.row-link:hover .row-title { text-decoration: underline; text-underline-offset: 0.18em; }
.row-main { display: flex; flex-direction: column; min-width: 0; }
.row-title { font-weight: 700; font-size: var(--step-0); color: var(--ink); }
.row-sub { color: var(--ink-2); font-size: var(--step--1); }
.row-sub-extra::before { content: ""; display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--line-strong); margin: 0 8px; vertical-align: middle; }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; text-align: right; }
.row-side-label { font-size: 0.8125rem; color: var(--ink-3); }
.row-side-text { font-size: var(--step--1); color: var(--ink-2); font-weight: 650; }

/* ---- Pips: the k-anonymity meter ---------------------------------------------------------- */

.pips { display: inline-flex; gap: 4px; align-items: center; }
.pip { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: transparent; }
.pip.on { background: var(--accent); border-color: var(--accent); }
.pip.on.full { background: var(--verified); border-color: var(--verified); }
.pips-lg { gap: 8px; }
.pips-lg .pip { width: 22px; height: 22px; border-width: 2px; }

/* ---- How it works -------------------------------------------------------------------------- */

.how { padding: 44px 0; }
.how-grid { display: grid; gap: 28px; margin-top: 16px; }
@media (min-width: 860px) { .how-grid { grid-template-columns: repeat(3, 1fr); gap: 40px; } }
.how-item { border-top: 3px solid var(--ink); padding-top: 16px; }
.how-item:nth-child(2) { border-top-color: var(--accent); }
.how-item:nth-child(3) { border-top-color: var(--band); }
.how-item h3 { font-size: var(--step-1); }
.how-item p { color: var(--ink-2); }
.how-pips { display: flex; align-items: center; gap: 12px; margin-top: 14px; color: var(--ink-3); font-size: var(--step--1); font-weight: 650; }

.cta { --cta-bg: var(--violet); --cta-fg: #ffffff; background: var(--cta-bg); color: var(--cta-fg); padding: 48px 0; }
.cta :focus-visible { outline-color: var(--lime); }
.cta h2 { font-size: var(--step-3); font-weight: 800; letter-spacing: -0.02em; max-width: 18em; }
.cta p { color: color-mix(in srgb, var(--cta-fg) 80%, var(--cta-bg)); max-width: 36em; }
.cta .btn { background: transparent; color: var(--cta-fg); border-color: color-mix(in srgb, var(--cta-fg) 45%, transparent); }
.cta .btn-primary { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.cta .btn-primary:hover { background: color-mix(in srgb, var(--lime) 88%, #ffffff); }
.cta-inner .row-actions { margin-top: 20px; }

/* ---- Notes, gates, loading ----------------------------------------------------------------- */

.loading { display: flex; align-items: center; gap: 10px; color: var(--ink-3); padding: 24px 0; }
.loading-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .loading-dot { animation: breathe 1.4s ease-in-out infinite; }
}
@keyframes breathe { 50% { opacity: 0.25; transform: scale(0.7); } }

.note { border-radius: var(--radius-s); padding: 12px 14px; margin: 12px 0; border-left: 4px solid var(--line-strong); background: var(--surface); }
.note-error { border-left-color: var(--danger); background: var(--danger-soft); }
.note-quiet { border-left-color: var(--accent); background: var(--accent-soft); }
.note-ok { border-left-color: var(--verified); background: var(--verified-soft); }
.note-held { border-left-color: var(--band); background: var(--band-soft); color: var(--ink); }
.note-title { font-weight: 750; }
.gate { padding: 28px 0; max-width: 34em; }
.gate h2 { font-size: var(--step-2); }
.hospital-section .gate { padding: 8px 0; }
.hospital-section .gate h2 { font-size: var(--step-1); }

/* ---- Privacy check: the wristband ---------------------------------------------------------- */

.shield { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.privacy-line { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: var(--step--1); margin: 4px 0 12px; }
.privacy-ok { color: var(--verified); }
.privacy-flag {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--band-soft); color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--band) 60%, transparent);
  border-left: 8px solid var(--band);
  border-radius: var(--radius-s); padding: 12px 14px; margin: 4px 0 14px;
}
.privacy-flag .shield { color: var(--band-ink); margin-top: 2px; }
.privacy-flag-title { font-weight: 750; margin-bottom: 4px; }
.privacy-flag-foot { color: var(--ink-2); font-size: var(--step--1); }
@media (prefers-reduced-motion: no-preference) {
  .privacy-flag, .crisis { animation: arrive 0.25s ease-out; }
}
@keyframes arrive { from { opacity: 0; transform: translateY(-4px); } }

.crisis {
  background: var(--surface); border: 1.5px solid var(--verified); border-radius: var(--radius);
  padding: 16px 18px; margin: 8px 0 16px;
}
.crisis h3 { font-size: var(--step-1); color: var(--verified); }
.crisis .crisis-lines { margin-top: 12px; }
.btn-crisis { background: var(--verified); color: var(--surface); border-color: var(--verified); text-decoration: none; }
.btn-crisis:hover { text-decoration: none; }

/* ---- Forms --------------------------------------------------------------------------------- */

.form { display: grid; gap: 16px; max-width: 40rem; }
.field { display: block; border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field > .label, legend.label { padding: 0; }
.field-row { display: grid; gap: 16px; }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }
.field-msg { color: var(--danger); font-size: var(--step--1); font-weight: 650; margin: 4px 0 0; min-height: 0; }
.field-msg:empty { display: none; }
.field-foot { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.field-foot .field-msg:empty + .count { margin-left: auto; }
.count { color: var(--ink-3); font-size: 0.8125rem; margin-top: 4px; margin-left: auto; }
.affix { display: flex; align-items: stretch; }
.affix > span { display: grid; place-items: center; padding: 0 12px; background: var(--sunken); border: 1.5px solid var(--line-strong); border-right: 0; border-radius: var(--radius-s) 0 0 var(--radius-s); color: var(--ink-2); font-weight: 700; }
.affix input { border-radius: 0 var(--radius-s) var(--radius-s) 0; }

.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-opt { position: relative; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-opt span {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 16px;
  border: 1.5px solid var(--line-strong); border-radius: 999px; font-weight: 650; background: var(--surface);
}
.seg-opt input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.seg-opt input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.seg-2 .seg-opt span { min-width: 88px; justify-content: center; }

.radio { display: flex; align-items: center; gap: 10px; min-height: var(--tap); cursor: pointer; }
.radio input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }

.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; min-height: var(--tap); position: relative; }
.switch input { position: absolute; opacity: 0; width: 52px; height: 30px; margin: 0; cursor: pointer; }
.switch-track { flex: none; width: 52px; height: 30px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background-color 0.15s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked + .switch-track { background: var(--ink); }
.switch input:checked + .switch-track::after { transform: translateX(22px); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--focus); outline-offset: 2px; }
.switch .hint { display: block; }

/* ---- Chips & badges ------------------------------------------------------------------------ */

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.chips li { font-size: 0.8125rem; font-weight: 650; color: var(--ink-2); background: var(--sunken); border-radius: 6px; padding: 3px 9px; }
.badge {
  display: inline-flex; align-items: center; font-size: 0.75rem; font-weight: 750; line-height: 1;
  padding: 5px 8px; border-radius: 6px; background: var(--sunken); color: var(--ink-2);
}
.badge-held { background: var(--band-soft); color: var(--band-ink); border: 1px solid color-mix(in srgb, var(--band) 60%, transparent); }
.badge-fleeting { background: var(--accent-soft); color: var(--ink); }
.badge-op { background: var(--ink); color: var(--paper); }
.badge-verified { background: var(--verified-soft); color: var(--verified); }
.held-reason { font-size: var(--step--1); color: var(--ink-2); flex-basis: 100%; }

/* ---- Jobs ---------------------------------------------------------------------------------- */

.jobs { border-top: 1px solid var(--line); }
.job {
  display: grid; gap: 4px 20px; padding: 18px 0; border-bottom: 1px solid var(--line);
  grid-template-columns: 1fr; grid-template-areas: "pay" "body" "apply";
}
.job-pay { grid-area: pay; font-size: var(--step-2); font-weight: 800; letter-spacing: -0.02em; margin: 0; color: var(--ink); }
.job-body { grid-area: body; min-width: 0; }
.job-title { font-size: var(--step-0); font-weight: 750; margin: 0 0 2px; }
.job-where { display: flex; flex-wrap: wrap; gap: 0 14px; color: var(--ink-2); font-size: var(--step--1); margin: 0; }
.job-where a { font-weight: 650; }
.job-apply { grid-area: apply; justify-self: start; margin-top: 10px; }
@media (min-width: 720px) {
  .job { grid-template-columns: 11rem 1fr auto; grid-template-areas: "pay body apply"; align-items: start; }
  .job-apply { margin-top: 0; }
}

/* ---- Hospital ------------------------------------------------------------------------------ */

.hospital-head { margin-bottom: 28px; }
.hospital-head .btn { margin-top: 16px; }
.hospital-address { color: var(--ink-2); margin-bottom: 4px; }
.hospital-section { margin-top: 44px; }

.locked {
  background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius);
  padding: 24px; max-width: 44rem;
}
.locked-count { font-size: var(--step-2); margin: 14px 0 6px; }
.locked p { color: var(--ink-2); }

.stats { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
@media (min-width: 720px) { .stats { padding: 28px 32px; } }
.stats-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 16px; }
.stats-count { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: var(--step--1); font-weight: 650; }
.stat-label { font-size: var(--step--1); font-weight: 700; color: var(--ink-2); margin-bottom: 2px; }
.stat-big { font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1; color: var(--ink); }
.pay { margin: 18px 0 8px; }
.pay-median { color: var(--ink-2); font-weight: 650; margin-bottom: 14px; }
.band { position: relative; height: 14px; border-radius: 7px; background: var(--sunken); }
.band-fill { position: absolute; top: 0; bottom: 0; border-radius: 7px; background: color-mix(in srgb, var(--accent) 55%, transparent); }
.band-median { position: absolute; top: -6px; bottom: -6px; width: 4px; margin-left: -2px; border-radius: 2px; background: var(--ink); }
.band-labels { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: var(--step--1); color: var(--ink-2); }
.vitals { display: grid; grid-template-columns: 1fr; gap: 0; margin: 24px 0 0; border-top: 1px solid var(--line); }
.vital { padding: 16px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.vital dt { font-weight: 700; color: var(--ink-2); font-size: var(--step--1); }
.vital dd { margin: 0; }
@media (min-width: 640px) {
  .vitals { grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
  .vital { flex-direction: column-reverse; justify-content: flex-end; border-bottom: 0; padding: 18px 16px 16px 0; }
  .vital + .vital { border-left: 1px solid var(--line); padding-left: 20px; }
}
.table-wrap { overflow-x: auto; margin-top: 24px; }
.by-specialty { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.by-specialty caption { text-align: left; font-weight: 750; font-size: var(--step-0); padding-bottom: 8px; }
.by-specialty th, .by-specialty td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.by-specialty thead th { color: var(--ink-3); font-weight: 700; }
.by-specialty tbody th { font-weight: 650; }
.by-specialty .num { text-align: right; white-space: nowrap; }

.report-form { margin-top: 12px; }

/* ---- Spaces & feed ------------------------------------------------------------------------- */

.space-group { margin-top: 32px; }
.space-group .hint { margin-top: -4px; }

.feed-head { margin-bottom: 20px; }
.composer { margin: 8px 0 20px; }
.composer-start {
  width: 100%; text-align: left; min-height: 56px; padding: 0 18px;
  font: inherit; color: var(--ink-3); background: var(--surface);
  border: 1.5px solid var(--line-strong); border-radius: var(--radius); cursor: text;
}
.composer-start:hover { border-color: var(--accent); color: var(--ink-2); }
.composer .form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; max-width: none; box-shadow: var(--shadow); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 12px 0 0; }
.tab {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 16px;
  font: inherit; font-weight: 700; color: var(--ink-2); text-decoration: none;
  background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; cursor: pointer;
}
.tab[aria-current="page"], .tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

.feed > li { border-bottom: 1px solid var(--line); }
.post-row { display: flex; gap: 12px; padding: 16px 0; }
.post-row.is-held { background: linear-gradient(90deg, var(--band-soft), transparent 70%); }
.post-row-body { min-width: 0; flex: 1; }
.post-row-title { font-size: var(--step-1); margin-bottom: 4px; }
.post-row-title a { color: var(--ink); text-decoration: none; }
.post-row-title a:hover { text-decoration: underline; }
.excerpt { color: var(--ink-2); margin-bottom: 8px; overflow-wrap: anywhere; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: var(--step--1); color: var(--ink-3); margin: 0; }
.meta .author { font-weight: 700; color: var(--ink-2); }
.load-more { text-align: center; padding: 20px 0; }

.votes { display: flex; flex-direction: column; align-items: center; flex: none; width: var(--tap); position: relative; }
.vote {
  display: grid; place-items: center; width: var(--tap); height: var(--tap);
  border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); cursor: pointer;
}
.vote svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.vote:hover { background: var(--sunken); color: var(--ink); }
.vote.up.on { color: var(--accent); }
.vote.up.on svg { fill: currentColor; }
.vote.down.on { color: var(--danger); }
.vote.down.on svg { fill: currentColor; }
.score { font-weight: 800; font-size: var(--step--1); line-height: 1; }
.vote-error {
  position: absolute; top: 100%; left: 0; z-index: 5; width: max-content; max-width: 14rem;
  background: var(--ink); color: var(--paper); font-size: 0.8125rem; padding: 6px 10px; border-radius: 6px;
}
.actions .votes, .actions-sm .votes { flex-direction: row; width: auto; }

/* ---- Post & replies ------------------------------------------------------------------------ */

.post { padding-bottom: 8px; }
.post-title { font-size: var(--step-3); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 8px; }
.post-body { margin: 18px 0; font-size: var(--step-1); line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.post.is-held .post-title::after { content: ""; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px 0; }
.actions-sm { border: 0; padding: 0; gap: 0 4px; }
.disclosure { display: contents; }
.disclosure > .form, .disclosure > .note, .disclosure > .confirm { flex-basis: 100%; }
.report-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 14px; margin: 6px 0 10px; max-width: none; }
.report-panel fieldset { border: 0; padding: 0; margin: 0; }
.confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 0; font-weight: 650; }

.replies { margin-top: 28px; }
.thread > li { border-top: 1px solid var(--line); }
.reply { padding: 14px 0 8px; }
.reply.is-held { background: linear-gradient(90deg, var(--band-soft), transparent 70%); }
.reply-body { margin: 6px 0 4px; white-space: pre-line; overflow-wrap: anywhere; }
.children { margin-left: 12px; padding-left: 14px; border-left: 2px solid var(--line); }
.children > li + li { border-top: 1px solid var(--line); }
@media (min-width: 640px) { .children { margin-left: 22px; } }
.reply-form { margin: 8px 0 16px; max-width: none; }

/* ---- Sign in, verify, account ------------------------------------------------------------- */

.signin-options { display: grid; gap: 8px; margin: 24px 0 32px; max-width: 26rem; }
.btn-apple { background: var(--ink); color: var(--paper); border-color: var(--ink); width: 100%; }
.dev-signin { border-top: 1px solid var(--line); padding-top: 24px; max-width: 26rem; margin-bottom: 20px; }

.verify-grid { display: grid; gap: 32px; margin-top: 24px; }
@media (min-width: 900px) { .verify-grid { grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: start; } }
.privacy-plain section { padding: 16px 0; border-top: 1px solid var(--line); }
.privacy-plain h2 { font-size: var(--step-1); }
.privacy-plain p { color: var(--ink-2); }
.legal-list { list-style: disc; padding-left: 1.25em; color: var(--ink-2); display: grid; gap: 4px; margin-top: 6px; }
.keep {
  display: inline-block; font-weight: 750; color: var(--ink) !important;
  background: var(--verified-soft); border-left: 4px solid var(--verified); padding: 6px 12px; border-radius: 4px;
}
.verify-action .form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.status { border-radius: var(--radius); padding: 20px; margin-bottom: 20px; background: var(--surface); border: 1px solid var(--line); }
.status-verified { display: flex; gap: 14px; border-color: var(--verified); }
.status-verified .shield { width: 32px; height: 32px; color: var(--verified); }
.status-pending { border-left: 6px solid var(--accent); }
.status-rejected { border-left: 6px solid var(--danger); }
.status h2 { font-size: var(--step-2); }

.panel { padding: 22px 0; border-top: 1px solid var(--line); }
.panel-danger .section-title { color: var(--danger); }
.status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---- Admin --------------------------------------------------------------------------------- */

.queue { display: grid; gap: 14px; margin-top: 18px; }
.queue-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.queue-item.urgent { border: 2px solid var(--danger); background: color-mix(in srgb, var(--danger-soft) 55%, var(--surface)); }
.urgent-flag { color: var(--danger); font-weight: 800; margin-bottom: 6px; }
.queue-title { font-size: var(--step-1); margin: 8px 0 4px; }
.queue-body { white-space: pre-line; overflow-wrap: anywhere; }
.queue-why, .kv { display: grid; gap: 4px 16px; margin: 10px 0 14px; font-size: var(--step--1); }
.queue-why div, .kv div { display: flex; gap: 10px; flex-wrap: wrap; }
.queue-why dt, .kv dt { font-weight: 700; color: var(--ink-3); min-width: 6rem; }
.queue-why dd, .kv dd { margin: 0; }
@media (min-width: 640px) { .kv { grid-template-columns: repeat(2, 1fr); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
