/* Brackwell internal ops UI.
   Dense and utilitarian on purpose: this is a tool a property manager works in, not a page they
   read. Light work surface, black for the brand, and colour only for status. Red is a unit that
   needs a visit or an error, so a screen with nothing wrong shows none. Light only: the dark
   tokens apply when something sets data-theme="dark" on the root, and nothing does yet. */

:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --sunk: #f7f8f9;
  --ink: #1c1c1c;
  --ink-soft: #474c54;
  --muted: #5c6169;
  --line: #e3e5e8;
  /* Input and control borders: 3:1 on white, which WCAG asks of a control's edge. */
  --line-2: #8a9099;

  /* Black is the brand: the rail, headings, primary buttons, focus and selection. */
  --brand: #000000;
  --on-brand: #ffffff;
  --rail: #000000;
  --rail-muted: #a6a6a6;
  --rail-w: 216px;

  /* Status. Text passes 4.5:1 on white and on its wash; a mark (dot, bar) passes 3:1 on white. */
  --good: #0b6b34;
  --good-wash: #e3f3e9;
  --good-mark: #14883f;
  --warn: #7a4d00;
  --warn-wash: #fbeed3;
  --warn-mark: #b97a00;
  --bad: #a61b1b;
  --bad-wash: #fce7e5;
  --bad-mark: #d12a1f;
  --neutral-wash: #eceef1;

  --radius: 6px;
}

