:root {
  /* Room to Breathe: calm, clear, kind. Deep teal on soft paper; one teal action at a time. */
  --bg: #f5f7f5;
  --panel: #ffffff;
  --ink: #17262a;
  --muted: #5a6a6c;
  --line: #e0e7e5;
  --brand: #0f766e;
  --brand-strong: #115e59;
  --brand-soft: #e7f5f2;
  --accent: #0f766e;
  --green: #15803d; --green-soft: #ecfdf3;
  --yellow: #a16207;
  --orange: #b45309; --orange-soft: #fff7ed;
  --red: #b91c1c; --red-soft: #fef2f2;
  --unknown: #8a8f98;
  --zone-ink: #0b0d10;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(23, 38, 42, .05), 0 6px 20px rgba(23, 38, 42, .05);
  --ring: 0 0 0 3px rgba(15, 118, 110, .28);
  --on-brand: #fff; --field-line: #cdd7d5;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1514; --panel: #141e1d; --ink: #e3ecea; --muted: #9db0ad; --line: #233130;
    --brand: #2dd4bf; --brand-strong: #5eead4; --brand-soft: #12302d; --accent: #5eead4;
    --green: #4ade80; --green-soft: #10261a; --orange: #fbbf24; --orange-soft: #2a2010; --red: #f87171; --red-soft: #2b1414;
    --yellow: #facc15; --shadow: none; --ring: 0 0 0 3px rgba(45, 212, 191, .35); --on-brand: #062925; --field-line: #31423f; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1514; --panel: #141e1d; --ink: #e3ecea; --muted: #9db0ad; --line: #233130;
  --brand: #2dd4bf; --brand-strong: #5eead4; --brand-soft: #12302d; --accent: #5eead4;
  --green: #4ade80; --green-soft: #10261a; --orange: #fbbf24; --orange-soft: #2a2010; --red: #f87171; --red-soft: #2b1414;
  --yellow: #facc15; --shadow: none; --ring: 0 0 0 3px rgba(45, 212, 191, .35); --on-brand: #062925; --field-line: #31423f; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* hidden always wins over component display rules */
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Bengali", "Noto Sans Devanagari", sans-serif;
}
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; }
.small { font-size: 12.5px; }
.muted { color: var(--muted); }
a { color: var(--accent); }
button, select, input {
  font: inherit; color: inherit; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 11px;
}
button { cursor: pointer; }
button:hover { border-color: var(--accent); }
button:disabled { opacity: .45; cursor: not-allowed; }
input[type=file] { max-width: 100%; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-brand); }
button.link { border: 0; background: none; color: var(--muted); text-decoration: underline; }

.topbar {
  display: flex; align-items: center; gap: 16px; padding: 10px 16px;
  background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
  flex-wrap: wrap;
}
.brand { font-weight: 700; letter-spacing: .01em; }
.logo { color: var(--red); }
.tabs { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 6px 10px; border-radius: 6px; color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--bg); color: var(--ink); font-weight: 600; }
.conn { font-size: 12px; padding: 3px 8px; border-radius: 99px; background: var(--bg); color: var(--muted); }
.conn.ok { color: var(--green); }

.tab { display: none; padding: 16px; max-width: 1440px; margin: 0 auto; }
.tab.active { display: block; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px;
  box-shadow: var(--shadow); min-width: 0;
}
.statusbar {
  display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px;
}
.venue-name { font-weight: 650; }
.badge { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 4px; background: var(--bg); }
.badge.demo { background: var(--accent); color: var(--on-brand); }
.occ { flex: 1; min-width: 200px; max-width: 420px; }
.occ-bar { height: 8px; border-radius: 99px; background: var(--bg); overflow: hidden; border: 1px solid var(--line); }
.occ-bar > div { height: 100%; width: 0; background: var(--green); transition: width .4s, background .4s; }
.occ-bar.big { height: 18px; }
.demo-controls { display: flex; gap: 6px; flex-wrap: wrap; }

