/* Meetline: dispatch console (references: Flightradar24, ride-hail dispatch screens). See design.md. */
:root {
  --ink: #e7eaee;
  --muted: #aab3bd;
  --line: #2a3038;
  --soft: #1f242b;
  --paper: #161a1f;
  --bg: #0e1114;
  --accent: #f2b233;
  --accent-ink: #15120a;
  --accent-soft: #2b2416;
  --radius: 6px;
  --sans: "Manrope", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--sans); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }

.console { display: grid; grid-template-columns: 330px minmax(0, 1fr) 380px; grid-template-rows: 60px minmax(0, 1fr); height: 100vh; height: 100dvh; }
.toolbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding: 0 16px; background: var(--paper); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: baseline; gap: 10px; flex: none; }
.brand-mark { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 1.8; align-self: center; }
.brand-mark circle { fill: var(--paper); }
.brand-mark .brand-meet { fill: var(--accent); stroke: var(--accent); }
.brand-name { font-weight: 700; font-size: 17px; }
.brand-sub { font: 500 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.toolbar-add { flex: 1; display: flex; gap: 8px; max-width: 760px; }
.toolbar .search { flex: 1; }
.col { background: var(--paper); overflow-y: auto; display: flex; flex-direction: column; }
.col-left { border-right: 1px solid var(--line); }
.col-right { border-left: 1px solid var(--line); }
.col-map { position: relative; min-width: 0; }
#map { position: absolute; inset: 0; background: #1b1f24; }
/* Neutral charcoal basemap: the coloured routes are the only colour on the map. */
.leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) grayscale(1) brightness(0.8) contrast(0.95); }

