:root {
  color-scheme: light;
  --paper: #f5f2e9;
  --white: #fffdf8;
  --ink: #20312b;
  --muted: #526159;
  --line: #dcded1;
  --green: #224d3a;
  --green-pale: #e9efe2;
  --rust: #943e26;
  --sand: #eddfbf;
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-size: 15px; line-height: 1.5; }
[hidden] { display: none !important; }
a { color: var(--green); text-underline-offset: .18em; }
button, input, select { font: inherit; min-width: 0; }
button, summary { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid #aa5b30; outline-offset: 3px; }
.shell { width: min(100% - 64px, 1440px); margin-inline: auto; }
.masthead { background: #20392f; color: #fffdf8; }
.masthead-inner { min-height: 59px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.masthead a { color: inherit; }
.brand { font-weight: 690; text-decoration: none; letter-spacing: .01em; }
.guide-link { font-size: .86rem; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-block: 34px 25px; }
h1, h2, h3, p { margin: 0; }
h1 { font: clamp(2.05rem, 4vw, 4.4rem)/1.03 Georgia, serif; letter-spacing: -.046em; }
.intro p:not(.data-label) { color: var(--muted); margin-block-start: 12px; }
.data-label { border-left: 2px solid #ab603b; padding-left: 12px; font-size: .86rem; font-weight: 650; flex: none; }
.data-label span { display: block; font-size: .78rem; font-weight: 450; color: var(--muted); }
.workspace { display: grid; grid-template-columns: minmax(300px, 365px) minmax(0, 1fr); align-items: start; gap: 22px; }
.workspace > *, .output { min-width: 0; }
.output { display: grid; gap: 20px; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 13px; padding: 18px; }
h2 { font-size: 1.24rem; line-height: 1.25; letter-spacing: -.025em; }
h3 { font-size: 1.04rem; line-height: 1.35; }
.controls { position: sticky; top: 14px; max-height: max(270px, calc(100dvh - 232px)); display: flex; flex-direction: column; }
.controls form { display: flex; flex: 1; min-height: 0; flex-direction: column; }
.form-fields { min-height: 0; overflow: auto; overscroll-behavior: contain; padding-inline: 3px; }
.form-action { flex: none; }
.controls h2 { margin-bottom: 12px; }
.step { border-top: 1px solid var(--line); padding-block: 10px; }
summary { font-weight: 650; padding-block: 4px; }
.step[open] summary { margin-bottom: 9px; }
.stack { display: grid; gap: 9px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 6px; }
.wide { grid-column: 1 / -1; }
label:not(.checkbox) { display: grid; gap: 3px; color: var(--muted); font-size: .82rem; font-weight: 630; }
input:not([type=checkbox]), select {
  width: 100%; max-width: 100%; min-height: 38px; color: var(--ink); background: #fffefb;
  border: 1px solid #c4cbbd; border-radius: 6px; padding: 5px 8px; font-weight: 500;
}
input[readonly], :disabled { color: var(--muted); }
input[type=checkbox] { accent-color: var(--green); width: 16px; height: 16px; margin: 0; flex: none; }
.checkbox { display: flex; align-items: center; gap: 8px; min-height: 33px; cursor: pointer; }
.city-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 6px; }
.city-row:last-child, .city-row:first-child { grid-template-columns: minmax(0, 1fr); }
.quiet, .primary, .zoom-tools button {
  appearance: none; min-height: 39px; padding: 6px 11px; border-radius: 7px;
  font-weight: 660; line-height: 1.25; overflow-wrap: anywhere;
}
.quiet, .zoom-tools button { background: var(--white); color: var(--green); border: 1px solid #bfcdbc; }
.primary { width: 100%; background: var(--green); color: #fffdf8; border: 1px solid var(--green); }
.quiet:hover:not(:disabled), .zoom-tools button:hover { background: var(--green-pale); }
.primary:hover:not(:disabled) { background: #183b2b; }
.add { margin-block: 8px 11px; }
.form-action { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.hint, .quiet-text { color: var(--muted); font-size: .81rem; font-weight: 450; }
.hint:empty { display: none; }
.error { color: var(--rust); }
.visit-list { max-height: 235px; overflow: auto; margin-block: 9px; }
.visit-row { display: grid; grid-template-columns: minmax(0, 1fr) 62px; gap: 6px; align-items: center; border-bottom: 1px solid var(--line); padding-block: 5px; }
.visit-list h3 { font-size: .82rem; margin-block: 8px 2px; }
.offer { display: grid; gap: 6px; background: #f5f6ed; border-radius: 7px; padding: 8px; }
.map-panel { padding: 0; overflow: hidden; }
.map-heading { display: flex; align-items: start; justify-content: space-between; gap: 10px; padding: 15px 16px 11px; }
.route-title { margin-top: 3px; color: var(--muted); font-size: .89rem; }
.map-frame { position: relative; min-height: 260px; border-block: 1px solid #d9d5c5; background-color: #eee9d8; }
/* Size the schematic only. Leaflet owns the SVGs in its panes and controls. */
#map { display: block; width: 100%; height: clamp(262px, 29vw, 435px); }
.map-frame.live-map { height: clamp(262px, 29vw, 435px); z-index: 0; }
.zoom-tools { position: absolute; right: 11px; bottom: 10px; display: flex; gap: 4px; }
.zoom-tools button { padding-inline: 10px; font-size: .81rem; }
.map-caption, .map-links { padding: 5px 16px; color: var(--muted); font-size: .75rem; }
.map-caption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; }
.map-links { padding-bottom: 10px; }
/* Leaflet loads after this stylesheet. Preserve centering when its marker styles arrive. */
#liveMap .leaflet-marker-icon.city-pin {
  display: grid; place-items: center; box-sizing: border-box; padding: 0;
  border-radius: 50%; border: 2px solid white; background: var(--green); color: white;
  font: 700 12px/1 system-ui, sans-serif;
}
#liveMap .city-pin span { display: block; }
.leaflet-control-attribution { max-width: 100%; overflow-wrap: anywhere; }
#results-heading { margin-bottom: 3px; }
.results-note { margin-bottom: 9px; }
.result-hero { border: 1px solid #c3d2be; border-radius: 10px; background: var(--green-pale); padding: 15px 16px; margin-bottom: 11px; }
.result-hero p { margin-top: 5px; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 10px; }
.card { min-width: 0; padding: 14px; }
.card.preferred { border-color: #65816b; }
.card h3 { overflow-wrap: anywhere; }
.card p { margin-top: 4px; }
.badge { display: inline-block; margin-bottom: 4px; background: var(--green-pale); color: var(--green); padding: 3px 7px; border-radius: 4px; font-size: .73rem; font-weight: 675; }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-block: 9px; }
.metric { min-width: 0; display: grid; align-content: start; background: #f6f5ed; border-radius: 6px; padding: 7px; }
.metric small { color: var(--muted); }
.metric strong { overflow-wrap: anywhere; font-size: .93rem; }
.card details, .event { border-top: 1px solid var(--line); padding-block: 5px; }
.card ul { margin: 5px 0 8px; padding-left: 20px; color: var(--muted); font-size: .87rem; }
.timeline-heading { font-weight: 650; padding-top: 6px; }
.event small { display: block; color: var(--muted); }
.data-details { margin-block: 22px 14px; }
.data-details p { max-width: 85ch; margin-top: 6px; }
.page-footer { color: var(--muted); display: flex; justify-content: space-between; gap: 10px; padding-bottom: 22px; font-size: .78rem; }
@media (max-width: 900px) {
  .shell { width: min(100% - 28px, 720px); }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .controls, .controls form { display: block; }
  .controls { position: static; max-height: none; }
  .form-fields { overflow: visible; padding-inline: 0; }
  .intro { align-items: start; flex-direction: column; gap: 12px; margin-block: 22px 16px; }
  #map, .map-frame.live-map { height: clamp(255px, 55vw, 360px); }
}
@media (max-width: 390px) {
  .panel:not(.map-panel) { padding: 12px; }
  .map-heading { flex-direction: column; padding-inline: 10px; }
  .map-caption, .map-links { padding-inline: 10px; }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .masthead-inner { align-items: start; padding-block: 10px; }
}
