:root {
  --ink: #0E1A2B;
  --muted: #4F5B6B;
  --muted-2: #33475E;
  --line: #DDE2E8;
  --line-soft: #EEF1F4;
  --field-line: #B8C1CC;
  --ground: #F4F6F8;
  --card: #FFFFFF;
  --soft: #FAFBFC;
  --accent: #1F4E79;
  --accent-tint: #E8EFF6;
  --warn: #9A4500;
  --warn-tint: #FFF8F2;
  --radius: 10px;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.45; }
a { color: var(--accent); }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.mono { font-family: var(--mono); font-size: 13px; }

/* Header */
.topbar { background: var(--ink); color: #fff; }
.topbar-inner { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 17px; }
.brand:hover { color: #fff; }
.topbar-note { margin: 0; font-size: 13px; color: #C9D3DF; }
.topbar-note a { color: #fff; }

main.wrap { padding-top: 32px; padding-bottom: 64px; }

/* Intro */
.intro { margin-bottom: 24px; }
.eyebrow { margin: 0 0 8px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
h1 { margin: 0 0 8px; font-size: 34px; line-height: 1.15; font-weight: 600; }
.intro-hint { margin-top: 8px; font-size: 14px; }
.lead { margin: 0; font-size: 16px; color: var(--muted); max-width: 760px; line-height: 1.5; }

/* Layout */
.layout { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
#scope-form { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.panel { flex: 1 1 340px; min-width: 0; position: sticky; top: 16px; }
@media (max-width: 960px) { .panel { position: static; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.card-head h2, .panel-head h2 { margin: 0; font-size: 19px; font-weight: 600; }
.card-head p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.card-head .sub { font-size: 14px; font-weight: 400; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.grid > .wide { grid-column: 1 / -1; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.field.narrow { max-width: 360px; }
.range-row { display: flex; gap: 12px; flex-wrap: wrap; }
.range-part { display: flex; flex-direction: column; gap: 4px; font-size: 13px; flex: 1 1 140px; min-width: 0; }
label, .label, legend { font-size: 14px; font-weight: 500; padding: 0; }
.req { font-weight: 400; color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
input, select, textarea {
  font: inherit; font-size: 15px; color: var(--ink); background: #fff;
  border: 1px solid var(--field-line); border-radius: 6px; padding: 10px 12px; min-height: 44px; width: 100%;
}
textarea { line-height: 1.45; resize: vertical; }
select { appearance: auto; }
.field.is-missing input, .field.is-missing select, .field.is-missing textarea, .field.is-missing .picker-toggle {
  border-color: var(--warn); background: var(--warn-tint);
}
.field.is-missing.price-box, .field.is-missing.options { border-color: var(--warn); }

.calc { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; align-items: baseline; background: var(--soft); border: 1px solid var(--line-soft); border-radius: 8px; padding: 12px 14px; font-size: 14px; color: var(--muted); }
.calc output { font-family: var(--mono); font-size: 15px; font-weight: 500; color: var(--ink); }

/* Choice chips (radios) */
.choices { border: 0; padding: 0; margin: 0; min-width: 0; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 16px; border: 1px solid var(--field-line); border-radius: 6px; background: #fff; font-size: 14px; font-weight: 400; cursor: pointer; }
.choice input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Picker */
.picker { position: relative; }
.picker-toggle { font: inherit; font-size: 15px; text-align: left; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; min-height: 44px; border-radius: 6px; cursor: pointer; color: var(--ink); background: #fff; border: 1px solid var(--field-line); }
.picker-panel { border: 1px solid var(--line); border-radius: 8px; padding: 16px; background: #fff; box-shadow: 0 8px 24px rgba(14, 26, 43, 0.08); display: flex; flex-direction: column; gap: 16px; }
.picker-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 20px; }
.picker-group { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.picker-group legend { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.pick { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; font-weight: 400; cursor: pointer; }
.pick input { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--accent); flex-shrink: 0; }
.picker-foot { display: flex; justify-content: flex-end; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { display: inline-flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; border-radius: 999px; background: var(--accent-tint); font-size: 14px; }
.chips .cat { color: var(--muted-2); }
.chips a { font-size: 13px; }
.chip-x { width: 32px; height: 32px; border-radius: 16px; border: none; background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; color: var(--muted-2); }

/* Pricing */
.price-box { border: 1px solid var(--line); background: var(--soft); border-radius: 8px; padding: 16px; gap: 10px; }
.price-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: baseline; font-size: 14px; }
.price-line strong { font-size: 18px; font-weight: 600; }

/* Evaluation options (checkbox cards) */
.options { gap: 10px; }
.option { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 400; }
.option input { width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.option span { display: flex; flex-direction: column; gap: 2px; }
.option strong { font-size: 15px; font-weight: 600; }
.option em { font-style: normal; font-size: 14px; color: var(--muted); line-height: 1.45; }
.option:has(input:checked) { border-color: var(--accent); background: #F3F7FB; }
.note { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted-2); }

/* Panel */
.panel .card { padding: 20px; gap: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.panel-head h2 { font-size: 17px; }
.badge { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--line-soft); color: var(--muted-2); white-space: nowrap; }
.badge.ready { background: var(--accent); color: #fff; }
/* Stages: three segments, filled up to the stage reached */
.stages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stages li { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.stage-bar { height: 6px; border-radius: 3px; background: var(--line-soft); transition: background .2s; }
.stages li.on .stage-bar { background: var(--accent); }
.stage-name { font-size: 12px; color: var(--muted); line-height: 1.3; }
.stages li.on .stage-name { color: var(--ink); font-weight: 600; }
.stage-now { margin: 0; font-size: 14px; line-height: 1.45; }
.stage-now strong { font-weight: 600; }
#stage-next { margin: 0; }
/* Stage groups under the bar */
.stage-groups { display: flex; flex-direction: column; gap: 12px; }
.stage-group { display: flex; flex-direction: column; gap: 4px; }
.stage-head { margin: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; }
.stage-tag { font-size: 12px; color: var(--muted); }
.stage-group.is-next .stage-tag { color: var(--accent); font-weight: 600; }
.stage-group.is-done .stage-head strong::after { content: ' \2713'; color: var(--accent); }
.stage-group.is-done .stage-head { color: var(--muted); }
.stage-offer { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted-2); }
.stage-group.is-later .stage-offer, .stage-group.is-later .missing button { color: var(--muted); }
.stage-group .missing { list-style: none; padding-left: 0; margin: 2px 0 0; }
.overline { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.missing, .soft { margin: 6px 0 0; padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.missing button { font: inherit; color: var(--warn); background: none; border: 0; padding: 2px 0; text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: rgba(154, 69, 0, .35); }
.soft { color: var(--muted); }
.soft:empty, .missing:empty { display: none; }
.ready { margin: 0; font-size: 14px; color: var(--accent); font-weight: 500; }
.msg { margin: 0; font-size: 14px; color: var(--warn); }
.verify { border-top: 1px solid var(--line-soft); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.verify-title { margin: 0; font-size: 15px; font-weight: 600; }
.verify p { margin: 0; }
.code-input { font-family: var(--mono); font-size: 20px; letter-spacing: .2em; }
.verify-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }

/* Buttons */
.btn { font: inherit; font-size: 15px; font-weight: 500; border: none; border-radius: 6px; padding: 12px 16px; min-height: 44px; cursor: pointer; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-light { background: #fff; color: var(--ink); border: 1px solid var(--field-line); }
.btn-block { width: 100%; }
.btn:disabled { background: var(--line-soft); color: var(--muted); cursor: not-allowed; }
.link-btn { font: inherit; font-size: 14px; background: none; border: none; color: var(--accent); text-decoration: underline; cursor: pointer; padding: 10px 0; min-height: 44px; }

/* Done */
.done { max-width: 760px; margin: 24px auto 0; padding: 32px; gap: 18px; }
.done:focus { outline: none; }
.done h1 { font-size: 28px; margin: 0; }
.done h2 { font-size: 16px; margin: 6px 0 0; }
.done p { margin: 0; }
.tick { width: 44px; height: 44px; border-radius: 22px; background: var(--accent-tint); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.next { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.summary { margin: 0; background: var(--soft); border: 1px solid var(--line-soft); border-radius: 8px; padding: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 20px; font-size: 14px; }
.summary dt { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.summary dd { margin: 2px 0 0; }

/* Gaps on the done page */
.gap-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.gap-list li { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--warn-tint); color: var(--warn); border: 1px solid #F3DCC7; }

/* Booking: a box like the scope summary */
.booking { display: flex; flex-direction: column; gap: 10px; }
.box { background: var(--soft); border: 1px solid var(--line-soft); border-radius: 8px; padding: 16px; }
.done .box h2 { margin: 0; }
.booking-placeholder { margin: 0; padding: 28px 16px; text-align: center; font-size: 14px; color: var(--muted); border: 1px dashed var(--line); border-radius: 8px; background: #fff; }
.edit-box { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.edit-banner { margin: 16px 0 0; padding: 12px 14px; border-radius: 8px; background: var(--accent-tint); color: var(--accent); font-size: 14px; }
#booking-frame { width: 100%; height: 760px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
@media (max-width: 600px) { #booking-frame { height: 900px; } }

/* Honeypot */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  h1 { font-size: 28px; }
  .card { padding: 18px; }
}