.grid {
  align-items: start;
  display: grid; gap: 14px;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  grid-template-areas: "map alerts" "zones side";
}
.map-card { grid-area: map; }
.alerts-card { grid-area: alerts; max-height: 520px; overflow: auto; }
.zones-card { grid-area: zones; }
.side-card { grid-area: side; }
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; grid-template-areas: "alerts" "map" "zones" "side"; }
}

#map { width: 100%; height: auto; display: block; }
#map .zone { stroke: var(--panel); stroke-width: .6; transition: fill .5s; }
#map .zlabel { font-size: 3.2px; font-weight: 700; fill: var(--zone-ink); pointer-events: none; }
#map .zsub { font-size: 2.6px; fill: var(--zone-ink); pointer-events: none; }
#map .gate { stroke-width: 1.6; stroke-linecap: round; }
#map .gate.open { stroke: var(--ink); }
#map .gate.closed { stroke: var(--red); stroke-dasharray: 1 1; }
#map .glabel { font-size: 2.4px; fill: var(--muted); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; color: var(--muted); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.GREEN { --lv: var(--green); } .YELLOW { --lv: var(--yellow); } .ORANGE { --lv: var(--orange); }
.RED { --lv: var(--red); } .UNKNOWN { --lv: var(--unknown); }
.sw { background: var(--lv); }

.alerts { display: flex; flex-direction: column; gap: 10px; }
.alert { border-left: 4px solid var(--lv); background: var(--bg); border-radius: 8px; padding: 10px 12px; }