:root[data-theme="dark"] {
  --bg: #0e0f11;
  --surface: #17191c;
  --sunk: #1e2125;
  --ink: #e6e8eb;
  --ink-soft: #c2c7ce;
  --muted: #9aa1aa;
  --line: #2a2e33;
  --line-2: #6b727b;
  --brand: #f2f2f2;
  --on-brand: #000000;
  --good: #5cc98a;
  --good-wash: #12301f;
  --good-mark: #3fae6c;
  --warn: #e3b04f;
  --warn-wash: #33270f;
  --warn-mark: #d39b2c;
  --bad: #f08a7e;
  --bad-wash: #3a1a17;
  --bad-mark: #e5554a;
  --neutral-wash: #262a2f;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.login { max-width: 440px; margin: 64px auto; padding: 0 16px; }
.login button { margin-top: 16px; }
#login-error { color: var(--bad); }

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

/* ---------------------------------- chrome ---------------------------------- */

/* A black bar on every page; on the operator app it is a left rail from 768px up. */
header.top {
  position: sticky; top: 0; z-index: 20;
  background: var(--rail); color: #fff;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  padding: 10px 16px; min-height: 54px;
}
header.top :focus-visible { outline-color: #fff; }
.brand { font-weight: 700; font-size: 15px; color: #fff; }
nav.tabs { display: flex; gap: 2px; order: 3; width: 100%; overflow-x: auto; }
nav.tabs button {
  background: none; border: 0; color: var(--rail-muted);
  font: inherit; font-weight: 500; padding: 8px 12px; white-space: nowrap;
  border-radius: var(--radius); cursor: pointer;
}
nav.tabs button:hover { color: #fff; background: #1f1f1f; }
nav.tabs button[aria-current="page"] { color: #000; background: #fff; font-weight: 600; }

.spacer { flex: 1; }
#sign-out { background: transparent; color: #fff; border-color: #4a4a4a; }

.health {
  font-size: 12px; line-height: 1;
  display: flex; align-items: center; gap: 6px;
  color: var(--rail-muted); padding: 6px 10px;
  border: 1px solid #3a3a3a; border-radius: 99px;
}
.health .pip { width: 7px; height: 7px; border-radius: 50%; background: var(--rail-muted); }
.health.up .pip { background: var(--good-mark); }
.health.down .pip { background: #ff8a80; }
.health.down { color: #ff8a80; border-color: #ff8a80; }

main { max-width: 1180px; margin: 0 auto; padding: 24px 16px 80px; }

@media (min-width: 768px) {
  header.rail {
    position: fixed; inset: 0 auto 0 0; width: var(--rail-w);
    flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 4px; padding: 20px 12px;
  }
  header.rail .brand { padding: 0 12px 16px; font-size: 16px; }
  header.rail nav.tabs { order: 0; flex-direction: column; overflow: visible; }
  header.rail nav.tabs button { text-align: left; padding: 9px 12px; }
  header.rail #sign-out { margin: 0 12px 8px; }
  header.rail .health { align-self: flex-start; margin: 0 12px; }
  header.rail ~ main { margin-left: var(--rail-w); padding: 28px 32px 80px; }
}

/* ---------------------------------- headings ---------------------------------- */

h1 { font-size: 20px; line-height: 28px; font-weight: 700; color: var(--brand); margin: 0 0 4px; }
h2 { font-size: 16px; line-height: 24px; font-weight: 650; color: var(--brand); margin: 0 0 12px; }
h3 { font-size: 14px; font-weight: 650; color: var(--brand); }
.sub { color: var(--muted); margin: 0 0 24px; font-size: 13.5px; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.page-head .grow { flex: 1; min-width: 0; }

/* ---------------------------------- cards ---------------------------------- */

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 24px; margin-bottom: 16px;
}
@media (max-width: 767px) { .card { padding: 16px; } }
.card.tight { padding: 14px 16px; }
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.grid.two { grid-template-columns: 1fr; }
/* Two columns only where the rail leaves room for a 560px table beside a 300px form. */
@media (min-width: 1280px) { .grid.two { grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); } }

/* ---------------------------------- stats ---------------------------------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-bottom: 16px; }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px;
}
.stat .k { font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.stat .k::first-letter { text-transform: uppercase; }
.stat, a.stat { display: flex; flex-direction: column; }
/* Labels wrap to one or two lines; the numbers still line up. */
.stat .v { font-size: 24px; line-height: 1.2; font-weight: 700; color: var(--brand); margin-top: auto; padding-top: 6px; font-variant-numeric: tabular-nums; }

/* ---------------------------------- tables ---------------------------------- */

.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 13px; min-width: 560px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--sunk); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--sunk); }
td.num { white-space: nowrap; }
td.best { background: var(--good-wash); }

/* ---------------------------------- pills ---------------------------------- */

/* A status chip: tinted, labelled, sentence case even when the label arrives lower case. */
.pill {
  display: inline-block; font-size: 12px; font-weight: 600; line-height: 1;
  padding: 5px 8px; border-radius: 4px; white-space: nowrap;
  border: 1px solid transparent; color: var(--ink-soft); background: var(--neutral-wash);
}
.pill::first-letter { text-transform: uppercase; }
.pill.good { color: var(--good); background: var(--good-wash); }
.pill.warn { color: var(--warn); background: var(--warn-wash); }
.pill.bad  { color: var(--bad); background: var(--bad-wash); }
/* The server's "accent" tone is waiting: amber like "warn", outlined so the two stay apart. */
.pill.accent { color: var(--warn); background: var(--surface); border-color: var(--warn-mark); }
/* Demo data. Dashed and uncoloured on purpose: it is a label about provenance, not a status. */
.pill.demo { color: var(--muted); border: 1px dashed var(--muted); background: transparent; }

/* ---------------------------------- forms ---------------------------------- */

label { display: block; font-weight: 600; font-size: 13px; margin: 0 0 5px; }
label .hint { font-weight: 400; color: var(--muted); }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--radius); padding: 8px 10px;
}
/* Everything that can take focus, including a table's scroll box, which Chrome makes focusable. */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--brand); }
textarea { min-height: 78px; resize: vertical; }
.field { margin-bottom: 13px; }
.row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }

