:root {
  --ink: #1B2A41;
  --ink-soft: #2A3C57;
  --muted: #5B6470;
  --line: #D7DEE7;
  --line-strong: #B8C2CF;
  --ground: #F2F5F9;
  --page: #E6EBF1;
  --card: #FFFFFF;
  --accent: #B4650A;
  --accent-ink: #8A4D06;
  --head-text: #DCE3EC;
  --head-kicker: #C9D3E0;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--page);
  line-height: 1.45;
}
a { color: var(--accent-ink); }
a:hover { color: #5E3404; }
select, textarea, button, input { font-family: inherit; font-size: 16px; }

.shell { width: 100%; max-width: 640px; min-height: 100vh; margin: 0 auto; background: var(--ground); display: flex; flex-direction: column; }
.shell.white { background: var(--card); }

header.top { padding: 20px 20px 16px; background: var(--ink); color: #fff; display: flex; flex-direction: column; gap: 6px; }
header.top .kicker { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--head-kicker); }
header.top h1 { margin: 0; font-size: 22px; line-height: 1.2; font-weight: 700; }
header.top p { margin: 0; font-size: 14px; color: var(--head-text); }
header.top .notice { margin-top: 6px; padding: 10px 12px; background: var(--ink-soft); border-radius: 6px; font-size: 13px; color: #fff; }

nav.tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: var(--card); }
nav.tabs a { display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1.2; padding: 0 4px; height: 44px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; }
nav.tabs a[aria-current="page"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--accent); }

