:root {
  --navy: #1f3864; --green: #456254; --mid: #739481; --sage: #a2b6a6; --ink: #292f31;
  --grey: #5f6b6d; --line: #d9dfda; --tint: #eef2ef; --risk: #b5651d; --bg: #ffffff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 16px/1.5 "Segoe UI", Calibri, Arial, sans-serif; }
h1, h2, h3 { color: var(--navy); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(28px, 4.5vw, 44px); }
h2 { font-size: 28px; }
h3 { font-size: 18px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; border-bottom: 1px solid var(--line); }
.brand img { display: block; }
.draft-tag { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--grey); border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; }
main { max-width: 1000px; margin: 0 auto; padding: 32px 16px 48px; }
.eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: 13px; font-weight: 700; color: var(--green); margin: 0 0 8px; }
.lead { font-size: 19px; color: var(--grey); max-width: 760px; }
.lead.small { font-size: 16px; }
.fine { font-size: 13px; color: var(--grey); }
.center { text-align: center; }
.muted { color: var(--grey); }
.small { font-size: 13px; }
.hero { padding: 24px 0 8px; }
.chain { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 24px 0; font-weight: 600; font-size: 14px; }
.chain span { background: var(--tint); color: var(--green); padding: 6px 12px; border-radius: 6px; }
.chain i { color: var(--sage); font-style: normal; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.actions.spread { justify-content: space-between; }
.btn { font: inherit; font-weight: 600; border-radius: 8px; padding: 12px 20px; cursor: pointer; border: 2px solid var(--navy); text-decoration: none; display: inline-block; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { background: #172a4b; }
.btn.ghost { background: #fff; color: var(--navy); }
.btn.link { background: none; border-color: transparent; color: var(--grey); text-decoration: underline; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn:focus-visible, input:focus-visible { outline: 3px solid var(--sage); outline-offset: 2px; }
.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-top: 40px; }
.price-card { border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.price-card h3 { margin-bottom: 4px; }
.price-card p { margin: 4px 0; color: var(--grey); }
.price { font-size: 30px; font-weight: 700; color: var(--ink) !important; }
.price span { font-size: 16px; color: var(--grey); }

/* Wizard */
.progress { height: 6px; background: var(--tint); border-radius: 3px; overflow: hidden; margin-bottom: 16px; }
.progress-bar { height: 100%; background: var(--green); transition: width .3s; }
.step-label { font-size: 13px; color: var(--grey); margin: 0 0 4px; }
.q { border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin: 14px 0; }
.q.invalid { border-color: var(--risk); background: #fdf6f0; }
.q-label { display: block; font-weight: 600; margin-bottom: 8px; }
.opt { font-weight: 400; font-size: 12px; color: var(--grey); margin-left: 6px; }
.help { margin: -4px 0 10px; font-size: 14px; color: var(--grey); }
input[type=text], input[type=number] { font: inherit; padding: 10px 12px; border: 1px solid #b9c3bc; border-radius: 6px; width: 100%; max-width: 360px; }
.num { display: flex; align-items: center; gap: 10px; }
.num input { max-width: 180px; }
.num span { color: var(--grey); font-size: 14px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--green); background: var(--tint); }
.follow-up { margin-top: 12px; padding: 12px 14px; border-left: 4px solid var(--navy); background: #f5f7fb; border-radius: 6px; }
.follow-up.invalid { border-left-color: var(--risk); background: #fdf6f0; }
.follow-up textarea { font: inherit; width: 100%; padding: 10px 12px; border: 1px solid #b9c3bc; border-radius: 6px; resize: vertical; }
.req { font-weight: 400; font-size: 12px; color: var(--risk); margin-left: 6px; }
input.locked { background: var(--tint); color: var(--ink); border-color: var(--line); cursor: not-allowed; }
.error { color: var(--risk); font-weight: 600; min-height: 1.5em; }

/* Scorecard */
.results-actions { margin-top: 0; }
.scorecard { border: 1px solid var(--line); border-radius: 12px; padding: 28px; }
.sc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 2px solid var(--navy); padding-bottom: 12px; margin-bottom: 18px; }
.sc-head h2 { margin: 0; }
.sc-head p { margin: 2px 0 0; }
.sc-top { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi-tile { background: var(--tint); border-radius: 10px; padding: 14px 16px; }
.kpi-tile p { margin: 0; font-size: 14px; }
.kpi-tile .big { font-size: 36px; font-weight: 700; color: var(--navy); line-height: 1.15; }
.kpi-tile .big small { font-size: 16px; color: var(--grey); font-weight: 400; }
.band { font-weight: 700; }
.band.good { color: var(--green); } .band.mid { color: #8a7a1e; } .band.risk { color: var(--risk); }
.sc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 14px; }
.areas { display: grid; grid-template-columns: minmax(120px, 45%) 1fr; gap: 10px 12px; align-items: center; font-size: 14px; }
.area-score { display: flex; align-items: center; gap: 8px; }
.area-score b { width: 2em; text-align: right; }
.bar { flex: 1; height: 10px; background: #e4e9e5; border-radius: 5px; overflow: hidden; }
.fill { height: 100%; } .fill.good { background: var(--green); } .fill.mid { background: var(--mid); } .fill.risk { background: var(--risk); }
.na { color: var(--grey); font-size: 13px; }
.wins { margin: 0; padding-left: 20px; font-size: 14px; }
.wins li { margin-bottom: 6px; }
.chain-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.chain-table th { background: var(--navy); color: #fff; text-align: left; padding: 8px; font-weight: 600; }
.chain-table td { border-bottom: 1px solid var(--line); padding: 8px; vertical-align: top; }
.money { font-weight: 700; white-space: nowrap; }
.basis { font-weight: 400; font-size: 11px; color: var(--grey); white-space: normal; }
.sc-foot { font-size: 12px; color: var(--grey); margin: 14px 0 0; }
.assumptions { margin: 20px 0; border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; }
.assumptions summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.assumptions form { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-top: 14px; }
.assumptions label { font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.cta { background: var(--tint); border-radius: 12px; padding: 24px; margin-top: 24px; }
/* Scorecard guide (dialog) */
dialog.guide { width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); }
dialog.guide::backdrop { background: rgba(31, 56, 100, .35); }
.guide-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 2px solid var(--navy); position: sticky; top: 0; background: #fff; }
.guide-head h2 { margin: 0; font-size: 22px; }
.guide-head .btn { padding: 8px 14px; }
.guide-body { padding: 8px 22px 22px; overflow-y: auto; max-height: calc(100vh - 130px); }
.guide-body section { border-bottom: 1px solid var(--line); padding: 14px 0; scroll-margin-top: 8px; }
.guide-body section:last-child { border-bottom: 0; }
.guide-body h3 { margin: 0 0 6px; }
.guide-body p, .guide-body li, .guide-body dd { font-size: 15px; }
.guide-lead { font-size: 16px !important; }
.guide-toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.guide-toc a { font-size: 13px; background: var(--tint); color: var(--green); text-decoration: none; padding: 4px 10px; border-radius: 99px; font-weight: 600; }
.guide-defs dt { font-weight: 700; color: var(--navy); margin-top: 10px; }
.guide-defs dd { margin: 2px 0 0; }
.guide-example { background: var(--tint); border-left: 4px solid var(--green); border-radius: 6px; padding: 8px 12px; margin: 8px 0; }
.guide-example p, .guide-example ul, .guide-example ol { margin: 4px 0; }
.guide-ex-title { font-size: 12px !important; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--green); }
.guide-note { font-style: italic; color: var(--grey); }
@media (max-width: 600px) { .guide-head, .guide-body { padding-left: 14px; padding-right: 14px; } .guide-head h2 { font-size: 18px; } }
.guide-head-actions { display: flex; gap: 8px; }
.guide-print { display: none; }
@media print {
  body.printing-guide > *:not(#guide-print) { display: none !important; }
  body.printing-guide #guide-print { display: block; font-size: 11pt; }
  .guide-print-head { border-bottom: 2px solid var(--navy); padding-bottom: 8px; margin-bottom: 8px; }
  .guide-print-head h1 { font-size: 20pt; margin: 6px 0 2px; }
  .guide-print-head p { margin: 0; color: var(--grey); font-size: 9pt; }
  .guide-print .guide-toc { display: none; }
  .guide-print section { break-inside: auto; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .guide-print .guide-defs dt { break-after: avoid; }
  .guide-print h3 { font-size: 13pt; margin: 0 0 4px; break-after: avoid; }
  .guide-print p, .guide-print li, .guide-print dd { font-size: 10.5pt; }
  .guide-print .guide-example { break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .guide-print .guide-defs dd { break-inside: avoid; }
  .guide-print-foot { font-size: 8pt !important; color: var(--grey); margin-top: 10px; }
}

/* Signed-in pieces: top bar, My value cases, save status */
.userbar { display: flex; align-items: center; gap: 8px; }
.userbar .btn { padding: 6px 10px; }
.small-btn { font-size: 14px; }
.new-case { margin: 20px 0; }
.new-case label { font-weight: 600; display: block; margin-bottom: 6px; }
.new-case-row { display: flex; flex-wrap: wrap; gap: 10px; }
.new-case-row input { flex: 1 1 260px; max-width: none; }
.case-list { list-style: none; padding: 0; margin: 0 0 20px; }
.case-item { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; }
.case-item b { display: block; color: var(--navy); }
.new-case-where { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.new-case-where .inline-label { display: inline; margin: 0; font-weight: 600; }
.new-case-where select { font: inherit; padding: 8px 10px; border: 1px solid #b9c3bc; border-radius: 6px; max-width: 100%; }
.team-tag { display: inline-block; font-size: 12px; font-weight: 700; color: var(--green); background: var(--tint); border-radius: 99px; padding: 2px 8px; margin: 2px 0 2px; }
.case-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.case-actions .btn { padding: 8px 14px; }
.save-status { margin-left: 10px; color: var(--green); font-weight: 600; }
.save-status.bad { color: var(--risk); }
.sample-flag { display: inline-block; background: var(--tint); color: var(--green); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; padding: 4px 10px; border-radius: 99px; margin: 0 0 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.footer { text-align: center; font-size: 12px; color: var(--grey); padding: 24px 16px; border-top: 1px solid var(--line); }

@media (max-width: 720px) {
  .sc-top, .sc-grid { grid-template-columns: 1fr; }
  .scorecard { padding: 16px; }
  .chain-table thead { display: none; }
  .chain-table, .chain-table tbody, .chain-table tr, .chain-table td { display: block; width: 100%; }
  .chain-table tr { border-bottom: 2px solid var(--line); padding: 6px 0; }
  .chain-table td { border: 0; padding: 4px 0; }
}

@media print {
  @page { size: letter; margin: 0.4in; }
  body { font-size: 11px; }
  .topbar, .no-print, .footer { display: none !important; }
  main { padding: 0; max-width: none; }
  .scorecard { border: 0; padding: 0; }
  .sc-top, .sc-grid { grid-template-columns: repeat(3, 1fr); }
  .sc-grid { grid-template-columns: 1fr 1fr; }
  .kpi-tile .big { font-size: 26px; }
  .chain-table { font-size: 10px; }
  .chain-table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .kpi-tile, .bar, .fill { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  tr { break-inside: avoid; }
}
/* Scorecard PDF download: no outer card frame (it would be clipped at the page edge). */
body.pdf-export .scorecard { border: 0 !important; box-shadow: none !important; border-radius: 0 !important; margin: 0 !important; padding: 0 !important; width: 700px !important; max-width: 700px !important; box-sizing: border-box; } /* fits inside Letter width minus 10 mm margins (about 736 px), with room to spare */
/* Landing: main column (hero + pricing) with "Less effort, more value." cards stacked down the side. */
main:has(> #view-landing:not([hidden])) { max-width: 1240px; }
.landing-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 36px; align-items: start; }
.landing-main .pricing { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.landing-main .hero { padding-top: 4px; }
.landing-main .lead { font-size: 17px; }
.landing-main .chain { margin: 14px 0; }
.landing-main .price-card .price { margin: 2px 0; }
.landing-main .fine.center { margin: 6px 0; }
.landing-main .price-card { padding: 14px; }
.landing-main .price-card p:not(.price) { font-size: 14px; }
.why { background: var(--tint); border-radius: 12px; padding: 20px; margin-top: 24px; }
.why h2 { color: var(--navy); font-size: 22px; margin: 0 0 12px; }
.why-grid { display: grid; gap: 12px; }
.why-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.why-card h3 { color: var(--green); font-size: 16px; margin: 0 0 4px; }
.why-card p { margin: 0; font-size: 14px; }
.why-line { font-weight: 600; color: var(--navy); font-size: 14px; margin: 14px 0 0; }
@media (max-width: 900px) {
  .landing-grid { grid-template-columns: 1fr; gap: 8px; }
  .why { margin-top: 16px; }
}
