/*
 * Performance platform — stylesheet.
 *
 * Mobile first: everything below is written for a phone, and the few
 * `min-width` blocks widen it for a desktop. No framework, no build step.
 */

:root {
  --bg: #f5f7f9;
  --card: #ffffff;
  --ink: #131a22;
  --muted: #5b6673;
  --faint: #8a94a0;
  --line: #e2e7ed;
  --line-strong: #ccd4dd;
  --accent: #0d6e64;
  --accent-ink: #0a574f;
  --accent-soft: #e8f6f3;
  --good: #157a4a;
  --good-soft: #e7f6ee;
  --warn: #a8600a;
  --warn-soft: #fdf3e3;
  --bad: #b3261e;
  --bad-soft: #fdeceb;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(19, 26, 34, .05), 0 6px 20px -12px rgba(19, 26, 34, .18);
}

* { box-sizing: border-box; }

/* Sections stay hidden until the answer that calls for them is chosen. */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--accent-ink); }

/* ── Chrome ─────────────────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  max-width: 1120px;
  margin: 0 auto;
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }

.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: linear-gradient(140deg, var(--accent), #14a08f);
}

.brand-name { display: block; font-weight: 650; font-size: 15px; }
.brand-sub { display: block; font-size: 12px; color: var(--muted); }

.topbar-user { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.who { text-align: right; line-height: 1.25; margin-right: 2px; }
.who strong { display: block; font-size: 13px; }
.who span { display: block; font-size: 11.5px; color: var(--muted); }

/* The tab strip scrolls sideways on a phone rather than wrapping into a block. */
.tabs { border-top: 1px solid var(--line); background: #fbfcfd; position: relative; }
.tabs-inner {
  display: flex; gap: 2px; padding: 0 10px;
  max-width: 1120px; margin: 0 auto;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
/* The strip scrolls sideways on a phone, so it needs to look scrollable —
   otherwise a tab that is cut off by the edge reads as broken text. */
.tabs::after {
  content: ""; position: absolute; top: 1px; right: 0; bottom: 0; width: 30px;
  background: linear-gradient(to right, rgba(251, 252, 253, 0), #fbfcfd 80%);
  pointer-events: none;
}
@media (min-width: 960px) { .tabs::after { display: none; } }
.tabs-inner::-webkit-scrollbar { height: 3px; }
.tabs-inner::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }

.tab {
  flex: none; padding: 11px 12px; font-size: 13.5px; font-weight: 550;
  color: var(--muted); text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--accent-ink); border-bottom-color: var(--accent); }

.page { max-width: 1120px; margin: 0 auto; padding: 18px 16px 56px; }

.foot {
  max-width: 1120px; margin: 0 auto; padding: 0 16px 40px;
  font-size: 12.5px; color: var(--faint);
}
.foot p + p { margin-top: 6px; }

/* ── Page furniture ─────────────────────────────────────────────────────── */

.page-head { margin-bottom: 16px; }
.page-head h1 { font-size: 22px; }
.page-head p { color: var(--muted); font-size: 14px; margin-top: 4px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}
.card-head { padding: 15px 16px 0; }
.card-head h2 { font-size: 16px; }
.card-head p { color: var(--muted); font-size: 13.5px; margin-top: 5px; }
.card-body { padding: 15px 16px 16px; }
.card-head + .card-body { padding-top: 13px; }

.card-accent { border-color: #bfe0da; }

/* Sections stack: one per line, never side by side. */
.stack { display: block; }

.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }

.split { display: grid; gap: 16px; grid-template-columns: 1fr; }

.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.row-tight { display: flex; align-items: center; gap: 6px; }

/* ── Controls ───────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 15px; font: inherit; font-size: 14px; font-weight: 600;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--faint); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn-quiet:hover { background: #eef1f5; color: var(--ink); }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-stamp { background: var(--accent-soft); border-color: #bfe0da; color: var(--accent-ink); }
.btn-stamp.is-stamped { background: var(--good-soft); border-color: #b9e2cc; color: var(--good); }

.field { display: block; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.hint { display: block; font-size: 12.5px; color: var(--muted); margin-top: 5px; }

input[type="text"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], select, textarea {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 16px;
  color: var(--ink); background: #fff;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  -webkit-appearance: none; appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%), linear-gradient(135deg, var(--faint) 50%, transparent 50%); background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9fd5cc; outline-offset: 1px; border-color: var(--accent); }

.field-inline { display: flex; align-items: center; gap: 8px; margin: 0; }
.field-inline .label { margin: 0; }
.field-inline select { width: auto; min-width: 170px; padding: 7px 34px 7px 10px; font-size: 14px; background-position: calc(100% - 16px) 15px, calc(100% - 11px) 15px; }

.field-static .static-value { display: block; font-size: 15px; font-weight: 600; }

.choice { display: flex; gap: 8px; }
.choice label {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  cursor: pointer; font-size: 14.5px; font-weight: 600; background: #fff;
}
.choice input { width: auto; margin: 0; }
.choice label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }

.period-picker { margin-left: auto; }

/* ── Badges, flashes, notes ─────────────────────────────────────────────── */

.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 650; letter-spacing: .01em;
  background: #eef1f5; color: var(--muted); white-space: nowrap;
}
.badge-good { background: var(--good-soft); color: var(--good); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-accent { background: var(--accent-soft); color: var(--accent-ink); }

.flash {
  padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px;
  font-size: 14px; font-weight: 550; border: 1px solid;
}
.flash-good { background: var(--good-soft); border-color: #b9e2cc; color: var(--good); }
.flash-bad { background: var(--bad-soft); border-color: #f2c6c3; color: var(--bad); }
.flash-warn { background: var(--warn-soft); border-color: #f0dcb8; color: var(--warn); }

.notice { padding: 12px 14px; border-radius: var(--radius-sm); background: #f8fafb; border: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.notice strong { color: var(--ink); }

/* ── Score display ──────────────────────────────────────────────────────── */

.dial {
  position: relative; width: 132px; height: 132px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--tone, var(--accent)) calc(var(--pct, 0) * 1%), #e9edf2 0);
  display: grid; place-content: center; text-align: center;
}
.dial::after {
  content: ""; position: absolute; inset: 11px; border-radius: 50%; background: var(--card);
}
.dial-value { position: relative; font-size: 30px; font-weight: 700; line-height: 1; z-index: 1; }
.dial-caption { position: relative; display: block; font-size: 11px; color: var(--muted); margin-top: 3px; z-index: 1; }
.dial-empty { background: #e9edf2; }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.15; }
.stat-label { font-size: 12.5px; color: var(--muted); }

.trend { display: flex; align-items: flex-end; gap: 6px; height: 108px; padding-top: 6px; }
.trend-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 5px; }
.trend-bar { width: 100%; max-width: 42px; border-radius: 5px 5px 2px 2px; background: var(--faint); }
.trend-good { background: var(--good); }
.trend-warn { background: #d99a2b; }
.trend-bad { background: var(--bad); }
.trend-count { background: var(--accent); }
.trend-empty { background: #dde3e9; height: 3px !important; }
.trend-flat { align-items: center; justify-content: center; height: auto; min-height: 64px; }
.trend-flat p { text-align: center; }
.trend-label { font-size: 11px; color: var(--faint); }

/* ── Business-intelligence charts ───────────────────────────────────────── */

/* Horizontal bars: a ranked comparison, where the labels are names. */
.hbars { display: flex; flex-direction: column; gap: 9px; }
.hbar-row { display: grid; grid-template-columns: minmax(96px, 34%) 1fr auto; align-items: center; gap: 10px; }
.hbar-label { font-size: 12.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 12px; background: #eef2f6; border-radius: 6px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.hbar-value { font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--muted); min-width: 34px; text-align: right; }

/* Band distribution: one stacked bar, so proportions read at a glance. */
.bandbar { display: flex; height: 18px; border-radius: 9px; overflow: hidden; background: #eef2f6; }
.bandbar-seg { display: block; height: 100%; }
.bandbar-good { background: var(--good); }
.bandbar-exceeds { background: #06401f; }
.bandbar-warn { background: #d99a2b; }
.bandbar-bad { background: var(--bad); }
.bandbar-empty { background: #c3ccd6; }
.bandbar-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.legend-item strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* Heatmap: person × month. An empty row is a person who has filed nothing. */
.heatmap { display: flex; flex-direction: column; gap: 3px; overflow-x: auto; }
/* A fixed name column, not 1fr: on a wide card 1fr stretched the name to 800px
   and left the month cells stranded at the far right. The month cells then share
   the remaining width, so the grid fills the card instead of hugging the left. */
.heatmap-row { display: grid; grid-template-columns: 200px repeat(6, 1fr); gap: 3px; align-items: center; justify-content: start; }
.heatmap-head { position: sticky; top: 0; }
.heatmap-name { font-size: 12.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 6px; }
.heatmap-cell { height: 24px; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-variant-numeric: tabular-nums; color: #fff; }
.heatmap-month { color: var(--faint); font-size: 11px; }
.heat-0 { background: #e3e9ef; }
.heat-1 { background: #b7ddd6; color: #0a574f; }
.heat-2 { background: #6fbfb2; }
.heat-3 { background: #2f9c8c; }
.heat-4 { background: var(--accent); }

/* On a phone the six month columns have to fit without a sideways swipe, or the
   newest month is the one that gets clipped — which is the one that matters. */
@media (max-width: 520px) {
  .heatmap-row { grid-template-columns: 104px repeat(6, 26px); }
  .heatmap-cell { height: 22px; font-size: 10px; }
  .heatmap-name { font-size: 11.5px; }
}

/* Week selector above the filing chart. "All month" first so the whole picture
   stays one click away; the arrows step through the weeks so nobody has to aim
   at a pill on a phone. */
.weeknav { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.weeknav-pills { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.weekpill {
  display: inline-block;
  padding: 5px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.weekpill:hover { color: var(--ink); border-color: var(--muted); }
.weekpill.is-active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.weekpill.is-active:hover { color: #fff; }
.weeknav-step {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  line-height: 1;
}
.weeknav-step:hover { color: var(--ink); border-color: var(--muted); }
.weeknav-step.is-off { opacity: .35; }

/* In the week list the name is the finding, so it wraps instead of being cut to
   "Reah Blackman Br…" — the generic bar chart can truncate an area label, but
   not the person you are being asked to go and talk to. */
.week-people .hbar-label { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.3; }
.week-people .hbar-row { grid-template-columns: minmax(110px, 46%) 1fr auto; align-items: center; }

/* Weekly bars: person × week inside one month. Height is relative to the
   busiest week, so the shape of a month is visible rather than the volume. */
.wbars { display: flex; flex-direction: column; }
.wbar-row {
  display: grid;
  /* A capped name column: at 1fr the name stretched to 750px on a wide card and
     pushed every bar to the far right edge. The week columns share what is left. */
  grid-template-columns: minmax(120px, 240px) repeat(var(--wk-cols, 5), minmax(30px, 1fr)) 56px;
  gap: 8px;
  align-items: end;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.wbar-row:last-child { border-bottom: 0; }
.wbar-head { align-items: center; border-bottom: 1px solid var(--line-strong); padding-bottom: 6px; }
.wbar-head .wbar-cell {
  font-size: 10.5px;
  color: var(--faint);
  letter-spacing: .02em;
  height: auto;
  justify-content: center;
  /* "15–21" broke into "15–" / "21" without this. */
  white-space: nowrap;
}
.wbar-head .wbar-name, .wbar-head .wbar-total {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--faint);
  font-weight: 600;
}
.wbar-name { font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; color: var(--ink); }
.wbar-cell { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; height: 46px; }
.wbar-count { font-size: 10px; line-height: 1; color: var(--muted); font-variant-numeric: tabular-nums; height: 10px; }
.wbar-track { display: flex; align-items: flex-end; height: 30px; width: 100%; max-width: 56px; margin: 0 auto; background: #eef2f6; border-radius: 3px; overflow: hidden; }
.wbar-fill { display: block; width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; }
.wbar-total { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink); padding-bottom: 1px; }
.wbar-empty .wbar-name { color: var(--faint); }
.wbar-empty .wbar-total { color: var(--faint); }

/* On a phone the five week columns plus the name have to fit 340px of card. */
@media (max-width: 520px) {
  .wbar-row { grid-template-columns: minmax(74px, 1fr) repeat(var(--wk-cols, 5), 30px) 34px; gap: 2px; }
  .wbar-name { font-size: 11.5px; }
  .wbar-cell { height: 40px; }
  .wbar-track { height: 26px; max-width: none; }
  .wbar-total { font-size: 12px; }
  /* "15–21" is 27px of text in a 30px column; at 9.5px it ran into its neighbour. */
  .wbar-head .wbar-cell { font-size: 8.5px; letter-spacing: 0; }
}

/* Cards in a row keep their own height, so a short card does not stretch to
   leave a screenful of empty space beside a tall one. */
.grid-start { align-items: start; }

/* KPI tiles: the summary row at the top of the board. */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.kpi-label { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.kpi-value { display: block; font-size: 26px; font-weight: 650; line-height: 1.15; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi-note { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi-good .kpi-value { color: var(--good); }
.kpi-warn .kpi-value { color: var(--warn); }
.kpi-bad .kpi-value { color: var(--bad); }

/* ── Lists and tables ───────────────────────────────────────────────────── */

.rowlist { display: flex; flex-direction: column; }
.rowitem { padding: 13px 0; border-bottom: 1px solid var(--line); }
.rowitem:first-child { padding-top: 0; }
.rowitem:last-child { border-bottom: 0; padding-bottom: 0; }
.rowitem-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rowitem-title { font-size: 14.5px; font-weight: 650; }
.rowitem-meta { font-size: 12.5px; color: var(--muted); }
.rowitem-body { font-size: 14px; margin-top: 4px; }
.quote { border-left: 3px solid var(--line-strong); padding: 2px 0 2px 11px; color: var(--muted); font-size: 14px; margin-top: 7px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); font-weight: 650; }
td.wrap, th.wrap { white-space: normal; min-width: 180px; }
tbody tr:last-child td { border-bottom: 0; }

.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mt { margin-top: 12px; }
.mb { margin-bottom: 12px; }

/* ── Sign-in ────────────────────────────────────────────────────────────── */

.gate { max-width: 560px; margin: 0 auto; padding: 28px 16px 60px; }
.gate-brand { text-align: center; margin-bottom: 22px; }
.gate-brand .brand-mark { width: 44px; height: 44px; border-radius: 13px; margin: 0 auto 12px; }
.gate-brand h1 { font-size: 21px; }
.gate-brand p { color: var(--muted); font-size: 14px; margin-top: 5px; }

.tiles { display: grid; gap: 10px; grid-template-columns: 1fr; }
.tile {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 15px 16px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); text-decoration: none; color: inherit;
  box-shadow: var(--shadow); font-weight: 600; font-size: 15px;
}
.tile:hover { border-color: var(--accent); }
.tile span.chev { color: var(--faint); font-weight: 400; }

.namelist { display: flex; flex-direction: column; gap: 8px; }
.namepick {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 15px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); text-decoration: none; color: inherit; font-size: 15px;
}
.namepick:hover { border-color: var(--accent); }
.namepick.is-picked { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; }

/* ── How to use (the guide under the sign-in list) ──────────────────────── */

.howto {
  margin-top: 20px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  text-align: left;
}
.howto-heading {
  font-size: 15px; margin: 0; padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
}

/* The strip scrolls sideways on a phone rather than stacking seven tabs. */
.howto-tabs-wrap { position: relative; background: #fbfcfd; }
.howto-tabs-wrap::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 26px;
  background: linear-gradient(to right, rgba(251, 252, 253, 0), #fbfcfd 80%);
  pointer-events: none;
}

.howto-tabs {
  display: flex; gap: 2px; padding: 0 8px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin;
  border-bottom: 1px solid var(--line);
}
.howto-tabs::-webkit-scrollbar { height: 3px; }
.howto-tabs::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }

@media (min-width: 640px) {
  /* The card is narrower than seven tabs, so on a wide screen they wrap onto a
     second row and all seven stay reachable without a hidden scroll. Declared
     after the base rule above so it actually overrides it. */
  .howto-tabs-wrap::after { display: none; }
  .howto-tabs { flex-wrap: wrap; overflow-x: visible; padding: 2px 8px 0; }
}

.howto-tab {
  flex: none; padding: 10px; font: inherit; font-size: 13px; font-weight: 600;
  color: var(--muted); background: none; border: 0; cursor: pointer;
  white-space: nowrap; border-bottom: 2px solid transparent;
}
.howto-tab:hover { color: var(--ink); }
.howto-tab.is-active { color: var(--accent-ink); border-bottom-color: var(--accent); }
.howto-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.howto-panel { padding: 14px 16px 16px; font-size: 13.5px; line-height: 1.5; }
/* Only the script sets [hidden]; with scripting off every panel stays open. */
.howto-panel[hidden] { display: none; }
.howto-panel:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }
.howto-lead { margin: 0 0 10px; color: var(--muted); }

.howto-steps { margin: 0 0 12px; padding-left: 18px; }
.howto-steps li { margin-bottom: 7px; }

.howto-list { list-style: none; margin: 0 0 10px; padding: 0; }
.howto-list li { padding: 10px 0; border-top: 1px solid var(--line); }
.howto-list li:first-child { border-top: 0; padding-top: 2px; }
.howto-sec { display: block; font-weight: 650; color: var(--ink); margin-bottom: 3px; }
.howto-how { display: block; color: var(--muted); }

.howto-note {
  margin: 10px 0 0; padding: 10px 12px; font-size: 13px;
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  border-radius: 6px; color: var(--ink);
}
.howto-note strong { color: var(--accent-ink); }

/* ── Desktop ────────────────────────────────────────────────────────────── */

@media (min-width: 640px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 960px) {
  .page { padding: 26px 20px 64px; }
  .split { grid-template-columns: 320px 1fr; align-items: start; }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .tabs-inner { padding: 0 12px; }
}

/* ── Family liaison ────────────────────────────────────────────────────────
   One kind of record at a time. The tabs are a plain wrap rather than a
   scroller so the fifth one is never hidden off the edge of a phone. */
.subtabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 18px 0 14px;
}
.subtab {
  font-size: 13px; font-weight: 550; padding: 7px 12px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  color: var(--muted); text-decoration: none; background: var(--card);
}
.subtab:hover { color: var(--ink); border-color: var(--line-strong); background: #f6f8fa; }
.subtab.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

.pfcl-list { display: flex; flex-direction: column; gap: 0; }
.pfcl-row {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.pfcl-row:first-child { border-top: 0; padding-top: 0; }
.pfcl-row-main { min-width: 0; }
.pfcl-when {
  display: block; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--faint); font-weight: 650;
}
.pfcl-who { display: block; font-size: 14.5px; margin-top: 2px; }
.pfcl-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted); margin-top: 5px;
}
.pfcl-text { font-size: 13px; margin: 6px 0 0; overflow-wrap: anywhere; }
.pfcl-row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pfcl-row-actions form { display: inline; }
.pfcl-inline-form { display: flex; flex-direction: column; gap: 10px; }

/* A row has two columns once there is room for the buttons beside the text. */
@media (min-width: 720px) {
  .pfcl-row { flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 16px; }
  .pfcl-row-main { flex: 1 1 auto; }
  .pfcl-row-actions { flex: 0 0 auto; align-items: center; }
  .pfcl-inline-form { flex-direction: row; align-items: flex-end; }
  .pfcl-inline-form .field { flex: 1 1 0; min-width: 0; }
}


/* "Not on the list? Add it here", sitting directly under the dropdown it belongs
   to. Kept always visible rather than behind a disclosure: the roster starts
   empty, so this is the first thing most officers need, not an edge case. */
.field-add {
  margin: -6px 0 16px;
  padding: 12px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: #f8fafb;
}
.field-add-kicker {
  display: block;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .02em;
  color: var(--muted);
  margin-bottom: 8px;
}
.field-add .field { margin-bottom: 8px; }
.field-add .field:last-child { margin-bottom: 0; }

/* The roster's two add-forms: stacked on a phone, side by side when there is room. */
.pfcl-add-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.pfcl-add-form { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.pfcl-add-form .btn { align-self: flex-start; }

@media (min-width: 860px) {
  .pfcl-add-grid { grid-template-columns: 1fr 1fr; gap: 0 26px; align-items: start; }
  /* A hairline between the two forms: without it the columns read as one long
     form with a strange gap in the middle. */
  .pfcl-add-form + .pfcl-add-form {
    border-left: 1px solid var(--line);
    padding-left: 26px;
  }
}


@media print {
  .topbar, .foot, .btn, .tabs { display: none !important; }
  .card { box-shadow: none; break-inside: avoid; }
}
