/* IndieGrantRadar: a dated agenda. Deep teal band, warm paper, amber for what is due.
   The month ruler is the signature: every list on the page is the same agenda, grouped by month. */
:root {
  --teal: #087f87;
  --band: #075c66;
  --band-ink: #f1f8f8;
  --band-muted: #b5dade;
  --band-amber: #f9bd5c;
  --bg: #e9f3f3;
  --surface: #f7fbfb;
  --sunk: #d9e9e9;
  --text: #0f2f33;
  --muted: #45636a;
  --rule: #c2d9d9;
  --rule-strong: #86adb0;
  --link: #066a72;
  --amber: #e39a2b;
  --amber-ink: #8a4a05;
  --soon-bg: #fdeccb;
  --ok: #2c6e49;
  --err: #a3321f;
  --ruler-ink: #f1f8f8;
  --hit-bg: #087f87;
  --hit-ink: #ffffff;
  --backdrop: rgba(4, 38, 42, .6);
  --serif: "Iowan Old Style", Charter, Georgia, "Times New Roman", serif;
  --sans: "Avenir Next", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --teal: #1d9aa0; --band: #05343a; --band-ink: #e2f1f1; --band-muted: #9fc3c7; --band-amber: #f6c574;
    --bg: #08262b; --surface: #0d343a; --sunk: #061d21; --text: #e2f1f1; --muted: #9fc3c7;
    --rule: #1c4d54; --rule-strong: #3b8088; --link: #7adde0;
    --amber: #f0b04c; --amber-ink: #f6c574; --soon-bg: #3b3115; --ok: #7fcf9f; --err: #ff9d8a; --ruler-ink: #eefafa;
    --hit-bg: #35b5ba; --hit-ink: #04262a; --backdrop: rgba(0, 10, 12, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --teal: #1d9aa0; --band: #05343a; --band-ink: #e2f1f1; --band-muted: #9fc3c7; --band-amber: #f6c574;
    --bg: #08262b; --surface: #0d343a; --sunk: #061d21; --text: #e2f1f1; --muted: #9fc3c7;
    --rule: #1c4d54; --rule-strong: #3b8088; --link: #7adde0;
    --amber: #f0b04c; --amber-ink: #f6c574; --soon-bg: #3b3115; --ok: #7fcf9f; --err: #ff9d8a; --ruler-ink: #eefafa;
    --hit-bg: #35b5ba; --hit-ink: #04262a; --backdrop: rgba(0, 10, 12, .7);
    color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
}
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

h1, h2, h3, .wordmark, .month-h { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-size: clamp(1.55rem, 2.6vw, 2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 12px; }
a { color: var(--link); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 2px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; background: #f9bd5c; color: #1c1503; padding: 10px 14px; z-index: 20; font-weight: 600; }
.skip:focus { top: 8px; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 0.94rem; max-width: 70ch; }

/* ---------- header band ---------- */
.site-header { background: var(--band); color: var(--band-ink); }
.head-row { display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-height: 44px; }
.mark-blip { fill: var(--band-amber); }
.wordmark { font-size: 1.4rem; letter-spacing: 0.005em; }
.wordmark i { font-style: italic; color: var(--band-amber); }
.site-nav { display: flex; gap: 2px 4px; flex-wrap: wrap; margin-left: auto; }
.site-nav a { color: var(--band-ink); text-decoration: none; padding: 10px 10px; min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; font-size: 0.97rem; border-bottom: 2px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--amber); }
.theme-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; background: transparent; color: var(--band-ink); border: 1px solid rgba(255,255,255,.3); border-radius: 4px; cursor: pointer; }
.theme-btn:hover { border-color: var(--amber); }
@media (max-width: 719px) {
  .site-nav { order: 3; width: 100%; margin-left: -7px; flex-wrap: nowrap; }
  .site-nav a { padding: 10px 7px; font-size: 0.93rem; white-space: nowrap; min-width: 44px; text-align: center; }
  .theme-btn { margin-left: auto; }
}

