/*
VOICE   formal, civic, collegial: a committee's public docket
IDEA    the motion docket / order paper of a governing body
PICTURE the CFCA seal on a navy field with a gold rule; each item is a docket entry with a support tally
COLOUR  seal blue #0061a8, navy #0b1f5c, gold #cfa616, flag red #b0102a for "don't support"
TYPE    Source Serif 4 for titles (the seal's serif lettering), Inter for text
*/
:root {
  color-scheme: light;
  --blue: #0061a8; --blue-d: #004b82; --navy: #0b1f5c; --gold: #cfa616; --gold-l: #f6efd2; --red: #b0102a;
  --bg: #f4f6fa; --card: #ffffff; --ink: #14213d; --text: #3a4660; --muted: #667089; --line: #dde3ee;
  --radius: 14px; --pill: 999px;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; min-width: 0; }
[hidden] { display: none !important; }
html { scroll-padding-top: 24px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--sans); overflow-x: clip; }
a { color: var(--blue); }
h1, h2, h3 { font-family: var(--serif); color: var(--ink); line-height: 1.15; margin: 0; text-wrap: balance; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 max(4vw, 16px); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 50; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* header */
.top { background: var(--navy); color: #fff; border-bottom: 5px solid var(--gold); }
.bar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding-top: 12px; font-size: 14px; }
.bar .who { color: #d6def0; }
.bar button { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.45); }
.bar button:hover { background: rgba(255,255,255,.1); }
.hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(18px, 3vw, 36px); align-items: center; padding: 18px 0 34px; }
.hero img { width: clamp(110px, 16vw, 180px); height: auto; display: block; filter: drop-shadow(0 6px 18px rgba(0,0,0,.35)); }
.hero h1 { color: #fff; font-size: clamp(30px, 4.4vw, 48px); font-weight: 600; }
.hero .sub { color: var(--gold); font-weight: 600; letter-spacing: .02em; margin: 6px 0 12px; }
.hero p.lead { color: #dfe6f5; max-width: 62ch; margin: 0 0 18px; }
.hero .actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 600px) {
  .hero { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .hero .actions { justify-content: center; }
  .bar { justify-content: center; }
}

/* buttons & inputs */
button, .btn { font: 600 15px/1 var(--sans); border-radius: var(--pill); padding: 12px 20px; min-height: 44px; border: 1px solid transparent; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn-primary { background: var(--gold); color: var(--navy); }
.btn-primary:hover { background: #e0b928; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue-d); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn-danger { background: #fff; color: var(--red); border-color: #e9c3ca; }
.btn-danger:hover { background: #fbeef0; }
.btn-sm { padding: 8px 14px; min-height: 36px; font-size: 14px; }
button[disabled] { opacity: .55; cursor: default; }
label { display: block; font-weight: 600; color: var(--ink); margin: 14px 0 6px; font-size: 15px; }
label .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
input, select, textarea { width: 100%; font: 16px/1.4 var(--sans); padding: 11px 12px; border: 1px solid #c7cfdd; border-radius: 10px; background: #fff; color: var(--ink); }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: 2px solid rgba(0,97,168,.2); }

/* toolbar */
main { padding: 28px 0 60px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: #fff; border: 1px solid var(--line); color: var(--ink); padding: 8px 14px; min-height: 38px; font-weight: 500; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip .n { color: var(--muted); font-weight: 400; }
.chip[aria-pressed="true"] .n { color: #c9d3ea; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters input { width: 220px; }
.filters select { width: auto; }

/* docket items */
.list { display: grid; gap: 16px; }
.item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 2.4vw, 26px); display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 18px 28px; }
.item:target { box-shadow: 0 0 0 3px var(--gold); }
@media (max-width: 760px) { .item { grid-template-columns: 1fr; } }
.meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.type { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink); background: var(--gold-l); border-radius: var(--pill); padding: 4px 10px; }
.type::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--blue)); }
.t-rule-change { --dot: #0061a8; } .t-championship { --dot: #cfa616; } .t-tools { --dot: #2a7f8f; }
.t-awards { --dot: #b0102a; } .t-partnerships { --dot: #0b1f5c; } .t-education { --dot: #5b7d2a; }
.badge { font-size: 12px; font-weight: 700; border-radius: var(--pill); padding: 3px 9px; background: #e8ebf2; color: var(--ink); }
.badge.pending { background: var(--gold-l); color: #6b5400; }
.badge.declined { background: #fbeef0; color: var(--red); }
.badge.published { background: #e3f0fa; color: var(--blue-d); }
.item h2 { font-size: clamp(21px, 2.4vw, 26px); font-weight: 600; margin-bottom: 8px; }
.item .summary { margin: 0 0 10px; color: var(--text); }
.details { white-space: pre-wrap; border-left: 3px solid var(--gold); padding: 4px 0 4px 14px; margin: 10px 0; }
.summary { white-space: pre-wrap; }
.summary.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.pcs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
@media (max-width: 600px) { .pcs { grid-template-columns: 1fr; } }
.pc { border-radius: 12px; padding: 12px 14px; border-top: 4px solid; background: var(--bg); }
.pc.pro { border-color: var(--blue); }
.pc.con { border-color: var(--red); }
.pc h3 { font-size: 17px; margin: 0 0 6px; }
.pc.pro h3 { color: var(--blue); }
.pc.con h3 { color: var(--red); }
.pc p { margin: 0; white-space: pre-wrap; }
.pc p.none { color: var(--muted); font-style: italic; }
.linkish { background: none; border: 0; padding: 0; min-height: 0; color: var(--blue); font-weight: 600; font-size: 14px; }
.linkish:hover { text-decoration: underline; }

/* tally */
.tally { border-left: 1px solid var(--line); padding-left: 24px; display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 760px) { .tally { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 16px; } }
.nums { display: flex; justify-content: space-between; font-size: 14px; }
.nums strong { font-family: var(--serif); font-size: 28px; color: var(--ink); display: block; line-height: 1; }
.nums .against strong { color: var(--red); text-align: right; }
.nums .against { text-align: right; }
.meter { height: 10px; border-radius: var(--pill); background: #f0d6db; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--blue); transition: width .4s ease; }
.meter.zero { background: #e8ebf2; }
.vote { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vote button { justify-content: center; padding: 10px 8px; font-size: 14px; }
.vote .yes { background: #fff; color: var(--blue); border-color: #b9d3ea; }
.vote .no { background: #fff; color: var(--red); border-color: #e9c3ca; }
.vote .yes.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.vote .no.on { background: var(--red); color: #fff; border-color: var(--red); }
.mine { font-size: 13px; color: var(--muted); }
.closed-note { font-size: 13px; color: var(--muted); font-style: italic; }

/* comments */
.comments { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 12px; }
.comments ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.comments li { background: var(--bg); border-radius: 10px; padding: 10px 14px; }
.comments .by { font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.comments .by strong { color: var(--ink); }
.comments .s-support { color: var(--blue); font-weight: 600; }
.comments .s-oppose { color: var(--red); font-weight: 600; }
.comments p { margin: 0; white-space: pre-wrap; }

.empty, .notice { background: #fff; border: 1px dashed #c7cfdd; border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); }
.notice.err { border-style: solid; border-color: #e9c3ca; color: var(--red); }
section.mysubs { margin-bottom: 26px; }
section.mysubs h2 { font-size: 22px; margin-bottom: 10px; }
.sub-row { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.sub-row + .sub-row { margin-top: 8px; }
.sub-row .note { flex-basis: 100%; font-size: 14px; color: var(--muted); }

/* dialogs */
dialog { border: 0; border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); color: var(--text); box-shadow: 0 20px 60px rgba(11,31,92,.35); }
dialog::backdrop { background: rgba(11,31,92,.55); }
dialog form, dialog .body { padding: 22px 24px 24px; }
dialog h2 { font-size: 24px; margin-bottom: 6px; }
dialog .row { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }
dialog .msg { margin: 12px 0 0; font-size: 14px; }
dialog .msg.err { color: var(--red); }
dialog .msg.ok { color: #1f6b3a; }
dialog .msg.onboard { background: var(--gold-l); border-radius: 12px; padding: 14px 16px; color: var(--ink); }
dialog .msg.onboard p { margin: 0 0 10px; }
.code-input { font-size: 26px; letter-spacing: 8px; text-align: center; font-family: var(--serif); }
.stance-pick { border: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.stance-pick label { margin: 0; border: 2px solid var(--line); border-radius: 12px; padding: 12px; display: flex; gap: 10px; align-items: center; cursor: pointer; font-weight: 600; }
.stance-pick input { width: auto; accent-color: var(--blue); }
.stance-pick label:has(input:checked) { border-color: var(--blue); background: #eef5fb; }
.counter { font-size: 12px; color: var(--muted); text-align: right; margin-top: 4px; }

footer { background: var(--navy); color: #c9d3ea; font-size: 14px; padding: 22px 0; border-top: 5px solid var(--gold); }
footer a { color: #fff; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }

@media (prefers-reduced-motion: reduce) { .meter span { transition: none; } }

.how { margin-top: 40px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 3vw, 30px); }
.how h2 { font-size: 24px; margin-bottom: 8px; }
.how ol { margin: 0; padding-left: 22px; display: grid; gap: 8px; max-width: 75ch; }

/* admin */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tabs a { text-decoration: none; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 2.6vw, 26px); }
.panel + .panel { margin-top: 16px; }
.panel h2 { font-size: 22px; margin-bottom: 6px; }
.panel > p { margin-top: 0; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.acts { white-space: nowrap; text-align: right; }
td.acts button { margin: 2px 0 2px 4px; }
.scroll { overflow-x: auto; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
@media (max-width: 600px) {
  .grid2 { grid-template-columns: 1fr; }
  table { font-size: 14px; }
  .stack thead { display: none; }
  .stack tr { display: grid; padding-block: 10px; border-bottom: 1px solid var(--line); }
  .stack td { display: flow-root; border: 0; padding: 3px 0; padding-inline-start: 7em; text-align: start; }
  .stack td::before { content: attr(data-l); float: inline-start; width: 6.5em; margin-inline-start: -7em; color: var(--muted); font-size: 13px; }
  .stack td:empty { display: none; }
  .stack td.acts { padding-inline-start: 0; text-align: start; white-space: normal; display: flex; flex-wrap: wrap; gap: 6px; }
  .stack td.acts button { margin: 0; }
  .stack td.acts::before { content: none; }
}
.review { border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.review + .review { margin-top: 12px; }
.review h3 { font-size: 20px; margin: 6px 0; }
.review .row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.gate { max-width: 520px; margin: 0 auto; text-align: center; }
.resp-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; max-height: 55vh; overflow: auto; }
.resp-list li { background: var(--bg); border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.resp-list p { margin: 4px 0 0; white-space: pre-wrap; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.25); z-index: 100; max-width: calc(100vw - 32px); }
