:root {
  --ink: #142033;
  --ink-soft: #465468;
  --muted: #6d7888;
  --line: #d9dee6;
  --line-strong: #c3cad5;
  --canvas: #f4f6f8;
  --surface: #ffffff;
  --surface-subtle: #f8f9fb;
  --navy: #173a63;
  --navy-hover: #102e51;
  --navy-tint: #edf3f9;
  --green: #198754;
  --green-bg: #eaf7f0;
  --amber: #a96600;
  --amber-bg: #fff5dc;
  --red: #c53532;
  --red-bg: #fff0ef;
  --critical: #8f1d1d;
  --critical-bg: #fbe8e8;
  --blue: #2563a6;
  --blue-bg: #edf5ff;
  --sidebar: 260px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; touch-action: manipulation; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.auth-view { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; padding: 28px 5vw 24px; background: linear-gradient(90deg, #102338 0, #102338 31%, var(--canvas) 31%, var(--canvas) 100%); }
.auth-brand { display: flex; align-items: center; gap: 11px; color: #eef4fa; }
.auth-panel { align-self: center; justify-self: center; width: min(920px, 100%); display: grid; grid-template-columns: 1fr 390px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: 0 18px 55px rgba(16,35,56,.14); }
.auth-context { padding: 62px 55px; color: #eaf0f6; background: #173a63; }
.auth-context .eyebrow { color: #9ec9ec; }
.auth-context h1 { max-width: 12ch; margin: 0 0 18px; color: #fff; font-size: 37px; line-height: 1.05; }
.auth-context > p:not(.eyebrow) { max-width: 39ch; color: #ced9e5; font-size: 14px; line-height: 1.65; }
.auth-trust { display: flex; flex-direction: column; gap: 12px; margin-top: 36px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.18); }
.auth-trust span { display: flex; align-items: center; gap: 10px; color: #dde7f0; font-size: 11px; font-weight: 600; }
.auth-trust svg { color: #8ec5ed; }
.auth-form { align-self: center; padding: 48px 42px; }
.auth-form .field { margin-bottom: 20px; }
.field select { width: 100%; min-height: 43px; padding: 9px 38px 9px 11px; border: 1px solid var(--line-strong); border-radius: 0; outline: 0; color: var(--ink); background: #fff; font-size: 13px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px; background-size: 5px 5px; background-repeat: no-repeat; }
.field select:focus-visible { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,166,.12); }
.button-primary { color: #fff; background: var(--navy); border-color: var(--navy); }
.button-primary:hover { background: var(--navy-hover); border-color: var(--navy-hover); }
.button-full { width: 100%; min-height: 44px; }
.form-error { min-height: 17px; margin: -8px 0 10px; color: var(--red); font-size: 11px; line-height: 1.4; }
.auth-sent { text-align: center; }
.sent-mark { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 18px; color: var(--green); background: var(--green-bg); border: 1px solid #bfe2ce; }
.auth-sent h2 { font-size: 22px; }
.auth-sent p { margin-bottom: 24px; color: var(--ink-soft); font-size: 13px; line-height: 1.55; }
.auth-reset { display: block; margin: 18px auto 0; color: var(--ink-soft); }
.auth-reset:hover { color: var(--ink); }
.auth-footer { align-self: end; margin: 0; color: #748397; font-size: 10px; text-align: center; text-transform: uppercase; letter-spacing: .08em; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 10; width: var(--sidebar); display: flex; flex-direction: column; padding: 25px 18px 20px; color: #eaf0f6; background: #102338; border-right: 1px solid #0d1c2d; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.42); color: #fff; font-size: 13px; font-weight: 800; letter-spacing: -.04em; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.2; }
.brand-copy strong { font-size: 15px; letter-spacing: .01em; }
.brand-copy small { margin-top: 3px; color: #aebaca; font-size: 11px; }
.progress-block { margin: 30px 8px 23px; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 9px; color: #b7c3d2; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .065em; }
.progress-label strong { color: #fff; }
.progress-track { overflow: hidden; height: 3px; background: rgba(255,255,255,.12); }
.progress-track span { display: block; width: 0; height: 100%; background: #80b8e6; transition: width .3s ease; }
.step-nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; padding-right: 2px; scrollbar-width: thin; }
.step-link { display: grid; grid-template-columns: 24px 1fr 8px; align-items: center; gap: 8px; min-height: 40px; padding: 7px 9px; border: 1px solid transparent; color: #adbac9; font-size: 12px; text-decoration: none; transition: background .15s, color .15s, border-color .15s; }
.step-link:hover { color: #fff; background: rgba(255,255,255,.055); }
.step-link.active { color: #fff; background: rgba(128,184,230,.12); border-color: rgba(128,184,230,.25); }
.step-index { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid rgba(255,255,255,.18); font-size: 10px; font-weight: 700; }
.step-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.17); }
.step-link.complete .step-dot { background: #65c693; }
.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 9px; padding: 18px 8px 0; border-top: 1px solid rgba(255,255,255,.1); }
.signed-in-user { display: flex; flex-direction: column; gap: 3px; margin-bottom: 5px; overflow: hidden; }
.signed-in-user span { overflow: hidden; color: #d3dce6; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.signed-in-user strong { color: #80b8e6; font-size: 10px; letter-spacing: .06em; }
.version { color: #8493a5; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.text-button { align-self: flex-start; padding: 0; border: 0; color: #b8c3d0; background: transparent; font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
.text-button:hover { color: #fff; }

.main { margin-left: var(--sidebar); padding: 0 48px; }
.topbar { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; justify-content: space-between; min-height: 92px; margin: 0 -48px; padding: 16px 48px; background: rgba(244,246,248,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.eyebrow, .section-kicker { margin: 0 0 5px; color: var(--blue); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .11em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 24px; line-height: 1.15; letter-spacing: -.025em; }
h2 { margin-bottom: 7px; font-size: 20px; line-height: 1.2; letter-spacing: -.02em; text-wrap: balance; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.peer-badge { padding: 6px 9px; color: var(--navy); background: var(--navy-tint); border: 1px solid #cfdeec; font-size: 10px; font-weight: 750; letter-spacing: .055em; }
.save-state { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.save-state > span { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.save-state.saving > span { background: var(--amber); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 14px; border: 1px solid transparent; font-size: 12px; font-weight: 650; transition: border-color .15s, background .15s, color .15s; }
.button-secondary { border-color: var(--line-strong); color: var(--ink); background: var(--surface); }
.button-secondary:hover { border-color: #9ba7b7; background: var(--surface-subtle); }

#analysis-form { width: min(1100px, 100%); margin: 36px auto 0; }
.viewing-banner { width: min(1100px, 100%); margin: 22px auto -16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; color: #664300; background: var(--amber-bg); border: 1px solid #e9ca83; font-size: 11px; }
.facilitator-dashboard { width: min(1100px, 100%); min-height: 570px; margin: 36px auto 0; background: var(--surface); border: 1px solid var(--line); }
.dashboard-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; padding: 28px 30px; border-bottom: 1px solid var(--line); }
.dashboard-heading h2 { margin-bottom: 6px; font-size: 24px; }
.dashboard-heading p:last-child { margin-bottom: 0; color: var(--ink-soft); font-size: 12px; }
.group-tabs { display: flex; gap: 2px; padding: 16px 20px 0; border-bottom: 1px solid var(--line); }
.group-tab { position: relative; min-height: 38px; padding: 0 15px; border: 0; color: var(--muted); background: transparent; font-size: 11px; font-weight: 700; }
.group-tab[aria-selected="true"] { color: var(--navy); }
.group-tab[aria-selected="true"]::after { content: ""; position: absolute; right: 12px; bottom: -1px; left: 12px; height: 2px; background: var(--navy); }
.reports-summary { padding: 16px 22px; color: var(--ink-soft); background: var(--surface-subtle); border-bottom: 1px solid var(--line); font-size: 11px; }
.reports-summary strong { color: var(--ink); }
.reports-table-wrap { overflow-x: auto; }
.reports-table { width: 100%; border-collapse: collapse; }
.reports-table th { padding: 11px 14px; color: var(--muted); background: #fff; border-bottom: 1px solid var(--line); font-size: 9px; text-align: left; text-transform: uppercase; letter-spacing: .075em; }
.reports-table td { padding: 14px; border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: 11px; }
.reports-table td:first-child { color: var(--ink); font-weight: 650; }
.reports-table td:last-child { text-align: right; }
.progress-value { display: inline-flex; align-items: center; gap: 8px; }
.progress-mini { width: 62px; height: 3px; background: var(--line); }
.progress-mini span { display: block; height: 100%; background: var(--green); }
.empty-reports td { padding: 55px 20px; color: var(--muted) !important; font-weight: 400 !important; text-align: center !important; }
.company-panel, .analysis-section, .remediation { background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(20,32,51,.035); }
.company-panel { display: grid; grid-template-columns: 260px 1fr; gap: 42px; padding: 28px 30px; }
.section-intro p { max-width: 45ch; margin-bottom: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.55; }
.company-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 17px 14px; }
.field { display: flex; flex-direction: column; gap: 7px; color: var(--ink-soft); font-size: 11px; font-weight: 650; }
.field-wide { grid-column: span 2; }
.field input, .metric-input { width: 100%; min-height: 41px; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 0; outline: none; color: var(--ink); background: #fff; font-size: 13px; font-weight: 500; transition: border-color .15s, box-shadow .15s; }
.field input::placeholder, .metric-input::placeholder { color: #99a3b0; font-weight: 400; }
.field input:focus-visible, .metric-input:focus-visible { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,166,.12); }
.input-prefix { display: grid; grid-template-columns: 37px 1fr; }
.input-prefix > span { display: grid; place-items: center; min-height: 41px; color: var(--muted); background: var(--surface-subtle); border: 1px solid var(--line-strong); border-right: 0; font-size: 12px; }

#steps-container { display: flex; flex-direction: column; gap: 18px; margin-top: 18px; }
.analysis-section { scroll-margin-top: 110px; }
.section-header { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 16px; min-height: 82px; padding: 17px 22px; border-bottom: 1px solid var(--line); }
.section-number { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line-strong); color: var(--navy); background: var(--surface-subtle); font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; }
.section-title-wrap h2 { margin-bottom: 4px; font-size: 17px; }
.section-title-wrap p { margin-bottom: 0; color: var(--muted); font-size: 11px; }
.section-status { min-width: 84px; padding: 6px 9px; color: var(--muted); background: var(--surface-subtle); border: 1px solid var(--line); font-size: 10px; font-weight: 700; text-align: center; text-transform: uppercase; letter-spacing: .055em; }
.section-status.complete { color: var(--green); background: var(--green-bg); border-color: #bfe2ce; }
.metric-table { width: 100%; border-collapse: collapse; }
.metric-table th { padding: 10px 13px; color: var(--muted); background: var(--surface-subtle); border-bottom: 1px solid var(--line); font-size: 9px; font-weight: 700; text-align: left; text-transform: uppercase; letter-spacing: .08em; }
.metric-table td { padding: 12px 13px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.metric-table tr:last-child td { border-bottom: 0; }
.metric-name { display: flex; align-items: flex-start; gap: 11px; }
.metric-code { flex: 0 0 auto; display: inline-grid; place-items: center; min-width: 38px; height: 24px; padding: 0 6px; color: var(--ink-soft); background: #eef1f4; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; font-weight: 700; }
.metric-label strong { display: block; margin-top: 1px; color: var(--ink); font-size: 12px; font-weight: 650; line-height: 1.35; }
.metric-label small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.benchmark { color: var(--ink-soft); font-size: 11px; white-space: nowrap; }
.benchmark strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.input-wrap { position: relative; width: 128px; }
.input-wrap .metric-input { padding-right: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.input-unit { position: absolute; top: 50%; right: 11px; transform: translateY(-50%); color: var(--muted); font-size: 11px; pointer-events: none; }
.result-cell { width: 245px; }
.result { display: flex; align-items: center; gap: 9px; min-height: 31px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.result-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: #ccd2da; }
.result.good { color: #136a43; }.result.good .result-dot { background: var(--green); }
.result.watch { color: #805000; }.result.watch .result-dot { background: #d58a00; }
.result.poor { color: #a52926; }.result.poor .result-dot { background: var(--red); }
.result.critical { color: #7d1717; }.result.critical .result-dot { background: var(--critical); }
.result.info { color: #1b588e; }.result.info .result-dot { background: var(--blue); }
.bands { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.band { display: flex; align-items: center; gap: 7px; min-height: 35px; padding: 7px 11px; border-right: 1px solid var(--line); color: var(--ink-soft); font-size: 9px; line-height: 1.25; }
.band:last-child { border-right: 0; }
.band-dot { width: 7px; height: 7px; border-radius: 50%; }
.band.good .band-dot { background: var(--green); }.band.watch .band-dot { background: #d58a00; }.band.poor .band-dot { background: var(--red); }.band.critical .band-dot { background: var(--critical); }
.sum-row { display: flex; justify-content: flex-end; gap: 20px; padding: 12px 14px; background: var(--surface-subtle); border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 11px; }
.sum-row strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.sum-row.valid strong { color: var(--green); }
.sum-row.invalid strong { color: var(--red); }

.remediation { scroll-margin-top: 110px; display: grid; grid-template-columns: 50px 1fr; gap: 18px; margin-top: 18px; padding: 24px 22px 28px; }
.remediation-content { min-width: 0; }
.compact { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 12px; }
.compact .section-kicker { flex-basis: 100%; }
.compact h2 { margin-bottom: 0; }
.compact p { flex: 1 1 360px; }
.recommendations { margin: 24px 0 0; padding: 0; list-style: none; counter-reset: rec; border-top: 1px solid var(--line); }
.recommendations li { counter-increment: rec; display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: start; padding: 16px 0; border-bottom: 1px solid var(--line); }
.recommendations li::before { content: counter(rec, decimal-leading-zero); color: var(--muted); font-family: ui-monospace, monospace; font-size: 10px; font-weight: 700; }
.recommendation-copy strong { display: block; margin-bottom: 4px; font-size: 12px; }
.recommendation-copy span { color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
.priority { padding: 4px 7px; font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.priority.critical { color: var(--critical); background: var(--critical-bg); }.priority.poor { color: var(--red); background: var(--red-bg); }.priority.watch { color: var(--amber); background: var(--amber-bg); }
.empty-recommendation { display: block !important; color: var(--muted); font-size: 11px; }
.empty-recommendation::before { content: none !important; }
.page-footer { width: min(1100px, 100%); display: flex; justify-content: space-between; margin: 30px auto 0; padding: 0 0 40px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 30; transform: translateY(15px); padding: 11px 14px; color: #fff; background: var(--ink); box-shadow: 0 8px 25px rgba(20,32,51,.22); font-size: 11px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { transform: none; opacity: 1; }

@media (max-width: 980px) {
  .auth-panel { grid-template-columns: 1fr 350px; }
  .auth-context { padding: 48px 38px; }
  :root { --sidebar: 218px; }
  .main { padding: 0 24px; }
  .topbar { margin: 0 -24px; padding: 16px 24px; }
  .company-panel { grid-template-columns: 1fr; gap: 22px; }
  .company-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .metric-table th:nth-child(2), .metric-table td:nth-child(2) { display: none; }
  .result-cell { width: 200px; }
}

@media (max-width: 720px) {
  .auth-view { display: block; padding: 18px 14px 24px; background: #102338; }
  .auth-brand { margin-bottom: 18px; }
  .auth-panel { display: block; }
  .auth-context { padding: 30px 25px; }
  .auth-context h1 { max-width: 16ch; font-size: 30px; }
  .auth-trust { margin-top: 24px; }
  .auth-form { padding: 30px 25px; }
  .auth-footer { margin-top: 18px; color: #8291a2; }
  :root { --sidebar: 0px; }
  .sidebar { position: sticky; top: 0; width: 100%; height: auto; flex-direction: row; align-items: center; padding: 10px 14px; }
  .brand { padding: 0; }.brand-copy small, .progress-block, .step-nav, .sidebar-footer { display: none; }
  .main { margin-left: 0; padding: 0 14px; }
  .topbar { top: 54px; min-height: 70px; margin: 0 -14px; padding: 11px 14px; }
  .eyebrow, .save-state { display: none; }
  .peer-badge { display: none; }
  h1 { font-size: 18px; }
  .button { min-height: 40px; padding: 0 11px; }
  #analysis-form { margin-top: 16px; }
  .company-panel { padding: 21px 17px; }
  .company-grid { grid-template-columns: 1fr 1fr; }
  .field-wide { grid-column: 1 / -1; }
  .section-header { grid-template-columns: 38px 1fr; padding: 14px; }
  .section-status { display: none; }
  .metric-table, .metric-table tbody, .metric-table tr, .metric-table td { display: block; width: 100%; }
  .metric-table thead { display: none; }
  .metric-table tr { display: grid; grid-template-columns: minmax(0, 1fr) 115px; gap: 10px 14px; padding: 16px 14px; border-bottom: 1px solid var(--line); }
  .metric-table td { min-width: 0; padding: 0; border: 0; }
  .metric-name, .metric-label { min-width: 0; }
  .metric-table td:nth-child(1) { grid-column: 1 / -1; }
  .metric-table td:nth-child(2) { display: block; }
  .metric-table td:nth-child(2)::before { content: "Benchmark "; color: var(--muted); }
  .input-wrap { width: 115px; }
  .result-cell { grid-column: 1 / -1; }
  .bands { grid-template-columns: 1fr 1fr; }
  .band:nth-child(2) { border-right: 0; }.band:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .remediation { grid-template-columns: 38px 1fr; padding: 20px 14px; }
  .recommendations li { grid-template-columns: 27px 1fr; }
  .priority { grid-column: 2; justify-self: start; }
  .facilitator-dashboard { margin-top: 16px; }
  .dashboard-heading { display: block; padding: 20px 17px; }
  .dashboard-heading .button { margin-top: 17px; }
  .viewing-banner { align-items: flex-start; margin-top: 16px; }
}

@media (max-width: 600px) {
  .topbar-actions .button { width: 42px; padding: 0; font-size: 0; }
  .topbar-actions .button svg { width: 18px; height: 18px; }
  .company-grid { grid-template-columns: 1fr; }.field-wide { grid-column: auto; }
  .metric-table tr { grid-template-columns: 1fr 105px; }.input-wrap { width: 105px; }
  .compact { display: block; }.compact h2 { margin-bottom: 7px; }
  .page-footer { flex-direction: column; gap: 6px; }
  .reports-table th:nth-child(3), .reports-table td:nth-child(3) { display: none; }
}

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  .sidebar, .topbar-actions, .toast, .viewing-banner, .facilitator-dashboard, .auth-view { display: none !important; }
  .main { margin: 0; padding: 0; }
  .topbar { position: static; min-height: auto; margin: 0 0 15px; padding: 0 0 13px; background: #fff; border-bottom: 2px solid var(--ink); }
  #analysis-form { width: 100%; margin: 0; }
  .company-panel, .analysis-section, .remediation { box-shadow: none; break-inside: avoid; }
  .company-panel { padding: 16px; }
  #steps-container { gap: 10px; margin-top: 10px; }
  .analysis-section { break-inside: avoid; }
  .section-header { min-height: 58px; padding: 9px 12px; }
  .metric-table td { padding: 7px 10px; }
  .metric-input { border-color: #9aa2ad !important; box-shadow: none !important; }
  .bands { display: none; }
  .remediation { margin-top: 10px; }
  .page-footer { padding-bottom: 0; }
}
