/* Second Watch — "First Light" theme.
   Night ground, lantern amber for "someone's here", dawn gold and rose from the sunrise. */

@font-face {
  font-family: "Sora";
  src: url("/fonts/sora-latin-wght-normal.fa26406eed.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-wght-normal.3100e775e8.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* ground */
  --midnight: #0e1424;
  --surface: #151d33;
  --raised: #1c2541;
  --dusk: #2e2a4d;
  --dusk-raised: #3d3762;
  --line: #2a3552;
  --line-strong: #3a4769;

  /* ink */
  --ink: #dde4f0;
  --ink-strong: #f4f6fa;
  --muted: #9aa6bc;
  --dusk-ink: #dcd3e6;

  /* light */
  --lantern: #f2b45a;
  --first-light: #f2c46d;
  --rose: #e07a6a;
  --focus: #9ec1e8;

  /* status */
  --talk-bg: #3a2e1c;
  --ok: #a9c7b6;
  --ok-bg: #1d2f2b;
  --fault: #f0a094;
  --fault-bg: #3a1f2a;
  --sent: #9ec1e8;
  --sent-bg: #1c2a45;

  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 18px;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.2rem;
  --display: "Sora", "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--midnight);
  color: var(--ink);
  font: 400 var(--step-0)/1.55 "Inter", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}

h1, h2, h3 { font-family: var(--display); color: var(--ink-strong); line-height: 1.15; margin: 0; letter-spacing: -0.015em; }
h1 { font-size: var(--step-3); font-weight: 700; }
h2 { font-size: var(--step-2); font-weight: 650; }
h3 { font-size: var(--step-1); font-weight: 600; }
p { margin: 0; max-width: 68ch; }

a { color: var(--first-light); text-underline-offset: 0.2em; }
a:hover { color: #f7d894; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
main:focus, main:focus-visible { outline: none; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-weight: 600; padding: 0; margin-bottom: 0.4rem; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }

/* ---------- brand ---------- */

.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--display); font-weight: 700; font-size: var(--step-1); color: var(--ink-strong); letter-spacing: -0.01em; }
.brand-mark { width: 2rem; height: 2rem; flex: none; }
.brand span { font-family: "Inter", sans-serif; font-weight: 400; font-size: var(--step-0); color: var(--muted); }

/* ---------- top bar ---------- */

.topbar {
  background: var(--midnight);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0.85rem 1rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}
.agency-switch { margin-left: auto; display: flex; gap: 0.5rem; align-items: center; }
.agency-switch select {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  padding: 0.3rem 0.5rem;
  font: inherit;
  font-size: var(--step--1);
  min-height: 2.25rem;
}

.tabs {
  flex-basis: 100%;
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  margin-top: 0.4rem;
  scrollbar-width: none;
}
.tabs a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.6rem 0.8rem 0.7rem;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.tabs a:hover { color: var(--ink-strong); }
.tabs a[aria-current="page"] { color: var(--ink-strong); border-bottom-color: var(--lantern); font-weight: 600; }
.tabs .tab-log {
  margin-left: auto;
  font-weight: 600;
  color: var(--lantern);
}

.testmode {
  background: var(--talk-bg);
  color: var(--first-light);
  font-size: var(--step--1);
  padding: 0.45rem 1rem;
  text-align: center;
}

/* ---------- layout ---------- */

main {
  max-width: 64rem;
  margin: 0 auto;
  padding: 1.75rem 1rem 4rem;
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}
.page-head p { margin-top: 0.35rem; color: var(--muted); }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 1.25rem;
}
.stack > * + * { margin-top: 1rem; }
.split { display: grid; gap: 1.25rem; }
@media (min-width: 52rem) {
  .split { grid-template-columns: minmax(0, 1fr) 22rem; align-items: start; }
}