.alert.past { opacity: .7; padding: 6px 10px; }
.alert.past ul { display: none; }
.alert.RED:not(.past) { animation: pulse 1.4s ease-in-out 3; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 25%, transparent); } }
.alert-head { display: flex; justify-content: space-between; gap: 8px; font-weight: 650; }
.lvl { color: var(--lv); }
.alert ul { margin: 6px 0; padding-left: 18px; }
.actions { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.action { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
.action .txt { flex: 1; }
.action button { padding: 3px 9px; font-size: 12.5px; white-space: nowrap; }
.action.done { opacity: .55; }
.announce { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

.zones { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.zcard { border: 1px solid var(--line); border-top: 4px solid var(--lv); border-radius: 8px; padding: 10px; }
.zcard .big { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.zcard dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 6px 0 0; font-size: 12.5px; }
.zcard dt { color: var(--muted); }
.zcard dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.zcard svg { width: 100%; height: 34px; display: block; margin-top: 6px; }
.zcard .spark { fill: none; stroke: var(--lv); stroke-width: 1.5; }
.zcard .crit { stroke: var(--red); stroke-dasharray: 3 3; stroke-width: 1; }
.ttc-warn { color: var(--red); font-weight: 700; }

.triggers { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.triggers button[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); color: var(--on-brand); }
.log { padding-left: 18px; margin: 0; max-height: 220px; overflow: auto; }

.plan-grid { grid-template-columns: 1fr 1fr; grid-template-areas: none; }
@media (max-width: 900px) { .plan-grid { grid-template-columns: 1fr; } }
.form { display: grid; gap: 10px; }
.form.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .form.two { grid-template-columns: 1fr; } }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.form input, .form select { color: var(--ink); width: 100%; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; grid-column: 1 / -1; }
fieldset.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
fieldset.checks label { flex-direction: row; align-items: center; gap: 6px; color: var(--ink); }
fieldset.checks input { width: auto; }
.exit-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.exit-row input[type=number] { width: 90px; }
.out { margin: 14px 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.kpi { background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.kpi .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi.hl { outline: 2px solid var(--accent); }
.verdict { padding: 10px 12px; border-radius: 8px; font-weight: 650; margin-bottom: 10px; border-left: 4px solid var(--lv); background: var(--bg); }
.factors { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.factors li { background: var(--bg); border-radius: 6px; padding: 7px 10px; font-size: 13.5px; }
.factors .pts { float: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.factors .rec { color: var(--muted); font-size: 12.5px; }

.counter { max-width: 560px; margin: 0 auto; }
.cnt-display { font-size: 72px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; margin: 10px 0; }
.cnt-pct { text-align: center; margin: 6px 0 14px; font-weight: 600; }
.cnt-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cnt-buttons button { font-size: 22px; padding: 22px 10px; font-weight: 700; border-radius: 12px; }
.cnt-buttons .in { background: color-mix(in srgb, var(--green) 14%, var(--panel)); }
.cnt-buttons .out-btn { background: color-mix(in srgb, var(--accent) 12%, var(--panel)); }

.foot { text-align: center; padding: 18px 16px 28px; }

@media print {
  .topbar, .foot, #print-plan, .statusbar { display: none !important; }
  body { background: #fff; color: #000; }
  .tab { display: none !important; }
  #tab-plan { display: block !important; }
  .card { box-shadow: none; break-inside: avoid; }
}

@media (max-width: 600px) {
  .tabs { order: 3; flex-basis: 100%; justify-content: space-between; }
  .tabs button { flex: 1; }
}

.who { font-size: 12px; padding: 3px 10px; border-radius: 99px; margin-left: auto; }
dialog { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink);
  max-width: min(420px, calc(100vw - 32px)); padding: 16px; }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
.err { color: var(--red); font-weight: 600; }

/* web app: what-if and photo count */
.lead { max-width: 820px; margin: 0 0 14px; font-size: 15px; }
.notice { margin-bottom: 14px; border-left: 4px solid var(--accent); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
h3 { font-size: 14px; margin: 14px 0 6px; }
.rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.vrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px; border-radius: 8px; background: var(--bg); }
.vrow input:not([type=checkbox]), .vrow select { flex: 1 1 120px; min-width: 0; }
.vrow input[type=number] { flex: 0 1 70px; }
.vrow label { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.wi-chart { margin: 0; }
.wi-chart figcaption { font-weight: 650; margin-bottom: 4px; }
.wi-chart svg { width: 100%; height: auto; display: block; }
.wi-chart .ax { font-size: 10px; fill: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.scroll { overflow-x: auto; margin: 12px 0; }
.wi-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.wi-table th, .wi-table td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.wi-table th { color: var(--muted); font-weight: 600; font-size: 12px; }
.wi-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.photo-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); grid-template-areas: none; }
@media (max-width: 900px) { .photo-grid { grid-template-columns: 1fr; } }
.ph-wrap { margin: 10px 0; border-radius: 8px; overflow: hidden; background: var(--bg); }
#ph-canvas { width: 100%; height: auto; display: block; }
#ph-canvas.marking { cursor: crosshair; outline: 3px solid var(--accent); }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.notice-inline { border-left: 3px solid var(--orange); padding: 6px 10px; background: var(--bg); border-radius: 6px; }
@media (max-width: 600px) {
  /* wrap, never scroll: a sideways-scrolling tab bar hides the last tabs on a phone */
  .tabs { flex-wrap: wrap; max-width: 100%; }
  .tabs button { white-space: nowrap; flex: 1 1 auto; }
}
.wi-map { height: 420px; border-radius: 8px; margin: 8px 0; border: 1px solid var(--line); }
@media (max-width: 600px) { .wi-map { height: 340px; } }
.wi-map.drawing, .wi-map.drawing .leaflet-interactive { cursor: crosshair; }
.wi-map .vertex { background: #fff; border: 2px solid #2456d6; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0,0,0,.3); }
.wi-map img { max-width: none; } /* page-wide image rules must not resize map tiles */
.map-label { background: rgba(0,0,0,.6); color: #fff; border: 0; box-shadow: none; font-weight: 600; }
.map-label::before { display: none; }
html { scroll-padding-top: 70px; } /* scrolled-to elements clear the sticky header */

/* --- plan an event: one question, one answer --- */
.flow { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.hero { padding: 10px 2px 2px; }
.hero h1 { font-size: clamp(26px, 5vw, 38px); margin: 0 0 6px; letter-spacing: -.02em; }
.hero p { margin: 0; color: var(--muted); font-size: 16px; max-width: 640px; }
.step-h { display: flex; align-items: center; gap: 10px; font-size: 18px; text-transform: none; letter-spacing: 0;
  color: var(--ink); margin-bottom: 12px; }
.step-h .num { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--on-brand);
  display: inline-grid; place-items: center; font-size: 15px; flex: none; }
.choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.choice-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px;
  text-align: left; border-radius: 10px; }
.choice-btn span { font-size: 12.5px; color: var(--muted); }
.choice-btn[aria-pressed="true"] { border: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }
@media (max-width: 600px) {
  .choice-btn { padding: 10px 8px; align-items: center; text-align: center; }
  .choice-btn b { font-size: 13px; }
  .choice-btn span { display: none; }
}
.venue-out { margin-top: 10px; }
.people-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.big-input { font-size: 26px; font-weight: 700; width: 190px; padding: 8px 12px; }
.arrive { display: flex; align-items: center; gap: 8px; color: var(--muted); }
button.big { font-size: 17px; padding: 12px 22px; border-radius: 10px; }
@media (max-width: 600px) { .big-input { flex: 1 1 100%; width: 100%; } button.big { flex: 1 1 100%; } }
.verdict-big { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 12px; margin-bottom: 12px;
  background: color-mix(in srgb, var(--vc) 14%, var(--panel)); border: 2px solid var(--vc); }
.v-pass { --vc: var(--green); } .v-warn { --vc: var(--orange); } .v-fail { --vc: var(--red); }
.v-icon { width: 46px; height: 46px; border-radius: 50%; background: var(--vc); color: var(--on-brand); font-size: 26px;
  font-weight: 800; display: grid; place-items: center; flex: none; }
.v-head { font-size: clamp(20px, 4vw, 28px); font-weight: 800; letter-spacing: -.01em; }
.v-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.checks { list-style: none; padding: 0; margin: 0 0 6px; display: flex; flex-direction: column; gap: 8px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; background: var(--bg); }
.c-icon { width: 22px; height: 22px; border-radius: 50%; color: var(--on-brand); font-weight: 800; font-size: 13px;
  display: grid; place-items: center; flex: none; margin-top: 1px; }
.c-pass .c-icon { background: var(--green); } .c-warn .c-icon { background: var(--orange); } .c-fail .c-icon { background: var(--red); }
.fixes { margin: 0 0 12px; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
details.more, details.advanced { margin: 10px 0; }
details > summary { cursor: pointer; font-weight: 650; }
details.advanced[open] > summary { margin-bottom: 12px; }
.row .grow { flex: 1 1 220px; min-width: 0; }
.name-row { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; max-width: 420px; }
.places { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 6px; }
.places button { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 1px; padding: 9px 12px; }
.places button span { font-size: 12.5px; color: var(--muted); }

/* Event overview: the area around the venue */
.ov-form { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: end; }
.ov-form fieldset.modes { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.ov-form fieldset.modes label { font-size: 13px; }
.ov-map { height: 520px; margin: 8px 0; }
.ov-layers { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 10px 0 4px; }
.ov-layers label { display: inline-flex; gap: 5px; align-items: center; }
.ov-pin span { font-size: 18px; line-height: 24px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
.timeline { position: relative; height: 26px; margin: 12px 0 4px; border-radius: 6px; background: var(--bg); overflow: hidden; }
.tl-seg { position: absolute; top: 0; bottom: 0; font-size: 11.5px; line-height: 26px; padding: 0 6px; color: var(--on-brand);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-prep { background: var(--muted); } .tl-arr { background: var(--accent); } .tl-event { background: var(--green); }
.tl-dep { background: var(--orange); }
details.agency { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin: 8px 0; }
details.agency summary { cursor: pointer; }
ol.posts { margin: 8px 0 4px; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
ol.posts button.link { text-align: left; padding: 0; color: var(--ink); text-decoration: none; }
ul.plain { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ov-fixes { margin: 6px 0; padding: 8px 10px; border-radius: 8px; background: var(--bg); }
.ov-fixes ul { margin: 6px 0; padding-left: 18px; }
.fix-form { display: flex; flex-direction: column; gap: 6px; min-width: 220px; }
.fix-form label { display: flex; flex-direction: column; gap: 2px; }
.fix-form label:has(input[type=checkbox]) { flex-direction: row; align-items: center; gap: 6px; }
.fix-form input[type=number] { width: 100%; }

/* ---- phones: feel like an app ---------------------------------------------------------------- */
button.busy, button.busy:disabled { opacity: 1; cursor: progress; }
button.busy::before {
  content: ""; display: inline-block; width: 1em; height: 1em; margin-right: .5em; vertical-align: -.15em;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { button.busy::before { animation: none; } }
@media (max-width: 600px) {
  /* 16px stops iPhone Safari from zooming the page when a field is tapped */
  input, select, textarea { font-size: 16px; }
  button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
  /* the brand scrolls away; the sections sit in a bar at the bottom, where a thumb reaches */
  .topbar { position: static; padding: 10px 16px; }
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100; flex-wrap: nowrap; gap: 0; margin: 0; /* above map controls (1000) */
    background: var(--panel); border-top: 1px solid var(--line);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .tabs button {
    flex: 1 1 0; min-width: 0; white-space: normal; line-height: 1.15; font-size: 12.5px;
    padding: 9px 2px; min-height: 48px; border-radius: 10px;
  }
  .tabs button[aria-selected="true"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}
@media print { .tabs { display: none !important; } body { padding-bottom: 0; } }

/* ================================================================================================
   Room to Breathe design layer: calm and clear (see docs/PRODUCT_AUDIT.md for the reasoning).
   One teal action at a time, plain words, the next step always obvious.
   ================================================================================================ */
body { font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Bengali",
  "Noto Sans Devanagari", sans-serif; font-size: 15.5px; line-height: 1.5; }
h2 { font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--ink); font-weight: 700; }
h3 { font-size: 16px; }
a { color: var(--accent); }
.card { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 20px; }

/* buttons: teal = do this, outlined = everything else */
button { border-radius: 10px; border: 1px solid var(--line); background: var(--panel); box-shadow: none;
  padding: 9px 14px; transition: background .15s, border-color .15s, box-shadow .15s; }
button:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); background: var(--brand-soft); }
button.primary, .btn-buy, .btn-next {
  background: var(--brand); border: 1px solid var(--brand); color: var(--on-brand); font-weight: 600; border-radius: 10px;
  padding: 10px 18px; box-shadow: 0 1px 2px rgba(15, 118, 110, .25);
}
button.primary:hover, .btn-buy:hover, .btn-next:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
button.big { font-size: 16px; padding: 12px 22px; }
button.link { color: var(--accent); text-decoration: none; padding: 4px 2px; }
button.link:hover { text-decoration: underline; background: none; }
input, select { border-radius: 10px; border: 1px solid var(--field-line); background: var(--panel); }
input:focus, select:focus, button:focus-visible, summary:focus-visible { outline: none; border-color: var(--brand); box-shadow: var(--ring); }

/* header: brand, the venue search, sign-in */
.topbar { background: var(--panel); color: var(--ink); border-bottom: 1px solid var(--line); gap: 16px;
  padding: 10px 20px; flex-wrap: nowrap; }
.brand { color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 10px; font-size: 18px;
  font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }
.logo { width: 26px; height: 26px; border-radius: 50%; display: inline-block; flex: none;
  background: radial-gradient(circle, var(--brand) 0 26%, transparent 27% 45%, color-mix(in srgb, var(--brand) 55%, transparent) 46% 58%,
    transparent 59% 77%, color-mix(in srgb, var(--brand) 25%, transparent) 78% 100%); }
.nav-search { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 680px; height: 44px; margin: 0 auto;
  border-radius: 999px; padding: 0 6px 0 16px; background: var(--bg); border: 1px solid var(--line); }
.nav-search:focus-within { border-color: var(--brand); box-shadow: var(--ring); background: var(--panel); }
.nav-scope { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.nav-search .nav-ico { color: var(--muted); flex: none; }
.nav-search input { flex: 1; min-width: 0; border: 0; box-shadow: none; background: transparent; font-size: 15px; padding: 0; color: var(--ink); }
.nav-search input:focus { box-shadow: none; }
.nav-go { border-radius: 999px; background: var(--brand); color: var(--on-brand); border: 0; padding: 7px 16px; font-weight: 600; }
.nav-go:hover { background: var(--brand-strong); }
.topbar .who { white-space: nowrap; }
.topbar .conn { background: var(--bg); }
.subnav { background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 4px;
  padding: 0 16px; flex: none; }
.subnav button { color: var(--muted); background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 0;
  padding: 12px 12px 9px; font-weight: 600; }
.subnav button:hover { color: var(--ink); background: none; }
.subnav button[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); background: none; }
.subnav-note { margin-left: auto; color: var(--muted); font-size: 13px; }

/* hero with the step guide */
.flow { max-width: 1240px; margin: 0 auto; }
.hero { display: flex; flex-direction: column; gap: 14px; padding: 8px 4px 18px; background: none; }
.hero h1 { font-size: 32px; margin: 0; letter-spacing: -.02em; }
.hero p { margin: 0; color: var(--muted); max-width: 680px; font-size: 16.5px; }
.guide { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; flex-wrap: wrap; counter-reset: guide; }
.guide li { counter-increment: guide; display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; }
.guide li::before { content: counter(guide); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg); color: var(--muted); font-size: 13px; }
.guide li.now { border-color: var(--brand); color: var(--ink); box-shadow: var(--ring); }
.guide li.now::before { background: var(--brand); color: var(--on-brand); }
.guide li.done { color: var(--ink); }
.guide li.done::before { content: "✓"; background: var(--brand-soft); color: var(--brand); }
.guide .sep { list-style: none; color: var(--muted); opacity: .5; align-self: center; padding: 0; border: 0; background: none;
  cursor: default; counter-increment: none; }
.guide .sep::before { content: none; }

/* the plan page: venue, the decision box, results */
.plan-layout { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-areas: "venue box" "results box"; align-items: start; }
.pl-venue { grid-area: venue; min-width: 0; }
.pl-results { grid-area: results; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.buybox { grid-area: box; position: sticky; top: 16px; display: flex; flex-direction: column; gap: 12px; }
.buybox .people-row { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
.buybox .big-input { width: 100%; font-size: 24px; font-weight: 700; padding: 10px 14px; }
.buybox .arrive { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; color: var(--muted); align-items: stretch; }
.buybox .arrive select { width: 100%; }
.buybox #as-run { width: 100%; font-size: 16px; padding: 13px; }
.trust { list-style: none; margin: 0; padding: 0 6px; display: flex; flex-direction: column; gap: 4px; color: var(--muted); }
.trust li::before { content: "✓  "; color: var(--brand); font-weight: 700; }
.bb-summary { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.bb-summary .bb-v { font-weight: 700; font-size: 16px; }
.bb-summary .bb-n { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.bb-summary .v-pass { color: var(--green); } .bb-summary .v-warn { color: var(--orange); } .bb-summary .v-fail { color: var(--red); }
@media (max-width: 960px) {
  .plan-layout { grid-template-columns: 1fr; grid-template-areas: "venue" "box" "results"; }
  .buybox { position: static; }
}

/* the venue, found for you */
.found { border: 1px solid color-mix(in srgb, var(--brand) 40%, var(--line)); background: var(--brand-soft);
  border-radius: 12px; padding: 14px 16px; margin: 10px 0; }
.found-head { display: flex; gap: 12px; align-items: flex-start; }
.found-pin { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: grid;
  place-items: center; font-weight: 700; flex: none; }
.found .btns { margin-top: 12px; }

/* step headings and choices */
.step-h { font-size: 20px; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; letter-spacing: -.01em; }
.step-h .num { background: var(--brand-soft); color: var(--brand); }
.choice-btn { border-radius: 12px; text-align: left; }
.choice-btn[aria-pressed="true"] { border-color: var(--brand); box-shadow: var(--ring); background: var(--brand-soft); }

/* results: a calm scorecard */
.score { border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; margin-bottom: 16px; background: var(--panel); }
.score-head { display: flex; gap: 14px; align-items: center; padding: 16px 18px; color: var(--ink); }
.score.v-pass .score-head { background: var(--green-soft); }
.score.v-warn .score-head { background: var(--orange-soft); }
.score.v-fail .score-head { background: var(--red-soft); }
.score-head .v-icon { color: var(--on-brand); width: 40px; height: 40px; font-size: 20px; }
.score.v-pass .v-icon { background: var(--green); } .score.v-warn .v-icon { background: var(--orange); } .score.v-fail .v-icon { background: var(--red); }
.score-head .v-head { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.score.v-pass .v-head { color: var(--green); } .score.v-warn .v-head { color: var(--orange); } .score.v-fail .v-head { color: var(--red); }
.score-head .v-sub { color: var(--muted); font-size: 13.5px; }
.score-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); border-top: 1px solid var(--line); }
.score-nums .num { padding: 14px 18px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.score-nums .num:last-child { border-right: 0; }
.score-nums .n { font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.score-nums .l { font-size: 13px; color: var(--muted); }
.score-nums .num.bad .n { color: var(--red); }
.score-nums .num.good .n { color: var(--green); }
.todo { list-style: none; counter-reset: todo; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 8px; }
.todo li { counter-increment: todo; display: flex; gap: 12px; align-items: flex-start; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.todo li::before { content: counter(todo); flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid;
  place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 13px; }
.next-step { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line)); border-radius: var(--radius);
  padding: 14px 16px; margin: 14px 0; }
.next-step p { margin: 0; }
details.why > summary, details.more > summary { cursor: pointer; font-weight: 700; margin: 10px 0; }
.caveat { border: 1px solid color-mix(in srgb, var(--orange) 35%, var(--line)); background: var(--orange-soft);
  border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; font-size: 14.5px; }
.caveat-mini { color: var(--orange); margin-top: 6px; }

/* step 3: the main button in front, the assumptions one click away */
.ov-form { display: flex; flex-direction: column; gap: 12px; }
.ov-go { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ov-assume { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.ov-assume > summary { cursor: pointer; list-style: none; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ov-assume > summary::-webkit-details-marker { display: none; }
.ov-assume > summary .link { color: var(--accent); margin-left: auto; }
.ov-assume-body { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 12px; }
.ov-assume-body fieldset.modes { grid-column: 1 / -1; }
.ov-assume-body .ov-detailed, .ov-assume-body .ov-file { grid-column: 1 / -1; display: block; color: var(--ink); }
.ov-assume-body .ov-detailed input { width: auto; margin-right: 6px; vertical-align: -2px; }

@media (max-width: 600px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .nav-search { order: 3; flex-basis: 100%; }
  .nav-go { padding: 7px 12px; }
  .subnav { padding: 0; }
  .subnav button { border-bottom: 0; padding: 9px 2px; }
  .subnav button[aria-selected="true"] { color: var(--brand); background: var(--brand-soft); border-radius: 10px; }
  .subnav-note { display: none; }
  .hero { padding: 4px 2px 12px; }
  .hero h1 { font-size: 25px; }
  .hero p { font-size: 15px; }
  .guide li { padding: 6px 10px 6px 6px; font-size: 13px; }
  .guide .sep { display: none; }
  .card { padding: 16px; }
  .score-head .v-head { font-size: 18px; }
  .score-nums .n { font-size: 22px; }
  /* one search box on phones: the one in the header (the card keeps "Where am I") */
  #wi-map-search input, #wi-map-search button:not(#wi-locate) { display: none; }
}

/* before a place is found the map stays small, with a hint, instead of a whole-world map */
.wi-map { transition: height .25s ease; }
.wi-map.idle { height: 200px !important; }
.map-hint { position: absolute; inset: 0; display: grid; place-items: center; z-index: 500; pointer-events: none; }
.map-hint span { background: color-mix(in srgb, var(--panel) 92%, transparent); color: var(--ink); padding: 10px 14px;
  border-radius: 999px; font-weight: 600; box-shadow: var(--shadow); }
#wi-builder:not(.has-venue) .builder-lists { display: none; }
.builder-lists { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-top: 10px; }
.builder-lists > summary { cursor: pointer; }

/* ================================================================================================
   Fluid layer: sizes that scale smoothly with the screen, gentle motion, and the theme switch.
   ================================================================================================ */
:root { --gap: clamp(12px, 1.6vw, 18px); --pad: clamp(14px, 2.4vw, 22px); }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { font-size: clamp(15px, 14.2px + .25vw, 16px); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility; }
h1, h2, h3, .v-head, .step-h { text-wrap: balance; }
p, li, .small { text-wrap: pretty; }
::selection { background: color-mix(in srgb, var(--brand) 28%, transparent); }
.tab { padding: var(--pad) clamp(12px, 3vw, 28px); }
.card { padding: var(--pad); }
.plan-layout, .pl-results, .flow { gap: var(--gap); }
.hero h1 { font-size: clamp(25px, 18px + 1.8vw, 36px); line-height: 1.15; }
.hero p { font-size: clamp(15px, 14px + .3vw, 17px); }
.step-h { font-size: clamp(17px, 15px + .5vw, 20px); }
.score-head .v-head { font-size: clamp(18px, 15px + .8vw, 23px); }
.score-nums .n { font-size: clamp(21px, 17px + 1vw, 28px); }
.ov-map { height: clamp(340px, 62vh, 600px); }

/* touch: big enough to hit, no hover states that stick after a tap */
@media (pointer: coarse) { button:not(.link), select { min-height: 40px; } }
@media (hover: none) {
  button:hover { background: var(--panel); border-color: var(--line); }
  button.primary:hover, .btn-buy:hover, .btn-next:hover, .nav-go:hover { background: var(--brand); border-color: var(--brand); }
  .subnav button:hover, button.link:hover, .theme-btn:hover { background: none; }
}
button:active:not(:disabled) { transform: scale(.98); }
button { transition: background .15s, border-color .15s, box-shadow .15s, transform .08s; }

/* the theme switch: a quiet round button in the header */
.theme-btn { flex: none; width: 40px; height: 40px; padding: 0; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--panel); color: var(--muted); }
.theme-btn:hover { color: var(--ink); background: var(--bg); }
.theme-btn svg { transition: transform .35s ease; }
.theme-btn:active svg { transform: rotate(-30deg); }
:root.theming, :root.theming * , :root.theming *::before {
  transition: background-color .3s ease, border-color .3s ease, color .3s ease, fill .3s ease !important; }

/* street maps sit quieter in the dark theme; satellite imagery is left as it is */
:root[data-theme="dark"] .street-tiles { filter: brightness(.78) contrast(1.08) saturate(.85); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .street-tiles { filter: brightness(.78) contrast(1.08) saturate(.85); }
}
.leaflet-container { background: var(--bg); font: inherit; }
.leaflet-container .leaflet-bar a, .leaflet-container .leaflet-control-layers { background-color: var(--panel); color: var(--ink);
  border-color: var(--line); }
.leaflet-container .leaflet-bar a:hover { background-color: var(--bg); }
.leaflet-container .leaflet-bar { border-color: var(--line); }
.leaflet-control-layers-expanded { color: var(--ink); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--ink); }

/* gentle motion: sections and answers ease in instead of popping */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tab.active { animation: rise .22s ease-out; }
#as-result:not([hidden]), #ov-out:not([hidden]), #bb-summary:not([hidden]), .found { animation: rise .3s ease-out; }
.todo li { animation: rise .3s ease-out backwards; }
.todo li:nth-child(2) { animation-delay: .04s; } .todo li:nth-child(3) { animation-delay: .08s; }
.todo li:nth-child(4) { animation-delay: .12s; } .todo li:nth-child(n+5) { animation-delay: .16s; }
.as-read { min-height: 1.4em; margin-top: 4px; color: var(--brand); font-weight: 600; }
details > summary { transition: color .15s; }
details > summary:hover { color: var(--brand); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

@media (max-width: 600px) {
  .brand { flex: 1; }
  .theme-btn { width: 38px; height: 38px; }
}

/* scorecard dividers drawn by the grid gap, so they stay right however many columns fit */
.score-nums { gap: 1px; background: var(--line); }
.score-nums .num, .score-nums .num:last-child { border-right: 0; background: var(--panel); }
