:root {
  --bg: #f4f6fa; --card: #fff; --ink: #1d2433; --muted: #5b6475; --line: #dfe4ec;
  --brand: #2f5fd0; --brand-ink: #fff; --good: #1a7f4b; --ok: #b7791f; --poor: #c0392b;
  --good-bg: #e6f4ec; --ok-bg: #fbf1dc; --poor-bg: #fbe8e5;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.5; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-bottom: 48px; }
.top { background: #14213d; color: #fff; }
.top-inner { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; padding-top: 12px; padding-bottom: 12px; }
h1 { font-size: 1.25rem; margin: 0; }
h1 span { font-weight: 400; opacity: .7; font-size: .9rem; margin-left: 8px; }
h2 { margin: 0 0 4px; font-size: 1.4rem; }
h3 { margin: 0 0 8px; font-size: 1.1rem; display: flex; align-items: baseline; gap: 12px; }
h3 small { font-weight: 400; color: var(--muted); font-size: .85rem; }
.tools { display: flex; flex-wrap: wrap; gap: 6px; }
button { font: inherit; cursor: pointer; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); padding: 8px 16px; border-radius: 8px; }
button:hover { filter: brightness(1.08); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.secondary { background: #fff; color: var(--brand); }
button.ghost { background: transparent; color: inherit; border-color: transparent; padding: 6px 10px; }
.top button.ghost { color: #dbe4ff; border-color: rgba(255,255,255,.25); }
button.danger { color: var(--poor); }
:focus-visible { outline: 3px solid #8fb0ff; outline-offset: 2px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-top: 16px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; color: var(--muted); margin: 0 0 4px; }
.muted { color: var(--muted); }
.stepper { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 16px 0 0; }
.stepper button { background: #fff; color: var(--muted); border: 1px solid var(--line); padding: 6px 12px; font-size: .88rem; }
.stepper li.current button { border-color: var(--brand); color: var(--brand); font-weight: 600; }
.stepper li.done button { color: var(--good); }
.stepper b { display: inline-block; min-width: 1.4em; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px 20px; margin-top: 16px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-weight: 600; font-size: .9rem; }
.field.check label { display: flex; gap: 8px; align-items: center; font-weight: 500; }
input[type=text], input[type=number], input[type=date], select { font: inherit; padding: 8px 10px; border: 1px solid #b9c2d3; border-radius: 8px; background: #fff; width: 100%; }
input[aria-invalid=true], select[aria-invalid=true] { border-color: var(--poor); background: var(--poor-bg); }
.field small { color: var(--muted); font-size: .8rem; }
.err { color: var(--poor); font-size: .82rem; min-height: 1em; }
.rows { margin: 16px 0 12px; display: grid; gap: 12px; }
.row { display: grid; grid-template-columns: 1.4fr 1fr 1fr .7fr 1fr auto; gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfd; }
.row button { align-self: center; margin-top: 18px; }
.nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.nav .muted { font-size: .82rem; }
.report-head { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.score { text-align: center; }
.score .gauge { max-width: 100%; height: auto; }
.grade { margin: -4px 0 0; font-weight: 700; font-size: 1.1rem; }
.grade.good, .up { color: var(--good); } .grade.ok { color: var(--ok); } .grade.poor, .down { color: var(--poor); }
dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 12px 0; }
dt { font-size: .8rem; color: var(--muted); } dd { margin: 0; font-size: 1.25rem; font-weight: 700; }
dd input { font-size: .95rem; }
.buttons { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.cats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-around; }
.cat .gauge { height: auto; }
.actions { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.action { border: 1px solid var(--line); border-left-width: 5px; border-radius: 8px; padding: 10px 12px; }
.action.critical { border-left-color: var(--poor); } .action.important { border-left-color: var(--ok); } .action.optimize { border-left-color: var(--brand); }
.action label { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.action input { margin-top: 5px; width: 18px; height: 18px; flex: none; }
.action input:checked + span strong { text-decoration: line-through; color: var(--muted); }
.why { color: var(--muted); font-size: .9rem; } .impact { font-size: .9rem; }
.badge { display: inline-block; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; padding: 1px 8px; border-radius: 99px; font-weight: 700; vertical-align: 1px; }
.badge.critical { background: var(--poor-bg); color: var(--poor); } .badge.important { background: var(--ok-bg); color: var(--ok); } .badge.optimize { background: #e5ecfb; color: var(--brand); }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
tr.group th, tr.group td { background: #eef2f9; font-weight: 700; }
tr.group th span { float: right; color: var(--muted); font-weight: 600; }
td small { display: block; color: var(--muted); font-size: .76rem; margin-top: 2px; }
.bar { display: inline-block; width: 70px; height: 8px; background: #e3e8ef; border-radius: 4px; overflow: hidden; vertical-align: middle; }
.bar i { display: block; height: 100%; background: var(--brand); }
tr.good .bar i { background: var(--good); } tr.ok .bar i { background: var(--ok); } tr.poor .bar i { background: var(--poor); }
.pill { padding: 2px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; background: #eceff4; }
.pill.good { background: var(--good-bg); color: var(--good); } .pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.poor { background: var(--poor-bg); color: var(--poor); }
.compact { max-width: 560px; }
.spark-row { display: flex; gap: 12px; align-items: center; margin: 8px 0; }
.compare { display: flex; flex-wrap: wrap; gap: 16px; margin: 14px 0; }
.compare label { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.compare select { width: auto; }
.disclaimer { color: var(--muted); font-size: .82rem; margin-top: 20px; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #14213d; color: #fff; padding: 10px 18px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; }
#toast.show { opacity: 1; }
@media (max-width: 760px) {
  .report-head { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr 1fr; }
  .row button { margin-top: 0; justify-self: start; }
}
@media print {
  body { background: #fff; }
  .top, .stepper, .no-print, #toast { display: none !important; }
  .card { border: 0; padding: 8px 0; break-inside: avoid; }
  .action, tr { break-inside: avoid; }
  .wrap { max-width: none; }
}
