:root {
  --navy: #1F3864;
  --gold: #B8860B;
  --green: #C6EFCE; --green-text: #1e6b31;
  /* --amber-text darkened from the original #8a6d00 this round: that value gave only a
     4.13:1 contrast ratio against --amber's own #FFEB9C pill background and 4.44:1 against
     .flash-warning's lighter #fff3cd -- both below WCAG 2.1 SC 1.4.3's 4.5:1 minimum for
     normal-size text (measured directly with the standard relative-luminance formula, not
     eyeballed). #7c6200 is the same colour scaled 10% darker -- clears both backgrounds with
     margin (4.89:1 and 5.26:1) rather than sitting right at the 4.5:1 edge, and reads as the
     same amber/gold hue, not a different colour. */
  --amber: #FFEB9C; --amber-text: #7c6200;
  --grey: #D9D9D9; --grey-text: #555;
  --bg: #f5f6f8;
}
* { box-sizing: border-box; }
body {
  font-family: Arial, Helvetica, sans-serif;
  margin: 0; background: var(--bg); color: #1a1a1a; line-height: 1.5;
}
.topbar {
  background: var(--navy); color: white; padding: 14px 24px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
}
.brand { color: white; font-weight: bold; font-size: 1.2em; text-decoration: none; }
.brand span { font-weight: normal; opacity: .7; font-size: .7em; }
.topbar nav a { color: white; margin-left: 20px; text-decoration: none; opacity: .9; }
.topbar nav a:hover { text-decoration: underline; }
main { max-width: 1100px; margin: 24px auto; padding: 0 16px; }
.card {
  background: white; border-radius: 8px; padding: 24px; margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.card.intro h1 { margin-top: 0; color: var(--navy); }
.note { color: #666; font-size: .92em; }
.upload-box { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 16px; }
.file-label { display: block; }
.file-label input { display: block; margin-bottom: 8px; }
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 6px; text-decoration: none;
  font-size: 1em; font-weight: bold; border: none; cursor: pointer;
}
.btn-primary { background: var(--navy); color: white; }
.btn-primary:hover { background: #16294a; }
.btn-secondary { background: white; color: var(--navy); border: 2px solid var(--navy); }
.btn-secondary:hover { background: #eef1f6; }
/* .or, .metric-id, .value-unit, .value-na and footer below were all darkened from their
   original #999/#888/#777 this round: measured directly, those gave contrast ratios of only
   2.6-3.5:1 against their white/--bg backgrounds -- well under WCAG 2.1 SC 1.4.3's 4.5:1
   minimum for normal text, and, for .value-na in particular, on text that carries real
   information ("Not computed") rather than pure decoration. Standardised on #666 -- already
   used by .note above and already proven compliant (5.3-5.7:1 against both backgrounds this
   app actually places text on) -- rather than inventing a fourth slightly-different muted
   grey that would need its own separate contrast check. */
.or { color: #666; margin: 4px 0; }
.template-link { margin-top: 14px; font-size: .92em; }
.period-form { display: flex; gap: 20px; align-items: flex-end; flex-wrap: wrap; margin: 16px 0; }
.period-form label { display: flex; flex-direction: column; font-size: .9em; color: #444; gap: 4px; }
.period-form input { padding: 8px; font-size: 1em; }

/* The /configure cadence picker (Workstream D) -- five self-contained one-click report
   forms, replacing a typed date range as the PRIMARY path. Text colours reuse only pairs
   already covered by the WCAG contrast regression scenario below (--navy and #666 on a
   white background), rather than introducing a new pair that scenario wouldn't check. */
.cadence-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin: 16px 0; }
.cadence-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
                background: white; border: 1px solid #ddd; border-radius: 8px; padding: 16px; }
.cadence-card-title { font-weight: bold; color: var(--navy); font-size: 1.05em; }
.cadence-card-period { color: #666; font-size: .92em; margin-bottom: 6px; }
.advanced-period { margin-top: 20px; }
.advanced-period summary { cursor: pointer; color: var(--navy); font-weight: bold; margin-bottom: 8px; }
.flash-wrap { margin-bottom: 16px; }
.flash { padding: 12px 16px; border-radius: 6px; margin-bottom: 8px; }
.flash-error { background: #ffe1e1; color: #8a1f1f; }
.flash-success { background: #e1f5e1; color: #1e6b31; }
.flash-warning { background: #fff3cd; color: var(--amber-text); }
.cat-heading { color: var(--navy); border-bottom: 2px solid var(--navy); padding-bottom: 6px; margin-top: 32px; }
.gap-heading { color: #8a1f1f; border-bottom-color: #8a1f1f; }
/* Added this round so app.py's Content-Security-Policy header can drop style-src's own
   'unsafe-inline' allowance: every connector-sync-result template used to carry a literal
   style="color:#8a1f1f;" attribute (14 occurrences across 6 templates, checked directly --
   every single one this exact static string, never a per-row/dynamic value) for one
   recurring case, a sync-failure/caveat note that should read in the same error red as
   .flash-error/.gap-heading above rather than .note's own muted grey. Same colour, same
   contrast guarantee (see the WCAG check below) -- moved into a real class instead of
   staying inline, since a static value never needed to be inline in the first place. */
.note-error { color: #8a1f1f; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 8px; }
.metric-card { background: white; border-radius: 8px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.metric-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.metric-id { font-family: monospace; color: #666; font-size: .85em; }
.metric-card h3 { margin: 4px 0 6px; font-size: 1.05em; color: #111; }
.def { font-size: .85em; color: #555; margin: 0 0 10px; }
.value-block { margin: 10px 0; }
.value-num { font-size: 1.8em; font-weight: bold; color: var(--navy); }
.value-unit { font-size: .85em; color: #666; margin-left: 4px; }
.value-na { color: #666; font-style: italic; }
.value-text { font-size: 1.05em; font-weight: 600; color: var(--navy); }
.dq-flag { font-size: .8em; color: var(--amber-text); margin: 4px 0; }
.breakdown { margin: 8px 0; font-size: .82em; }
.breakdown pre { background: #f3f3f3; padding: 8px; border-radius: 4px; overflow-x: auto; }
.regime-pills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.pill {
  display: inline-block; padding: 3px 9px; border-radius: 12px; font-size: .75em; font-weight: bold;
}
.pill-sm { font-size: .68em; font-weight: normal; }
.pill-green { background: var(--green); color: var(--green-text); }
.pill-amber { background: var(--amber); color: var(--amber-text); }
.pill-grey { background: var(--grey); color: var(--grey-text); }
.gap-table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; margin-bottom: 30px; }
.gap-table th, .gap-table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid #eee; font-size: .9em; }
.gap-table th { background: #f0f0f0; }
footer { text-align: center; color: #666; font-size: .8em; padding: 30px 16px; }

/* Screen-reader-only text: present in the accessibility tree, invisible on screen. Added
   this round to label the 16 file inputs on configure.html that had no accessible name at
   all -- a screen-reader user tabbing to one heard only "file, no file selected" with no
   indication of which of the 16 near-identical upload fields on that page it was, since
   their only visible context (the <h2> above each one) wasn't programmatically associated
   with the <input>. Standard "clip" technique -- not display:none/visibility:hidden, which
   would remove it from the accessibility tree too and defeat the purpose -- kept deliberately
   separate from the app's existing .value-na/.note-style classes so it never accidentally
   becomes visible if reused for something else. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