.hero { background: var(--band); color: var(--band-ink); padding: 28px 0 44px; }
.hero-grid { display: grid; gap: 24px; grid-template-areas: "text" "quick" "readout"; }
.hero-text { grid-area: text; }
.quick { grid-area: quick; }
.readout { grid-area: readout; }
.lede { font-size: 1.12rem; color: var(--band-muted); max-width: 60ch; margin: 16px 0 0; }
.readout { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(255,255,255,.28); }
.readout > div { padding: 12px 12px 0 0; min-width: 0; }
.readout > div + div { padding-left: 12px; border-left: 1px solid rgba(255,255,255,.28); }
.readout dt { font-size: 0.86rem; color: var(--band-muted); }
.readout dd { margin: 0; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: clamp(1.45rem, 3.4vw, 2.1rem); font-weight: 600; line-height: 1.2; min-height: 1.2em; }
#ro-next, #ro-soon { color: var(--band-amber); }
.readout dd.ro-sub { font-family: var(--sans); font-size: 0.86rem; font-weight: 400; color: var(--band-muted); line-height: 1.3; min-height: 2.6em; overflow-wrap: anywhere; }
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); grid-template-areas: "text quick" "readout quick"; align-items: start; gap: 28px 48px; }
  .readout { align-self: end; }
  .readout { border-top: 0; }
  .readout > div:first-child { border-left: 1px solid rgba(255,255,255,.28); padding-left: 12px; }
}

/* ---------- sections ---------- */
.sec { padding-top: 40px; padding-bottom: 8px; scroll-margin-top: 8px; }
.sec-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 8px; }
.count { font-family: var(--sans); font-size: 1rem; font-weight: 400; color: var(--muted); }

/* ---------- timeline ---------- */
.timeline-sec { padding-top: 40px; }
.timeline-sec .sec-head { background: var(--surface); border: 1px solid var(--rule); border-bottom: 0; border-radius: 6px 6px 0 0; padding: 14px 16px 6px; margin: 0; }
.tl-toggles { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.tl-frame { background: var(--surface); border: 1px solid var(--rule); border-top: 0; border-radius: 0 0 6px 6px; padding: 0 0 6px; }
.tl-scroll { overflow-x: auto; min-height: 246px; }
.tl-svg { display: block; }
.tl-ruler { fill: var(--teal); }
.tl-tick { stroke: var(--ruler-ink); stroke-width: 1; opacity: .6; }
.tl-tick-m { stroke-width: 2; opacity: 1; }
.tl-daynum { fill: var(--ruler-ink); font: 12px var(--mono); opacity: .9; }
.tl-month { fill: var(--text); font: 600 14px var(--serif); }
.tl-guide { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 2 4; }
.tl-soonband { fill: var(--soon-bg); }
.tl-today { stroke: var(--text); stroke-width: 2; }
.tl-todaylabel { fill: var(--text); font: 600 12.5px var(--sans); }
.tl-stem { stroke-width: 1.2; }
.m-mine-stem, .m-done-stem { stroke: var(--teal); }
.m-soon-stem { stroke: var(--amber); }
.m-ex-stem { stroke: var(--rule-strong); stroke-dasharray: 2 3; }
.m-mine { fill: var(--teal); stroke: var(--surface); stroke-width: 1.5; }
.m-soon { fill: var(--amber); stroke: var(--text); stroke-width: 1.5; }
.m-done { fill: var(--rule-strong); stroke: var(--surface); stroke-width: 1.5; }
.m-ex { fill: var(--surface); stroke: var(--rule-strong); stroke-width: 1.8; }
.tl-labelbg { fill: var(--surface); opacity: .86; }
.tl-label { fill: var(--text); font: 600 13px var(--sans); }
.tl-svg a { cursor: pointer; outline: none; }
.tl-svg a:hover .tl-label { fill: var(--link); text-decoration: underline; }
.tl-svg a:hover circle:not(.tl-hit), .tl-svg a:focus circle:not(.tl-hit) { stroke: var(--text); stroke-width: 2.5; }
.tl-svg a:focus-visible circle:not(.tl-hit) { stroke: var(--amber); stroke-width: 4; }
.tl-tip rect { fill: var(--text); }
.tl-tip text { fill: var(--bg); font: 600 12.5px var(--sans); }
.tl-legend { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 12px 0 4px; font-size: 0.92rem; color: var(--muted); }
.lg { display: inline-flex; align-items: center; gap: 7px; }
.tl-cue { color: var(--amber-ink); font-weight: 600; }
.tl-summary { font-size: 0.92rem; color: var(--muted); min-height: 1.5em; }

/* ---------- controls ---------- */
label { font-weight: 600; font-size: 0.95rem; }
.opt { font-weight: 400; color: var(--muted); font-size: 0.86rem; }
input[type="text"], input[type="url"], input[type="number"], input[type="date"], input[type="time"], select, textarea {
  font: inherit; font-size: 1rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--rule-strong); border-radius: 4px; padding: 9px 10px; min-height: 44px; width: 100%;
}
textarea { min-height: 84px; resize: vertical; }
input:disabled { opacity: .5; }
input[aria-invalid="true"] { border-color: var(--err); border-width: 2px; }
.err { color: var(--err); font-size: 0.92rem; margin: 4px 0 0; font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--teal); flex: none; margin: 0; }
.btn {
  font: inherit; font-size: 0.97rem; font-weight: 600; min-height: 44px; padding: 8px 16px; cursor: pointer;
  color: var(--text); background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: var(--teal); background: var(--sunk); }