/* ---------- buttons & forms ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font: inherit;
  font-weight: 600;
  border-radius: var(--radius-s);
  border: 1px solid var(--first-light);
  background: var(--first-light);
  color: var(--midnight);
  padding: 0.6rem 1.1rem;
  cursor: pointer;
  text-decoration: none;
  min-height: 2.75rem;
}
.btn:hover { background: #f7d894; border-color: #f7d894; color: var(--midnight); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.secondary { background: transparent; color: var(--ink-strong); border: 1.5px solid var(--line-strong); }
.btn.secondary:hover { border-color: var(--ink); background: transparent; color: var(--ink-strong); }
.btn.light { background: var(--ink-strong); border-color: var(--ink-strong); color: var(--midnight); }
.btn.light:hover { background: #fff; }
.btn.quiet { background: none; border-color: transparent; color: var(--muted); padding-inline: 0.5rem; }
.btn.quiet:hover { color: var(--fault); background: none; }

label { display: block; font-weight: 600; font-size: var(--step--1); margin-bottom: 0.3rem; color: var(--ink); }
.hint { font-weight: 400; color: var(--muted); }
input, select, textarea {
  width: 100%;
  font: inherit;
  color: var(--ink-strong);
  background: var(--midnight);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  padding: 0.55rem 0.7rem;
  min-height: 2.75rem;
}
input::placeholder, textarea::placeholder { color: #7f8aa1; }
select option { background: var(--surface); color: var(--ink); }
textarea { min-height: 5rem; resize: vertical; }
.field-row { display: grid; gap: 0.85rem; }
@media (min-width: 36rem) { .field-row.two { grid-template-columns: 1fr 1fr; } }
.check { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 400; font-size: var(--step-0); }
.check input { width: 1.15rem; height: 1.15rem; min-height: 0; margin-top: 0.2rem; flex: none; accent-color: var(--first-light); }

.form-error {
  background: var(--fault-bg);
  color: var(--fault);
  border-radius: var(--radius-s);
  padding: 0.6rem 0.75rem;
  font-size: var(--step--1);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  background: var(--ink-strong);
  color: var(--midnight);
  padding: 0.7rem 1rem;
  border-radius: var(--radius-s);
  max-width: calc(100% - 2rem);
  z-index: 10;
}

/* ---------- status chips ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--step--1);
  font-weight: 600;
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  background: var(--raised);
  color: var(--muted);
  white-space: nowrap;
}
.chip.talk { background: var(--lantern); color: var(--midnight); }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.fault { background: var(--fault-bg); color: var(--fault); }
.chip.sent { background: var(--sent-bg); color: var(--sent); }

/* ---------- calls list ---------- */

.calls { list-style: none; margin: 0; padding: 0; }
.calls li + li { margin-top: 0.6rem; }
.call {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 1rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 0.95rem 1.1rem;
  color: inherit;
  text-decoration: none;
}
.call:hover { border-color: var(--line-strong); background: var(--raised); color: inherit; }
.call.has-talk { border-color: var(--lantern); }
.call-title { font-weight: 600; color: var(--ink-strong); }
.call-meta { color: var(--muted); font-size: var(--step--1); }
.tally { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: end; }

/* ---------- the check-in board ---------- */

.board { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.board li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 1rem;
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.board li.talk {
  background: var(--talk-bg);
  box-shadow: inset 4px 0 0 var(--lantern);
}
.board .who { font-weight: 600; font-size: var(--step-1); color: var(--ink-strong); }
.board .how { color: var(--muted); font-size: var(--step--1); }
.board .note {
  grid-column: 1 / -1;
  margin-top: 0.35rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-s);
  background: rgba(242, 180, 90, 0.08);
  color: var(--first-light);
  white-space: pre-wrap;
}
.board .error { grid-column: 1 / -1; color: var(--fault); font-size: var(--step--1); }

.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 0.25rem 0 1.25rem;
}
.summary div { font-size: var(--step--1); color: var(--muted); }
.summary strong { display: block; font-family: var(--display); font-size: var(--step-2); color: var(--ink-strong); font-weight: 650; line-height: 1.1; }
.summary .is-talk strong { color: var(--lantern); }

/* ---------- people picker ---------- */

