/* KDS Statutory. KDS Brand Kit (brand.yaml, 5 May 2026): Arial, charcoal ink. Scandinavian treatment (Mark, 17 Oct
   2026): warm linen ground, white surfaces, hairlines, generous space, muted natural status tints. Target: WCAG 2.2 AA
   (every text/background pair below is 4.5:1 or better). */
:root {
  --ink: #2E2E2E; --muted: #66625B; --line: #E3DFD7; --line-soft: #EFECE6; --ground: #F7F5F1; --surface: #FFFFFF;
  --band: #F2EFEA; --accent: #4F6250; --focus: #355468;
  --sage: #E2EADD; --sage-ink: #2F4430; --sand: #F4E8C8; --sand-ink: #574516; --clay: #F3DCD4; --clay-ink: #6B2C20;
  --stone: #ECE9E3; --radius: 10px; --shadow: 0 1px 2px rgba(46, 46, 46, .04), 0 4px 16px rgba(46, 46, 46, .04);
}
* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: Arial, Helvetica, sans-serif; line-height: 1.55; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; border-radius: 6px; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 32px; }
h1 { font-size: 2rem; font-weight: normal; letter-spacing: -.01em; margin: 4px 0 8px; }
h2 { font-size: .8rem; font-weight: bold; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 48px 0 14px; }
h3 { font-size: 1rem; margin: 24px 0 8px; }
p { max-width: 80ch; }
.meta, .muted { color: var(--muted); font-size: .88rem; }
.label { text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; color: var(--muted); }

/* header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 20px; min-height: 72px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; }
.brand img { height: 28px; width: auto; display: block; }
.brand span { font-size: .78rem; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); border-left: 1px solid var(--line); padding-left: 16px; }
.nav { display: flex; gap: 0; flex-wrap: wrap; flex: 1; }
.nav a { padding: 7px 11px; text-decoration: none; font-size: .88rem; white-space: nowrap; color: var(--muted); border-radius: 999px; }
.nav a:hover { background: var(--band); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--surface); }
.who { display: flex; gap: 12px; align-items: center; font-size: .85rem; color: var(--muted); }
.search input { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--ground); font: inherit; font-size: .88rem; width: 170px; color: var(--ink); }
.search input:focus { background: var(--surface); }

/* notice band */
.notice { border-bottom: 1px solid var(--line-soft); font-size: .8rem; color: var(--muted); }
.notice .wrap { padding-top: 10px; padding-bottom: 10px; }
main { padding: 32px 0 72px; }

/* blocks */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 20px; }
.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.card .big { font-size: 2.4rem; line-height: 1.05; letter-spacing: -.02em; }
.card .small { font-size: .85rem; color: var(--muted); margin-top: 8px; }
.table-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
th { font-size: .72rem; font-weight: bold; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); background: var(--surface); }
thead th { border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--ground); }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.date { white-space: nowrap; font-variant-numeric: tabular-nums; }
main > .wrap > table { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }

/* statuses */
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .74rem; white-space: nowrap; background: var(--stone); color: var(--ink); }
.st-verified, .st-confirmed, .st-source { background: var(--sage); color: var(--sage-ink); }
.st-calculated { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.st-awaiting_confirmation, .st-suggested, .st-stale { background: var(--sand); color: var(--sand-ink); }
.st-conflicting, .st-rejected, .st-overdue { background: var(--clay); color: var(--clay-ink); }
.st-not_available, .st-source_unavailable { background: var(--stone); color: var(--muted); }
.check { background: var(--clay); color: var(--clay-ink); padding: 12px 16px; margin: 8px 0; border-radius: 8px; font-size: .9rem; }
.ok { background: var(--sage); color: var(--sage-ink); padding: 12px 16px; margin: 8px 0; border-radius: 8px; font-size: .9rem; }

/* records */
.record { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); margin: 16px 0; overflow: hidden; box-shadow: var(--shadow); }
.record > header { padding: 14px 18px; display: flex; gap: 14px; flex-wrap: wrap; align-items: baseline; border-bottom: 1px solid var(--line-soft); }
.record > header a { font-weight: bold; }
.record dl { display: grid; grid-template-columns: minmax(180px, 300px) 1fr; margin: 0; }
.record dt, .record dd { padding: 9px 18px; margin: 0; border-bottom: 1px solid var(--line-soft); }
.record dt { color: var(--muted); font-size: .88rem; }
.record .due { background: var(--ground); }
.desc { max-width: 70ch; }

/* forms and login */
.btn { display: inline-block; background: var(--ink); color: var(--surface); border: 0; border-radius: 999px; padding: 11px 22px; font: inherit; font-size: .92rem; cursor: pointer; text-decoration: none; }
.btn:hover { background: #000; }
.btn.light { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.light:hover { box-shadow: inset 0 0 0 1px var(--ink); background: var(--surface); }
form.inline { display: inline; }
form.inline button { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; cursor: pointer; }
form.inline button:hover { color: var(--ink); }
.login { max-width: 420px; margin: 88px auto; padding: 40px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); border: 1px solid var(--line-soft); }
.login img { height: 40px; margin-bottom: 28px; }
.field { margin: 18px 0; }
.field label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.field input { width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--ground); font: inherit; color: var(--ink); }
.field input:focus { background: var(--surface); }
.error { background: var(--clay); color: var(--clay-ink); padding: 10px 14px; border-radius: 8px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 20px; }
.filters a { padding: 6px 14px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; font-size: .85rem; color: var(--muted); }
.filters a[aria-current="true"] { background: var(--ink); color: var(--surface); box-shadow: none; }
footer.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; padding: 24px 0 40px; }
.spaced { margin-top: 36px; }
.field input.wide { max-width: 420px; }