.btn.primary { background: var(--hit-bg); border-color: var(--hit-bg); color: var(--hit-ink); }
.btn.primary:hover { background: var(--hit-bg); border-color: var(--text); filter: brightness(.92); }
.btn.small { padding: 6px 12px; font-size: 0.92rem; }
.btn.quiet { background: transparent; border-color: transparent; color: var(--muted); font-weight: 400; text-decoration: underline; text-underline-offset: 3px; padding-left: 8px; padding-right: 8px; }
.btn.quiet:hover { color: var(--err); background: transparent; }
.btn.on { border-color: var(--teal); color: var(--link); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.inline-select { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; }
.inline-select select { width: auto; }

/* profile band */
.profile-band fieldset { border: 0; border-left: 6px solid var(--teal); background: var(--sunk); margin: 0; padding: 16px 18px; border-radius: 0 6px 6px 0; }
.profile-band legend { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; float: left; width: 100%; padding: 0; margin-bottom: 4px; }
.profile-band .hint { clear: both; margin-bottom: 4px; }
.profile-list { display: flex; flex-wrap: wrap; gap: 0 22px; }
#profile-sec { padding-top: 28px; }

/* ---------- agenda ---------- */
.agenda { min-height: 220px; }
.month { margin-top: 22px; }
.month-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 1.2rem; padding: 0 0 6px; border-bottom: 3px solid var(--teal); }
.month-n { font-family: var(--sans); font-size: 0.88rem; font-weight: 400; color: var(--muted); }
.rows { list-style: none; margin: 0; padding: 0; }
.rows-flat { border-top: 3px solid var(--teal); margin-top: 22px; }
.row {
  display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 4px 14px; padding: 16px 10px 16px 10px;
  border-bottom: 1px solid var(--rule); border-left: 5px solid transparent; scroll-margin-top: 16px;
  transition: background-color .2s;
}
.row.soon { background: var(--soon-bg); border-left-color: var(--amber); }
.row.overdue { border-left-color: var(--err); }
.row:target { outline: 3px solid var(--amber); outline-offset: -3px; }
.row.settled .date, .row.settled .prog { opacity: .7; }
.date { display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1.05; padding-top: 2px; }
.d-wd, .d-mon { font-size: 0.82rem; color: var(--muted); }
.d-day { font-family: var(--serif); font-size: 2.1rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.d-roll { font-family: var(--serif); font-size: 1rem; font-style: italic; color: var(--muted); padding-top: 6px; line-height: 1.2; }
.body { min-width: 0; }
.prog { font-family: var(--serif); font-size: 1.18rem; font-weight: 600; line-height: 1.25; margin: 0 0 2px; overflow-wrap: anywhere; }
.ex-tag { font-family: var(--sans); font-size: 0.76rem; font-weight: 600; color: var(--muted); border: 1px solid var(--rule-strong); border-radius: 3px; padding: 1px 6px; vertical-align: 3px; white-space: nowrap; }
.sub { color: var(--muted); font-size: 0.95rem; margin: 0 0 4px; overflow-wrap: anywhere; }
.summary { margin: 0 0 6px; font-size: 0.98rem; max-width: 62ch; }
.next { margin: 2px 0 6px; font-size: 0.98rem; overflow-wrap: anywhere; }
.next span { font-weight: 600; color: var(--link); margin-right: 4px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; padding: 0; }
.chip { font-size: 0.83rem; border: 1px solid var(--rule-strong); border-radius: 3px; padding: 1px 7px; color: var(--muted); }
.chip.hit { background: var(--hit-bg); border-color: var(--hit-bg); color: var(--hit-ink); }
.fit { font-size: 0.88rem; font-weight: 600; color: var(--link); margin: 6px 0 0; }
.fit-none { color: var(--muted); font-weight: 400; }
.side { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 6px; }
.side p { margin: 0; }
.due, .amount { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 0.95rem; }
.due { font-weight: 600; }
.due-soon { color: var(--amber-ink); }
.due-over { color: var(--err); }
.status-l { display: block; }
.st { min-height: 44px; padding: 6px 8px; font-size: 1rem; width: auto; font-weight: 600; }
.st-submitted, .st-awarded { border-color: var(--ok); color: var(--ok); }
.st-declined { color: var(--muted); }
.ready { display: inline-flex; align-items: center; gap: 3px; font-size: 0.88rem; color: var(--muted); }
.ready i { width: 14px; height: 8px; border: 1px solid var(--rule-strong); background: transparent; transition: background-color .2s; }
.ready i.on { background: var(--teal); border-color: var(--teal); }
.ready span { margin-left: 5px; font-family: var(--mono); }
.detail { grid-column: 1 / -1; display: grid; gap: 8px 32px; margin-top: 10px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; }
.checklist { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; min-width: 0; }
.checklist legend { font-weight: 600; padding: 0; margin-bottom: 2px; }
.detail-info p { margin: 0 0 8px; font-size: 0.97rem; overflow-wrap: anywhere; }
.detail-info strong { display: block; font-size: 0.86rem; color: var(--muted); font-weight: 600; }
.detail-actions { display: flex; gap: 8px; }
.empty { padding: 28px 16px; border: 1px dashed var(--rule-strong); border-radius: 6px; color: var(--muted); margin-top: 16px; }
@media (min-width: 760px) {
  .row { grid-template-columns: 76px minmax(0, 1fr) 210px; padding: 18px 12px 18px 12px; gap: 4px 20px; }
  .side { grid-column: 3; flex-direction: column; align-items: flex-end; text-align: right; margin-top: 0; gap: 8px; }
  .detail { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .d-day { font-size: 2.4rem; }
}

.io-row { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; margin-top: 22px; padding: 14px 0; border-top: 1px solid var(--rule); }
.io-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.io-label { font-weight: 600; font-size: 0.95rem; margin-right: 2px; }
.io-quiet { margin-left: auto; }
.calc { margin-top: 4px; border-top: 1px solid var(--rule); }
.calc summary, .faq summary { cursor: pointer; font-weight: 600; padding: 12px 0; min-height: 44px; }
.calc ul { margin: 0 0 12px; padding-left: 20px; max-width: 75ch; font-size: 0.97rem; }
.calc li { margin-bottom: 6px; }

/* examples */

/* ---------- guide ---------- */
.guide { margin-top: 48px; padding-top: 40px; border-top: 6px solid var(--teal); }
.prose { max-width: 70ch; }
.prose h3 { margin: 30px 0 8px; font-size: 1.35rem; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 12px; }
.prose li { margin-bottom: 6px; }
.table-scroll { overflow-x: auto; margin: 0 0 12px; }
.compare { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 0.95rem; }
.compare th, .compare td { text-align: left; vertical-align: top; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--rule); }
.compare thead th { font-family: var(--serif); font-size: 1.05rem; border-bottom: 3px solid var(--teal); }
.compare tbody th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.glossary { margin: 0; }
.glossary > div { display: grid; gap: 2px 20px; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.glossary dt { font-weight: 600; }
.glossary dd { margin: 0; }
@media (min-width: 640px) { .glossary > div { grid-template-columns: 170px 1fr; } }
.faq { max-width: 70ch; margin-top: 8px; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { font-family: var(--serif); font-size: 1.12rem; display: list-item; padding: 14px 0; }
.faq p { margin: 0 0 16px; }

.site-footer { margin-top: 56px; background: var(--band); color: var(--band-muted); padding: 28px 0 32px; font-size: 0.93rem; }
.site-footer p { max-width: 80ch; }
.site-footer strong { color: var(--band-ink); }

/* ---------- dialog and toast ---------- */
dialog { border: 0; border-top: 8px solid var(--teal); border-radius: 6px; padding: 0; background: var(--bg); color: var(--text); width: min(680px, calc(100vw - 24px)); max-height: calc(100vh - 24px); }
dialog::backdrop { background: var(--backdrop); }
#prog-form { padding: 18px 20px 20px; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.form-grid { display: grid; gap: 14px 16px; }
.form-grid fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.form-grid legend { font-weight: 600; font-size: 0.95rem; padding: 0; }
.amount-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 8px; }
@media (min-width: 600px) { .form-grid { grid-template-columns: 1fr 1fr; } .span2 { grid-column: 1 / -1; } }
.dlg-foot { display: flex; gap: 10px; margin: 18px -20px -20px; padding: 14px 20px; border-top: 1px solid var(--rule); position: sticky; bottom: 0; background: var(--bg); }
.toast { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 14px;
  background: var(--text); color: var(--bg); padding: 10px 12px 10px 16px; border-radius: 6px; width: max-content; max-width: calc(100vw - 32px); font-size: 0.97rem; }
.toast .btn { min-height: 44px; background: transparent; color: var(--bg); border-color: currentColor; }

.more { margin: 16px 0 0; }
.more .btn { width: 100%; }
@media (max-width: 359px) {
  .head-row { gap: 4px 8px; }
  .wordmark { font-size: 1.2rem; }
  .site-nav { flex-wrap: wrap; gap: 0 6px; }
  .site-nav a { padding: 10px 6px; }
  .readout { grid-template-columns: 1fr; }
  .readout > div { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; padding: 10px 0; align-items: baseline; }
  .readout > div + div { padding-left: 0; border-left: 0; border-top: 1px solid rgba(255,255,255,.28); }
  .readout dd:not(.ro-sub) { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
  .readout dd.ro-sub { min-height: 0; overflow-wrap: break-word; }
}
/* ---------- first-screen quick add ---------- */
.field label { display: block; margin-bottom: 4px; }
.field .check { display: inline-flex; margin-bottom: 0; }
.quick { background: var(--surface); color: var(--text); border-radius: 6px; padding: 18px 18px 14px; border-top: 6px solid var(--band-amber); }
.quick h2 { font-size: 1.4rem; margin-bottom: 10px; }
.quick .field { margin-bottom: 12px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.quick-note { font-size: 0.9rem; color: var(--muted); margin: 12px 0 0; }
.warn { border-left: 5px solid var(--err); background: var(--surface); padding: 10px 14px; font-weight: 600; max-width: 70ch; }

/* ---------- tracker: examples block, empty state ---------- */
.empty-start p { margin: 0 0 10px; color: var(--text); }
.empty-start p:last-child { margin: 0; }
.ex-block { margin-top: 32px; padding-top: 4px; border-top: 3px dashed var(--rule-strong); }
.ex-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin-top: 14px; }
.ex-head h3 { font-size: 1.2rem; }
.ex-block .rows { border-top: 1px solid var(--rule); }
.ex-restore { margin: 18px 0 0; }
.tl-label-ex { fill: var(--muted); font-weight: 400; font-style: italic; }
.tl-empty { fill: var(--muted); font: italic 14px var(--serif); }
.scroll-cue { display: none; font-size: 0.9rem; color: var(--muted); margin: 0 0 6px; }
@media (max-width: 600px) { .scroll-cue { display: block; } }
.prose .compare.schedule { min-width: 0; }

/* ---------- ad slots (hidden unless ads.js fills them) ---------- */
.ad-slot { margin-top: 48px; margin-bottom: 8px; }
.ad-label { font-size: 0.8rem; color: var(--muted); margin: 0 0 4px; letter-spacing: 0.02em; }
.ad-box { min-height: 120px; background: var(--sunk); border-radius: 4px; overflow: hidden; }
@media (max-width: 600px) { .ad-box { min-height: 280px; } }

/* ---------- sibling tools and footer ---------- */
.siblings { margin-top: 56px; padding: 28px 0 20px; background: var(--sunk); border-top: 1px solid var(--rule); }
.siblings h2 { font-size: 1.35rem; margin-bottom: 8px; }
.sib-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px 32px; }
.sib-list li { padding: 2px 0; }
.sib-list a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; font-weight: 600; font-family: var(--serif); font-size: 1.1rem; }
.sib-list span { display: block; color: var(--muted); font-size: 0.95rem; margin-top: -6px; }
@media (min-width: 900px) { .sib-list { grid-template-columns: repeat(3, 1fr); } }
.siblings + .site-footer { margin-top: 0; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 0 18px; margin: 8px 0; }
.foot-nav a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; color: var(--band-ink); }
.site-footer a { color: var(--band-ink); }
.copy { margin: 4px 0 0; }