.picker { list-style: none; margin: 0; padding: 0; max-height: 26rem; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-s); }
.picker li { display: grid; grid-template-columns: auto 1fr; gap: 0.6rem; align-items: center; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--line); }
.picker li:last-child { border-bottom: 0; }
.picker li.chosen { background: var(--raised); }
.picker input[type="checkbox"] { width: 1.15rem; height: 1.15rem; min-height: 0; accent-color: var(--first-light); }
.picker .role-on-call { grid-column: 2; }
.picker .name { font-weight: 600; color: var(--ink-strong); }

/* ---------- tables (roster, audit) ---------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-m); }
table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: var(--step--1); }
th, td { text-align: left; padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-weight: 600; color: var(--muted); background: var(--raised); }
td.name { font-weight: 600; font-size: var(--step-0); color: var(--ink-strong); }
td select { min-width: 10rem; min-height: 2.4rem; padding-block: 0.35rem; }
td .contact + .contact { margin-top: 0.2rem; }
td .btn.quiet { min-height: 2.4rem; }
tr.inactive td { color: var(--muted); }

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-m);
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--muted);
}
.empty p { margin: 0 auto 1rem; }

/* ---------- onboarding ---------- */

.welcome { max-width: 34rem; margin: 3rem auto; }
.welcome p { margin: 0.75rem 0 1.5rem; }

/* =========================================================
   Responder page — the "First Light" hero and check-in.
   ========================================================= */

.respond-page { min-height: 100vh; }

.sky {
  position: relative;
  overflow: hidden;
  background: var(--midnight);
  height: clamp(19rem, 35vw, 36rem);
}
.sky-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sky-inner {
  position: relative;
  max-width: 34rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.eyebrow { font-size: var(--step--1); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--first-light); }
.slogan { font-family: var(--display); font-size: 1.9rem; font-weight: 700; line-height: 1.08; color: var(--ink-strong); letter-spacing: -0.02em; max-width: 16ch; }
@media (min-width: 40rem) { .slogan { font-size: 2.4rem; } }