main { padding: 20px; display: flex; flex-direction: column; gap: 16px; flex-grow: 1; }
@media (min-width: 640px) { main { padding: 28px 32px; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card h2 { margin: 0; font-size: 14px; font-weight: 600; }
.small { font-size: 13px; color: var(--muted); margin: 0; }
form { display: flex; flex-direction: column; gap: 20px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.stat .label { font-size: 12px; color: var(--muted); }
.stat .value { font-size: 32px; font-weight: 700; line-height: 1; }
.stat .value.accent { color: var(--accent-ink); font-size: 30px; line-height: 1.1; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field label, .field legend, .field .q { font-size: 14px; font-weight: 600; padding: 0; }
.field select { height: 48px; padding: 0 12px; border: 1.5px solid var(--line-strong); border-radius: 6px; background: var(--card); color: var(--ink); }
.field input[type="text"] { height: 48px; padding: 0 12px; border: 1.5px solid var(--line-strong); border-radius: 6px; background: var(--card); color: var(--ink); }
.field textarea { width: 100%; padding: 12px; line-height: 1.4; border: 1.5px solid var(--line-strong); border-radius: 6px; resize: vertical; color: var(--ink); }
fieldset { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 8px; }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choices.row { flex-direction: row; }
.choices label { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; border: 1.5px solid var(--line-strong); border-radius: 6px; font-size: 15px; cursor: pointer; }
.choices.row label { flex: 1 1 0; justify-content: center; min-height: 44px; }
.choices input { width: 20px; height: 20px; margin: 0; accent-color: var(--ink); }
.choices label:has(input:checked) { border-color: var(--ink); background: var(--ground); font-weight: 600; }

.btn { display: flex; width: 100%; align-items: center; justify-content: center; height: 52px; border: 0; border-radius: 6px; font-size: 16px; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.outline { height: 44px; background: transparent; border: 1.5px solid var(--ink); color: var(--ink); font-size: 14px; font-weight: 600; }
.btn[disabled] { opacity: 0.6; cursor: wait; }

.rows { display: flex; flex-direction: column; gap: 10px; }
.row-line { display: flex; justify-content: space-between; align-items: center; font-size: 14px; gap: 12px; }
.row-line strong { font-weight: 600; }
.row-line.muted { color: var(--muted); }
.bar { height: 10px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar > div { height: 100%; background: var(--ink); border-radius: 3px; }
.bar > div.accent { background: var(--accent); }
.bar-row { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.bar-row .row-line { font-size: 13px; }

.quote { border-left: 4px solid var(--accent); }
.quote p { margin: 0; font-size: 15px; font-style: italic; }
.foot { font-size: 12px; color: var(--muted); margin: 0; overflow-wrap: anywhere; }
.ok { padding: 14px; border-radius: 6px; background: #E7F3EA; color: #1E5631; font-size: 15px; }
.err { padding: 12px 14px; border-radius: 6px; background: #FBE9E7; color: #8A2A1E; font-size: 14px; }
.hidden { display: none !important; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
ul.tight, ol.tight { margin: 0; padding-left: 18px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.evidence { border-left: 3px solid var(--ink); padding-left: 12px; display: flex; flex-direction: column; gap: 2px; }
.evidence.accent { border-left-color: var(--accent); }
.evidence b { font-size: 14px; }
.evidence span { font-size: 13px; color: var(--muted); }

.proposal-link { color: inherit; text-decoration: none; border-left: 4px solid var(--accent); }
.proposal-link:hover { color: inherit; border-color: var(--line-strong); border-left-color: var(--accent); }
.proposal-link .more { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 700; white-space: nowrap; flex-shrink: 0; transition: background 0.15s; }
.proposal-link:hover .more, .proposal-link:focus-visible .more { background: var(--accent-ink); }
.proposal-link:active .more { transform: translateY(1px); }
.proposal-link:hover { box-shadow: 0 1px 4px rgba(27, 42, 65, 0.12); }
.kicker-sm { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.proposal { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.proposal:first-child { padding-top: 0; border-top: 0; }
.proposal-title { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.3; }
.proposal-body { margin: 0; font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; }
.btn.vote { width: auto; padding: 0 16px; flex-shrink: 0; }
.back { font-size: 13px; font-weight: 600; text-decoration: none; }

.monthpick { border: 1.5px solid var(--line-strong); border-radius: 6px; background: var(--card); padding: 8px 10px 10px; }
.mp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.mp-head button { width: 44px; height: 40px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font-size: 24px; line-height: 1; cursor: pointer; }
.mp-head button:hover:not([disabled]) { background: var(--ground); }
.mp-head button[disabled] { opacity: 0.25; cursor: default; }
.mp-year { font-size: 16px; font-weight: 700; }
.mp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.mp-grid button { height: 44px; border: 1.5px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); font-size: 15px; cursor: pointer; }
.mp-grid button:hover:not([disabled]) { border-color: var(--ink); }
.mp-grid button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 700; }
.mp-grid button[disabled] { background: var(--ground); color: var(--line-strong); cursor: default; }
.req { color: var(--accent-ink); font-weight: 700; margin-left: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
header.top .kicker.center { text-align: center; }
.stat .value.nodata { font-size: 20px; line-height: 1.2; color: var(--muted); }

.voices { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.voices-h { margin: 0; font-size: 14px; font-weight: 600; }
.voice-list { display: flex; flex-direction: column; gap: 10px; }
.voice { margin: 0; padding: 10px 12px; background: var(--ground); border-left: 4px solid var(--accent); border-radius: 0 6px 6px 0; }
.voice p { margin: 0; font-size: 15px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; }
.voice.open p { display: block; -webkit-line-clamp: unset; }
.voice p::before { content: "\201C"; }
.voice p::after { content: "\201D"; }
.linkish { margin-top: 4px; padding: 0; border: 0; background: none; color: var(--accent-ink); font-size: 13px; font-weight: 600; cursor: pointer; }

/* admin */
.admin-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.btn.admin-small { width: auto; height: 40px; padding: 0 14px; font-size: 14px; }
.btn.danger { border-color: #8A2A1E; color: #8A2A1E; }
.admin-tabs { margin: 0 -20px; }
@media (min-width: 640px) { .admin-tabs { margin: 0 -32px; } }
.admin-list { display: flex; flex-direction: column; gap: 12px; }
.admin-list .field .q, .admin-list .field label.q { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.admin-list input[type="text"], .admin-list select, .admin-list textarea, .field input[type="password"] { width: 100%; min-height: 40px; padding: 8px 10px; border: 1.5px solid var(--line-strong); border-radius: 6px; background: var(--card); color: var(--ink); font-size: 15px; font-weight: 400; }
.field input[type="password"] { height: 48px; font-size: 16px; }
.admin-ticks { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 400; }
.admin-ticks label { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.card.pending { border-left: 4px solid var(--accent); }


/* Utility classes: the Content-Security-Policy (style-src 'self') blocks inline style="" attributes */
.contents { display: contents; }
.big-num { font-size: 30px; font-weight: 700; line-height: 1.1; }
.big-num.accent { color: var(--accent-ink); }
.card h2.sub { font-size: 12px; font-weight: 400; color: var(--muted); }
.card h2.sub .ink { color: var(--ink); font-weight: 700; }
.link-strong { font-size: 14px; font-weight: 600; }
.muted-inline { font-weight: 400; color: var(--muted); }
.spacer-16 { height: 16px; }
.spacer-12 { height: 12px; }
.row-between { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.body-14 { margin: 0; font-size: 14px; }
.voice-list.scrolls { overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; border-bottom: 1px solid var(--line); }
.voice-list:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.field.subfield { margin-top: 8px; padding: 12px 0 0 12px; border-left: 3px solid var(--line); }
.field.subfield label { font-size: 14px; font-weight: 600; }
nav.tabs.admin-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-filter { display: flex; gap: 8px; }
.admin-filter input, .admin-filter select { height: 44px; padding: 0 12px; border: 1.5px solid var(--line-strong); border-radius: 6px; background: var(--card); color: var(--ink); font-size: 15px; }
.admin-filter input { flex: 1 1 auto; min-width: 0; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.na-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1.5px solid var(--line-strong); border-radius: 999px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.na-toggle:has(input:checked) { background: #FBE9E7; border-color: #8A2A1E; color: #8A2A1E; }
.card.is-na { background: var(--ground); border-style: dashed; }
.supports { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.supports .q { font-size: 13px; font-weight: 600; }
.support-rows { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow-y: auto; }
.support-row { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 4px 0; }
.support-row span { flex: 1 1 auto; }
.support-row code { font-size: 12px; color: var(--muted); }
.support-row.is-na span, .support-row.is-na code { text-decoration: line-through; color: var(--muted); }
.done { display: flex; flex-direction: column; gap: 16px; }

nav.tabs.sub-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: -20px -20px 0; }
@media (min-width: 640px) { .sub-tabs { margin: -28px -32px 0; } }
.panel { display: flex; flex-direction: column; gap: 16px; }
.sort { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1.5px solid var(--ink); border-radius: 6px; overflow: hidden; }
.sort button { height: 40px; border: 0; background: var(--card); color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer; }
.sort button + button { border-left: 1.5px solid var(--ink); }
.sort button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.preview { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; white-space: pre-line; overflow-wrap: anywhere; }
.na-toggle:has(input:disabled) { opacity: 0.45; cursor: not-allowed; }
.admin-list input:disabled, .admin-list textarea:disabled { background: var(--ground); color: var(--muted); -webkit-text-fill-color: var(--muted); opacity: 1; cursor: not-allowed; }
.btn[disabled][title] { cursor: not-allowed; }
.admin-list select:disabled, .admin-ticks input:disabled { background: var(--ground); color: var(--muted); cursor: not-allowed; }
.admin-ticks label:has(input:disabled) { color: var(--muted); }
.mp-chosen { margin-top: 8px; }

/* admin: equal-size cards that scroll inside, laid out in columns on wide screens */
.shell.wide { max-width: 1240px; }
.admin-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.admin-list > .card { height: 560px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.admin-list > .card > * { flex-shrink: 0; }
.admin-list > p { grid-column: 1 / -1; }
/* the card's number, date and N/A switch stay in view while its contents scroll */
.admin-list > .card > .admin-head { position: sticky; top: -16px; z-index: 1; margin: -16px -16px 0; padding: 16px 16px 8px; background: inherit; border-bottom: 1px solid var(--line); }
@media (max-width: 420px) { .admin-list { grid-template-columns: minmax(0, 1fr); } .admin-list > .card { height: 520px; } }
.suggest-cta { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.suggest-cta h2 { margin: 0 0 2px; }
.suggest-cta .btn { width: auto; height: 44px; padding: 0 16px; font-size: 15px; }
@media (max-width: 420px) { .suggest-cta .btn { width: 100%; } }
/* the comment box as the last option of "What has this loss meant", framed like the tick boxes */
.choice-other { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1.5px solid var(--line-strong); border-radius: 6px; }
.choice-other:focus-within { border-color: var(--ink); background: var(--ground); }
.choices .choice-other label { display: block; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; font-size: 15px; font-weight: 600; cursor: default; }
.choice-other textarea { width: 100%; padding: 10px 12px; line-height: 1.4; border: 1.5px solid var(--line); border-radius: 6px; resize: vertical; color: var(--ink); background: var(--card); }
.ts:empty { display: none; } .ts { display: flex; justify-content: center; }

/* ---- Larger screens: use the width. Phones and small tablets are unchanged. ---- */
@media (min-width: 900px) {
  .shell { max-width: 1120px; }
  header.top { padding: 28px 32px 22px; }
  header.top h1 { font-size: 28px; }

  /* forms and single proposals: a comfortable reading column in the middle */
  main.read > * { width: 100%; max-width: 760px; margin-left: auto; margin-right: auto; }
  main.read .choices:not(.row) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main.read .choices .choice-other { grid-column: 1 / -1; }

  /* Survey Results: cards flow into two columns */
  main.cols { display: block; column-count: 2; column-gap: 20px; }
  main.cols > *, main.cols > .contents > * { break-inside: avoid; margin-bottom: 20px; }
  main.cols > #loading, main.cols > .foot, main.cols > .contents > .grid2:first-child { column-span: all; }

  /* Residents' Proposals: proposal cards side by side; the form stays a reading column */
  main.list-page #list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
  main.list-page [data-panel="suggest"] > *, main.list-page [data-panel="list"] > .ok { width: 100%; max-width: 760px; margin-left: auto; margin-right: auto; }
}
@media (min-width: 1240px) {
  .shell:not(.wide) { max-width: 1200px; }
  main.cols { column-count: 3; }
  main.list-page #list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* "Burglaries Since November 2026" on Survey Results: bold italic, highlighted */
.card h2.sub.highlight { align-self: flex-start; padding: 3px 10px; border-radius: 4px; background: #FCEBD5; color: var(--accent-ink); font-size: 14px; font-weight: 700; font-style: italic; }