/* ---------- article and info pages ---------- */
.page-head { background: var(--band); color: var(--band-ink); padding: 20px 0 36px; }
.page-head .lede { margin-top: 14px; }
.page-head a { color: var(--band-ink); }
.crumbs { font-size: 0.92rem; color: var(--band-muted); margin-bottom: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; }
.article h2, .prose > h2, .prose section > h2 { font-size: clamp(1.35rem, 2.2vw, 1.65rem); margin: 34px 0 10px; }
.article > p:first-of-type { font-size: 1.08rem; }
.art-cta { margin: 28px 0; }
.checks { list-style: none; padding-left: 0; }
.checks li { padding-left: 28px; position: relative; }
.checks li::before { content: ""; position: absolute; left: 2px; top: 6px; width: 14px; height: 8px; border-left: 2.5px solid var(--teal); border-bottom: 2.5px solid var(--teal); transform: rotate(-45deg); }
.prose .compare { min-width: 420px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
@media print {
  :root:not(#_) {
    --teal: #087f87; --band: #ffffff; --band-ink: #0f2f33; --band-muted: #45636a; --band-amber: #8a4a05;
    --bg: #ffffff; --surface: #ffffff; --sunk: #ffffff; --text: #0f2f33; --muted: #45636a; --rule: #c2d9d9; --rule-strong: #86adb0;
    --link: #066a72; --amber: #e39a2b; --amber-ink: #8a4a05; --soon-bg: #fdeccb; --ok: #2c6e49; --err: #a3321f; --ruler-ink: #ffffff;
    --hit-bg: #087f87; --hit-ink: #ffffff; color-scheme: light;
  }
  .site-nav, .theme-btn, .toolbar, .io-row, .quick, .siblings, .ad-slot, .foot-nav, .ex-restore, #rm-examples, .toast, .tl-toggles, .tl-cue, .skip, [data-toggle], [data-track], .detail-actions, #profile-sec, .calc { display: none !important; }
  .hero { padding: 8px 0 16px; }
  .timeline-sec { margin-top: 0; }
  .tl-scroll { overflow: visible; min-height: 0; }
  .tl-svg { width: 100%; height: auto; }
  .row, .month-h, .faq details, .glossary > div { break-inside: avoid; }
  .month-h { break-after: avoid; }
  .site-footer { margin-top: 24px; border-top: 1px solid var(--rule); }
}

/* Info and article pages: keep the reading column aligned with the header text */
.wrap.prose { max-width: 1180px; }
.wrap.prose > * { max-width: 70ch; }
.wrap.prose > .table-scroll { max-width: 70ch; }
/* Date inputs move focus between their own parts; keep the ring on the whole field. */
input:focus, input:focus-within, select:focus, textarea:focus { outline: 3px solid var(--amber); outline-offset: 2px; }

/* ---------- round 7: three steps on the first screen ---------- */
.hero-text { max-width: 760px; }
.manual-note { margin: 12px 0 0; padding-left: 12px; border-left: 4px solid var(--band-amber); color: var(--band-ink); font-weight: 600; }
.steps { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 16px; }
@media (min-width: 960px) { .steps { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; } }
.step { background: var(--surface); color: var(--text); border-radius: 6px; padding: 18px; border-top: 6px solid var(--teal); min-width: 0; }
.step-add { border-top-color: var(--band-amber); }
.step p { margin: 0 0 12px; }
.step .quick { padding: 0; border: 0; background: none; border-radius: 0; }
.step-h { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; margin: 0 0 8px; }
.quick .step-h { font-size: 1.3rem; margin-bottom: 4px; }
.step-n { flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--hit-bg); color: var(--hit-ink); font: 600 1rem var(--sans); }
.step-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.step .readout { display: block; border: 0; margin: 0 0 12px; }
.step .readout > div, .step .readout > div + div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; align-items: baseline; padding: 8px 0; border: 0; border-top: 1px solid var(--rule); }
.step .readout > div:first-child { border-left: 0; padding-left: 0; }
.step .readout dt { color: var(--muted); grid-column: 1; }
.step .readout dd:not(.ro-sub) { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 1.5rem; color: var(--text); }
.step #ro-next, .step #ro-soon { color: var(--amber-ink); }
.step .readout dd.ro-sub { grid-column: 1; color: var(--muted); min-height: 0; font-size: 0.86rem; }

