/* Roadbook Format — spec site. Static, dependency-free, technical aesthetic. */
:root {
  --bg: #fcfcfd;
  --panel: #f6f7f9;
  --text: #1a2233;
  --muted: #5b6577;
  --faint: #8b94a7;
  --border: #dde2ea;
  --accent: #b45309;
  --accent-bright: #f59e0b;
  --ok: #047857;
  --err: #b91c1c;
  --warn: #b45309;
  --code-bg: #11161f;
  --code-text: #d6dde8;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f17;
    --panel: #111722;
    --text: #dce3ee;
    --muted: #94a0b4;
    --faint: #5f6b80;
    --border: #232c3b;
    --accent: #fbbf24;
    --accent-bright: #f59e0b;
    --ok: #34d399;
    --err: #f87171;
    --warn: #fbbf24;
    --code-bg: #070b12;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}
header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 0.65rem 1.2rem;
  display: flex;
  align-items: baseline;
  gap: 1.6rem;
  flex-wrap: wrap;
  font-family: var(--mono);
}
.logo { font-size: 0.95rem; font-weight: 700; text-decoration: none; color: var(--text); letter-spacing: -0.01em; }
.logo span { color: var(--accent); }
.logo .v { color: var(--faint); font-weight: 400; font-size: 0.8rem; margin-left: 0.4rem; }
nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
nav a { color: var(--muted); text-decoration: none; font-size: 0.8rem; }
nav a:hover { color: var(--text); }
nav a.active { color: var(--accent); }
main { max-width: 880px; margin: 0 auto; padding: 2.4rem 1.2rem 4rem; }
h1 { font-size: 1.7rem; line-height: 1.25; margin: 0 0 0.6rem; letter-spacing: -0.02em; }
h2 {
  font-family: var(--mono);
  font-size: 1.02rem;
  margin: 2.6rem 0 0.7rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}
h2 a.anchor, h3 a.anchor { color: var(--faint); text-decoration: none; margin-left: 0.4rem; opacity: 0; }
h2:hover a.anchor, h3:hover a.anchor { opacity: 1; }
h3 { font-family: var(--mono); font-size: 0.92rem; margin: 1.8rem 0 0.4rem; }
p.lead { font-size: 1.02rem; color: var(--muted); margin-top: 0; max-width: 62ch; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.kicker {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 1rem;
}
.badges { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0 0 1.4rem; }
.badge {
  font-family: var(--mono);
  font-size: 0.72rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.14rem 0.5rem;
  color: var(--muted);
  background: var(--panel);
}
.badge b { color: var(--accent); font-weight: 600; }
.note {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-bright);
  border-radius: 4px;
  background: var(--panel);
  padding: 0.7rem 1rem;
  margin: 1rem 0;
  font-size: 0.9rem;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.7rem; margin: 1.4rem 0; }