.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border-radius: var(--radius); padding: 8px 14px;
  border: 1px solid var(--brand); background: var(--brand); color: var(--on-brand);
}
a.btn { display: inline-block; text-decoration: none; line-height: 1.55; }
.btn:hover:not(:disabled) { opacity: .86; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover:not(:disabled) { opacity: 1; background: var(--sunk); }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.small { padding: 5px 10px; font-size: 12.5px; }

/* A number you can open. The score is a button so the rows behind it are one click away. */
button.linkish {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer;
  text-align: left; text-decoration: underline dotted var(--line-2); text-underline-offset: 3px;
}
button.linkish:hover, button.linkish[aria-expanded="true"] { text-decoration-color: var(--brand); }
.actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------- notices ---------------------------------- */

.notice {
  border: 1px solid var(--line); background: var(--sunk); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 14px; font-size: 13px;
}
.notice.warn { background: var(--warn-wash); border-color: var(--warn-mark); }
.notice.bad { background: var(--bad-wash); border-color: var(--bad-mark); }
.notice.good { background: var(--good-wash); border-color: var(--good-mark); }
.notice .t { font-weight: 650; display: block; margin-bottom: 3px; }
.notice ul { margin: 6px 0 0; padding-left: 18px; }

.empty { color: var(--muted); text-align: center; padding: 34px 16px; font-size: 13px; }
.muted { color: var(--muted); }
/* Was monospace. Counts and times keep their columns with tabular figures instead. */
.mono { font-variant-numeric: tabular-nums; }
code { font: inherit; font-weight: 600; background: var(--neutral-wash); padding: 1px 5px; border-radius: 4px; }
.said { font-style: italic; color: var(--ink-soft); }

/* ---------------------------------- quote cards ---------------------------------- */

.quotes { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); }
.quote {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 15px; display: flex; flex-direction: column; gap: 9px;
}
.quote.winner { border-color: var(--good); border-width: 2px; padding: 14px; }
.quote .qh { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.quote .name { font-weight: 650; font-size: 14px; }
.quote dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 12.5px; }
.quote dt { color: var(--muted); }
.quote dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.spin {
  display: inline-block; width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid var(--line-2); border-top-color: var(--brand);
  animation: spin .7s linear infinite; vertical-align: -1px;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

/* ---------------------------------- toast ---------------------------------- */

#toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--brand); color: var(--on-brand);
  padding: 11px 17px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; z-index: 100; max-width: 90vw;
}
#toast[hidden] { display: none !important; }
#toast.bad { background: var(--bad); color: #fff; }

/* ---------------------------------- empty states ---------------------------------- */

.empty-state { padding: 22px 6px 10px; max-width: 600px; }
.empty-state .t { font-weight: 650; font-size: 15px; margin: 0 0 6px; }
.empty-state p { margin: 0 0 8px; font-size: 13px; color: var(--ink-soft); }
.empty-state .why { color: var(--muted); }
.empty-state .act { margin-top: 12px; }

/* ---------------------------------- auditable rows ---------------------------------- */

tr.history-row > td { background: var(--sunk); padding: 12px 14px 14px; }
.history .scroll { margin-top: 8px; }
.history table { min-width: 0; }
.defs { display: grid; grid-template-columns: max-content 1fr; gap: 9px 14px; margin: 0; font-size: 13px; }
.defs dt { font-weight: 600; white-space: nowrap; }
.defs dd { margin: 0; color: var(--ink-soft); }
@media (max-width: 640px) { .defs { grid-template-columns: 1fr; } .defs dd { margin-bottom: 4px; } }
.assumptions { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-soft); }
.assumptions li { margin-bottom: 6px; }

/* ---------------------------------- decisions ---------------------------------- */

/* A count you can open. Each tile lists every job of its status. */
a.stat { color: inherit; text-decoration: none; }
a.stat:hover { border-color: var(--line-2); background: var(--sunk); }
a.stat.active { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }

ol.decisions { list-style: none; margin: 0; padding: 0; }
.decision {
  display: grid; grid-template-columns: 1fr auto; gap: 3px 16px; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.decision:first-child { border-top: 0; padding-top: 2px; }
.decision .d { font-size: 14px; }
.decision .f { grid-column: 1; font-size: 13px; color: var(--ink-soft); }
.decision .a { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: 8px; }
@media (max-width: 640px) {
  .decision { grid-template-columns: 1fr; }
  .decision .a { grid-row: auto; grid-column: 1; }
}

/* ------------------------------- inspection cycle ------------------------------- */

/* Coloured by the tone the server sent (domain/inspections.ts), never by a state name. */
[data-tone] { --tone: var(--line-2); }
[data-tone="good"] { --tone: var(--good-mark); }
[data-tone="warn"], [data-tone="accent"] { --tone: var(--warn-mark); }
[data-tone="bad"] { --tone: var(--bad-mark); }
/* A dot before each count's label; the server's "accent" (waiting) is a ring, "warn" a dot. */
a.stat[data-tone] .k::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; vertical-align: 1px;
  border-radius: 50%; background: var(--tone);
}
a.stat[data-tone="accent"] .k::before { background: transparent; box-shadow: inset 0 0 0 2px var(--tone); }

