: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;
}

/* v0.118: multi-factor sign-in pages */
.qr-box { margin: 1rem 0; }
.qr-box img { display: block; background: #fff; padding: 0.5rem; border: 1px solid var(--grey); }
.secret-text { font-family: Consolas, "Courier New", monospace; font-size: 1.1rem; letter-spacing: 0.08em; word-break: break-all; }
.recovery-list { font-family: Consolas, "Courier New", monospace; font-size: 1.1rem; list-style: none; padding: 0; columns: 2; max-width: 22rem; }
.recovery-list li { padding: 0.2rem 0; }

/* v0.120: the hidden field on the sign-up and password-reset forms. Moved off-screen rather than hidden
   with display:none, which some bots detect; aria-hidden and tabindex=-1 keep it away from people. */
.hp-field { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.pow-check { margin: 1rem 0; }

/* v0.126: chart styles. The SVG charts carry only presentation attributes (the Content-Security-Policy does not
   allow inline style attributes), so their sizing lives here. Text colours reuse --navy and #52514e, both well
   above 4.5:1 on white; the current style is marked by weight, a border and aria-current, not by colour alone. */
.chart { max-width: 100%; height: auto; display: block; }
.chart-styles h2 { margin-top: 0; color: var(--navy); font-size: 1.15em; }
.chart-style-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }
.chart-style-link { display: inline-block; padding: 7px 14px; border: 2px solid var(--navy); border-radius: 6px;
  background: white; color: var(--navy); text-decoration: none; font-size: .92em; }
.chart-style-link:hover, .chart-style-link:focus { background: #eef1f7; }
.chart-style-current { background: var(--navy); color: white; font-weight: bold; }
.chart-style-current:hover, .chart-style-current:focus { background: var(--navy); }
.chart-style-help { margin: 4px 0 0; }
.chart-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin: 12px 0 16px; }
.chart-panel { background: white; border-radius: 8px; padding: 14px 16px; margin: 0; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.chart-panel figcaption { font-weight: bold; color: var(--navy); margin-bottom: 8px; }
.chart-key { font-size: .78em; color: #555; margin: 6px 0 0; }
.metric-chart { margin: 8px 0 10px; }

/* v0.127: report types on the Choose your report page, the report heading and the scheduled-report settings. */
.type-menu-heading { margin: 18px 0 6px; color: var(--navy); font-size: 1em; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.type-link { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 2px solid #c5cbd8;
  border-radius: 8px; background: white; color: #1a1a1a; text-decoration: none; }
.type-link:hover, .type-link:focus { border-color: var(--navy); background: #eef1f7; }
.type-link-title { font-weight: bold; color: var(--navy); }
.type-link-summary { font-size: .86em; color: #444; }
.type-current { border-color: var(--navy); background: var(--navy); }
.type-current .type-link-title, .type-current .type-link-summary { color: white; }
.type-current:hover, .type-current:focus { background: var(--navy); }
.type-chosen { margin-top: 16px; padding-top: 4px; border-top: 1px solid #d8dce6; }
.report-purpose { margin: 4px 0 8px; }
.not-available-heading { margin-top: 28px; }
.type-settings-table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.type-settings-table th, .type-settings-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #e1e4ec; }
.type-settings-table select { max-width: 100%; }

/* v0.128: reporting maturity (the tag on a report, the trend card and per-metric delta lines) and the new
   Reporting maturity page. */
.maturity-tag { margin: 2px 0 10px; }
.trend-card { margin-top: 0; }
.trend-toggle-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }
.trend-toggle-link { display: inline-block; padding: 7px 14px; border: 2px solid var(--navy); border-radius: 6px;
  background: white; color: var(--navy); text-decoration: none; font-size: .92em; }
.trend-toggle-link:hover, .trend-toggle-link:focus { background: #eef1f7; }
.trend-toggle-current { background: var(--navy); color: white; font-weight: bold; }
.trend-toggle-current:hover, .trend-toggle-current:focus { background: var(--navy); }
.trend-line { margin: 6px 0 0; font-size: .86em; font-weight: bold; }
.trend-up { color: #1e6b31; }
.trend-down { color: #a3291f; }
.trend-flat { color: #555; }
.trend-none { color: #888; font-weight: normal; font-style: italic; }
.ladder { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.ladder-stage { border: 2px solid #c5cbd8; border-radius: 8px; padding: 12px 16px; background: white; }
.ladder-stage h3 { margin: 0 0 4px; color: var(--navy); }
.ladder-stage .question { color: #555; font-style: italic; margin: 0 0 6px; }
.ladder-stage .aperito-note { margin: 6px 0 0; font-size: .9em; color: #444; }
.ladder-stage .moving-up-note { margin: 6px 0 0; font-size: .9em; color: #444; padding-top: 6px;
  border-top: 1px solid #e1e4ec; }
.ladder-stage.not-offered { background: #f6f6f4; }
.stage-character { display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 10px;
  font-size: .62em; font-weight: bold; text-transform: uppercase; letter-spacing: .03em; vertical-align: middle; }
.stage-character.transactional { background: #e1e4ec; color: var(--navy); }
.stage-character.transformational { background: var(--gold); color: #2b1f00; }
.self-check-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 10px; padding: 10px 0; border-bottom: 1px solid #e1e4ec; }
.self-check-row:last-of-type { border-bottom: none; }
.self-check-submit { margin-top: 14px; }
.self-check-text { flex: 1 1 420px; }
.self-check-options { display: flex; gap: 14px; flex-wrap: wrap; }
.self-check-options label { font-size: .88em; display: flex; align-items: center; gap: 4px; }
.maturity-result { border: 2px solid var(--navy); border-radius: 8px; padding: 14px 18px; background: #eef1f7;
  margin: 10px 0; }
.maturity-result h3 { margin: 0 0 4px; color: var(--navy); }
.maturity-history-table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.maturity-history-table th, .maturity-history-table td { text-align: left; padding: 5px 8px;
  border-bottom: 1px solid #e1e4ec; }
.type-stage-table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.type-stage-table th, .type-stage-table td { text-align: left; padding: 5px 8px; border-bottom: 1px solid #e1e4ec; }
.methods { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.method-card { border: 2px solid #c5cbd8; border-radius: 8px; padding: 12px 16px; background: white; }
.method-card h3 { margin: 0 0 4px; color: var(--navy); }
.method-card .aperito-note { margin: 6px 0 0; font-size: .9em; color: #444; }
.case-studies-heading { margin: 18px 0 2px; color: var(--navy); }
.case-studies { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 0; }
.case-study-card { border: 2px solid #c5cbd8; border-radius: 8px; padding: 12px 16px; background: #fbfbfa; }
.case-study-card h4 { margin: 0 0 4px; color: var(--navy); font-size: 1em; }
.case-source { margin: 6px 0 0; font-size: .85em; color: #555; }
.case-source a { color: var(--navy); }