.cell {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  background: var(--panel);
}
.cell h3 { margin: 0 0 0.25rem; font-size: 0.85rem; }
.cell p { margin: 0; font-size: 0.86rem; color: var(--muted); }
pre {
  background: var(--code-bg);
  color: var(--code-text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  font-size: 0.8rem;
  line-height: 1.55;
}
pre code { font-family: var(--mono); }
code { font-family: var(--mono); }
p code, li code, td code, .note code {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.05rem 0.32rem;
  font-size: 0.82em;
}
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; margin: 0.8rem 0 1.6rem; }
th, td { text-align: left; padding: 0.42rem 0.6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th {
  font-family: var(--mono);
  color: var(--faint);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom-width: 2px;
}
td:first-child { white-space: nowrap; }
.req { color: var(--err); font-weight: 700; }
.type { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.btn {
  display: inline-block;
  font-family: var(--mono);
  background: var(--accent-bright);
  color: #0b0f17;
  font-weight: 700;
  border: none;
  border-radius: 6px;
  padding: 0.55rem 1.2rem;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
}
.btn.secondary { background: transparent; color: var(--text); border: 1px solid var(--border); font-weight: 500; }
textarea.validator-input {
  width: 100%;
  min-height: 260px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 0.8rem;
}
.dropzone {
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 0.8rem;
  text-align: center;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.8rem;
  margin: 0.8rem 0;
}
.dropzone.over { border-color: var(--accent-bright); color: var(--accent); }
.result { border: 1px solid var(--border); border-radius: 6px; background: var(--panel); padding: 0.8rem 1rem; margin: 1rem 0; }
.result-ok { color: var(--ok); font-weight: 700; font-family: var(--mono); font-size: 0.9rem; }
.result-err { color: var(--err); font-weight: 700; font-family: var(--mono); font-size: 0.9rem; }
.result .meta { color: var(--faint); font-size: 0.78rem; font-family: var(--mono); margin: 0.2rem 0 0; }
ul.issues { list-style: none; padding: 0; margin: 0.6rem 0 0; font-size: 0.85rem; }
ul.issues li { padding: 0.35rem 0; border-top: 1px solid var(--border); }
ul.issues .path { font-family: var(--mono); font-size: 0.75rem; color: var(--faint); display: block; }
ul.issues li.e::before { content: 'error '; font-family: var(--mono); font-size: 0.72rem; color: var(--err); font-weight: 700; }
ul.issues li.w::before { content: 'warning '; font-family: var(--mono); font-size: 0.72rem; color: var(--warn); font-weight: 700; }
dl.toolspec dt { font-family: var(--mono); font-size: 0.85rem; font-weight: 600; margin-top: 0.9rem; }
dl.toolspec dd { margin: 0.15rem 0 0 0; color: var(--muted); font-size: 0.88rem; }
footer {
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.75rem;
  text-align: center;
  padding: 1.4rem 1rem 2.4rem;
}
footer a { color: var(--faint); }

/* --- v1 site pass: CTAs, example chips, prompt box, viewer --- */
.cta-row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin: 1rem 0 1.6rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.small { padding: 0.3rem 0.7rem; font-size: 0.75rem; }
p.small { font-size: 0.82rem; color: var(--muted); }
.examples { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin: 1rem 0 0.4rem; font-family: var(--mono); }
.examples-label { font-size: 0.72rem; color: var(--faint); text-transform: uppercase; letter-spacing: 0.08em; }
.example { display: inline-flex; align-items: stretch; }
.chip {
  font-family: var(--mono);
  font-size: 0.76rem;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px 0 0 6px;
  padding: 0.28rem 0.7rem;
  cursor: pointer;
}
.example .chip:only-child { border-radius: 6px; }
.chip:hover { border-color: var(--accent-bright); color: var(--accent); }
.iconbtn {
  display: inline-flex; align-items: center;
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 0 0.5rem;
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 6px 6px 0;
  background: var(--panel);
  color: var(--muted);
  text-decoration: none;
}
.iconbtn:hover { color: var(--accent); border-color: var(--accent-bright); }
.prompt-box { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; margin: 0.8rem 0 1.2rem; }
.prompt-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 0.4rem 0.8rem; background: var(--panel); border-bottom: 1px solid var(--border); }
.prompt-toolbar .meta { font-family: var(--mono); font-size: 0.72rem; color: var(--faint); }
.prompt-box pre { margin: 0; border: none; border-radius: 0; white-space: pre-wrap; }
textarea.validator-input.short { min-height: 160px; }
details > summary { cursor: pointer; font-family: var(--mono); font-size: 0.78rem; color: var(--faint); margin-top: 0.8rem; }

/* viewer */
.trip { border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.2rem 1.4rem; background: var(--bg); margin: 1rem 0 2rem; }
.trip .meta { color: var(--muted); font-size: 0.8rem; margin: 0.15rem 0; }
.trip .faint { color: var(--faint); }
.trip-head { border-bottom: 1px solid var(--border); padding-bottom: 0.8rem; margin-bottom: 0.4rem; }
.trip img.cover { width: 100%; max-height: 220px; object-fit: cover; border-radius: 6px; margin-bottom: 0.6rem; }
.trip-title { font-family: inherit; font-size: 1.4rem; margin: 0; padding: 0; border: none; letter-spacing: -0.02em; }
.trip-sub { color: var(--muted); margin: 0.1rem 0 0.4rem; }
.chips { display: flex; gap: 0.35rem; flex-wrap: wrap; margin: 0.4rem 0 0; }
.tag {
  display: inline-block; font-family: var(--mono); font-size: 0.68rem; line-height: 1.5;
  border: 1px solid var(--border); border-radius: 4px; padding: 0 0.4rem; color: var(--muted); background: var(--panel); vertical-align: middle;
}
.tag.member { font-size: 0.78rem; color: var(--text); }
.tag.st-confirmed, .tag.st-done { color: var(--ok); border-color: var(--ok); }
.tag.st-to_book, .tag.st-optional, .tag.st-replaced { color: var(--warn); border-color: var(--warn); }
.tag.st-cancelled, .tag.st-skipped { color: var(--err); border-color: var(--err); text-decoration: line-through; }
.tag.trig { color: var(--accent); }
.stars { color: var(--accent-bright); font-size: 0.8rem; letter-spacing: 0.05em; }
h3.sec { font-family: var(--mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); margin: 1.6rem 0 0.5rem; }
.day { border-top: 1px solid var(--border); padding: 0.8rem 0 0.4rem; }
.day-head { font-size: 1rem; }
.day-idx { font-family: var(--mono); font-size: 0.75rem; color: var(--accent); font-weight: 700; margin-right: 0.3rem; }
.day-intro { color: var(--muted); font-size: 0.9rem; margin: 0.2rem 0 0.4rem; }
ul.items { list-style: none; padding: 0; margin: 0.4rem 0; }
.item { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0.6rem; padding: 0.45rem 0; border-top: 1px dashed var(--border); font-size: 0.9rem; }
.item .time { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); padding-top: 0.15rem; white-space: nowrap; }
.item.st-done .item-title strong { color: var(--muted); }
.item.st-skipped .item-title strong { text-decoration: line-through; color: var(--faint); }
.item .critical { color: var(--err); font-size: 0.85rem; }
.item .sub { margin-top: 0.25rem; font-size: 0.85rem; }
.item .sub ul { margin: 0.1rem 0 0.2rem; padding-left: 1.1rem; }
.item .sub li.chosen { color: var(--ok); }
.planb, .tip { font-size: 0.85rem; margin: 0.3rem 0; color: var(--muted); }
.planb b, .tip b { font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); margin-right: 0.3rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0.6rem; }
.card { border: 1px solid var(--border); border-radius: 6px; padding: 0.7rem 0.9rem; background: var(--panel); font-size: 0.88rem; }
.card p { margin: 0.2rem 0; }
.card-head { margin-bottom: 0.2rem; }
.card.person { display: flex; gap: 0.7rem; align-items: flex-start; }
.card img.avatar { width: 56px; height: 56px; object-fit: cover; border-radius: 50%; flex: none; }
ul.refs, ul.tickets, ul.check, ul.plain { list-style: none; padding: 0; margin: 0.3rem 0; font-size: 0.85rem; }
ul.refs li, ul.tickets li, ul.plain li { padding: 0.12rem 0; }
ul.check li.done { color: var(--faint); text-decoration: line-through; }
@media (max-width: 520px) { .item { grid-template-columns: 1fr; gap: 0.1rem; } }