.needs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
a.need {
  display: block; color: inherit; text-decoration: none; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
}
a.need:hover { border-color: var(--line-2); background: var(--sunk); }
a.need.active { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.need .v { font-size: 32px; line-height: 36px; font-weight: 700; color: var(--brand); margin-top: 10px; font-variant-numeric: tabular-nums; }
.need .d { font-weight: 650; margin-top: 2px; }
.need .w { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }

.timeline .weeks {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  font-size: 12px; line-height: 1; color: var(--muted); margin-bottom: 6px;
}
.timeline .weeks span::first-letter { text-transform: uppercase; }
.timeline .weeks .now { color: var(--brand); font-weight: 700; }
.timeline .track {
  position: relative; height: 10px; border-radius: 5px; background-color: var(--neutral-wash);
  background-image: repeating-linear-gradient(90deg, transparent 0, transparent calc(100% / var(--weeks) - 1px),
    var(--line-2) calc(100% / var(--weeks) - 1px), var(--line-2) calc(100% / var(--weeks)));
}
.timeline .fill { height: 100%; width: var(--at); background: var(--ink-soft); border-radius: 5px; }
.timeline .today { position: absolute; left: var(--at); top: -4px; bottom: -4px; width: 2px; background: var(--brand); }
.standing { display: flex; flex-wrap: wrap; gap: 6px 28px; margin-top: 12px; font-size: 13.5px; font-variant-numeric: tabular-nums; }
/* A count in running text: the same underline the openable scores use, on a link. */
a.count { color: inherit; text-decoration: underline dotted var(--line-2); text-underline-offset: 3px; }
a.count:hover { text-decoration-color: var(--brand); }
.statebar { display: flex; gap: 2px; height: 14px; margin-top: 14px; }
.statebar a { display: block; min-width: 3px; border-radius: 2px; background: var(--tone); }
.statebar a[data-tone="accent"] { background: repeating-linear-gradient(135deg, var(--tone) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px var(--tone); }
.statebar a:hover { opacity: .75; }
/* One line of short phrases: "Remind every [7] days", "Maximum reminders [3]", the switch, save. */
#inspection-reminder-settings { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
#inspection-reminder-settings label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); }
#inspection-reminder-settings input[type="number"] { width: 5em; }
#inspection-reminder-settings .btn { margin-left: auto; }
.inspection-sms-contact { display: grid; gap: 8px; min-width: 220px; padding: 10px 0; }
.inspection-sms-contact label { display: grid; gap: 4px; font-size: 12px; }
#inspection-rows td:last-child { min-width: 230px; }

/* ------------------------------- resident form ------------------------------- */

/* A phone-first page for one person filling in one unit: one question per block, 48px targets,
   17px inputs so iOS does not zoom, and red only once something is actually wrong. */
.resident-page { font-size: 17px; line-height: 1.53; }
.resident-page header.top { position: static; display: block; padding: 16px; }
.resident-page header.top .brand { display: block; font-size: 19px; line-height: 1.3; }
.resident-page header.top h1 { font-size: 15px; font-weight: 400; color: var(--rail-muted); margin: 4px 0 0; }

main.resident { max-width: 640px; padding: 16px 16px 48px; }
.resident .intro p { margin: 0 0 12px; }
.resident fieldset.q {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin: 0 0 12px; min-width: 0;
}
/* A floated legend sits inside the bordered block instead of on its top edge. */
.resident legend { float: left; width: 100%; padding: 0; margin: 0 0 10px; font-weight: 600; color: var(--brand); }
.resident legend + * { clear: both; }
.resident .opt { font-weight: 400; color: var(--muted); }
/* pre-line keeps a paragraph break written into the help text, as in her filter instruction. */
.resident .help { color: var(--ink-soft); font-size: 15px; margin: 0 0 12px; white-space: pre-line; }
.resident .choices { display: grid; gap: 8px; }
.resident .check {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; margin: 0;
  border: 1px solid var(--line-2); border-radius: var(--radius); font-size: 17px; font-weight: 400;
}
.resident .check:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.resident .check input[type="radio"] { width: 22px; height: 22px; margin: 0; accent-color: var(--brand); }
.resident input, .resident select, .resident textarea { background: var(--surface); font-size: 17px; }
.resident input[type="text"], .resident select { min-height: 48px; padding: 10px 14px; }
.resident textarea { min-height: 120px; padding: 12px 14px; }
.resident input.other { flex: 1; min-height: 40px; padding: 6px 10px; }
.resident input[type="file"] { min-height: 48px; padding: 0; border: 0; background: none; font-size: 15px; color: var(--muted); }
.resident input[type="file"]::file-selector-button {
  min-height: 48px; padding: 0 18px; margin-right: 12px; font: inherit; font-size: 16px; font-weight: 600;
  color: var(--brand); background: var(--surface); border: 1px solid var(--brand); border-radius: var(--radius); cursor: pointer;
}
.resident .photo-preview { display: grid; gap: 8px; font-size: 15px; margin-top: 8px; }
.resident .photo-entry { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 4px 4px 12px; border: 1px solid var(--line); border-radius: var(--radius); overflow-wrap: anywhere; }
.resident .photo-entry .linkish { flex: 0 0 auto; min-height: 48px; padding: 0 12px; }
.resident .photo-item-status[data-state="retake"], .resident .photo-item-status[data-state="invalid"] { color: var(--bad); }
.resident .photo-item-status[data-state="ok"] { color: var(--good); }
.resident .add-photo { margin-top: 8px; min-height: 48px; padding: 0 18px; font-size: 16px; }
.resident .photo-feedback { margin-top: 8px; font-size: 15px; line-height: 1.4; }
/* An empty photo field is not wrong yet. It still blocks submit, and the browser says why then. */
.resident .photo-feedback[data-state="needed"] { display: none; }
.resident .photo-feedback[data-state="retake"], .resident .photo-feedback[data-state="invalid"] { color: var(--bad); font-weight: 600; }
.resident .photo-feedback[data-state="pending"], .resident .photo-feedback[data-state="review"] { color: var(--ink-soft); }
.resident .photo-feedback[data-state="ok"] { color: var(--good); }
.resident > .muted, .resident form > .muted { font-size: 15px; }
.resident button[type="submit"] { width: 100%; min-height: 52px; font-size: 17px; margin-top: 8px; }

/* ----------------------------- inspection operations ----------------------------- */
.setup-form, .property-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 14px 0; padding: 14px; background: var(--sunk); border-radius: var(--radius); }
.setup-form h3 { grid-column: 1 / -1; margin: 0; }
.setup-form .btn, .property-settings .btn { align-self: end; min-height: 38px; }
.setup-form label, .property-settings label, .review-decision label { display: grid; gap: 5px; color: var(--ink-soft); font-size: 12px; }
.setup-form textarea, .property-settings textarea, .review-decision textarea { min-height: 76px; }
.property-editor { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 10px; }
.property-editor > summary, .response-review > summary { cursor: pointer; padding: 8px 0; }
.response-review { padding: 12px 16px; margin: 10px 0; }

/* Review: each photo question is a row, photo large and its verdict beside it. The decision column
   stays in view while the photos scroll; on a phone it is a bar along the bottom of the screen. */
.review-body { display: grid; gap: 20px; margin-top: 8px; }
.review-body.deciding { grid-template-columns: minmax(0, 1fr) 280px; align-items: start; }
.review-item { display: grid; grid-template-columns: minmax(0, 480px) minmax(180px, 1fr); gap: 8px 20px; padding: 16px 0; border-top: 1px solid var(--line); }
.review-item h3 { grid-column: 1 / -1; margin: 0; font-size: 14px; }
.review-item h3::first-letter, .review-answers dt::first-letter { text-transform: uppercase; }
.review-photos { display: grid; gap: 8px; align-content: start; }
.review-photos:has(> a:nth-child(2)) { grid-template-columns: 1fr 1fr; }
.review-photos img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--radius); }
.review-verdict p { margin: 0 0 6px; font-size: 13.5px; }
.review-verdict .t, .review-decide .t, .review-photos .t { font-weight: 650; }
.review-answers { border-top: 1px solid var(--line); padding-top: 8px; }
.review-answers > summary { cursor: pointer; padding: 8px 0; font-weight: 600; }
.review-answers dl { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 6px 16px; font-size: 13px; margin: 4px 0 8px; }
.review-answers dt { color: var(--ink-soft); }
.review-answers dd { margin: 0; overflow-wrap: anywhere; }
.review-decide { position: sticky; top: 16px; padding: 16px; background: var(--sunk); border-radius: var(--radius); }
.review-decide .t { margin: 0 0 12px; }
.review-decision .actions { display: grid; gap: 8px; margin-top: 10px; }
.review-decision .actions .btn { min-height: 44px; }
@media (max-width: 767px) {
  .review-body.deciding { grid-template-columns: minmax(0, 1fr); }
  .review-item { grid-template-columns: minmax(0, 1fr); }
  .review-decide {
    top: auto; bottom: 0; z-index: 5; margin: 0 -16px -12px; padding: 12px 16px;
    background: var(--surface); border-top: 1px solid var(--line-2); border-radius: 0;
  }
  .review-decide .t { margin-bottom: 8px; }
  .review-decision textarea { min-height: 48px; }
  .review-decision .actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .review-decision .actions .btn { min-height: 48px; padding: 6px 8px; }
}

