:root {
  --bg: #f7f8f7;
  --panel: #ffffff;
  --ink: #15201e;
  --muted: #5b6b68;
  --line: #dfe5e3;
  --brand: #0f766e;
  --brand-ink: #ffffff;
  --brand-soft: #e6f3f1;
  --high: #b42318;
  --high-soft: #fdecea;
  --medium: #a15c07;
  --medium-soft: #fdf3e2;
  --low: #3b6e2f;
  --low-soft: #edf6ea;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1514; --panel: #172120; --ink: #e8efed; --muted: #9aaba7; --line: #2a3735;
    --brand: #2bb3a5; --brand-ink: #062320; --brand-soft: #173431;
    --high: #f97066; --high-soft: #3a1d1b; --medium: #f5b54a; --medium-soft: #3a2c15; --low: #8fd17f; --low-soft: #1e3119;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--brand); border-radius: 8px; padding: 11px 18px; font: 600 15px var(--font); cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.ghost { background: transparent; color: var(--brand); }
.btn:disabled { opacity: .6; cursor: wait; }
.linkbtn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; }

/* ---------- landing ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.site-nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 19px; color: var(--ink); text-decoration: none; }
.hero { padding: 48px 0 40px; display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(32px, 5vw, 50px); margin: 0 0 16px; letter-spacing: -0.02em; }
.hero p.sub { font-size: 19px; color: var(--muted); margin: 0 0 24px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; box-shadow: 0 10px 30px rgba(0,0,0,.06); }
.hero-card h3 { margin: 0 0 12px; font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.mini-risk { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.pill { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap; height: fit-content; }
.pill.high, .badge.high { background: var(--high-soft); color: var(--high); }
.pill.medium, .badge.medium { background: var(--medium-soft); color: var(--medium); }
.pill.low, .badge.low { background: var(--low-soft); color: var(--low); }
.band { padding: 48px 0; border-top: 1px solid var(--line); }
.band h2 { font-size: 30px; margin: 0 0 12px; }
.band .lead { font-size: 18px; color: var(--muted); max-width: 720px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 24px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 24px; }
.fact b { display: block; font-size: 30px; color: var(--brand); }
.fact span { color: var(--muted); }
.price { max-width: 460px; background: var(--panel); border: 2px solid var(--brand); border-radius: 14px; padding: 28px; margin-top: 24px; }
.price .amt { font-size: 44px; font-weight: 800; }
.price ul { padding-left: 20px; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-top: 10px; }
.faq summary { font-weight: 600; cursor: pointer; }
.site-foot { padding: 30px 0 50px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }
.site-foot a { color: var(--muted); margin-right: 16px; }
.legal { max-width: 760px; padding: 20px 0 60px; }
.legal h1 { font-size: 34px; }
.legal h2 { font-size: 20px; margin-top: 28px; }

/* ---------- app ---------- */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 18px; padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.progress { flex: 1; display: flex; align-items: center; gap: 10px; max-width: 420px; }
.progress .bar { flex: 1; height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
#progress-bar { height: 100%; width: 0; background: var(--brand); transition: width .2s; }
#progress-text { font-size: 13px; color: var(--muted); white-space: nowrap; }
.layout { display: grid; grid-template-columns: 260px 1fr; gap: 28px; max-width: 1180px; margin: 0 auto; padding: 24px 20px; }
#steps { position: sticky; top: 76px; align-self: start; display: flex; flex-direction: column; gap: 4px; }
.step { display: flex; justify-content: space-between; gap: 8px; text-align: left; background: none; border: 0; border-radius: 8px; padding: 9px 12px; font: 15px var(--font); color: var(--ink); cursor: pointer; }
.step:hover { background: var(--brand-soft); }
.step.active { background: var(--brand); color: var(--brand-ink); font-weight: 600; }
.count { font-size: 12px; opacity: .8; }
#main { min-width: 0; }
#main h1 { font-size: 28px; margin: 4px 0 8px; }
.lead { color: var(--muted); font-size: 17px; margin: 0 0 20px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: 14px; font-weight: 600; }
.field input, .field textarea, .note, .asset input, select, .risk-grid input { font: 15px var(--font); padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); width: 100%; }
.field textarea { resize: vertical; }
.filebar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 8px 0 4px; }
.navrow { display: flex; justify-content: space-between; gap: 12px; margin: 28px 0 60px; }
.notice { background: var(--medium-soft); color: var(--medium); padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; }
.warn-inline { color: var(--medium); font-weight: 600; }
.assets { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.asset { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.asset.on { border-color: var(--brand); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--brand); }
.check small { display: block; color: var(--muted); font-weight: 400; }
.asset-detail { display: grid; grid-template-columns: 1fr 150px; gap: 8px; margin-top: 10px; }
.q { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.q.answered { border-left: 4px solid var(--brand); }
.q-head { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.qid { font-weight: 700; color: var(--brand); }
.q-text { font-size: 17px; font-weight: 600; margin: 8px 0 4px; }
.q-help { color: var(--muted); margin: 0 0 12px; font-size: 14px; }
.answers { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.ans { border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 8px 16px; border-radius: 99px; font: 600 14px var(--font); cursor: pointer; }
.ans:hover { border-color: var(--brand); }
.ans.sel-yes { background: var(--low-soft); border-color: var(--low); color: var(--low); }
.ans.sel-partly, .ans.sel-unsure { background: var(--medium-soft); border-color: var(--medium); color: var(--medium); }
.ans.sel-no { background: var(--high-soft); border-color: var(--high); color: var(--high); }
.ans.sel-na { background: var(--line); border-color: var(--muted); }
.note { font-size: 14px; }
.legend { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.risk { background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--low); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.risk.lv-high { border-left-color: var(--high); }
.risk.lv-medium { border-left-color: var(--medium); }
.risk-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.badge { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; }
.risk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 8px 0 12px; font-size: 13px; font-weight: 600; }
.risk-grid label { display: flex; flex-direction: column; gap: 4px; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.appfoot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; max-width: 1180px; margin: 0 auto; padding: 16px 20px 40px; color: var(--muted); font-size: 13px; }
.paywall { text-align: center; padding: 36px 24px; margin-top: 20px; border: 2px dashed var(--brand); border-radius: 14px; background: var(--brand-soft); }

/* ---------- report ---------- */
.report { background: #fff; color: #111; border: 1px solid var(--line); border-radius: var(--radius); padding: 40px; font-size: 14px; }
.report h1 { font-size: 34px; margin: 6px 0; color: #111; }
.report h2 { font-size: 20px; margin: 28px 0 10px; color: #0f766e; border-bottom: 2px solid #0f766e; padding-bottom: 4px; }
.report h3 { font-size: 16px; margin: 18px 0 8px; }
.r-cover { padding-bottom: 20px; }
.r-cover h2 { border: 0; color: #111; font-size: 24px; margin-top: 4px; }
.r-kicker { color: #0f766e; font-weight: 700; font-size: 13px; letter-spacing: .03em; }
.r-meta th { text-align: left; padding: 4px 18px 4px 0; color: #555; font-weight: 600; }
.r-meta td { padding: 4px 0; }
.r-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 10px 0 16px; }
.r-stats div { border: 1px solid #ddd; border-radius: 8px; padding: 12px; text-align: center; }
.r-stats b { display: block; font-size: 28px; }
.r-stats span { font-size: 12px; color: #555; }
.r-stats .high b { color: #b42318; } .r-stats .medium b { color: #a15c07; } .r-stats .low b { color: #3b6e2f; }
.r-table { width: 100%; border-collapse: collapse; margin: 6px 0 14px; }
.r-table th, .r-table td { border: 1px solid #d6d6d6; padding: 6px 8px; text-align: left; vertical-align: top; }
.r-table th { background: #f1f5f4; font-size: 12px; }
.r-table small { color: #666; }
.st-yes { color: #3b6e2f; font-weight: 600; } .st-no { color: #b42318; font-weight: 600; } .st-partly, .st-unsure { color: #a15c07; font-weight: 600; } .st-none { color: #999; }
.lvl-high { color: #b42318; font-weight: 700; } .lvl-medium { color: #a15c07; font-weight: 700; } .lvl-low { color: #3b6e2f; font-weight: 700; }
.sig { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; margin-top: 34px; }
.sig span { display: block; border-bottom: 1px solid #333; height: 30px; margin-bottom: 4px; }
.sig div { font-size: 12px; color: #555; }
.disclaimer { margin-top: 30px; font-size: 11px; color: #666; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 24px; }
  .cards, .facts { grid-template-columns: 1fr; }
  .layout { grid-template-columns: 1fr; padding: 16px; }
  #steps { position: static; flex-direction: row; overflow-x: auto; }
  .step { white-space: nowrap; }
  .grid2, .assets { grid-template-columns: 1fr; }
  .risk-grid { grid-template-columns: 1fr 1fr; }
  .topbar { flex-wrap: wrap; padding: 10px 16px; }
  #saved { display: none; }
  .report { padding: 18px; }
  .r-stats { grid-template-columns: 1fr 1fr; }
  .r-table { display: block; overflow-x: auto; }
}

@media print {
  body { background: #fff; }
  .no-print, .topbar, #steps, .appfoot, .toolbar { display: none !important; }
  .layout { display: block; padding: 0; max-width: none; }
  .report { border: 0; padding: 0; font-size: 11pt; }
  .report section { break-inside: auto; }
  .r-cover { break-after: page; }
  .r-table tr { break-inside: avoid; }
  .r-sign { break-before: page; }
  @page { margin: 16mm; }
}
