/* Seedfield Trust — one stylesheet, designed for trustees aged 70+ on old iPads and laptops.
   Rules: body text >= 18px, strong contrast, big targets, no colour-only meaning, prints cleanly. */
:root {
  --ink: #1b1b1b;
  --muted: #4a4a4a;
  --paper: #ffffff;
  --paper-2: #f4f2ec;
  --line: #d6d2c8;
  --green: #1e6b3a;
  --green-bg: #e6f2ea;
  --amber: #8a5a00;
  --amber-bg: #fbf1d9;
  --red: #9b1c1c;
  --red-bg: #f9e3e3;
  --blue: #1f4e8c;
  --blue-bg: #e7eef8;
  --focus: #ff8c00;
  --radius: 8px;
  --maxw: 1100px;
}
* { box-sizing: border-box; }
html { font-size: 18px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper-2); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
}
a { color: var(--blue); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 4px solid var(--focus); outline-offset: 2px;
}
h1 { font-size: 1.9rem; line-height: 1.2; margin: 0 0 .5rem; }
h2 { font-size: 1.45rem; line-height: 1.25; margin: 1.5rem 0 .5rem; }
h3 { font-size: 1.15rem; margin: 1rem 0 .4rem; }
p { margin: .5rem 0; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* Layout */
.topbar { background: var(--paper); border-bottom: 3px solid var(--green); }
.topbar-inner { max-width: var(--maxw); margin: 0 auto; padding: .6rem 1rem; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; }
.brand { font-weight: 700; font-size: 1.2rem; color: var(--green); text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; gap: .25rem .9rem; margin-left: auto; }
.nav a { padding: .35rem .2rem; font-weight: 600; }
.nav a[aria-current="page"] { border-bottom: 3px solid var(--green); text-decoration: none; }
main { max-width: var(--maxw); margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin: 1rem 0; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 860px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.stack > * + * { margin-top: .75rem; }
.row { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; }
.spacer { flex: 1; }

/* Buttons and forms */
.btn, button, input[type=submit] {
  display: inline-block; font: inherit; font-weight: 600; cursor: pointer;
  padding: .7rem 1.1rem; border-radius: var(--radius); border: 2px solid var(--green);
  background: var(--green); color: #fff; text-decoration: none; min-height: 48px; line-height: 1.2;
}
.btn.secondary, button.secondary { background: var(--paper); color: var(--green); }
.btn.quiet, button.quiet { background: transparent; color: var(--blue); border-color: transparent; padding-left: .5rem; padding-right: .5rem; }
.btn.danger, button.danger { background: var(--red); border-color: var(--red); }
.btn.big { font-size: 1.15rem; padding: .9rem 1.4rem; }
.btn[aria-disabled="true"], button:disabled { opacity: .55; cursor: not-allowed; }
label { display: block; font-weight: 600; margin: .75rem 0 .25rem; }
.hint { font-weight: 400; color: var(--muted); font-size: .9rem; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=password], input[type=tel], input[type=url], textarea, select {
  font: inherit; width: 100%; padding: .6rem .7rem; border: 2px solid #8b877d; border-radius: var(--radius); background: #fff; color: var(--ink); min-height: 48px;
}
textarea { min-height: 7rem; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 1.4rem; height: 1.4rem; vertical-align: middle; margin-right: .5rem; }
.choices { display: flex; flex-wrap: wrap; gap: .5rem; }
.choice { border: 2px solid #8b877d; border-radius: var(--radius); padding: .5rem .8rem; background: #fff; cursor: pointer; display: inline-flex; align-items: center; min-height: 48px; }
.choice input { margin-right: .5rem; }
.choice.selected, .choice:has(input:checked) { border-color: var(--green); background: var(--green-bg); font-weight: 600; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem 1rem 1rem; margin: 1rem 0; }
legend { font-weight: 700; padding: 0 .4rem; }
.field-value { white-space: pre-wrap; margin: 0 0 .9rem; }
.field-label { font-weight: 700; color: var(--muted); font-size: .9rem; text-transform: uppercase; letter-spacing: .02em; margin-bottom: .15rem; }

/* Status / badges (always text + colour, never colour alone) */
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .9rem; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.badge.ok { background: var(--green-bg); color: var(--green); border-color: #a8d3b6; }
.badge.warn { background: var(--amber-bg); color: var(--amber); border-color: #e5c98a; }
.badge.bad { background: var(--red-bg); color: var(--red); border-color: #e9a9a9; }
.badge.info { background: var(--blue-bg); color: var(--blue); border-color: #b3c6e6; }
.badge.plain { background: var(--paper-2); color: var(--muted); border-color: var(--line); }
/* A badge holding a sentence must wrap on a phone (a nowrap badge pushed the 390px meeting page sideways). */
.badge.wrap { white-space: normal; border-radius: .5rem; display: inline; line-height: 1.6; }
.notice { border-left: 6px solid var(--blue); background: var(--blue-bg); padding: .75rem 1rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 1rem 0; }
.notice.ok { border-color: var(--green); background: var(--green-bg); }
.notice.warn { border-color: var(--amber); background: var(--amber-bg); }
.notice.bad { border-color: var(--red); background: var(--red-bg); }

/* Home summary */
.owe { font-size: 1.35rem; line-height: 1.4; }
.owe strong { font-size: 1.5rem; }
.deadline { font-weight: 700; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; background: var(--paper); }
th, td { text-align: left; padding: .6rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--paper-2); font-size: .95rem; }
tr.mine td { background: #fbfaf5; }
td.num, th.num { text-align: right; white-space: nowrap; }
.app-list { list-style: none; padding: 0; margin: 0; }
.app-list li { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; margin: .6rem 0; }
.app-list .title { font-size: 1.15rem; font-weight: 700; }
.app-list .meta { color: var(--muted); }
.app-list .status { margin-top: .35rem; }

/* Checks panel */
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { padding: .55rem 0; border-bottom: 1px dashed var(--line); }
.checks li:last-child { border-bottom: 0; }
.checks .source { color: var(--muted); font-size: .85rem; }
.checks blockquote { margin: .3rem 0 0 0; padding: .3rem .7rem; border-left: 4px solid var(--line); background: var(--paper-2); font-style: italic; }
.checks .icon { display: inline-block; width: 1.6rem; font-weight: 700; }

/* Utility classes (no inline styles — CSP) */
.m0 { margin: 0; }
.mt-s { margin-top: .5rem; }
.w-narrow { max-width: 6rem; }
.w-mid { max-width: 16rem; }
.ta-short { min-height: 4.5rem; }
.ta-tall { min-height: 10rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.reveal-card { font-size: 1.25rem; }
.row-title { font-weight: 700; font-size: 1.15rem; }
.grid-2 > div { min-width: 0; }
.checks blockquote, .field-value, .app-list .meta, .meeting-row { overflow-wrap: anywhere; }
details > summary.btn { list-style: none; display: inline-block; }
details > summary.btn::-webkit-details-marker { display: none; }
@media (max-width: 700px) {
  .table-wrap { position: relative; }
  .table-wrap:not(.stack-sm)::before { content: "Swipe sideways to see the whole table →"; display: block; font-size: .85rem; color: var(--muted); padding: .2rem 0 .4rem; }
  /* Admin tables become stacked cards on phones: each cell shows its column heading. */
  .stack-sm table, .stack-sm tbody, .stack-sm tr, .stack-sm td { display: block; width: 100%; }
  .stack-sm thead { display: none; }
  .stack-sm tr { border: 1px solid var(--line); border-radius: var(--radius); margin: .6rem 0; padding: .4rem .6rem; background: var(--paper); }
  .stack-sm td { border: 0; padding: .3rem 0; }
  .stack-sm td::before { content: attr(data-label); display: block; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
  .stack-sm td:empty { display: none; }
}

/* Sign in */
.signin { max-width: 520px; margin: 2rem auto; }
.code-input { font-size: 1.6rem; letter-spacing: .25rem; text-transform: uppercase; text-align: center; }
.show-once { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.1rem; word-break: break-all; background: var(--paper-2); padding: .6rem; border-radius: var(--radius); border: 1px dashed #8b877d; }

/* Intake */
.dropzone { border: 3px dashed #8b877d; border-radius: var(--radius); padding: 2rem 1rem; text-align: center; background: #fff; }
.dropzone.over { border-color: var(--green); background: var(--green-bg); }
.parsed-field { border-bottom: 1px solid var(--line); padding: .5rem 0; }
.parsed-field .k { font-weight: 700; }
.masked { background: #111; color: #111; border-radius: 4px; }
.conf-ok { color: var(--green); font-weight: 700; }
.conf-warn { color: var(--amber); font-weight: 700; }

/* Meeting */
.meeting-row { display: grid; grid-template-columns: 1fr; gap: .5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); padding: .8rem 1rem; margin: .6rem 0; }
@media (min-width: 900px) { .meeting-row { grid-template-columns: 2fr 1.2fr 1.3fr; align-items: start; } }
.total-bar { position: sticky; top: 0; background: var(--paper); border-bottom: 2px solid var(--green); padding: .6rem 0; font-size: 1.15rem; z-index: 2; }

/* Autosave indicator */
.saved { color: var(--green); font-weight: 600; min-height: 1.5rem; }

/* Skip link */
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: .5rem; }
.skip:focus { left: .5rem; z-index: 10; }

/* Print — A4, minimum 12pt */
@media print {
  html { font-size: 12pt; }
  body { background: #fff; color: #000; }
  .topbar, .no-print, .btn, button, nav { display: none !important; }
  main { max-width: none; padding: 0; }
  .card { border: 0; padding: 0; margin: 0 0 1rem; page-break-inside: avoid; }
  a { color: #000; text-decoration: none; }
  .table-wrap { overflow: visible; }
  table { font-size: 12pt; }
  th, td { padding: .3rem .4rem; }
}
@page { margin: 14mm; }
body.print-landscape { }
@media print {
  body.print-landscape { font-size: 12pt; }
}

/* Key explaining the automatic-check icons (✓ ⚠ ? •) in words — walkthrough 2026-10-03 */
.tone-key { margin: 0 0 .75rem; line-height: 2; }

/* Wave 2 (2026-10-05): review-model sections, set-up steps, the meeting row being edited */
[hidden] { display: none !important; }
.pre-line { white-space: pre-line; }
.group > h2 { border-bottom: 2px solid var(--line); padding-bottom: .25rem; margin-top: 2rem; }
.group-not_meet > h2 { border-bottom-color: var(--amber); }
.meeting-row.editing { border: 3px solid var(--green); }
.steps { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.steps li a { display: inline-block; padding: .45rem .9rem; border: 2px solid var(--line); border-radius: var(--radius); background: var(--paper); text-decoration: none; font-weight: 600; }
.steps li[aria-current="step"] a { border-color: var(--green); background: var(--green-bg); color: var(--ink); }
.setup-steps { list-style: none; padding: 0; margin: 0; }
.setup-steps > li > h2 { margin-top: 0; }

/* Review report: one block per application (W2.6) — facts left, text right; never split across pages */
.report-group > h2 { margin-top: 1.5rem; border-bottom: 2px solid var(--line); }
.report-block { display: grid; grid-template-columns: 1fr; gap: .25rem 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); padding: .7rem 1rem; margin: .6rem 0; break-inside: avoid; page-break-inside: avoid; }
@media (min-width: 700px) { .report-block { grid-template-columns: 3fr 7fr; } }
.report-block dl { margin: 0; }
.report-block dt { font-weight: 700; font-size: .85rem; color: var(--muted); margin-top: .35rem; }
.report-block dd { margin: 0; overflow-wrap: anywhere; }
@media print {
  .report-block { grid-template-columns: 3fr 7fr; border: 1px solid #000; }
  .report-block dt { color: #000; }
}
/* "A trustee supports this — bring it to the meeting": its own line, never a wrapped badge */
.flag { display: block; margin: .4rem 0; padding: .3rem .6rem; border-left: 5px solid var(--amber); background: var(--amber-bg); color: var(--ink); font-weight: 600; border-radius: 0 var(--radius) var(--radius) 0; }
/* Payment sheet (W2.7): bank numbers in a font where 1/l and 0/O cannot be confused */
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace; letter-spacing: .03em; white-space: nowrap; }
table.sheet td, table.sheet th { vertical-align: top; }
/* The trustees' guide (W2.11): large print on screen and on paper */
body.guide main { max-width: 52rem; }
body.guide .guide-steps li, body.guide .guide-help { font-size: 1.25rem; line-height: 1.55; margin-bottom: .8rem; }
@media print {
  body.guide { font-size: 16pt; }
  body.guide h1 { font-size: 22pt; }
  body.guide .guide-steps li, body.guide .guide-help { font-size: 16pt; }
}
/* On the large-print guide the site address must wrap on a phone (390 px), never push the page sideways */
body.guide .mono { white-space: normal; }
