/* Assessment application */
body.app { background: var(--bg-soft); }
.app-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.app-header .nav { height: 64px; }
.app-header .progress-wrap { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: .85rem; color: var(--muted); }
.app-header .progress { width: 220px; height: 4px; background: var(--line); }
.app-header .progress-bar { height: 100%; background: var(--accent); width: 0; transition: width .4s ease; }
@media (max-width: 640px) { .app-header .progress { width: 70px; } .app-header .progress-label { font-size: .75rem; } .app-header .logo-text small { display: none; } .app-header .logo-text { font-size: .95rem; } }
@media (max-width: 380px) { .app-header .logo-text { display: none; } }

.app-main { min-height: calc(100vh - 64px); }
.view { animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Intro */
.intro { max-width: 1080px; margin: 0 auto; padding: 64px 32px 96px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 64px; }
.intro h1 { font-size: clamp(2rem, 4vw, 3rem); }
.intro .panel { background: #fff; border: 1px solid var(--line); padding: 32px; }
.field { display: grid; gap: 7px; margin-bottom: 18px; }
.field label { font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.field input, .field select {
  font: 400 1rem var(--sans); padding: 13px 14px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); border-radius: 2px; width: 100%;
  appearance: none; -webkit-appearance: none;
}
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23051c2c' stroke-width='1.6' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.field input:focus, .field select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-50); }
.intro ul.points { list-style: none; padding: 0; margin: 28px 0 0; border-top: 1px solid var(--line); }
.intro ul.points li { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.intro ul.points b { color: var(--ink); }
.intro ul.points span.n { font: 500 1.4rem/1 var(--serif); color: var(--accent); width: 28px; flex: none; }
@media (max-width: 900px) { .intro { grid-template-columns: 1fr; gap: 36px; padding: 36px 16px 64px; } }

/* Question */
.qwrap { max-width: 1180px; margin: 0 auto; padding: 48px 32px 80px; display: grid; grid-template-columns: 260px 1fr; gap: 64px; }
.stepper { list-style: none; padding: 0; margin: 0; position: sticky; top: 104px; align-self: start; }
.stepper li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
.stepper li .dot { width: 22px; height: 22px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; font-size: .7rem; font-weight: 700; border-radius: 50%; background: #fff; }
.stepper li.done { color: var(--ink-2); }
.stepper li.done .dot { background: var(--ink); border-color: var(--ink); color: #fff; }
.stepper li.current { color: var(--ink); font-weight: 600; }
.stepper li.current .dot { border-color: var(--accent); color: var(--accent); }
.stepper .sub { display: block; font-size: .75rem; font-weight: 500; color: var(--muted); margin-top: 2px; }
.qcard { background: #fff; border: 1px solid var(--line); padding: 44px 48px; }
.qmeta { display: flex; justify-content: space-between; gap: 16px; font-size: .8rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; font-weight: 600; margin-bottom: 18px; }
.qmeta .dim { color: var(--accent); }
.qtext { font: 400 clamp(1.5rem, 2.6vw, 2.05rem)/1.25 var(--serif); letter-spacing: -.015em; color: var(--ink); margin: 0 0 30px; }
.options { display: grid; gap: 10px; }
.option {
  display: grid; grid-template-columns: 40px 1fr; align-items: center; gap: 14px; text-align: left;
  padding: 16px 18px; border: 1px solid var(--line-strong); background: #fff; cursor: pointer; font: 400 1rem/1.45 var(--sans); color: var(--ink);
  transition: border-color .12s, background .12s, box-shadow .12s; border-radius: 2px; width: 100%;
}
.option:hover { border-color: var(--ink); }
.option .lvl { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line-strong); font-weight: 700; font-size: .85rem; color: var(--ink-2); }
.option[aria-checked="true"] { border-color: var(--accent); background: var(--accent-50); box-shadow: inset 3px 0 0 var(--accent); }
.option[aria-checked="true"] .lvl { background: var(--accent); border-color: var(--accent); color: #fff; }
.scale-hint { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin: 0 0 10px; text-transform: uppercase; letter-spacing: .06em; }
.qnav { display: flex; justify-content: space-between; align-items: center; margin-top: 30px; gap: 12px; }
.qnav .hint { font-size: .8rem; color: var(--muted); }
@media (max-width: 960px) { .qwrap { grid-template-columns: 1fr; gap: 0; padding: 20px 16px 64px; } .stepper { display: none; } .qcard { padding: 28px 20px; } .qnav .hint { display: none; } .save-mobile { display: block; } }

/* Checkpoint (target + confidence) */
.checkpoint .today { color: var(--ink-2); margin: -14px 0 22px; }
.target-scale .option.below { opacity: .55; }
.conf { border: 0; padding: 0; margin: 26px 0 0; }
.conf legend { font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 10px; }
.conf label { display: inline-flex; align-items: center; gap: 8px; margin: 0 18px 8px 0; font-size: .92rem; color: var(--ink-2); cursor: pointer; }
.conf input { accent-color: var(--accent); width: 16px; height: 16px; }

/* Results */
.results { max-width: 1180px; margin: 0 auto; padding: 48px 32px 96px; }
.rhead { background: #fff; border: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr auto; gap: 40px; align-items: center; padding: 40px 44px; }
.rhead h1 { font-size: clamp(1.7rem, 3vw, 2.4rem); margin-bottom: 12px; }
.rhead .actions { display: grid; gap: 10px; }
.rhead.single { grid-template-columns: 1fr; }
@media (max-width: 960px) { .results { padding: 24px 16px 64px; } .rhead { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 28px 20px; } .rhead .actions { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .rhead .actions { grid-template-columns: 1fr; } }
.stage { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 22px; }
.stage div { padding: 10px 8px 0; border-top: 4px solid var(--line); font-size: .75rem; color: var(--muted); }
.stage div.on { border-top-color: var(--accent); color: var(--ink); font-weight: 600; }
.stage div.past { border-top-color: #9fb3e8; }
@media (max-width: 600px) {
  .stage { display: flex; }
  .stage div { flex: 1 1 0; min-width: 0; font-size: 0; }
  .stage div::before { content: attr(data-n); font-size: .75rem; }
  .stage div.on { flex: 3 1 0; font-size: .75rem; }
  .stage div.on::before { content: none; }
}
.rgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px; }
@media (max-width: 960px) { .rgrid { grid-template-columns: minmax(0, 1fr); } }
.exhibit .dimrow { display: grid; grid-template-columns: 1fr 52px; gap: 6px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.exhibit .dimrow:last-child { border-bottom: 0; }
.exhibit .dimrow .bar { grid-column: 1 / -1; }
.exhibit .dimrow b { text-align: right; font-variant-numeric: tabular-nums; }
.gaps { display: grid; grid-template-columns: repeat(3, 1fr); }
.gap { padding: 26px 24px; border-right: 1px solid var(--line); }
.gap:last-child { border-right: 0; }
.gap .rank { font: 500 2.2rem/1 var(--serif); color: var(--accent); }
@media (max-width: 860px) { .gaps { grid-template-columns: 1fr; } .gap { border-right: 0; border-bottom: 1px solid var(--line); } }

/* v2 exhibits */
.arch-tag { display: inline-block; vertical-align: middle; font: 600 .72rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--accent); padding: 7px 10px; margin-left: 8px; position: relative; top: -4px; }
.archetype { width: 100%; height: auto; display: block; }
.archetype .quad { fill: #fff; stroke: var(--line-strong); stroke-width: 1; }
.archetype .quad.on { fill: var(--accent-50); stroke: var(--accent); stroke-width: 1.5; }
.archetype .q-name { font: 600 12px var(--sans); fill: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.archetype .q-name.on { fill: var(--accent); }
.archetype .axis-label { font: 500 11px var(--sans); fill: var(--muted); }
.archetype .you { fill: var(--accent); stroke: #fff; stroke-width: 2; }
.archetype .you-label { font: 700 12px var(--sans); fill: var(--ink); }
.archetype .bench-dot { fill: var(--muted); stroke: #fff; stroke-width: 2; }
.table-scroll { overflow-x: auto; }
.heat, .peer-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.heat th, .peer-table th { text-align: left; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.heat td, .peer-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink-2); }
.heat tr:last-child td, .peer-table tr:last-child td { border-bottom: 0; }
.cellv { display: inline-block; min-width: 46px; text-align: center; padding: 6px 8px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cellv.low { background: var(--low-bg); color: var(--low); } .cellv.mid { background: var(--mid-bg); color: #8d5f08; } .cellv.high { background: var(--high-bg); color: var(--high); }
.gapv { display: inline-block; padding: 6px 8px; font-weight: 700; font-size: .85rem; white-space: nowrap; }
.gapv.g0 { color: var(--high); } .gapv.g1 { background: #f1f3f6; color: var(--ink-2); } .gapv.g2 { background: var(--mid-bg); color: #8d5f08; } .gapv.g3 { background: var(--low-bg); color: var(--low); }
.industry-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; padding: 28px 32px; }
.industry-grid ol, .industry-grid ul { padding-left: 20px; margin: 0; color: var(--ink-2); }
.industry-grid li { margin-bottom: 6px; }
.industry-grid p { color: var(--ink-2); margin: 0; }
.industry-fact { margin: 0; padding: 16px 32px 24px; font-size: .88rem; color: var(--ink-2); border-top: 1px solid var(--line); }
@media (max-width: 860px) { .industry-grid { grid-template-columns: 1fr; padding: 20px; gap: 22px; } .industry-fact { padding: 16px 20px 20px; } .heat th, .heat td, .peer-table th, .peer-table td { padding: 10px; } }

/* Gate */
.gate { margin-top: 24px; background: var(--bg-navy); color: #fff; display: grid; grid-template-columns: 1fr 1fr; }
.gate .copy { padding: 44px; }
.gate .copy h2 { color: #fff; font-size: 2rem; }
.gate .copy p, .gate .copy li { color: #c5d0db; }
.gate .copy ul { padding-left: 18px; margin: 18px 0 0; }
.gate form { background: #fff; padding: 40px 44px; color: var(--ink); }
.gate .row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.consent { display: flex; gap: 10px; font-size: .85rem; color: var(--ink-2); margin: 6px 0 18px; align-items: flex-start; }
.consent input { margin-top: 3px; width: 16px; height: 16px; flex: none; accent-color: var(--accent); }
.form-error { color: var(--low); font-size: .9rem; margin: 0 0 12px; }
@media (max-width: 900px) { .gate { grid-template-columns: 1fr; } .gate .copy, .gate form { padding: 28px 20px; } .gate .row { grid-template-columns: 1fr; } }

/* Full report */
.report-block { background: #fff; border: 1px solid var(--line); margin-top: 24px; }
.report-block > header { padding: 26px 32px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.report-block > header h2 { font-size: 1.6rem; margin: 6px 0 0; }
.report-block .body { padding: 28px 32px; }
.dimreport { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; padding: 30px 32px; border-bottom: 1px solid var(--line); }
.dimreport:last-child { border-bottom: 0; }
.dimreport h3 { margin-bottom: 8px; }
.dimreport ol { padding-left: 20px; margin: 0; color: var(--ink-2); }
.dimreport ol li { margin-bottom: 8px; }
.answers { font-size: .85rem; border-top: 1px solid var(--line); }
.answers div { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.answers div b { color: var(--ink); font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { .dimreport { grid-template-columns: 1fr; gap: 20px; padding: 24px 20px; } .report-block > header { padding: 20px; flex-direction: column; } .report-block .body { padding: 20px; } }
.roadmap { display: grid; grid-template-columns: repeat(3, 1fr); }
.roadmap > div { padding: 28px 30px; border-right: 1px solid var(--line); }
.roadmap > div:last-child { border-right: 0; }
.roadmap h4 { font: 500 1.3rem/1.2 var(--serif); margin-bottom: 14px; }
.roadmap .item { padding: 12px 0; border-top: 1px solid var(--line); font-size: .92rem; color: var(--ink-2); }
.roadmap .item b { display: block; color: var(--ink); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 4px; }
@media (max-width: 860px) { .roadmap { grid-template-columns: 1fr; } .roadmap > div { border-right: 0; border-bottom: 1px solid var(--line); padding: 22px 20px; } }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; font-size: .9rem; z-index: 100; box-shadow: var(--shadow-lg); }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

@media print {
  .app-header, .no-print, .gate, .site-footer { display: none !important; }
  body.app { background: #fff; }
  .results { padding: 0; max-width: none; }
  .rhead, .report-block, .exhibit { break-inside: avoid; box-shadow: none; }
  .dimreport { break-inside: avoid; }
}

/* Sample report banner */
.sample-banner { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: #fff8e6; border: 1px solid #f2d48b; border-left: 4px solid #d99a00; padding: 16px 20px; margin-bottom: 20px; font-size: .95rem; color: var(--ink, #1b2a38); }
.sample-banner > div { flex: 1 1 320px; min-width: 0; }

/* v3: assessment flow */
.qhint { color: var(--muted); font-size: .95rem; margin: -18px 0 24px; }
.dimcount { display: none; }
.qnum { white-space: nowrap; }
.save-mobile { display: none; text-align: center; margin: 18px 0 0; font-size: .9rem; }
.qnav .hint a { color: var(--muted); text-decoration: underline; }
.halfway { background: var(--high-bg); color: var(--high); border-left: 3px solid var(--high); padding: 10px 14px; margin: -8px 0 22px; font-size: .92rem; }
.halfway b { color: var(--high); }
.target-scale .option .tl { font-weight: 600; }
.target-scale .option .tdesc { display: block; font-size: .85rem; color: var(--muted); margin-top: 2px; }
.team-banner { background: var(--accent-50); border-left: 3px solid var(--accent); padding: 12px 16px; margin: 0 0 22px; font-size: .95rem; color: var(--ink-2); }
.team-banner b { display: block; color: var(--ink); margin-bottom: 2px; }
@media (max-width: 960px) {
  .dimcount { display: inline; margin-right: 10px; }
  .dimcount::after { content: " ·"; }
  .qmeta { flex-wrap: wrap; gap: 4px 16px; }
}

/* Dialog */
.dlg { border: 1px solid var(--line); padding: 0; max-width: 520px; width: calc(100% - 32px); box-shadow: var(--shadow-lg); }
.dlg::backdrop { background: rgba(5, 28, 44, .45); }
.dlg-body { padding: 28px; }
.dlg-body h3 { margin-bottom: 10px; }
.dlg-actions { display: flex; justify-content: flex-end; margin-top: 20px; }
.copyrow { display: flex; gap: 8px; }
.copyrow input { flex: 1 1 auto; min-width: 0; font: 400 .92rem var(--sans); padding: 11px 12px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); border-radius: 2px; }
.copyrow .btn { flex: none; }
@media (max-width: 520px) { .copyrow { flex-direction: column; } }

/* Results: summary, navigation, ambition */
.exec-summary { background: #fff; border: 1px solid var(--line); border-top: 0; padding: 26px 44px 30px; }
.exec-summary .kicker { margin-bottom: 12px; }
.exec-summary ol { margin: 0; padding-left: 22px; display: grid; gap: 10px; }
.exec-summary li { color: var(--ink); font-size: 1.02rem; line-height: 1.55; }
.exec-summary li::marker { color: var(--accent); font-weight: 700; }
.ambition { margin-top: 20px; padding: 14px 18px; font-size: .95rem; color: var(--ink-2); border-left: 3px solid var(--mid); background: var(--mid-bg); }
.ambition.check { border-left-color: var(--accent); background: var(--accent-50); }
.ambition b { color: var(--ink); }
.report-nav { position: sticky; top: 64px; z-index: 30; display: flex; gap: 4px; overflow-x: auto; background: #fff; border: 1px solid var(--line); border-top: 0; padding: 0 28px; scrollbar-width: none; }
.report-nav::-webkit-scrollbar { display: none; }
.report-nav a { padding: 12px 12px; font-size: .85rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; border-bottom: 2px solid transparent; }
.report-nav a:hover { color: var(--accent); border-bottom-color: var(--accent); }
[id] { scroll-margin-top: 120px; }
@media (max-width: 960px) { .exec-summary { padding: 22px 20px; } .report-nav { padding: 0 8px; } }

/* Actions: owner, impact, effort */
.ameta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.atag { font-size: .7rem; font-weight: 600; letter-spacing: .03em; padding: 3px 7px; border: 1px solid var(--line); color: var(--ink-2); background: #fff; white-space: nowrap; }
.atag.owner { background: var(--ink); border-color: var(--ink); color: #fff; }
.atag.impact-high { border-color: #b7e0c3; background: var(--high-bg); color: var(--high); }
.atag.effort-low { border-color: #b7e0c3; color: var(--high); }
.atag.effort-high { border-color: #f1c2b6; color: var(--low); }
.quickwins { border-top: 1px solid var(--line); padding: 22px 30px 26px; }
.quickwins ul { margin: 0; padding-left: 18px; color: var(--ink-2); display: grid; gap: 12px; }
.notice { margin-top: 24px; background: var(--high-bg); border: 1px solid #b7e0c3; color: var(--high); padding: 12px 18px; font-size: .95rem; }
.private-link h4 { margin-bottom: 4px; }
.cta-navy { background: var(--bg-navy); border-color: var(--bg-navy); }
.cta-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding: 36px 32px; }
.cta-row h2 { color: #fff; margin-bottom: 8px; }
.cta-row p { color: #c5d0db; margin: 0; }
@media (max-width: 860px) { .quickwins { padding: 20px; } .cta-row { padding: 28px 20px; } }

/* Gate preview */
.gate .preview { margin: 14px 0 6px; border-top: 1px solid rgba(255,255,255,.15); }
.gate .pitem { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.15); color: #e3e9f0; font-size: .93rem; }
.gate .pitem b { display: block; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: #8fb0ff; margin-bottom: 2px; }
.gate .pitem.blur { filter: blur(4px); user-select: none; }

/* Team */
.team-cta h2 { font-size: 1.6rem; }
.team-cta .copyrow { max-width: 680px; }
.team-table .rangecell { min-width: 200px; }
.range { position: relative; height: 18px; background: linear-gradient(90deg, var(--line) 0 1px, transparent 1px) 0 0 / 25% 100%, #f1f3f6; margin-bottom: 4px; }
.range .bar { position: absolute; top: 6px; height: 6px; background: #9fb3e8; min-width: 2px; }
.range .mean { position: absolute; top: 3px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; }
.range .tgt { position: absolute; top: 0; width: 2px; height: 18px; margin-left: -1px; background: var(--high); }
.disagree { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.dq { padding: 22px 24px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dq h4 { margin: 4px 0 12px; }
.dist { display: grid; gap: 6px; font-size: .8rem; }
.drow { display: grid; grid-template-columns: minmax(0, 1fr) 90px 20px; gap: 10px; align-items: center; color: var(--ink-2); }
.drow .dl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drow .db { height: 8px; background: #f1f3f6; }
.drow .db i { display: block; height: 100%; background: var(--accent); }
.drow b { text-align: right; }

/* Score table becomes cards on phones */
@media (max-width: 640px) {
  .heat:not(.team-table) thead { display: none; }
  .heat:not(.team-table), .heat:not(.team-table) tbody, .heat:not(.team-table) tr, .heat:not(.team-table) td { display: block; width: 100%; }
  .heat:not(.team-table) tr { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 8px 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .heat:not(.team-table) td { padding: 0; border: 0; font-size: .85rem; }
  .heat:not(.team-table) td:first-child { grid-column: 1 / -1; }
  .heat:not(.team-table) td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; font-size: .65rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
  .heat:not(.team-table) tr:last-child { border-bottom: 0; }
}
@media print {
  .report-nav, .team-cta, .private-link, .notice { display: none !important; }
  .gate .pitem.blur { filter: none; }
}

/* Language switch in the assessment header */
.app-header .lang-link { margin-left: auto; }
.app-header .progress-wrap:not([hidden]) + .lang-link { margin-left: 18px; }
