:root {
    color-scheme: light;
    --ink: #171a22;
    --muted: #747985;
    --paper: #fffdf9;
    --line: #e9e7e2;
    --lime: #d9ff43;
    --lime-dark: #bddf29;
    --shadow: 0 24px 70px rgba(31, 35, 45, .16);
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; }
body { margin: 0; overflow: hidden; background: #e7e7e2; color: var(--ink); font-family: 'Manrope', 'Segoe UI', system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { color: inherit; }
#map { position: fixed; inset: 0; z-index: 0; }

.leaflet-control-attribution { font-size: 9px !important; opacity: .72; }
.leaflet-control-attribution a[href*="leaflet"] { display: none !important; }
.leaflet-control-zoom { border: 0 !important; border-radius: 14px !important; overflow: hidden; box-shadow: 0 8px 24px rgba(31,35,45,.14) !important; }
.leaflet-control-zoom a { border: 0 !important; color: var(--ink) !important; }

.topbar { position: fixed; z-index: 600; top: 0; left: 0; right: 0; height: 86px; padding: 0 34px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.brand, .location-button { pointer-events: auto; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-size: 20px; font-weight: 800; letter-spacing: -.055em; }
.brand > span:last-child { padding: 8px 13px 8px 4px; border-radius: 12px; background: rgba(255,255,255,.88); box-shadow: 0 5px 18px rgba(31,35,45,.1); }
.brand > span:last-child span { color: #777b83; }
.brand-mark { position: relative; display: block; width: 38px; height: 38px; border-radius: 12px; background: var(--ink); box-shadow: 0 5px 18px rgba(31,35,45,.18); }
.brand-mark i { position: absolute; display: block; background: var(--lime); border-radius: 20px; transform: rotate(-40deg); }
.brand-mark i:first-child { width: 8px; height: 25px; left: 12px; top: 6px; }
.brand-mark i:last-child { width: 8px; height: 16px; left: 22px; top: 8px; }

.location-button { border: 0; border-radius: 14px; background: rgba(255,255,255,.94); min-height: 46px; padding: 0 16px; display: inline-flex; align-items: center; gap: 9px; box-shadow: 0 8px 28px rgba(31,35,45,.13); cursor: pointer; font-weight: 700; }
.location-button:hover { background: white; }
.location-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.search-panel { position: fixed; z-index: 500; left: 30px; top: 102px; width: min(410px, calc(100vw - 60px)); max-height: calc(100vh - 128px); overflow: auto; padding: 31px; border: 1px solid rgba(255,255,255,.78); border-radius: 28px; background: rgba(255,253,249,.96); box-shadow: var(--shadow); scrollbar-width: thin; }
.panel-heading { margin-bottom: 23px; }
.eyebrow { margin: 0 0 6px !important; color: #899053 !important; font-size: 11px !important; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.panel-heading h1 { margin: 0; font-size: 34px; line-height: 1.08; letter-spacing: -.055em; }
.panel-heading p { margin: 9px 0 0; color: var(--muted); font-size: 14px; }

.route-fields { position: relative; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.address-field { position: relative; min-height: 73px; padding: 13px 53px 10px 51px; }
.address-field label { display: block; margin-bottom: 2px; color: #9498a2; font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.pick-field { position: absolute; top: 9px; right: 13px; padding: 3px 7px; border: 0; border-radius: 7px; background: transparent; color: #92968a; cursor: pointer; font-size: 9px; font-weight: 800; }
.pick-field:hover, .pick-field.active { background: var(--lime); color: var(--ink); }
.address-field input { width: 100%; border: 0; outline: 0; padding: 0; background: transparent; color: var(--ink); font-size: 15px; font-weight: 650; text-overflow: ellipsis; }
.address-field input::placeholder { color: #b5b7bd; font-weight: 500; }
.field-divider { height: 1px; margin: 0 49px; background: var(--line); }
.route-line { position: absolute; z-index: 2; left: 23px; top: 26px; bottom: 27px; width: 10px; display: flex; flex-direction: column; align-items: center; }
.route-line i { width: 9px; height: 9px; flex: 0 0 auto; border: 2px solid var(--ink); border-radius: 50%; background: white; }
.route-line span { width: 1px; flex: 1; margin: 4px 0; background: repeating-linear-gradient(to bottom, #adb0b7 0 3px, transparent 3px 6px); }
.route-line b { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 2px; background: var(--ink); }
.clear-field { position: absolute; right: 12px; bottom: 15px; width: 31px; height: 31px; display: none; border: 0; border-radius: 50%; background: #f1f1ee; color: #8b8e95; cursor: pointer; font-size: 20px; line-height: 1; }
.address-field.has-value .clear-field { display: block; }
.swap-button { position: absolute; z-index: 4; top: 55px; right: 13px; width: 36px; height: 36px; display: grid; place-items: center; border: 4px solid white; border-radius: 50%; background: #f0f1ec; cursor: pointer; }
.swap-button:hover { background: var(--lime); }
.swap-button svg { width: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.suggestions { position: absolute; z-index: 1000; left: 11px; right: 11px; top: calc(100% + 7px); display: none; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: 0 18px 45px rgba(31,35,45,.18); }
.suggestions.open { display: block; }
.suggestion { width: 100%; padding: 12px 14px; border: 0; border-bottom: 1px solid #efeee9; background: white; text-align: left; cursor: pointer; }
.suggestion:last-child { border-bottom: 0; }
.suggestion:hover, .suggestion:focus { outline: 0; background: #f6f7f0; }
.suggestion strong { display: block; overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.suggestion span { display: block; overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.suggestion-state { padding: 14px; color: var(--muted); font-size: 12px; }

.primary-button { width: 100%; min-height: 57px; margin-top: 13px; padding: 0 17px 0 20px; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 17px; background: var(--lime); cursor: pointer; font-size: 15px; font-weight: 800; transition: transform .15s ease, background .15s ease; }
.primary-button:hover { background: #e2ff69; transform: translateY(-1px); }
.primary-button:active { transform: translateY(0); }
.primary-button:disabled { cursor: wait; opacity: .65; transform: none; }
.primary-button svg { width: 23px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.map-tip { margin: 9px 2px 0; color: #989b9f; font-size: 9px; line-height: 1.4; text-align: center; }
.route-summary { margin: 17px 2px 0; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.route-summary[hidden] { display: none; }
.route-summary i { width: 3px; height: 3px; border-radius: 50%; background: #b8bbc0; }

.results { margin-top: 22px; }
.results[hidden] { display: none; }
.results-heading { margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.results-heading h2 { margin: 0; font-size: 14px; letter-spacing: -.02em; }
.results-heading span { color: #999ca3; font-size: 10px; }
.provider-card { width: 100%; margin-top: 8px; padding: 14px; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 16px; background: white; color: inherit; text-align: left; text-decoration: none; }
a.provider-card { cursor: pointer; transition: border-color .15s, transform .15s; }
a.provider-card:hover { border-color: #cacfaa; transform: translateY(-1px); }
.provider-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: #15171c; color: white; font-size: 15px; font-weight: 800; }
.provider-icon.yandex { background: #ffdc60; color: #1d1d1f; }
.provider-icon.wb { background: linear-gradient(135deg,#9d28a8,#e52c91); }
.provider-icon.a1 { background: #df1642; }
.provider-name { display: block; font-size: 13px; font-weight: 800; }
.provider-meta { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.provider-price { text-align: right; }
.provider-price strong { display: block; font-size: 15px; white-space: nowrap; }
.provider-price span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.provider-card.disabled { opacity: .55; }
.provider-card.error { grid-template-columns: 42px 1fr; }
.provider-card.error .provider-meta { line-height: 1.35; }
.legal-note { margin: 9px 3px 0; color: #8b8e96; font-size: 9px; line-height: 1.45; }
.legal-note a { color: inherit; }
.panel-note { margin: 21px 4px 0; color: #a3a5aa; font-size: 9px; line-height: 1.5; }

.toast { position: fixed; z-index: 2000; left: 50%; bottom: 28px; max-width: min(420px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 13px; background: #171a22; color: white; box-shadow: 0 14px 35px rgba(0,0,0,.22); font-size: 12px; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.taxi-marker { background: transparent; border: 0; }
.leaflet-container.picking-point { cursor: crosshair; }
.marker-pin { width: 28px; height: 28px; display: grid; place-items: center; border: 3px solid white; border-radius: 50% 50% 50% 6px; background: var(--ink); box-shadow: 0 5px 14px rgba(31,35,45,.28); transform: rotate(-45deg); }
.marker-pin.to { background: var(--lime-dark); }
.marker-pin i { width: 6px; height: 6px; border-radius: 50%; background: white; transform: rotate(45deg); }
.route-loading .primary-button span::after { content: ''; display: inline-block; width: 12px; height: 12px; margin-left: 9px; border: 2px solid rgba(23,26,34,.25); border-top-color: var(--ink); border-radius: 50%; vertical-align: -2px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 680px) {
    .topbar { height: 68px; padding: 13px 16px 0; align-items: flex-start; }
    .brand { font-size: 17px; }
    .brand-mark { width: 34px; height: 34px; border-radius: 11px; }
    .brand-mark i:first-child { height: 22px; left: 11px; }
    .brand-mark i:last-child { height: 14px; left: 20px; }
    .brand > span:last-child { padding: 7px 10px 7px 3px; }
    .location-button { min-height: 39px; padding: 0 12px; font-size: 12px; }
    .location-button span { display: none; }
    .search-panel { left: 0; top: auto; bottom: 0; width: 100%; max-height: min(68vh, 650px); padding: 20px 17px calc(17px + env(safe-area-inset-bottom)); border: 0; border-radius: 26px 26px 0 0; box-shadow: 0 -12px 40px rgba(31,35,45,.16); }
    .search-panel::before { content: ''; display: block; width: 34px; height: 4px; margin: -10px auto 14px; border-radius: 10px; background: #d7d5d0; }
    .panel-heading { margin-bottom: 16px; }
    .panel-heading h1 { font-size: 27px; }
    .panel-heading p { margin-top: 5px; font-size: 12px; }
    .eyebrow { display: none; }
    .address-field { min-height: 65px; padding-top: 10px; padding-bottom: 8px; }
    .swap-button { top: 48px; }
    .primary-button { min-height: 53px; }
    .panel-note { display: none; }
    .leaflet-control-zoom { display: none; }
    .leaflet-bottom { bottom: min(68vh, 650px); }
    .toast { bottom: calc(min(68vh, 650px) + 14px); }
}

@media (max-height: 720px) and (max-width: 680px) {
    .search-panel { max-height: 76vh; }
    .panel-heading p { display: none; }
    .leaflet-bottom { bottom: 76vh; }
    .toast { bottom: calc(76vh + 10px); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .001ms !important; }
}
