/* Hermes onboarding wizard — styles. No external fonts or requests. */
:root {
  --paper: #f2f4f3;
  --surface: #ffffff;
  --ink: #16222b;
  --muted: #55646e;
  --line: #d8dfe3;
  --primary: #0e5a5e;
  --primary-ink: #ffffff;
  --primary-hover: #0a4649;
  --tint: #e3f0ef;
  --warn-bg: #fbf1dc;
  --warn-ink: #6b4a0f;
  --bad: #b3261e;
  --bad-bg: #fbe9e7;
  --ok: #1e7b4f;
  --radius: 10px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f171d; --surface: #16222b; --ink: #e8eef1; --muted: #9fb0ba;
    --line: #2a3a45; --primary: #4fb3b8; --primary-ink: #06282a; --primary-hover: #6cc6ca;
    --tint: #173035; --warn-bg: #3a2d10; --warn-ink: #f0d9a3; --bad: #ff8a80; --bad-bg: #3a1a17; --ok: #5fd39a;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--sans); }
h1, h2 { line-height: 1.2; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem); font-weight: 650; }
h2 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0; }
code { font-family: var(--mono); font-size: .9em; background: var(--tint); padding: .1em .35em; border-radius: 4px; }
a { color: var(--primary); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

/* Header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1180px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; color: var(--primary); }
.brand span { color: var(--ink); }
.pill { font-size: .8rem; background: var(--warn-bg); color: var(--warn-ink); padding: 4px 10px; border-radius: 999px; }
.noscript { padding: 20px; text-align: center; }

/* Layout */
.layout { max-width: 1180px; margin: 0 auto; padding: 28px 20px 64px; display: grid; grid-template-columns: 200px minmax(0, 1fr) 300px; gap: 36px; align-items: start; }

/* Step rail */
.rail { position: sticky; top: 24px; }
.rail ol { list-style: none; margin: 0; padding: 0; position: relative; }
.rail ol::before { content: ""; position: absolute; left: 13px; top: 14px; bottom: 14px; width: 2px; background: var(--line); }
.rail li { position: relative; }
.rail button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 0; cursor: default; color: var(--muted); font-size: .95rem; }
.rail button .dot { position: relative; z-index: 1; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--paper); border: 2px solid var(--line); display: grid; place-items: center; font-size: .8rem; font-weight: 650; }
.rail li.done button { cursor: pointer; color: var(--ink); }
.rail li.done .dot { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.rail li.current button { color: var(--ink); font-weight: 650; }
.rail li.current .dot { border-color: var(--primary); color: var(--primary); }
.rail li.done button:hover span.t { text-decoration: underline; }
.rail button:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }

/* Stage */
.stage { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: clamp(20px, 3vw, 36px); }
.stage section[hidden] { display: none; }
.stage h1:focus { outline: none; }
.lead { color: var(--muted); margin: 8px 0 24px; max-width: 62ch; }
.field { margin: 0 0 20px; border: 0; padding: 0; min-width: 0; }
.field > legend, .field > label, label.lab { display: block; font-weight: 600; margin: 0 0 6px; padding: 0; font-size: .95rem; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset > legend { padding: 0; }
.opt { font-weight: 400; color: var(--muted); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.mt { margin-top: 12px; } .mt2 { margin-top: 28px; }
input[type=text], input[type=email], input[type=password], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: 44px;
}
textarea { resize: vertical; font-family: var(--mono); font-size: .88rem; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input[aria-invalid=true], textarea[aria-invalid=true], select[aria-invalid=true] { border-color: var(--bad); }
.hint { color: var(--muted); font-size: .85rem; margin-top: 6px; }
.err { color: var(--bad); font-size: .88rem; margin-top: 6px; min-height: 0; }
.err:empty { display: none; }
.status { font-size: .9rem; margin-top: 8px; min-height: 0; }
.status:empty { display: none; }
.status.ok { color: var(--ok); } .status.bad { color: var(--bad); }
.fixed { padding: 10px 12px; min-height: 44px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); display: flex; align-items: center; }
.suffix { display: flex; align-items: stretch; }
.suffix input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.suffix span { display: flex; align-items: center; padding: 0 12px; background: var(--tint); border: 1px solid var(--line); border-left: 0; border-radius: 0 8px 8px 0; color: var(--muted); white-space: nowrap; font-size: .9rem; }
.inline { display: flex; gap: 10px; }
.inline input { flex: 1; }

/* Segmented choice */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 24px; }
.seg.small { margin: 0; }
.seg label { cursor: pointer; display: block; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); height: 100%; }
.seg small { display: block; color: var(--muted); margin-top: 2px; font-size: .85rem; }
.seg input:checked + span { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; background: var(--tint); }
.seg input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 2px; }