/* preview modal (validator) */
dialog.preview { width: min(920px, 94vw); max-height: 90vh; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); }
dialog.preview::backdrop { background: rgba(0, 0, 0, 0.55); }
.preview-bar { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.5rem 0.9rem; background: var(--panel); border-bottom: 1px solid var(--border); z-index: 1; }
.preview-bar .meta { font-family: var(--mono); font-size: 0.72rem; color: var(--faint); }
dialog.preview .trip { border: none; margin: 0; border-radius: 0; }

/* viewers page */
.viewer-card { display: grid; grid-template-columns: 1fr auto; gap: 0.6rem 1rem; align-items: start; }
.viewer-card .who { font-size: 0.8rem; color: var(--faint); font-family: var(--mono); }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.7rem 1rem; margin: 0.8rem 0; }
.form label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8rem; color: var(--muted); font-family: var(--mono); }
.form label.wide { grid-column: 1 / -1; }
.form input, .form select, .form textarea {
  font: inherit; font-size: 0.9rem; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  border: 1px solid var(--border); border-radius: 6px; background: var(--panel); color: var(--text); padding: 0.4rem 0.55rem;
}
.form textarea { min-height: 70px; resize: vertical; }
.form .checks { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; font-family: inherit; }
.form .checks label { flex-direction: row; align-items: center; gap: 0.3rem; font-family: inherit; color: var(--text); font-size: 0.86rem; }
.form fieldset { border: 1px solid var(--border); border-radius: 6px; padding: 0.5rem 0.8rem; margin: 0; grid-column: 1 / -1; }
.form legend { font-family: var(--mono); font-size: 0.72rem; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; padding: 0 0.3rem; }
.open-in { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin: 0.6rem 0 1.4rem; }
.open-in .meta { font-family: var(--mono); font-size: 0.72rem; color: var(--faint); }

