/* Catchment Care styles */
@font-face { font-family: 'Atkinson'; font-weight: 400; font-display: swap; src: url(/fonts/atkinson-hyperlegible-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Atkinson'; font-weight: 400; font-display: swap; src: url(/fonts/atkinson-hyperlegible-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F; }
@font-face { font-family: 'Atkinson'; font-weight: 700; font-display: swap; src: url(/fonts/atkinson-hyperlegible-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Atkinson'; font-weight: 700; font-display: swap; src: url(/fonts/atkinson-hyperlegible-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F; }
@font-face { font-family: 'Bricolage'; font-weight: 700; font-display: swap; src: url(/fonts/bricolage-grotesque-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Bricolage'; font-weight: 700; font-display: swap; src: url(/fonts/bricolage-grotesque-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F; }

:root {
  --bg: #F4F6F2;
  --card: #FFFFFF;
  --ink: #12332E;
  --muted: #4E5F5A;
  --line: #E2E8E4;
  --field: #C9D3CF;
  --blue: #1F6FA8;
  --blue-ink: #FFFFFF;
  --blue-soft: #E3ECF3;
  --deep: #12332E;
  --deep-ink: #FFFFFF;
  --deep-muted: #C9D8D3;
  --warn-bg: #FFF4E5;
  --warn-ink: #7A3E06;
  --overdue: #9A4508;
  --ok: #1F6E4A;
  --ok-bg: #E2F1E8;
  --danger: #A12C2C;
  --chip: #ECEFEC;
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1B19;
    --card: #182725;
    --ink: #E8F0EC;
    --muted: #A9BAB4;
    --line: #2A3A37;
    --field: #3E504C;
    --blue: #6BB3E6;
    --blue-ink: #08202F;
    --blue-soft: #1B3242;
    --deep: #E8F0EC;
    --deep-ink: #0F1B19;
    --deep-muted: #3E504C;
    --warn-bg: #3A2814;
    --warn-ink: #F5C892;
    --overdue: #F5A766;
    --ok: #7FD1A6;
    --ok-bg: #173226;
    --danger: #F08A8A;
    --chip: #22322F;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Atkinson', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.45;
}
a { color: var(--blue); font-weight: 700; }
h1, h2, h3 { font-family: 'Bricolage', 'Atkinson', system-ui, sans-serif; line-height: 1.15; margin: 0; }
h1 { font-size: 30px; }
h2 { font-size: 21px; }
h3 { font-size: 18px; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
svg { width: 1.2em; height: 1.2em; flex-shrink: 0; vertical-align: -0.2em; }
.list-row > svg { width: 22px; height: 22px; color: var(--muted); }
.row > svg, .card-deep svg, .card-warn svg { width: 24px; height: 24px; }
.btn svg { width: 22px; height: 22px; }

.shell { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; padding: 20px 18px 120px; display: flex; flex-direction: column; gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack-lg { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-2 > label.field { justify-content: flex-end; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.tiny { font-size: 13px; }
.center { text-align: center; }
.hidden { display: none !important; }

.card { background: var(--card); border-radius: var(--radius); padding: 18px; }
.card.flush { padding: 0; overflow: hidden; }
.card-deep { background: var(--deep); color: var(--deep-ink); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.card-deep .muted { color: var(--deep-muted); }
@media (prefers-color-scheme: dark) { .card-deep .muted { color: #4E5F5A; } }
.card-warn { background: var(--warn-bg); color: var(--warn-ink); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.card-soft { background: var(--blue-soft); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.big-number { font-family: 'Bricolage', sans-serif; font-size: 46px; line-height: 1; }

.list > * { border-bottom: 1px solid var(--line); }
.list > *:last-child { border-bottom: none; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 56px; }
.list-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
a.list-row, button.list-row { color: inherit; text-decoration: none; font-weight: 400; width: 100%; background: none; border: none; text-align: left; cursor: pointer; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 20px; border-radius: 14px; border: 2px solid transparent;
  background: var(--blue); color: var(--blue-ink); font-weight: 700; font-size: 17px;
  text-decoration: none; cursor: pointer; width: 100%;
}
.btn.secondary { background: transparent; border-color: var(--blue); color: var(--blue); }
.btn.quiet { background: transparent; color: var(--ink); border-color: var(--field); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.on-deep { background: var(--deep-ink); color: var(--deep); }
.btn.small { min-height: 44px; font-size: 15px; padding: 0 14px; width: auto; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.link-btn { background: none; border: none; color: var(--blue); font-weight: 700; padding: 10px 0; min-height: 44px; cursor: pointer; }

.seg { min-height: 46px; border-radius: 12px; border: 2px solid var(--field); background: var(--card); font-weight: 700; cursor: pointer; padding: 0 8px; }
.seg[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: var(--blue-ink); }
.seg.wide { text-align: left; padding: 0 16px; width: 100%; }

.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 46px; height: 46px; border-radius: 12px; border: 2px solid var(--field); background: var(--card); font-size: 22px; font-weight: 700; cursor: pointer; }
.stepper output { min-width: 44px; text-align: center; font-size: 20px; font-weight: 700; }

label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 16px; }
label.field .hint { font-weight: 400; font-size: 14px; color: var(--muted); }
input[type=text], input[type=email], input[type=number], input[type=date], input[inputmode], select, textarea {
  min-height: 50px; border-radius: 12px; border: 2px solid var(--field); background: var(--card);
  padding: 10px 14px; width: 100%; font-size: 17px;
}
textarea { min-height: 96px; resize: vertical; }
.check { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; min-height: 56px; cursor: pointer; }
.check input { width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--blue); flex-shrink: 0; }
.check .grow { display: flex; flex-direction: column; gap: 2px; }

.code-input { font-size: 30px !important; letter-spacing: 10px; text-align: center; font-weight: 700; }

.dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; background: var(--field); }
.dot.overdue { background: var(--overdue); }
.dot.soon { background: var(--blue); }
.due { font-size: 14px; color: var(--muted); text-align: right; white-space: nowrap; }
.due.overdue { color: var(--overdue); font-weight: 700; }

.chip { display: inline-block; font-size: 14px; font-weight: 700; padding: 5px 11px; border-radius: 999px; background: var(--chip); }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.blue { background: var(--blue-soft); color: var(--blue); }
.pill { align-self: flex-start; font-size: 13px; font-weight: 700; color: var(--blue); background: var(--blue-soft); padding: 6px 12px; border-radius: 999px; }

.tile { background: var(--card); color: var(--ink); border-radius: var(--radius); padding: 16px; text-decoration: none; display: flex; flex-direction: column; gap: 10px; min-height: 100px; font-weight: 700; }
.tile.deep { background: var(--deep); color: var(--deep-ink); }
.tile svg { width: 28px; height: 28px; }
.tile .lock { font-size: 12px; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.tile.deep .lock { color: var(--deep-muted); }

.tank { width: 76px; height: 92px; border-radius: 12px; background: var(--blue-soft); position: relative; overflow: hidden; flex-shrink: 0; }
.tank > div { position: absolute; left: 0; right: 0; bottom: 0; background: var(--blue); transition: height .3s; }

.progress { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress > div { height: 100%; background: var(--blue); transition: width .2s; }

.check-btn { width: 46px; height: 46px; border: none; background: transparent; padding: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; color: var(--muted); }
.check-btn svg { width: 30px; height: 30px; }
.check-btn.done { color: var(--blue); }

.back { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; text-decoration: none; min-height: 44px; align-self: flex-start; }
.back svg { width: 20px; height: 20px; }

.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.source { font-size: 13px; color: var(--muted); }

nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--card); border-top: 1px solid var(--line);
  padding: 6px 8px calc(10px + env(safe-area-inset-bottom));
}
nav.tabs .inner { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
nav.tabs a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 400; min-height: 48px; }
nav.tabs a[aria-current="page"] { color: var(--blue); font-weight: 700; }
nav.tabs svg { width: 24px; height: 24px; }

.offline-bar { background: var(--warn-bg); color: var(--warn-ink); text-align: center; font-size: 14px; font-weight: 700; padding: 8px 12px; }

.toast {
  position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--deep); color: var(--deep-ink); border-radius: 14px; padding: 12px 16px; z-index: 50;
  display: flex; align-items: center; gap: 14px; max-width: calc(100% - 32px); width: max-content; box-shadow: 0 6px 24px rgba(0,0,0,.18);
}
.toast button { background: none; border: none; color: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; min-height: 40px; }
.toast.error { background: var(--danger); color: #fff; }

.hero { display: flex; flex-direction: column; gap: 14px; padding-top: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: 'Bricolage', sans-serif; font-size: 20px; }
.brand svg { width: 34px; height: 34px; }
.feature { display: flex; gap: 12px; align-items: flex-start; }
.feature svg { width: 26px; height: 26px; flex-shrink: 0; color: var(--blue); margin-top: 2px; }

.plan { border: 2px solid var(--field); border-radius: var(--radius); padding: 16px; background: var(--card); display: flex; flex-direction: column; gap: 6px; cursor: pointer; text-align: left; width: 100%; }
.plan[aria-pressed="true"] { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue) inset; }
.plan .price { font-family: 'Bricolage', sans-serif; font-size: 28px; }

.month { font-size: 14px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 6px; }

.prose { display: flex; flex-direction: column; gap: 12px; }
.prose h2 { margin-top: 8px; }
.prose ul { margin: 0; padding-left: 22px; }

.skeleton { height: 120px; border-radius: var(--radius); background: var(--line); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Records report & printing */
.report table { width: 100%; border-collapse: collapse; font-size: 15px; }
.report th, .report td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.report th { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
@media print {
  :root { --bg: #fff; --card: #fff; --ink: #000; --muted: #444; --line: #ccc; }
  nav.tabs, .no-print, .offline-bar, .toast { display: none !important; }
  main { padding: 0; }
  .card { padding: 8px 0; }
  body { font-size: 12pt; }
}