.respond {
  max-width: 34rem;
  margin: -2.5rem auto 0;
  padding: 0 1rem 3rem;
  position: relative;
}
.respond-card {
  background: var(--dusk);
  border-radius: var(--radius-l);
  padding: 1.5rem 1.25rem;
}
@media (min-width: 40rem) { .respond-card { padding: 1.75rem; } }
.respond .from { color: var(--first-light); font-weight: 600; font-size: var(--step--1); }
.respond h1 { font-size: var(--step-2); margin: 0.5rem 0 0.75rem; line-height: 1.25; }
.respond-card label { color: var(--dusk-ink); }
.respond-card textarea { background: var(--raised); border-color: #4a4870; }
.respond-card .muted { color: var(--dusk-ink); }
.shared-note { font-size: var(--step--1); color: var(--dusk-ink); margin-top: 0.35rem; }

.choices { display: grid; gap: 0.6rem; margin: 1.25rem 0 1rem; }
.choice {
  font: inherit;
  font-size: var(--step-1);
  font-weight: 600;
  text-align: left;
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius-m);
  border: 2px solid transparent;
  background: var(--dusk-raised);
  color: var(--ink-strong);
  cursor: pointer;
  min-height: 3.75rem;
}
.choice span { display: block; font-size: var(--step--1); font-weight: 400; color: var(--dusk-ink); margin-top: 0.15rem; }
.choice:hover { border-color: #6a5c86; }
.choice[aria-pressed="true"] { border-color: var(--first-light); background: #4a426f; }
.choice.talk[aria-pressed="true"] { border-color: var(--lantern); background: var(--lantern); color: var(--midnight); }
.choice.talk[aria-pressed="true"] span { color: #3a2e1c; }

.sunrise { width: 6rem; height: 2.5rem; display: block; margin-bottom: 0.5rem; }

.resources { list-style: none; padding: 0; margin: 1rem 0 0; }
.resources li { padding: 0.75rem 0; border-top: 1px solid #4a4870; }
.resources li strong { display: block; color: var(--ink-strong); }
.resources h2 { color: var(--dusk-ink); }
.private { margin-top: 1.25rem; font-size: var(--step--1); color: var(--muted); }
.crisis { margin-top: 0.5rem; font-size: var(--step--1); color: var(--muted); }

/* ---------- private journal ---------- */

.journal {
  margin-top: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 1.25rem;
}
.journal > * + * { margin-top: 0.9rem; }
.journal h2 { font-size: var(--step-1); }
.journal .lock-line { display: flex; align-items: center; gap: 0.5rem; font-size: var(--step--1); color: var(--muted); }
.journal .lock-icon { width: 1rem; height: 1rem; flex: none; }
.journal .row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.pin {
  font-family: var(--display);
  font-size: 1.5rem;
  letter-spacing: 0.5em;
  text-align: center;
  max-width: 14rem;
}
.disclaimer {
  background: var(--fault-bg);
  border-radius: var(--radius-m);
  padding: 0.9rem 1rem;
  color: var(--ink);
}
.disclaimer strong { color: var(--fault); }
.entries { list-style: none; margin: 0; padding: 0; }
.entries li { padding: 0.85rem 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 0.75rem; }
.entries .when { font-size: var(--step--1); color: var(--muted); }
.entries .text { grid-column: 1 / -1; white-space: pre-wrap; overflow-wrap: anywhere; }
.entries .btn.quiet { min-height: 2.25rem; font-size: var(--step--1); }

@media (prefers-reduced-motion: no-preference) {
  .board li.talk { animation: lift 600ms ease-out 1; }
  @keyframes lift { from { background: #5a4523; } to { background: var(--talk-bg); } }
}

/* =========================================================
   Public home page — night at the top, morning at the bottom.
   ========================================================= */

.skip { position: absolute; left: -999px; top: 0; background: var(--ink-strong); color: var(--midnight); padding: 0.6rem 1rem; z-index: 20; border-radius: 0 0 var(--radius-s) 0; }
.skip:focus { left: 0; }

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }

.hero {
  position: relative;
  overflow: hidden;
  min-height: clamp(40rem, 92vh, 52rem);
  display: flex;
  flex-direction: column;
}
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.site-nav {
  position: relative;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}
.site-nav .brand { text-decoration: none; }
.site-nav .brand:hover { color: var(--ink-strong); }
.site-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem; }
.site-links a:not(.btn) { color: var(--ink); text-decoration: none; }
.site-links a:not(.btn):hover { color: var(--first-light); }
@media (max-width: 34rem) { .site-links a:not(.btn) { display: none; } }

.hero-copy {
  position: relative;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: clamp(2rem, 8vh, 5rem) 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.hero-copy > * { max-width: 36rem; }
.hero h1 { font-size: clamp(2.3rem, 6vw, 3.9rem); line-height: 1.04; letter-spacing: -0.025em; }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--ink); line-height: 1.55; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.4rem; }
.cta-row .btn { min-height: 3rem; padding-inline: 1.5rem; font-size: 1.05rem; }
.crisis-line { font-size: var(--step--1); color: var(--muted); }

.band { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.band-night { background: var(--midnight); }
.band-dusk { background: #151a33; }
.band-plum { background: #221f40; }
.section-title { font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin-bottom: 2rem; }
.section-lede { color: var(--dusk-ink); font-size: 1.1rem; }

.meanings { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.meaning { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 1.5rem; }
.meaning-icon { width: 3.5rem; height: 3.5rem; display: block; margin-bottom: 1rem; }
.meaning h3 { margin-bottom: 0.5rem; }
.meaning p { color: var(--ink); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.steps li { border-top: 2px solid var(--line-strong); padding-top: 1.25rem; }
.step-num { font-family: var(--display); font-weight: 700; font-size: 1.1rem; color: var(--midnight); background: var(--first-light); width: 2.25rem; height: 2.25rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 0.9rem; }
.steps h3 { margin-bottom: 0.4rem; }

.privacy-grid { display: grid; gap: 2rem; }
@media (min-width: 52rem) { .privacy-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); align-items: start; } }
.promises { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.promises li { background: var(--dusk); border-radius: var(--radius-m); padding: 1.1rem 1.25rem; color: var(--dusk-ink); }
.promises strong { display: block; color: var(--ink-strong); margin-bottom: 0.2rem; }

.dawn { position: relative; overflow: hidden; min-height: clamp(34rem, 70vh, 42rem); display: flex; align-items: flex-start; }
.dawn-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.dawn-copy { position: relative; padding-top: clamp(3rem, 8vw, 5rem); padding-bottom: 12rem; display: flex; flex-direction: column; gap: 1rem; }
.dawn-copy > * { max-width: 36rem; }
.dawn h2 { color: #1e1a33; font-size: clamp(1.9rem, 4vw, 2.8rem); }
.dawn p { color: #2b2340; font-size: 1.08rem; }
.eyebrow-dark { color: #4a2f55; }
.btn.dark { background: #1e1a33; border-color: #1e1a33; color: #f7f2ec; }
.btn.dark:hover { background: #2b2340; border-color: #2b2340; color: #fff; }
.btn.outline-dark { background: transparent; border: 1.5px solid #1e1a33; color: #1e1a33; }
.btn.outline-dark:hover { background: rgba(30, 26, 51, 0.08); color: #1e1a33; }
.dawn a:focus-visible { outline-color: #1e1a33; }

.site-footer { background: #1e1a33; color: var(--dusk-ink); padding: 1.5rem 0; font-size: var(--step--1); }
.footer-row { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; align-items: center; justify-content: space-between; }
.small-brand { font-size: 1rem; }

/* Console header: the same ridge and first light, as a thin strip. */
.topbar { background: var(--midnight) url("/ridge.6b75163a5a.svg") center bottom / cover no-repeat; }
.topbar .brand { text-decoration: none; }
.topbar .brand:hover { color: var(--ink-strong); }
.home main { max-width: none; margin: 0; padding: 0; }
.dawn-card { background: rgba(247, 242, 236, 0.94); border-radius: var(--radius-l); padding: clamp(1.5rem, 3vw, 2.25rem); max-width: 38rem; display: flex; flex-direction: column; gap: 1rem; box-shadow: 0 20px 60px rgba(30, 26, 51, 0.25); }
.dawn-card > * { max-width: none; }
.dawn-copy { padding-bottom: 13rem; }
.eyebrow-dark { color: #7a3e4f; }
.dawn-card a:not(.btn) { color: #7a3e4f; font-weight: 600; }
.dawn-card a:not(.btn):hover { color: #4a2f55; }

/* ---------- follow-ups ---------- */

.board li.followed { box-shadow: inset 4px 0 0 var(--ok); }
.board .followup { grid-column: 1 / -1; margin-top: 0.5rem; }
.board .followup .row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.board .followup-form { max-width: 34rem; }
.followup-done { color: var(--ok); font-size: var(--step--1); display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; }
.followup-done .btn.quiet { min-height: 2.25rem; }
.followup-note { margin-top: 0.3rem; padding: 0.55rem 0.8rem; border-radius: var(--radius-s); background: var(--ok-bg); color: var(--ink); white-space: pre-wrap; }

/* ---------- audit filters ---------- */

.filters { display: grid; gap: 0.85rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); align-items: end; margin-bottom: 1rem; }
.filter-actions { display: flex; gap: 0.4rem; align-items: center; }
.audit-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 1rem; }
.chip.cat-response { background: var(--talk-bg); color: var(--first-light); }
.chip.cat-follow_up { background: var(--ok-bg); color: var(--ok); }
.chip.cat-check_in { background: var(--sent-bg); color: var(--sent); }
.chip.cat-security { background: var(--fault-bg); color: var(--fault); }
tr.manual td { background: rgba(240, 160, 148, 0.05); }

/* ---------- audit detail ---------- */

tr.audit-detail > td { background: var(--midnight); padding: 1rem 1.1rem 1.25rem; }
.audit-detail-body > * + * { margin-top: 0.85rem; }
.audit-subject { font-size: var(--step-0); }
.audit-subject strong { color: var(--ink-strong); }
table.audit-fields { background: var(--surface); }
table.audit-fields td:first-child { color: var(--muted); width: 12rem; }
.audit-context { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1.25rem; margin: 0; font-size: var(--step--1); }
.audit-context dt { color: var(--muted); }
.audit-context dd { margin: 0; overflow-wrap: anywhere; }
.btn.small-btn { min-height: 2.25rem; padding: 0.3rem 0.75rem; font-size: var(--step--1); }

/* ---------- roster ---------- */

td.row-actions .btn { display: flex; width: max-content; }
td.row-actions .btn + .btn { margin-top: 0.25rem; }
td.row-actions .btn.quiet { min-height: 2.25rem; padding-inline: 0.75rem; }
.split .row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.roster-filter { margin: -0.5rem 0 1rem; color: var(--muted); font-size: var(--step--1); }

/* Roster: fit beside the form without sideways scrolling. */
.roster-table td, .roster-table th { padding-inline: 0.6rem; }
.roster-table td.name { overflow-wrap: anywhere; }
.roster-table td .contact { overflow-wrap: anywhere; }
.roster-table td select { min-width: 0; width: 100%; max-width: 11rem; }
.roster-table td:nth-child(2) { width: 9.5rem; }
@media (max-width: 40rem) {
  /* Phones: each person becomes a small card instead of a wide row. */
  .roster-table thead { display: none; }
  .roster-table, .roster-table tbody { display: block; }
  .roster-table tr { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem 0.75rem; padding: 0.9rem 0.8rem; border-bottom: 1px solid var(--line); }
  .roster-table td { display: block; border: 0; padding: 0; }
  .roster-table td.name { grid-column: 1; }
  .roster-table td:nth-child(2) { grid-column: 2; grid-row: 1; width: auto; }
  .roster-table td:nth-child(3) { grid-column: 1 / -1; }
  .roster-table td.row-actions { grid-column: 1 / -1; display: flex; gap: 0.5rem; }
  .roster-table td.row-actions .btn + .btn { margin-top: 0; }
}
.field-hint { margin-top: 0.3rem; font-size: var(--step--1); color: var(--muted); }

/* ---------- import contacts ---------- */

.import-panel { margin-bottom: 1.25rem; }
.import-panel .row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: end; }
.import-panel label.btn { margin: 0; font-size: var(--step-0); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.import-how summary { cursor: pointer; color: var(--muted); font-size: var(--step--1); }
.import-how ul { margin: 0.5rem 0 0; padding-left: 1.2rem; font-size: var(--step--1); }
.import-how li + li { margin-top: 0.35rem; }
.import-table { max-height: 26rem; overflow: auto; }
.import-table td input:not([type="checkbox"]) { min-height: 2.25rem; padding-block: 0.3rem; min-width: 10rem; }
.import-table input[type="checkbox"] { width: 1.15rem; height: 1.15rem; min-height: 0; accent-color: var(--first-light); }
.import-table td.contact { overflow-wrap: anywhere; }
.import-actions select { width: auto; min-width: 10rem; }
.chip.fault + .chip, .contact .chip { margin-left: 0.35rem; }
.nowrap { white-space: nowrap; }
@media (max-width: 40rem) {
  .import-table { max-height: none; overflow: visible; }
  .import-table table, .import-table tbody { display: block; }
  .import-table thead tr { display: flex; align-items: center; gap: 0.6rem; }
  .import-table thead th:not(:first-child) { display: none; }
  .import-table thead th:first-child::after { content: "Select all"; margin-left: 0.6rem; font-weight: 600; }
  .import-table tbody tr { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 0.75rem; padding: 0.75rem; border-bottom: 1px solid var(--line); }
  .import-table td { display: block; border: 0; padding: 0; }
  .import-table td:first-child { grid-row: 1 / span 4; padding-top: 0.5rem; }
  .import-table td input:not([type="checkbox"]) { min-width: 0; width: 100%; }
  .import-table td:empty { display: none; }
}