/* ---------- where to find funding ---------- */
.funders-sec { padding-top: 40px; }
.funders-sec > .hint { margin-top: 8px; }
.funders { list-style: none; padding: 0; margin: 16px 0 12px; display: grid; gap: 8px 36px; }
@media (min-width: 960px) { .funders { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.f-group h3 { font-size: 1.15rem; padding-bottom: 6px; border-bottom: 3px solid var(--teal); margin: 12px 0 0; }
.f-group ul { list-style: none; margin: 0; padding: 0; }
.funder { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 0 14px; border-bottom: 1px solid var(--rule); }
.funder h4 { margin: 0; font-family: var(--serif); font-size: 1.1rem; line-height: 1.25; }
.funder h4 a { display: inline-flex; align-items: center; min-height: 44px; }
.funder p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* folded profile */
.profile-fold { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.profile-fold > summary { cursor: pointer; font-family: var(--serif); font-weight: 600; font-size: 1.2rem; padding: 10px 0; min-height: 44px; display: list-item; }
.profile-fold .profile-band fieldset { margin-bottom: 14px; }
.profile-fold legend { font-family: var(--sans); font-size: 0.98rem; font-weight: 400; }
@media print { .steps .step-actions, .funders .btn, .profile-fold { display: none !important; } }

/* ---------- round 8: next-deadline bar ---------- */
.dbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--band); color: var(--band-ink);
  border-top: 4px solid var(--band-amber); padding-bottom: env(safe-area-inset-bottom); }
.dbar.at-top { bottom: auto; top: 0; border-top: 0; border-bottom: 4px solid var(--band-amber); padding-bottom: 0; }
.dbar-in { display: flex; align-items: center; gap: 12px; min-height: 52px; max-height: 60px; padding-top: 4px; padding-bottom: 4px; }
.dbar-txt { flex: 1 1 auto; min-width: 0; margin: 0; display: flex; flex-direction: column; line-height: 1.25; }
.dbar-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dbar-sub { font-size: 0.86rem; color: var(--band-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dbar-prompt { font-weight: 600; }
.dbar-fig { flex: none; margin: 0; font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.4rem; color: var(--band-amber); white-space: nowrap; }
.dbar-link { flex: none; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 12px;
  color: var(--band-ink); border: 1px solid rgba(255,255,255,.45); border-radius: 4px; font-weight: 600; text-decoration: none; }
.dbar-link:hover { border-color: var(--band-amber); }
body.has-dbar { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
body.has-dbar .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
#step-3, #tracker, #funders, #quick-add { scroll-margin-top: 72px; }
@media (max-width: 359px) { .dbar-fig { font-size: 1.25rem; } .dbar-in { gap: 8px; } }
/* result panel: the main figure first and large */
.step .readout > div:first-child dd:not(.ro-sub) { font-size: 2.1rem; }
@media print { .dbar { display: none !important; } body.has-dbar { padding-bottom: 0; } }

/* ---------- round 9 ---------- */
/* fieldsets default to min-content width; let the profile wrap at any width */
.profile-band fieldset, .profile-fold fieldset, .checklist, .form-grid fieldset { min-width: 0; max-width: 100%; }
.profile-band legend, .profile-fold legend { white-space: normal; max-width: 100%; float: none; width: auto; }
.profile-list .check { max-width: 100%; }
/* funders: every group flows into 2 or 3 columns */
.funders { grid-template-columns: 1fr !important; }
.f-group ul { display: grid; gap: 0 32px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .f-group ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .f-group ul { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.f-group h3 { margin-top: 20px; }
.f-step { width: 100%; margin-top: 6px; padding: 14px; background: var(--surface); border: 1px solid var(--rule); border-left: 5px solid var(--band-amber); border-radius: 4px; }
.f-step .field { margin-bottom: 10px; }
.f-step-h { color: var(--text) !important; margin: 0 0 10px !important; }
.funder:has(.f-step) { grid-column: 1 / -1; }
/* own deadline line in rows */
.own-due { font-size: 0.9rem; color: var(--muted); }
/* bar: no cut names; shorter wording on narrow screens */
.dbar-name, .dbar-sub { white-space: normal; overflow: visible; text-overflow: clip; }
.dbar-short { display: none; }
/* narrow screens: "Next deadline in 9 days"; the program's full name is one tap away under Details */
@media (max-width: 479px) { .dbar-long, .dbar-sub { display: none; } .dbar-short { display: block; } }

@media (max-width: 767px) { .dbar-n40 .dbar-long { display: none; } .dbar-n40 .dbar-short { display: block; } }
.dbar-n80 .dbar-long { display: none; } .dbar-n80 .dbar-short { display: block; }
.f-step .field, .f-step .f-step-h { max-width: 560px; }
.profile-fold legend { float: left; width: 100%; margin-bottom: 6px; }
.profile-fold .profile-list { clear: both; }
