:root {
  --ink: #17202a;
  --muted: #5d6b7a;
  --line: #dde3ea;
  --bg: #f6f8fa;
  --card: #ffffff;
  --accent: #0f6e56;
  --accent-ink: #ffffff;
  --accent-soft: #e3f3ee;
  --warn: #b7791f;
  --danger: #b42318;
  --ok: #1f7a4d;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); line-height: 1.55; font-size: 16px; }
a { color: var(--accent); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 2.1rem; letter-spacing: -.01em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
main.container { padding-top: 32px; padding-bottom: 64px; min-height: 60vh; }

/* Header / footer */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.brand-mark { color: var(--accent); font-size: 1.4rem; }
.nav nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.nav nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.nav nav a:hover { color: var(--accent); }
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: .9rem; }
.site-footer p { margin: 0 0 .4em; }
form.inline { display: inline; }
button.link { background: none; border: 0; color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; padding: 0; }
button.link:hover { color: var(--accent); }

/* Buttons */
.btn { display: inline-block; background: var(--accent); color: var(--accent-ink) !important; padding: 10px 18px; border-radius: 8px; text-decoration: none; border: 0; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn-sm { padding: 7px 14px; font-size: .9rem; }
.btn-secondary { background: var(--card); color: var(--ink) !important; border: 1px solid var(--line); }
.btn-danger { background: var(--danger); }
.btn-block { display: block; width: 100%; text-align: center; }

/* Cards & grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card + .card { margin-top: 20px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stack > * + * { margin-top: 20px; }

/* Hero */
.hero { padding: 48px 0 32px; }
.hero h1 { font-size: 2.6rem; max-width: 720px; }
.hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 640px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.section { margin-top: 56px; }

/* Steps */
.steps { counter-reset: step; }
.steps li { list-style: none; position: relative; padding-left: 48px; margin-bottom: 14px; }
.steps li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: flex; align-items: center; justify-content: center; }
ul.steps { padding: 0; margin: 0; }

/* Pricing */
.price-card { position: relative; display: flex; flex-direction: column; }
.price-card.highlight { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow); }
.price-card .badge { position: absolute; top: -12px; right: 20px; background: var(--accent); color: #fff; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.price { font-size: 2rem; font-weight: 700; margin: 8px 0 0; }
.price small { font-size: 1rem; font-weight: 400; color: var(--muted); }
.price-card ul { padding-left: 20px; margin: 12px 0 20px; flex: 1; }
.price-card li { margin-bottom: 6px; }

/* Forms */
label { display: block; font-weight: 600; margin-bottom: 6px; }
.field { margin-bottom: 18px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: .875rem; display: block; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=tel], input[type=date], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.checkbox input { margin-top: 5px; }
.radio-row { display: flex; gap: 6px; flex-wrap: wrap; }
.radio-row label { font-weight: 500; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; cursor: pointer; background: #fff; margin: 0; }
.radio-row input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.radio-row label { position: relative; }
.radio-row label:has(input:focus-visible) { outline: 2px solid var(--accent); }
.radio-row input:checked + span { color: var(--accent); font-weight: 700; }
.radio-row label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.error { color: var(--danger); font-size: .9rem; }
fieldset { border: 0; padding: 0; margin: 0 0 24px; }
legend { font-weight: 700; font-size: 1.1rem; margin-bottom: 12px; }

/* Flash */
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; border: 1px solid; }
.flash-success { background: #e8f5ee; border-color: #b7dfc8; color: #135c35; }
.flash-info { background: #eaf1fb; border-color: #c1d5f0; color: #1d3f73; }
.flash-error { background: #fdecea; border-color: #f5b5b0; color: #8a1a12; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
tr:hover td { background: #fafbfc; }
.table-wrap { overflow-x: auto; }

/* Status pills */
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #eef1f4; color: var(--muted); white-space: nowrap; }
.pill-paid, .pill-released, .pill-active { background: #e8f5ee; color: var(--ok); }
.pill-pending_payment, .pill-assigned { background: #fff5e0; color: var(--warn); }
.pill-submitted, .pill-in_review { background: #eaf1fb; color: #1d3f73; }
.pill-cancelled, .pill-rejected { background: #fdecea; color: var(--danger); }
.pill-new { background: #fff5e0; color: var(--warn); }
.pill-contacted { background: #eaf1fb; color: #1d3f73; }
.pill-onboarded { background: #e8f5ee; color: var(--ok); }

/* Scores */
.score-big { font-size: 3.2rem; font-weight: 800; line-height: 1; }
.score-big small { font-size: 1.2rem; color: var(--muted); font-weight: 500; }
.band-excellent { color: var(--ok); }
.band-good { color: #2f855a; }
.band-warn { color: var(--warn); }
.band-poor { color: var(--danger); }
.band-none { color: var(--muted); }
.bar { height: 10px; background: #e9edf1; border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.bar.warn > span { background: var(--warn); }
.bar.poor > span { background: var(--danger); }
.section-score { display: grid; grid-template-columns: 1fr 80px; gap: 8px 12px; align-items: center; margin-bottom: 12px; }
.section-score .bar { grid-column: 1 / -1; }
.section-score .val { text-align: right; font-weight: 700; }
.stat { text-align: center; }
.stat .n { font-size: 2rem; font-weight: 800; }
.stat .l { color: var(--muted); font-size: .85rem; }
.trend { display: flex; align-items: flex-end; gap: 10px; height: 120px; padding-top: 10px; }
.trend .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; text-decoration: none; color: var(--ink); }
.trend .col span.b { width: 100%; max-width: 48px; background: var(--accent); border-radius: 6px 6px 0 0; }
.trend .col span.t { font-size: .75rem; color: var(--muted); margin-top: 4px; white-space: nowrap; }

/* Questions */
.question { padding: 16px 0; border-bottom: 1px solid var(--line); }
.question:last-child { border-bottom: 0; }
.question .q { font-weight: 600; margin-bottom: 8px; }
.question .help { color: var(--muted); font-size: .875rem; margin-bottom: 8px; }
.question textarea { min-height: 64px; }
.answer-row { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.answer-row .val { font-weight: 700; }
.answer-row .ev { color: var(--muted); font-size: .92rem; white-space: pre-wrap; }
pre.scenario { white-space: pre-wrap; background: var(--bg); padding: 16px; border-radius: 8px; border: 1px solid var(--line); font: inherit; }
.notice { background: #fff8e6; border: 1px solid #f3dc9c; padding: 12px 16px; border-radius: 8px; }
.demo-banner { background: #1d3f73; color: #fff; text-align: center; padding: 8px; font-size: .85rem; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.toolbar h1, .toolbar h2 { margin: 0; flex: 1; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: .9rem; }
dl.kv dd { margin: 0; }
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.6em; }

/* Print / report */
@media print {
  .site-header, .site-footer, .no-print, .flash { display: none !important; }
  body { background: #fff; }
  main.container { padding: 0; max-width: 100%; }
  .card { box-shadow: none; break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}
@media (max-width: 640px) {
  .hero h1 { font-size: 2rem; }
  .nav { height: auto; padding: 12px 0; flex-direction: column; align-items: flex-start; }
  .answer-row { grid-template-columns: 1fr; }
}
@media print { details { display:block } details > summary { display:none } details:not([open]) > *:not(summary) { display:block } }

/* Multi-report printouts: each report starts on a new page */
.page-break { margin-top: 48px; padding-top: 24px; border-top: 2px dashed var(--line); }
@media print { .page-break { break-before: page; page-break-before: always; margin-top: 0; padding-top: 0; border-top: 0; } }
.pill-overdue { background: #fdecea; color: var(--danger); }
.pill-draft { background: #eef1f4; color: var(--muted); }
.pill-ordered { background: #e8f5ee; color: var(--ok); }
.cq-row { display: grid; grid-template-columns: 32px 1fr 170px 36px; gap: 8px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cq-row .cq-num { font-weight: 700; color: var(--muted); padding-top: 10px; }
.cq-row .cq-more { grid-column: 2 / 4; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cq-row input, .cq-row select { width: 100%; }
@media (max-width: 640px) { .cq-row { grid-template-columns: 24px 1fr 36px; } .cq-row select { grid-column: 2; } .cq-row .cq-more { grid-column: 2; grid-template-columns: 1fr; } }

/* Admin menu: grouped, easy to scan */
.admin-nav { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin: 0 0 20px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.admin-nav-group { background: #fff; padding: 12px 16px; }
.admin-nav-group:last-child:nth-child(odd) { grid-column: 1 / -1; }
.admin-nav-label { font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px 2px; }
.admin-nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-nav-links a { display: inline-block; font-size: .9rem; font-weight: 500; line-height: 1.2; padding: 7px 12px; border-radius: 8px; color: #1b2330; background: var(--bg); border: 1px solid transparent; text-decoration: none; white-space: nowrap; }
.admin-nav-links a:hover { border-color: var(--line); background: #fff; }
.admin-nav-links a.active { background: var(--accent); color: #fff; font-weight: 600; }
.admin-title { font-size: 1.6rem; margin: 0 0 16px; }
@media (max-width: 760px) { .admin-nav { grid-template-columns: 1fr; } }
@media print { .admin-nav { display: none; } }

/* Custom Questions: package picker */
.tier-option { margin: 0 !important; }
.tier-option:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