/* Plans */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.plan { position: relative; display: flex; flex-direction: column; gap: 10px; text-align: left; padding: 16px; background: var(--surface); color: inherit; font: inherit; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.plan:hover { border-color: var(--muted); }
.plan[aria-checked=true] { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; background: var(--tint); }
.plan h3 { margin: 0; font-size: 1.05rem; }
.plan .price { font-size: 1.35rem; white-space: nowrap; font-weight: 650; font-variant-numeric: tabular-nums; }
.plan .price small { font-size: .85rem; font-weight: 400; color: var(--muted); }
.plan ul { list-style: none; margin: 0; padding: 0; font-size: .9rem; color: var(--muted); }
.plan p { font-size: .88rem; color: var(--muted); }
.plan .badge { position: absolute; top: -10px; right: 12px; background: var(--primary); color: var(--primary-ink); font-size: .75rem; font-weight: 650; padding: 2px 10px; border-radius: 999px; }

/* Chips and lists */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { font: inherit; color: inherit; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; cursor: pointer; }
.chip small { display: block; color: var(--muted); font-size: .82rem; }
.chip[aria-checked=true] { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; background: var(--tint); }
.list { display: grid; gap: 10px; }
.list.tight { gap: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.list.tight .item { padding: 12px 14px; border-top: 1px solid var(--line); }
.list.tight .item:first-child { border-top: 0; }
.item { display: flex; gap: 12px; align-items: flex-start; }
.item small { display: block; color: var(--muted); }
.prov { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; background: var(--surface); text-align: left; font: inherit; color: inherit; width: 100%; }
.prov[aria-checked=true] { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; background: var(--tint); }
.prov small { display: block; color: var(--muted); }
.tag { font-size: .75rem; background: var(--primary); color: var(--primary-ink); padding: 1px 8px; border-radius: 999px; margin-left: 6px; font-weight: 600; }
.cb { width: 20px; height: 20px; margin-top: 3px; flex: none; accent-color: var(--primary); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--primary); }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 12px; background: var(--paper); }
.panel .field:last-child { margin-bottom: 0; }
.plain { margin: 0 0 16px; padding-left: 20px; }
.plain li { margin-bottom: 4px; }
.devcode { font-family: var(--mono); font-size: 1.6rem; letter-spacing: .12em; font-weight: 650; padding: 8px 14px; background: var(--surface); border: 1px dashed var(--primary); border-radius: 8px; display: inline-block; margin: 6px 0; }

/* Callouts */
.callout { background: var(--tint); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 20px; }
.callout h2 { margin-bottom: 6px; }
.callout ul { margin: 6px 0 0; padding-left: 20px; }
.callout.warn { background: var(--warn-bg); color: var(--warn-ink); }
.callout.bad { background: var(--bad-bg); color: var(--bad); }

/* Buttons */
.btn { font: inherit; font-weight: 600; min-height: 44px; padding: 0 20px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; }
.btn.primary { background: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--muted); }
.btn.small { min-height: 34px; padding: 0 12px; background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.controls { display: flex; justify-content: space-between; gap: 12px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
.controls[hidden] { display: none; }

/* Review */
.rev { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; }
.rev h2 { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.rev h2 button { all: unset; cursor: pointer; font-size: .88rem; font-weight: 500; color: var(--primary); text-decoration: underline; }
.rev h2 button:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.rev dl { margin: 0; padding: 4px 16px 8px; display: grid; grid-template-columns: 11rem 1fr; gap: 6px 16px; }
.rev dt { color: var(--muted); } .rev dd { margin: 0; overflow-wrap: anywhere; }
.rev pre { margin: 0; white-space: pre-wrap; font-family: var(--mono); font-size: .85rem; }

/* Receipt */
.receipt { position: sticky; top: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.receipt h2 { margin-bottom: 12px; }
.receipt dl { margin: 0; display: grid; gap: 10px; }
.receipt dl div { display: flex; justify-content: space-between; gap: 12px; font-size: .92rem; }
.receipt dt { color: var(--muted); }
.receipt dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.receipt .total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; padding-top: 14px; border-top: 2px dashed var(--line); }
.receipt .total strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }

/* Progress */
.progress { list-style: none; margin: 0 0 20px; padding: 0; }
.progress li { display: flex; gap: 14px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.progress .ico { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: .8rem; font-weight: 700; margin-top: 1px; }
.progress small { display: block; color: var(--muted); }
.progress li[data-s=done] .ico { background: var(--ok); border-color: var(--ok); color: #fff; }
.progress li[data-s=running] .ico { border-color: var(--primary); border-top-color: transparent; animation: spin .9s linear infinite; }
.progress li[data-s=failed] .ico { background: var(--bad); border-color: var(--bad); color: #fff; }
.progress li[data-s=pending] { color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }
.log summary { cursor: pointer; color: var(--primary); }
.log pre { margin: 10px 0 0; background: #0f171d; color: #cfe3e6; padding: 14px; border-radius: 8px; max-height: 280px; overflow: auto; font: .8rem/1.5 var(--mono); white-space: pre-wrap; }
.codebox { display: flex; gap: 10px; align-items: flex-start; background: #0f171d; color: #cfe3e6; border-radius: 8px; padding: 12px; margin: 10px 0; }
.codebox pre { margin: 0; flex: 1; overflow-x: auto; font: .85rem/1.5 var(--mono); }
.finished { margin-top: 20px; padding: 20px; border: 2px solid var(--ok); border-radius: var(--radius); }
.finished h2 { color: var(--ok); font-size: 1.25rem; margin-bottom: 8px; }
.finished dl { display: grid; grid-template-columns: 9rem 1fr; gap: 6px 16px; margin: 14px 0; }
.finished dt { color: var(--muted); } .finished dd { margin: 0; overflow-wrap: anywhere; }

/* Responsive */
@media (max-width: 1020px) {
  .layout { grid-template-columns: 1fr; gap: 20px; }
  .rail { position: static; }
  .rail ol { display: flex; gap: 4px; overflow-x: auto; }
  .rail ol::before { display: none; }
  .rail button { flex-direction: column; gap: 4px; text-align: center; padding: 4px 8px; font-size: .78rem; width: auto; min-width: 64px; }
  .receipt { position: static; order: 3; }
}
@media (max-width: 640px) {
  .row, .seg, .plans { grid-template-columns: 1fr; }
  .rev dl, .finished dl { grid-template-columns: 1fr; }
  .rev dt { margin-top: 6px; }
  .inline { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .progress li[data-s=running] .ico { animation: none; border-top-color: var(--primary); }
}