/* ------------------------------ cycle results ------------------------------ */

/* Three short columns that wrap, so the list fits a phone without scrolling sideways. */
table.visit-list { min-width: 0; }
table.visit-list tr.group th { white-space: normal; color: var(--brand); background: none; }
@media (max-width: 767px) { table.visit-list th, table.visit-list td { padding: 8px 6px; } }
/* Two 130px tracks need 300px of viewport; below that a span would add a column and scroll sideways. */
@media (min-width: 300px) { .stats .stat.wide { grid-column: span 2; } }
.page-head .grow > .actions { margin-top: -12px; }

/* On paper, and only for this page: no rail or buttons, rows sized so about 30 units fit a letter
   page. The browser paginates, repeats the header row on each page, and never splits a unit. */
@media print {
  body:has(.cycle-results) { background: #fff; font-size: 10pt; }
  body:has(.cycle-results) header.rail, body:has(.cycle-results) #toast, .cycle-results .no-print { display: none !important; }
  body:has(.cycle-results) header.rail ~ main { margin: 0; padding: 0; max-width: none; }
  .cycle-results .card, .cycle-results .stat, .cycle-results .notice { border: 0; padding: 0; background: none; }
  .cycle-results .stats { grid-template-columns: repeat(4, 1fr); gap: 4px 12px; }
  .cycle-results .stat .v { font-size: 14pt; padding-top: 0; }
  table.visit-list { font-size: 9pt; }
  table.visit-list th, table.visit-list td { padding: 6px; }
  table.visit-list thead { display: table-header-group; }
  table.visit-list tr { break-inside: avoid; }
}
