:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #5f6b76;
  --line: #dce3e8;
  --surface: #ffffff;
  --canvas: #f4f7f8;
  --brand: #174b42;
  --brand-light: #e2f0ed;
  --complete: #17653a;
  --complete-light: #e3f4e9;
  --na: #75520a;
  --na-light: #fff2cf;
  --danger: #a62b2b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); line-height: 1.5; }
a { color: var(--brand); }
button, input, select { font: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .5rem; font-size: clamp(2rem, 6vw, 3rem); line-height: 1.05; }
h2 { line-height: 1.2; }

.site-header {
  min-height: 4rem; padding: .75rem max(1rem, calc((100vw - 72rem) / 2));
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.site-header nav { display: flex; align-items: center; gap: 1rem; color: var(--muted); }
.brand { color: var(--ink); font-size: 1.35rem; font-weight: 800; text-decoration: none; }
.page-shell { width: min(72rem, calc(100% - 2rem)); margin: 0 auto; padding: 2.5rem 0 4rem; }
.page-heading, .checklist-heading { display: flex; justify-content: space-between; gap: 2rem; align-items: end; margin-bottom: 2rem; }
.page-heading > div { max-width: 42rem; }
.eyebrow { margin-bottom: .45rem; color: var(--brand); font-size: .78rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.date-form { min-width: 18rem; }
.date-form label, .stacked-form label { display: block; margin-bottom: .35rem; font-size: .85rem; font-weight: 700; }
.field-row { display: flex; gap: .5rem; }
.field-help { margin: 0 0 .6rem; color: var(--muted); font-size: .9rem; }
input { min-height: 2.75rem; padding: .6rem .75rem; border: 1px solid #aab6bd; border-radius: .5rem; background: white; }
select { min-height: 2.75rem; padding: .55rem .7rem; border: 1px solid #aab6bd; border-radius: .5rem; background: white; }
.definition-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; }
.definition-card, .auth-card, .empty-state, .contribution-panel { padding: 1.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: .8rem; box-shadow: 0 2px 12px rgb(25 45 55 / 5%); }
.definition-card { display: flex; flex-direction: column; align-items: flex-start; }
.definition-card .button { margin-top: auto; }
.button { display: inline-flex; min-height: 2.6rem; padding: .55rem .9rem; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: .5rem; font-weight: 750; text-decoration: none; cursor: pointer; }
.button.primary { color: white; background: var(--brand); }
.button.secondary, .button.reset { color: var(--ink); background: white; border-color: #aab6bd; }
.button.complete { color: white; background: var(--complete); }
.button.na { color: #5e4208; background: var(--na-light); border-color: #d8b85f; }
.inline-form { display: inline; }
.link-button { padding: 0; color: var(--brand); border: 0; background: none; cursor: pointer; text-decoration: underline; }
.auth-card { width: min(28rem, 100%); margin: 4rem auto; }
.stacked-form { display: grid; }
.stacked-form input { width: 100%; margin-bottom: 1rem; }
.selector-card { width: min(34rem, 100%); padding: 1.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: .8rem; box-shadow: 0 2px 12px rgb(25 45 55 / 5%); }
.selector-card input, .selector-card select { width: 100%; margin-bottom: 1rem; }
.messages { margin-bottom: 1rem; }
.message { padding: .8rem 1rem; border-radius: .5rem; background: var(--brand-light); }
.message.error { color: var(--danger); background: #fde8e8; }
.back-link { display: inline-block; margin-bottom: 1.25rem; font-weight: 700; text-decoration: none; }
.checklist-meta { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-bottom: 0; color: var(--muted); }
.progress-summary { min-width: 8rem; padding: 1rem; text-align: center; background: var(--brand-light); border-radius: .75rem; }
.progress-summary strong, .progress-summary span { display: block; }
.progress-summary strong { font-size: 1.5rem; }
.shared-workflow-notice {
  display: flex; justify-content: space-between; gap: 1rem; align-items: center;
  margin: -1rem 0 2rem; padding: .9rem 1rem; color: #20433d;
  background: var(--brand-light); border: 1px solid #bad8d1; border-radius: .65rem;
}
.shared-workflow-notice strong, .shared-workflow-notice span { display: block; }
.shared-workflow-notice > div > span { color: #45615c; font-size: .88rem; }
.sync-status { flex: 0 0 auto; padding: .25rem .6rem; color: var(--brand); background: white; border-radius: 999px; font-size: .78rem; font-weight: 800; }
.sync-status.sync-error { color: var(--danger); background: #fde8e8; }
.sync-status.sync-saving { color: var(--na); background: var(--na-light); }
.sync-status.sync-saved { color: var(--complete); background: var(--complete-light); }
.sync-warning { padding: .8rem 1rem; color: var(--danger); background: #fde8e8; border-radius: .5rem; }
.task-section { margin: 2rem 0; }
.task-list { display: grid; gap: .7rem; }
.task-card { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1rem; background: white; border: 1px solid var(--line); border-left: .35rem solid #9ba8af; border-radius: .65rem; }
.task-card.state-completed { border-left-color: var(--complete); background: #fbfefc; }
.task-card.state-na { border-left-color: var(--na); background: #fffdf7; }
.task-card.is-saving { opacity: .72; }
.task-copy { min-width: 0; }
.task-line { display: flex; gap: .8rem; align-items: baseline; }
.task-line h3 { margin-bottom: .35rem; font-size: 1rem; }
.task-time { flex: 0 0 auto; color: var(--brand); font-size: .8rem; font-weight: 800; }
.task-attribution { display: flex; flex-wrap: wrap; gap: .35rem .7rem; align-items: center; color: var(--muted); font-size: .82rem; }
.status { padding: .12rem .5rem; color: #48535c; background: #edf1f3; border-radius: 999px; font-weight: 800; }
.status-completed { color: var(--complete); background: var(--complete-light); }
.status-na { color: var(--na); background: var(--na-light); }
.status-incomplete, .status-pending { color: var(--danger); background: #fde8e8; }
.report-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.filter-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.filter-actions .button { width: 100%; min-width: 0; padding-inline: .55rem; font-size: .85rem; white-space: nowrap; }
.report-filters { display: grid; gap: 1rem; width: 100%; max-width: 100%; margin-bottom: 1.5rem; padding: 1.2rem; overflow: hidden; background: white; border: 1px solid var(--line); border-radius: .8rem; }
.report-filters > *, .report-filter-row > * { min-width: 0; }
.report-program-filter { width: min(16rem, 100%); }
.report-filter-row { display: grid; gap: 1rem; width: 100%; min-width: 0; }
.report-filter-row-primary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.report-filter-row-secondary { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(12.5rem, 1fr); align-items: end; }
.report-filters label { display: grid; min-width: 0; align-content: start; gap: .35rem; font-size: .82rem; font-weight: 750; }
.report-filters input, .report-filters select { width: 100%; min-width: 0; max-width: 100%; }
.report-filters .checkbox-label { display: flex; align-items: center; align-self: end; }
.report-filters .checkbox-label input { min-height: auto; }
.filter-actions { align-self: end; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .75rem; margin-bottom: 1.5rem; }
.summary-grid > div { padding: 1rem; background: var(--brand-light); border-radius: .65rem; }
.summary-grid strong, .summary-grid span { display: block; }
.summary-grid strong { font-size: 1.4rem; }
.summary-grid span { color: var(--muted); font-size: .8rem; }
.table-wrap { overflow-x: auto; background: white; border: 1px solid var(--line); border-radius: .7rem; }
.report-table { width: 100%; border-collapse: collapse; background: white; }
.report-table th, .report-table td { padding: .7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.report-table th { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.report-table tr:last-child td { border-bottom: 0; }
.report-table .report-date { min-width: 7.25rem; white-space: nowrap; }
.task-actions { display: flex; flex: 0 0 auto; gap: .45rem; }
.task-actions button:disabled { cursor: wait; opacity: .65; }
.button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid #2e8172; outline-offset: 2px;
}
.contribution-panel { margin-top: 3rem; }
.contribution-list { padding-left: 1.3rem; }
.contribution-list li { margin: .55rem 0; }
.contribution-list time { display: inline-block; color: var(--muted); font-size: .85rem; }

@media (max-width: 720px) {
  .site-header { align-items: flex-start; }
  .site-header nav { flex-wrap: wrap; justify-content: flex-end; gap: .35rem .75rem; }
  .page-shell { padding-top: 1.5rem; }
  .page-heading, .checklist-heading { display: block; }
  .date-form { min-width: 0; margin-top: 1.25rem; }
  .field-row { flex-wrap: wrap; }
  .task-card { display: block; }
  .task-actions { margin-top: .9rem; flex-wrap: wrap; }
  .task-actions .button { flex: 1; }
  .progress-summary { display: inline-block; margin-top: 1rem; }
  .shared-workflow-notice { display: block; margin-top: 0; }
  .sync-status { display: inline-block; margin-top: .7rem; }
  .report-filter-row-primary, .report-filter-row-secondary { grid-template-columns: 1fr; }
}