.title { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.block .block-head .label { display: none; }
.label { color: var(--muted); }
.count { color: var(--muted); }
.search input { background: var(--bg); border-color: var(--line); color: var(--ink); height: 40px; }
.search input::placeholder { color: #9aa4ae; }
.suggest { background: var(--paper); border-color: var(--line); }
.suggest-item.is-active, .suggest-item:hover { background: var(--soft); }
.btn-primary:hover { background: #ffc44f; }
.btn-quiet { background: transparent; color: var(--ink); border-color: #3a414a; }
.btn-quiet:hover, .btn-quiet.is-on { background: var(--soft); border-color: var(--ink); }
.person-name:focus { background: var(--bg); }
.person-name:hover { background: var(--soft); }
.mode { border-color: var(--line); }
.mode-btn.is-on { background: var(--ink); color: var(--bg); }
.icon-btn:hover { background: var(--soft); }
.chip { background: transparent; border-color: #3a414a; }
.chip:hover { border-color: var(--ink); }
.chip.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.segs { border-color: #3a414a; }
.seg { background: transparent; }
.seg + .seg { border-left-color: #3a414a; }
.seg.is-on { background: var(--accent-soft); box-shadow: inset 0 -3px 0 var(--accent); }
.status { background: var(--soft); border-bottom-color: var(--line); color: var(--muted); }
.status[data-kind="error"] { color: #ffb4b4; background: #3a1c1c; }
.detail { background: var(--paper); }
.detail-kicker { color: var(--accent); }
.detail-figure-num { color: var(--accent); font-size: 26px; }
.leg-go { color: var(--accent); }
.leg-go:hover { background: var(--accent-soft); }
.leg-mark, .person-mark { box-shadow: 0 0 0 2px var(--paper); color: #0e1114; }
.venue-hit { background: transparent; border-color: var(--line); }
.venue-hit:hover { border-color: #4a525c; }
.venue.is-selected .venue-hit { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); background: #1b1f25; }
.venue-rank { background: var(--soft); }
.venue.is-selected .venue-rank { background: var(--accent); color: var(--accent-ink); }
.venue-stats b { color: var(--ink); }
.strip { border-bottom-color: var(--line); }
.strip-span { background: #3a414a; }
.tick { border-color: var(--paper); }
.foot { margin-top: auto; padding: 14px 20px; font-size: 12px; color: var(--muted); }
.toast { background: var(--ink); color: var(--bg); }
.link { color: var(--accent); }
.pin-person { color: #0e1114; border-color: #0e1114; }
.pin-venue { background: var(--paper); border-color: var(--ink); }
.pin-venue span { color: var(--ink); }
.pin-venue.is-selected { background: var(--accent); border-color: #0e1114; }
.pin-venue.is-selected span { color: var(--accent-ink); }
.pin-label { background: var(--paper); color: var(--muted); }
.pin-label b { color: var(--ink); }
.pin-center { border-color: var(--ink); background: rgba(14, 17, 20, 0.6); }
.pin-center::after { background: var(--ink); }
.search-ring { fill: var(--accent); stroke: var(--accent); }
.leaflet-container { font-family: var(--sans); }
.leaflet-bar a { background: var(--paper); color: var(--ink); border-bottom-color: var(--line); }
.leaflet-control-attribution { background: rgba(22, 26, 31, 0.85) !important; color: var(--muted); }
.leaflet-control-attribution a { color: var(--ink); }


/* ---- hone2 r1: clearer people rows, one primary per state, plain stats ---- */
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.block-head .title { margin: 0; }
.block .label { margin: 0 0 10px; }
.block-options .chips + .label { margin-top: 16px; }

.person { grid-template-columns: 32px minmax(0, 1fr) 28px; align-items: center; row-gap: 10px; padding: 12px 0; }
.person-place { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.person .mode { grid-column: 1 / -1; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.15fr; gap: 2px; padding: 2px; border-radius: var(--radius); }
.person .mode-btn { width: auto; height: 30px; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 0 4px; font-size: 12.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.person .mode-btn svg { width: 16px; height: 16px; flex: none; }
.person .mode-btn:hover { color: var(--ink); background: var(--soft); }
.person .mode-btn.is-on { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(242, 178, 51, 0.55); }

/* Use my location is the primary action only until there is a result; then Share is. */
.btn-locate { background: transparent; color: var(--ink); border-color: #3a414a; }
.btn-locate:hover { background: var(--soft); border-color: var(--ink); }
html[data-result="false"] .btn-locate { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
html[data-result="false"] .btn-locate:hover { background: #ffc44f; }

.detail-name { font-size: 24px; font-weight: 700; letter-spacing: -0.015em; }
.detail-figure-num { font-size: 28px; }

.results-hint { margin: -4px 0 12px; font-size: 12.5px; color: var(--muted); }
.venue-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-width: 0; }
.venue-max { flex: none; font-size: 12.5px; color: var(--muted); }
.venue-max b { font: 500 14px var(--mono); color: var(--ink); }
.venue.is-selected .venue-max b { color: var(--accent); }
.venue-also { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.venue-hours { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.venue-hours.is-open { color: var(--ink); }
.detail-hours { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.detail-hours.is-open { color: var(--ink); font-weight: 600; }
.detail-facts { margin: 2px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.detail-facts .fact-link { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.detail-facts .fact-link:hover { color: var(--accent); }
.strip { margin: 10px 0 2px; }
.strip-axis { display: flex; justify-content: space-between; font: 500 10.5px var(--mono); color: #9aa4ae; margin-bottom: 6px; }
.venue-stats { gap: 4px 14px; font-size: 12.5px; }

.block-how { border-bottom: 0; }
.how { margin: 0 0 12px; padding-left: 20px; color: var(--muted); font-size: 13px; }
.how li { margin-bottom: 6px; padding-left: 2px; }
.how li::marker { font: 500 12px var(--mono); color: var(--accent); }
.privacy { margin: 0; padding-left: 10px; border-left: 2px solid var(--line); font-size: 12.5px; color: var(--muted); }
.foot { border-top: 1px solid var(--line); }

@media (max-width: 1100px) {
  .console { grid-template-columns: 320px minmax(0, 1fr); grid-template-rows: 60px minmax(0, 1fr) auto; }
  .brand-sub { display: none; }
  .toolbar .search { min-width: 200px; }
  .col-right { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); max-height: 45vh; }
}
@media (max-width: 760px) {
  /* Phone: one column in task order - add people, map, group, options, result, ranked list, how it works. */
  .console { display: flex; flex-direction: column; height: auto; }
  .toolbar { flex-wrap: wrap; padding: 10px 12px; gap: 8px; position: static; }
  .toolbar-add { order: 3; flex: 1 1 100%; flex-wrap: wrap; }
  .toolbar .search { flex: 1 1 100%; }
  .toolbar-add .btn { flex: 1; }
  .col-left, .col-right { display: contents; }
  .col-map { height: 52vh; min-height: 320px; order: 1; }
  .block, .detail, .status, .foot { background: var(--paper); }
  .block-group { order: 2; border-top: 1px solid var(--line); }
  .block-options { order: 3; }
  .status { order: 4; }
  .detail { order: 5; border-top: 1px solid var(--line); }
  #results-wrap { order: 6; }
  .block-how { order: 7; border-bottom: 1px solid var(--line); }
  .foot { order: 8; margin-top: 0; }
  .block, .detail { padding: 16px; }
}
@media (max-width: 359px) {
  /* The result card repeats the label; keep the map pin clean on the narrowest phones. */
  .pin-label { display: none; }
}

/* ---- hone4 r1: one accent action, type roles, calmer phone ---- */
:root { --display: "Barlow Semi Condensed", "Manrope", system-ui, sans-serif; }

/* Type roles: condensed display for names and headings, mono for labels and figures, Manrope for reading. */
.brand-name { font: 600 20px/1 var(--display); letter-spacing: 0.01em; }
.detail-name { font: 600 30px/1.05 var(--display); letter-spacing: 0; }
.venue-name { font: 600 17px/1.2 var(--display); letter-spacing: 0.005em; }
.person-name { font-family: var(--display); font-size: 16px; font-weight: 600; }
.title, .label, .detail-kicker { font: 500 11.5px/1.3 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.detail-kicker { color: var(--accent); }

/* Amber marks only the meeting point, the winning number and the one primary action. */
.leg-go { color: var(--muted); }
.leg-go:hover { color: var(--ink); background: var(--soft); }
.detail-actions { align-items: center; gap: 16px; }
.text-link { color: var(--ink); font-weight: 500; text-decoration: underline; text-decoration-color: #4a525c; text-underline-offset: 3px; }
.text-link:hover { text-decoration-color: var(--ink); }
.text-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* After a result exists, adding people is secondary: ghost buttons, no borders. */
html[data-result="true"] .toolbar-add .btn { border-color: transparent; background: transparent; color: var(--muted); }
html[data-result="true"] .toolbar-add .btn:hover { color: var(--ink); background: var(--soft); }

@media (max-width: 760px) {
  /* The result card directly below the map names the place; the pin label only collided with routes. */
  .pin-label { display: none; }
  body { font-size: 15px; }
  .person .mode-btn { height: 40px; font-size: 13.5px; }
  .chip, .seg { min-height: 40px; }
  .venue-hit { padding: 14px; }
  .detail-name { font-size: 28px; }
}

/* hone4 r1b: labelled arrival dots, answer-first phone order once a result exists */
.strip { height: 20px; }
.strip-span { bottom: 8px; }
.tick {
  width: 18px;
  height: 18px;
  margin-left: -9px;
  bottom: 0;
  display: grid;
  place-items: center;
  font: 700 10px/1 var(--mono);
  color: #14171b;
  border-width: 2px;
}
@media (max-width: 760px) {
  html[data-result="true"] .status { order: 2; }
  html[data-result="true"] .detail { order: 3; border-top: 1px solid var(--line); }
  html[data-result="true"] .block-group { order: 4; }
  html[data-result="true"] .block-options { order: 5; }
  html[data-result="true"] #results-wrap { order: 6; }
}

/* hone4 r2: quieter minor pins, winner ring, collapsible help, phone dock */
.pin-venue.is-minor { width: 22px; height: 22px; border-width: 1.5px; border-color: #8a939d; background: #1f242b; opacity: 0.9; }
.pin-venue.is-minor span { font-size: 10px; color: #c9cfd6; }
.pin-venue.is-selected { box-shadow: 0 0 0 6px rgba(242, 178, 51, 0.22), 0 2px 6px rgba(0, 0, 0, 0.5); }
.block-how summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 32px; }
.block-how summary::-webkit-details-marker { display: none; }
.block-how summary::after { content: "+"; font: 500 14px var(--mono); color: var(--muted); }
.block-how[open] summary::after { content: "\2212"; }
.block-how[open] summary { margin-bottom: 8px; }
.block-how summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 760px) {
  /* With an answer, a shorter map lets the result and Share fit in the first screen. */
  html[data-result="true"] .col-map { height: 44vh; min-height: 300px; }
}
.share-note { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }

/* ---- hone5 r2: arrival bars (every bar ends at the venue), departure order, fair zone label ---- */
.leg { row-gap: 6px; }
.leg-bar { grid-column: 2 / -1; display: flex; justify-content: flex-end; height: 3px; border-radius: 2px; background: rgba(231, 234, 238, 0.07); overflow: hidden; }
.leg-bar i { display: block; height: 100%; border-radius: 2px; background: var(--c); opacity: 0.85; }
.depart-line { margin: -4px 0 14px; font-size: 13px; color: var(--muted); }
.depart-line b { color: var(--ink); font-weight: 600; }
.depart-line .nowrap { white-space: nowrap; }
.ring-label-wrap { background: none; border: 0; }
.ring-label { display: inline-block; padding: 2px 7px; border-radius: 3px; background: rgba(14, 17, 20, 0.82); border: 1px solid rgba(242, 178, 51, 0.5); color: var(--accent); font: 600 10.5px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; pointer-events: none; }
@media (max-width: 760px) {
  .ring-label-wrap { display: none; }
}

/* ---- hone5 r4: visible Add button inside the search field ---- */
.search input { padding-right: 64px; }
.search-add { position: absolute; top: 50%; right: 5px; transform: translateY(-50%); height: 30px; padding: 0 12px; border: 1px solid #3a414a; border-radius: 4px; background: var(--soft); color: var(--ink); font: 600 13px var(--sans); cursor: pointer; }
.search-add:hover { border-color: var(--ink); }
.search-add:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- hone5 r5: departure schedule for everyone, self-explaining zone label ---- */
.depart-line { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.depart-label { flex: 1 1 100%; font: 600 11px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.depart-step { white-space: nowrap; font-size: 13px; color: var(--muted); }
.ring-label-wrap { text-align: center; }
.ring-label { text-transform: none; letter-spacing: 0.02em; }

/* ---- hone5 r6: meeting time with clock leave times, bus/train link per person ---- */
.depart-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: -2px 0 16px; }
.depart-label { flex: 1 1 100%; display: flex; align-items: center; gap: 10px; font: 600 11px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.depart-time { height: 30px; padding: 0 8px; border: 1px solid #3a414a; border-radius: 4px; background: var(--bg); color: var(--ink); font: 500 14px var(--mono); color-scheme: dark; }
.depart-time:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.depart-caption { font-size: 13px; color: var(--muted); }
.depart-step { font-size: 13px; color: var(--muted); white-space: nowrap; }
.depart-step b { color: var(--ink); font-weight: 600; margin-right: 4px; }
.leg-mode { display: flex; flex-wrap: wrap; column-gap: 10px; }
.leg-transit { color: var(--muted); white-space: nowrap; text-decoration: underline; text-decoration-color: rgba(231, 234, 238, 0.3); text-underline-offset: 2px; }
.leg-transit:hover { color: var(--ink); text-decoration-color: var(--accent); }
.depart-caption { flex: 1 1 100%; margin-top: 2px; }
.depart-line { column-gap: 12px; }

/* Live group: one quiet row until used; the form and the connected bar share the same frame. */
.live { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.live[hidden] { display: none; }
.live-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; }
.live-row.is-on { grid-template-columns: 10px minmax(0, 1fr) auto auto; }
.live-icon svg { width: 20px; height: 20px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; display: block; }
.live-text { display: flex; flex-direction: column; min-width: 0; }
.live-text b { font-weight: 600; font-size: 14px; }
.live-text span { font-size: 12.5px; color: var(--muted); }
.live-btn { height: 32px; padding: 0 12px; font-size: 13px; }
.live-leave { font-size: 13px; padding: 4px 2px; color: var(--muted); }
.live-leave:hover { color: var(--ink); }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #4cc27a; box-shadow: 0 0 0 4px rgba(76, 194, 122, 0.18); }
.live-dot[data-status="connecting"], .live-dot[data-status="reconnecting"], .live-dot[data-status="offline"] { background: var(--accent); box-shadow: 0 0 0 4px rgba(242, 178, 51, 0.18); }
.live-form { padding: 12px; }
.live-title { margin: 0; font-weight: 600; font-size: 14px; }
.live-sub { margin: 2px 0 10px; font-size: 12.5px; color: var(--muted); }
.live-fields { display: flex; gap: 8px; }
.live-name { flex: 1; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink); font: inherit; }
.live-name:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.live-go { height: 38px; white-space: nowrap; }
.live-note { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.live-cancel { margin-top: 6px; font-size: 13px; padding: 2px 0; }
.person-live.is-stale { color: var(--muted); }
html[data-live="join"] #empty { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .live-dot[data-status="online"] { animation: live-pulse 2.4s ease-in-out infinite; }
}
@keyframes live-pulse { 50% { box-shadow: 0 0 0 7px rgba(76, 194, 122, 0.05); } }
.live-start { font-size: 13px; font-weight: 600; padding: 4px 2px; color: var(--ink); text-decoration-color: #4a525c; }
.live-start:hover { text-decoration-color: var(--accent); }
.live-opt { font: 500 10.5px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-left: 6px; }
/* Invited to a live group: the join form moves to the top of the panel. */
html[data-live="join"] .block-live, html[data-live="on"] .block-live { order: -1; }