/* one-line registers */
table.register { font-size: .84rem; }
table.register th { white-space: nowrap; position: sticky; top: 0; z-index: 1; }
table.register td { padding: 10px 12px; }
table.register td:first-child, table.register th:first-child { position: sticky; left: 0; background: var(--surface); }
table.register tbody tr:hover td:first-child { background: var(--ground); }
table.register td:nth-child(2) { min-width: 15rem; color: var(--muted); }
table.register .pill { font-size: .68rem; padding: 1px 7px; }

@media (max-width: 700px) {
  .wrap { padding: 0 16px; }
  .record dl { grid-template-columns: 1fr; }
  .record dt { border-bottom: 0; padding-bottom: 0; }
  .login { margin: 32px 16px; padding: 28px 20px; }
  h1 { font-size: 1.6rem; }
}
@media print {
  body { background: #fff; }
  .top, .search, .who form { display: none; }
  .card, .table-scroll, .record { box-shadow: none; border-color: #ccc; }
}
table.register td:first-child { white-space: nowrap; }

/* projects list and archiving */
table.projects td.job { white-space: nowrap; }
.btn.small { padding: 6px 14px; font-size: .8rem; }
.archive-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0 8px; }
.archive-form input { padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font: inherit; font-size: .88rem; width: 260px; color: var(--ink); }
.archived-band { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: space-between; background: var(--sand); color: var(--sand-ink); border-radius: var(--radius); padding: 12px 18px; margin: 8px 0 4px; }
.archived-band p { margin: 0; }
table.projects td:nth-child(2) { min-width: 13rem; }
table.projects td:last-child { white-space: nowrap; }
table.projects th { white-space: nowrap; }

/* staff entries */
.matches { margin: 8px 0 4px; }
.match-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 6px 0; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.inline-form input, .stack-form input, .entry-form input, .entry-form select { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font: inherit; font-size: .88rem; color: var(--ink); }
.stack-form { display: flex; flex-direction: column; gap: 6px; min-width: 15rem; }
.entry-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 16px; align-items: end; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.entry-form .field { margin: 6px 0; }
.entry-form .field.wide { grid-column: span 2; }
.entry-form input, .entry-form select { width: 100%; }
@media (max-width: 700px) { .entry-form .field.wide { grid-column: auto; } }
.filters a.filter-action { margin-left: auto; background: var(--ink); color: var(--surface); box-shadow: none; }

/* record history */
details.history { margin-top: 40px; }
details.history summary { cursor: pointer; font-size: .8rem; font-weight: bold; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); padding: 8px 0; }
details.history summary:hover { color: var(--ink); }
.small-note { font-size: .78rem; }

/* deadline lists */
table.deadlines a.job { white-space: nowrap; }
table.deadlines td:nth-child(5) { min-width: 12rem; }
.type { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .74rem; white-space: nowrap; background: var(--stone); color: var(--ink); }
.type-planning { background: #E3E8EE; color: #2C3E50; }
.type-fire { background: var(--clay); color: var(--clay-ink); }
.type-dac { background: var(--sage); color: var(--sage-ink); }
.type-bcms { background: var(--sand); color: var(--sand-ink); }
abbr.calc { font-size: .72rem; color: var(--muted); text-decoration: none; border-bottom: 1px dotted var(--muted); cursor: help; margin-left: 4px; }
a.portal { font-size: .8rem; padding: 2px 10px; border-radius: 999px; background: var(--band); text-decoration: none; white-space: nowrap; }
a.portal:hover { background: var(--ink); color: var(--surface); }

/* council review fixes, 27 Oct 2026 */
.banner { background: #B03A2E; color: #fff; font-size: .9rem; font-weight: bold; }
.banner .wrap { padding-top: 10px; padding-bottom: 10px; }
section.cannot { background: var(--clay); color: var(--clay-ink); border-left: 6px solid #B03A2E; border-radius: 8px; padding: 6px 20px 12px; margin: 16px 0 24px; }
section.cannot h2 { margin-top: 12px; }
section.cannot a { color: inherit; font-weight: bold; }
.check.red { border-left: 6px solid #B03A2E; }
span.calc { font-size: .72rem; color: var(--muted); margin-left: 4px; white-space: nowrap; }
details.working { margin-top: 4px; font-size: .78rem; color: var(--muted); }
details.working summary { cursor: pointer; color: var(--ink); text-decoration: underline dotted; width: max-content; }
tr.urg-overdue td:first-child { box-shadow: inset 5px 0 0 #B03A2E; }
tr.urg-urgent td:first-child { box-shadow: inset 5px 0 0 #D68910; }
tr.urg-soon td:first-child { box-shadow: inset 5px 0 0 #F4D03F; }
tr.urg-overdue td.date, tr.urg-urgent td.date { font-weight: bold; }
.legend { font-size: .8rem; color: var(--muted); line-height: 1.8; }
.legend .key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin: 0 4px 0 8px; vertical-align: -1px; }
.legend .key:first-child { margin-left: 0; }
.legend .key.urg-overdue { background: #B03A2E; } .legend .key.urg-urgent { background: #D68910; } .legend .key.urg-soon { background: #F4D03F; }
.card-ref { font-size: 1.15rem; margin: 4px 0 6px; }
.scroll-cue { font-size: .78rem; color: var(--muted); margin: 0 0 6px; }
table.register th:first-child, table.register td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; box-shadow: 1px 0 0 var(--line-soft); }