/* generic modal */
dialog.modal { width: min(760px, 94vw); max-height: 90vh; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); }
dialog.modal::backdrop { background: rgba(0, 0, 0, 0.55); }
.modal-body { padding: 0.9rem 1rem 1rem; margin: 0; }

/* wizard */
dialog.wizard { width: min(720px, 94vw); }
.wz-title { font-family: inherit; font-size: 1.15rem; margin: 0.2rem 0 0.4rem; }
.wz-nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 1.2rem 0 0; padding-top: 0.8rem; border-top: 1px solid var(--border); }
.wz-nav .meta { color: var(--err); font-family: var(--mono); font-size: 0.78rem; }
.crumb { color: var(--faint); } .crumb.on { color: var(--accent); font-weight: 700; } .crumb.done { color: var(--muted); }
.crumb-sep { color: var(--faint); margin: 0 0.35rem; }
.traveler { display: grid; grid-template-columns: 1.6rem 1fr 5rem 3.2rem 2rem; gap: 0.5rem; align-items: center; margin: 0.4rem 0; }
.traveler input { font: inherit; font-size: 0.95rem; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); color: var(--text); padding: 0.45rem 0.6rem; min-width: 0; }
.traveler .tkind { font-family: var(--mono); font-size: 0.72rem; color: var(--faint); }
.traveler .iconbtn { border-left: 1px solid var(--border); border-radius: 6px; justify-content: center; cursor: pointer; }
.traveler .iconbtn:disabled { opacity: 0.3; cursor: default; }
.wz-label { display: block; font-family: var(--mono); font-size: 0.8rem; color: var(--muted); margin: 0.8rem 0 0.4rem; }
.wz-label input { display: block; width: 100%; margin-top: 0.3rem; font: inherit; font-size: 0.95rem; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); color: var(--text); padding: 0.45rem 0.6rem; }
.city-search { position: relative; }
.city-results { position: absolute; left: 0; right: 0; top: 100%; z-index: 5; list-style: none; margin: 0.15rem 0 0; padding: 0.2rem 0; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,0.25); max-height: 260px; overflow-y: auto; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 0.9rem; }
.city-results li { padding: 0.4rem 0.7rem; cursor: pointer; }
.city-results li.on, .city-results li:hover { background: var(--panel); }
.city-results .flag, .cities .flag { font-size: 1.05rem; margin-right: 0.15rem; }
.cities { list-style: none; padding: 0; margin: 0.4rem 0 0; font-size: 0.92rem; }
.cities li { display: flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0; border-top: 1px dashed var(--border); }
.cities li .faint { color: var(--faint); font-size: 0.82rem; }
.city-actions { margin-left: auto; display: inline-flex; gap: 0.2rem; }
.city-actions .iconbtn { border-left: 1px solid var(--border); border-radius: 4px; cursor: pointer; padding: 0 0.4rem; }
.city-actions .iconbtn:disabled { opacity: 0.3; cursor: default; }
.pick { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0.7rem 0; }
.pick-label { flex-basis: 100%; font-family: var(--mono); font-size: 0.72rem; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; }
.pick button { font: inherit; font-size: 0.86rem; padding: 0.35rem 0.75rem; border-radius: 999px; border: 1px solid var(--border); background: var(--panel); color: var(--text); cursor: pointer; }
.pick button.on { border-color: var(--accent-bright); color: var(--accent); background: color-mix(in srgb, var(--accent-bright) 12%, var(--panel)); font-weight: 600; }
.faint { color: var(--faint); }

/* wizard: fixed nav, scrollable prompt on last step */
dialog.wizard[open] { display: flex; flex-direction: column; max-height: 90vh; }
dialog.wizard .modal-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
dialog.wizard .wz-step { flex: 1; min-height: 0; display: flex; flex-direction: column; }
dialog.wizard .wz-step[hidden] { display: none; }
dialog.wizard .wz-step[data-step="4"] .prompt-box { flex: 1; min-height: 0; display: flex; flex-direction: column; }
dialog.wizard .wz-step[data-step="4"] pre { flex: 1; min-height: 0; max-height: 55vh; overflow: auto; }
dialog.wizard .wz-nav { flex: none; }
