:root {
  color-scheme: light;
  --ink: #201c21; --muted: #6d626a; --accent: #bd1741; --accent-hover: #a41136;
  --line: #ece4e8; --soft: #f8f4f6; --rose: #fbedf1; --paper: #fff;
  --shadow: 0 12px 34px #3921311c;
  font: 15px/1.4 "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink); background: #f9f7f8;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button svg, a svg { flex: none; }
[hidden] { display: none !important; }
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.header { background: #fff; border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.header-inner { max-width: 1450px; margin: 0 auto; min-height: 76px; padding: 0 32px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; }
.brand img { width: 124px; height: auto; display: block; }
.city-button, .header-help { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 43px; border-radius: 12px; padding: 0 12px; }
.city-button { border: 1px solid var(--line); background: #fff; font-size: 14px; font-weight: 700; }
.city-button svg:first-child, .header-help svg { color: var(--accent); }
.city-button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-help { margin-left: auto; color: var(--ink); font-weight: 650; }
.header-help:hover, .city-button:hover { background: var(--soft); }
.workspace { width: min(100%, 1450px); margin: 0 auto; padding: 26px 32px 30px; flex: 1; display: grid;
  grid-template-columns: minmax(340px, 410px) minmax(0, 1fr); gap: 24px; align-items: start; }
.map-area { grid-column: 2; grid-row: 1; position: sticky; top: 16px; isolation: isolate;
  min-height: 530px; height: calc(100dvh - 132px); border: 1px solid #e5dfe1; border-radius: 24px; overflow: hidden; background: #eaece3; }
#map { position: absolute; inset: 0; background-color: #e9ede4; }
.leaflet-container .leaflet-tile-pane { filter: saturate(.78); }
.leaflet-container .leaflet-control-attribution { font: 11px/1.4 "Segoe UI", system-ui, sans-serif; margin: 0 4px 5px 0;
  border-radius: 6px; padding: 2px 6px; background: #fffe; color: #4d484c; }
.leaflet-control-attribution a { text-decoration: underline; color: #3c5966; }
.demo-tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; }
.map-tools { z-index: 1000; position: absolute; right: 17px; top: 50%; transform: translateY(-50%); display: grid; gap: 12px; }
.zoom-tools { display: grid; border-radius: 13px; overflow: hidden; box-shadow: var(--shadow); }
.map-tools button { border: 0; display: grid; place-items: center; height: 42px; width: 42px; background: white; }
.map-tools button:not(:disabled):hover { background: var(--rose); }
.zoom-tools button + button { border-top: 1px solid var(--line); }
#locate { color: var(--accent); border-radius: 13px; box-shadow: var(--shadow); }
.map-note { position: absolute; z-index: 1000; bottom: 27px; left: 14px; max-width: calc(100% - 70px); padding: 8px 11px;
  border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 10px; font-size: 12px; }
.map-pin { display: grid; place-items: center; background: var(--accent); color: white; border-radius: 50% 50% 50% 7px;
  transform-origin: 50% 50%; border: 2px solid #fff; box-shadow: 0 3px 10px #28212548; font-size: 15px; font-weight: 800; }
.map-pin--finish { background: #2e2330; }
.map-pin--stop { background: #fff; color: var(--accent); border-color: var(--accent); }
.map-car { display: grid; place-items: center; }
.map-car > span { position: relative; transform: rotate(var(--car-heading, 0deg)); }
.map-car img { display: block; width: 40px; height: 40px; filter: drop-shadow(0 0 1px white) drop-shadow(0 2px 2px #2e233078); }
.map-car--assigned::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent);
  background: #fff9; box-shadow: 0 2px 8px #39213140; }
.map-center-pin { position: absolute; z-index: 900; left: 50%; top: 50%; width: 24px; height: 24px;
  background: var(--accent); border: 3px solid white; border-radius: 50% 50% 50% 10%; pointer-events: none;
  transform: translate(-50%, -94%) rotate(-45deg); box-shadow: 0 3px 9px #28212550; transition: margin-top .17s; }
.map-center-pin.moving { margin-top: -5px; }

.panel { grid-column: 1; grid-row: 1; min-width: 0; display: flex; flex-direction: column; background: #fff;
  border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 8px 30px #56273b0d; overflow: clip; }
.view { padding: 23px 24px 20px; min-width: 0; }
.panel-grip { display: none; }
.section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin: 0 0 19px; }
.section-title p { color: var(--muted); font-size: 14px; margin: 5px 0 0; }
h1, h2, p { margin-block-start: 0; }
h1 { margin: 0; font-size: clamp(25px, 3vw, 35px); line-height: 1.08; letter-spacing: -.046em; font-weight: 770; }
h2 { margin: 0; font-size: 23px; letter-spacing: -.025em; line-height: 1.12; }
.demo-tag { flex: none; align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; margin-top: 4px;
  font-size: 11px; font-weight: 750; color: #8c2845; background: var(--rose); border-radius: 25px; padding: 5px 8px; white-space: nowrap; }
.demo-tag i { width: 6px; height: 6px; }
.address-card { border: 1px solid var(--line); border-radius: 16px; background: var(--soft); padding: 1px 12px; position: relative; }
.address-card:not(.summary)::before { content: ""; position: absolute; top: 31px; bottom: 31px; left: 24px; border-left: 1px dashed #c8adb7; }
.address-row { position: relative; display: flex; align-items: center; gap: 12px; min-height: 57px; }
.address-row + .address-row { border-top: 1px solid #eae0e5; }
.dot { position: relative; z-index: 1; display: grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px;
  border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; box-shadow: 0 0 0 4px var(--soft); }
.dot-end { background: #2e2330; }
.dot-stop { background: var(--rose); color: var(--accent); outline: 1px solid #efc8d4; }
.address-button { flex: 1; min-width: 0; align-self: stretch; border: 0; padding: 5px 0; text-align: left; background: none; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.address-button > span { min-width: 0; }
.address-button:hover strong, .address-button:hover .placeholder { color: var(--accent); }
.address-button svg { color: #82747c; }
.address-button strong, .summary strong { display: block; font-size: 15px; line-height: 1.2; overflow-wrap: anywhere; }
.address-button small, .summary small, .vehicle-card small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 2px; }
.placeholder { font-size: 16px; font-weight: 650; }
.trip-tools { display: flex; justify-content: space-between; margin: 4px 0 8px; gap: 4px; }
.text-button { min-height: 38px; display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px; color: var(--accent); border: 0; background: transparent; font-size: 13px; font-weight: 700; }
.text-button svg { width: 17px; }
.text-button:hover, .support-link:hover { text-decoration: underline; }
.quiet { color: var(--muted); }
.settings { display: flex; gap: 7px; align-items: stretch; margin-bottom: 16px; }
.setting { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; gap: 5px; padding: 7px 3px; min-height: 62px; background: #fff; border: 1px solid var(--line); border-radius: 12px; font-size: 12px; font-weight: 660; }
.setting svg { color: var(--accent); width: 19px; height: 19px; }
button.setting:hover { background: var(--soft); border-color: #e7cbd6; }
.estimate, .vehicle-card { display: flex; align-items: center; gap: 11px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 15px; margin-bottom: 12px; }
.estimate-icon, .list-icon { flex: none; width: 41px; height: 41px; border-radius: 11px; background: var(--rose); display: grid; place-items: center; color: var(--accent); }
.estimate-label { flex: 1; min-width: 0; }
.estimate-label b { display: block; font-size: 14px; }
.estimate-label small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.estimate > strong { font-weight: 800; font-size: 21px; white-space: nowrap; }
.primary, .secondary { min-height: 48px; width: 100%; border-radius: 13px; padding: 10px 13px; display: flex; align-items: center;
  justify-content: center; gap: 9px; font-size: 15px; font-weight: 720; border: 1px solid transparent; }
.primary { background: var(--accent); color: white; min-height: 51px; }
.primary:hover:not(:disabled) { background: var(--accent-hover); }
.primary:disabled { background: #f2dce5; color: #7a4257; }
.primary svg, .secondary svg { width: 18px; height: 18px; }
.secondary { margin-top: 9px; background: var(--soft); border-color: var(--line); color: var(--ink); }
.secondary:hover { background: #f1e8ed; }
.secondary.small { width: auto; min-height: 37px; padding: 5px 9px; margin: 0; font-size: 13px; }
.danger { color: var(--accent); }
.driver-actions { display: flex; gap: 8px; }
.driver-actions .secondary { flex: 1; font-size: 13px; }
.chat-feed { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; min-height: 120px;
  max-height: 36dvh; overflow: auto; padding: 4px 3px; }
.chat-feed > p { align-self: flex-start; }
.chat-message { max-width: 88%; padding: 8px 11px; background: var(--rose); border-radius: 12px 12px 2px 12px;
  white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-message.incoming { align-self: flex-start; background: var(--soft); border-radius: 12px 12px 12px 2px; }
.chat-message small { color: var(--muted); display: block; white-space: normal; }
#chat-status { color: var(--accent); font-size: 13px; margin: 6px 0; }
.chat-form { display: flex; align-items: flex-end; gap: 8px; }
.chat-form textarea { flex: 1; min-width: 0; resize: vertical; font-size: 16px; color: var(--ink); background: var(--soft);
  border: 1px solid var(--line); border-radius: 11px; padding: 8px; }
.chat-form button { flex: 0 0 auto; width: auto; min-height: 45px; font-size: 13px; }
.footnote, .muted { color: var(--muted); }
.footnote { margin: 8px 0 0; font-size: 11px; text-align: center; }
.footnote a { text-decoration: underline; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); min-height: 66px; margin-top: auto; border-top: 1px solid var(--line); padding: 3px 7px 4px; background: #fff; }
.tabs button { border: 0; position: relative; border-radius: 12px; background: transparent; display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 2px; color: var(--muted); font-size: 11px; font-weight: 650; padding: 5px 0; }
.tabs button[aria-current] { color: var(--accent); }
.tabs button[aria-current]::before { content: ""; position: absolute; top: 0; width: 22px; height: 2px; border-radius: 4px; background: var(--accent); }
.tabs button:hover { background: var(--soft); }
.panel.picking .tabs { display: none; }
.icon-button, #close-dialog { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px; background: none; border: 0; color: var(--muted); }
.icon-button:hover, #close-dialog:hover { color: var(--accent); background: var(--soft); }
.notice { display: flex; align-items: flex-start; gap: 8px; color: #6c3547; background: var(--rose); border: 1px solid #f3dbe4; padding: 9px; border-radius: 11px; margin: 0 0 9px; font-size: 12px; }
.notice svg { flex: none; }
.notice span { flex: 1; }
.inline-button { background: transparent; padding: 0; font-weight: 700; color: var(--accent); border: 0; text-decoration: underline; }
.summary { margin-bottom: 12px; }
.vehicle-card > div:nth-child(2) { flex: 1; }
.vehicle-card strong { display: block; line-height: 1.16; font-size: 15px; }
.plate { font-size: 13px; border: 1px solid currentColor; padding: 4px 6px; border-radius: 6px; white-space: nowrap; }
.total { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 13px; }
.total strong { font-size: 24px; }
.support-link { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; color: var(--accent); font-size: 13px; font-weight: 680; margin-top: 7px; }
.empty { color: var(--muted); display: grid; gap: 9px; justify-items: center; text-align: center; padding: 22px 5px; }
.empty > svg { color: var(--accent); }
.empty strong { color: var(--ink); }
.empty p { margin: 0; }

dialog { padding: 0; width: min(100% - 32px, 460px); border: 1px solid var(--line); border-radius: 20px; max-height: 86dvh; color: var(--ink); box-shadow: 0 20px 60px #35262d3f; overflow: auto; }
dialog::backdrop { background: #29192460; }
.dialog-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); padding: 14px 17px; background: #fff; }
#dialog-body { padding: 16px 17px 19px; }
.search-box { display: flex; gap: 7px; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); padding: 0 10px; margin-bottom: 9px; color: var(--accent); }
.search-box input { width: 100%; min-width: 0; background: transparent; border: 0; color: var(--ink); padding: 11px 3px; min-height: 46px; font-size: 16px; }
.search-box:focus-within { border-color: var(--accent); }
.search-box input:focus { outline: none; }
.map-choice { margin-bottom: 5px; }
.list-box { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.list-row { border: 0; background: #fff; display: flex; align-items: center; text-align: left; gap: 10px; width: 100%; padding: 8px 7px; min-height: 55px; }
.list-row:hover { background: var(--soft); }
.list-row > span:nth-child(2) { flex: 1; min-width: 0; }
.list-row strong, .option-row strong { display: block; overflow-wrap: anywhere; font-size: 14px; font-weight: 710; }
.list-row small, .option-row small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.list-row + .list-row, .address-result + .address-result { border-top: 1px solid var(--line); }
.list-icon { width: 35px; height: 35px; background: var(--rose); border-radius: 9px; }
.list-row > svg { margin-left: auto; color: var(--muted); }
.address-result { display: flex; align-items: center; }
.address-result .list-row { flex: 1; min-width: 0; }
.address-result .list-row > svg { display: none; }
.favorite.saved { color: var(--accent); }
.favorite.saved svg { fill: #f3bccc; }
.field { display: grid; gap: 6px; margin: 12px 0; font-size: 13px; font-weight: 650; }
.field input, .field textarea, .field select { border: 1px solid var(--line); border-radius: 10px; padding: 9px; font-size: 16px; color: var(--ink); min-width: 0; width: 100%; background: var(--soft); }
.field textarea { min-height: 75px; resize: vertical; }
.option-list { max-height: min(41dvh, 365px); overflow: auto; }
.option-row { display: flex; align-items: center; justify-content: space-between; gap: 9px; min-height: 45px; border-bottom: 1px solid var(--line); padding: 6px 3px; cursor: pointer; }
.option-row input { accent-color: var(--accent); width: 18px; height: 18px; }
.ratings { padding: 0; border: 0; display: flex; gap: 5px; }
.ratings label { flex: 1; }
.ratings input { position: absolute; opacity: 0; }
.ratings span { display: block; padding: 8px 3px; border-radius: 8px; background: var(--soft); text-align: center; cursor: pointer; white-space: nowrap; }
.ratings input:checked + span { color: #fff; background: var(--accent); }
.ratings input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.referral-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.referral-stats > div { padding: 9px 5px; text-align: center; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; }
.referral-stats b { display: block; font-size: 19px; color: var(--accent); }
.referral-stats small { display: block; color: var(--muted); font-size: 11px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.toast { position: fixed; z-index: 2000; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); padding: 11px 14px; color: #fff; background: #33202c; border-radius: 12px; box-shadow: var(--shadow); width: max-content; max-width: calc(100vw - 30px); font-size: 13px; }

@media (max-width: 760px) {
  .header-inner { min-height: 59px; gap: 11px; padding: 0 14px; }
  .brand img { width: 98px; }
  .city-button { min-height: 36px; padding: 0 7px; max-width: calc(100vw - 158px); gap: 4px; font-size: 13px; border-radius: 9px; }
  .city-button svg:first-child { width: 14px; }
  .header-help { padding: 0; width: 34px; min-height: 36px; }
  .header-help span { display: none; }
  .workspace { display: flex; flex-direction: column; padding: 0; gap: 0; align-items: stretch; }
  .map-area { height: clamp(175px, calc(100dvh - 548px), 44dvh); min-height: 0; position: relative; top: auto; border: 0; border-radius: 0; flex: none; }
  .map-tools { right: 10px; gap: 8px; }
  .map-tools button { width: 36px; height: 35px; }
  .map-tools button svg { width: 18px; }
  .panel { margin: -1px 0 0; min-height: 380px; border-radius: 18px 18px 0 0; border-width: 1px 0 0; position: relative; overflow: visible; flex: 1; }
  .view { padding: 10px clamp(13px, 4vw, 23px) 13px; }
  .panel-grip { display: block; width: 34px; height: 4px; background: #dfd4da; border-radius: 5px; margin: 0 auto 11px; }
  .section-title { margin-bottom: 13px; }
  .section-title p { margin-top: 4px; font-size: 13px; }
  .address-row { min-height: 49px; }
  .trip-tools { margin: 2px 0 5px; }
  .settings { margin-bottom: 9px; }
  .setting { min-height: 53px; gap: 3px; }
  .estimate { margin-bottom: 8px; padding: 7px 9px; }
  .estimate-icon { width: 35px; height: 35px; }
  .estimate-icon svg { width: 21px; }
  .tabs { min-height: 55px; position: sticky; bottom: 0; z-index: 1001;
    padding-bottom: max(3px, env(safe-area-inset-bottom)); }
  dialog { position: fixed; inset: auto 0 0; margin: 0; width: 100%; max-width: 100%; max-height: 86dvh; border-radius: 18px 18px 0 0; }
  #dialog-body { padding-bottom: max(17px, env(safe-area-inset-bottom)); }
  .toast { bottom: max(65px, calc(env(safe-area-inset-bottom) + 56px)); }
}
@media (max-width: 350px) {
  .estimate-label b { font-size: 13px; }
  .estimate > strong { font-size: 18px; }
}
