:root {
  color-scheme: dark;
  --bg: #17191d;
  --panel: #202329;
  --panel-2: #2a2e35;
  --text: #f5f5f2;
  --muted: #a7acb4;
  --accent: #c8ff62;
  --accent-text: #c8ff62;
  --accent-dark: #1e2a0c;
  --line: rgba(255,255,255,.1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #0f1012; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.chip, .filter-card, .cuisine-options, .place-card { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.app-shell { position: relative; width: 100%; max-width: 520px; height: 100dvh; min-height: 560px; margin: 0 auto; overflow: hidden; background: var(--bg); box-shadow: 0 0 60px rgba(0,0,0,.55); }
#map { position: absolute; inset: 0; background: #292d31; }
.maplibregl-control-container { display: none; }
.maplibregl-canvas { outline: none; }
.leaflet-marker-icon { transition: transform .2s ease, filter .2s ease; }
.place-marker { display: block; width: 31px; height: 31px; background: var(--panel); border: 2px solid #fff; border-radius: 50% 50% 50% 6px; transform: rotate(-45deg); box-shadow: 0 3px 12px rgba(0,0,0,.45); }
.place-marker span { display: grid; place-items: center; width: 100%; height: 100%; transform: rotate(45deg); font-size: 13px; }
.place-marker.selected { width: 38px; height: 38px; background: var(--accent); border-color: var(--accent); filter: drop-shadow(0 0 7px rgba(200,255,98,.75)); }
.user-marker { position: relative; width: 20px; height: 20px; border: 4px solid white; border-radius: 50%; background: #5b98ff; box-shadow: 0 0 0 7px rgba(91,152,255,.25), 0 2px 8px rgba(0,0,0,.5); }
.user-label { position: absolute; left: 50%; top: 24px; transform: translateX(-50%); width: max-content; padding: 4px 7px; border-radius: 7px; background: rgba(24,26,30,.9); color: white; font: 700 10px/1 system-ui; }
.top-controls { position: absolute; top: 0; z-index: 500; width: 100%; padding: calc(var(--safe-top) + 12px) 12px 0; pointer-events: none; background: linear-gradient(to bottom, rgba(15,16,18,.76), transparent); }
.top-controls { transition: transform .28s ease, opacity .2s ease; }
.top-controls > * { pointer-events: auto; }
.brand-row { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 10px; color: white; text-shadow: 0 1px 10px #000; }
.brand-actions { display: flex; align-items: center; gap: 8px; }
.header-icon { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid rgba(255,255,255,.16); border-radius: 13px; color: white; background: rgba(28,31,36,.9); font-size: 18px; box-shadow: 0 3px 12px rgba(0,0,0,.22); }
.brand { display: flex; align-items: center; gap: 7px; font-weight: 800; font-size: 18px; letter-spacing: -.4px; }
.brand-mark { display: block; width: 32px; height: 32px; border: 1px solid rgba(255,255,255,.58); border-radius: 10px; object-fit: cover; box-shadow: 0 2px 10px rgba(0,0,0,.24); }
.result-count { font-size: 12px; font-weight: 650; color: #e8e8e5; }
.result-count { max-width: 126px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 34px 9px 4px; scrollbar-width: none; scroll-snap-type: x proximity; -webkit-mask-image: linear-gradient(to right,#000 0,#000 calc(100% - 34px),transparent 100%); mask-image: linear-gradient(to right,#000 0,#000 calc(100% - 34px),transparent 100%); }
.chip-row::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; min-height: 44px; padding: 0 15px; border: 1px solid rgba(255,255,255,.16); border-radius: 22px; color: #f3f3f0; background: rgba(28,31,36,.9); font-size: 14px; font-weight: 680; box-shadow: 0 3px 12px rgba(0,0,0,.22); scroll-snap-align: start; }
.chip.active { border-color: var(--accent); color: #151811; background: var(--accent); }
.radius-control { display: grid; grid-template-columns: repeat(4, 1fr); padding: 4px; border: 1px solid var(--line); border-radius: 16px; background: rgba(26,29,34,.92); box-shadow: 0 4px 14px rgba(0,0,0,.24); }
.radius-control button { min-height: 40px; border: 0; border-radius: 12px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 700; }
.radius-control button.active { color: white; background: #3b4048; }
.map-actions { position: absolute; z-index: 510; right: 13px; bottom: calc(42% + 18px); display: grid; justify-items: end; gap: 10px; transition: bottom .25s ease; }
.search-area-button { min-width: 132px; min-height: 44px; padding: 0 16px; border: 1px solid rgba(200,255,98,.48); border-radius: 22px; color: #151719; background: var(--accent); box-shadow: 0 7px 24px rgba(0,0,0,.3); font-size: 13px; font-weight: 800; }
.map-button, .icon-button { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 1px solid var(--line); border-radius: 16px; color: white; background: rgba(31,34,40,.94); box-shadow: 0 4px 16px rgba(0,0,0,.3); font-size: 25px; }
.hidden { display: none !important; }
.sheet { position: absolute; z-index: 600; left: 0; bottom: 0; width: 100%; height: calc(100dvh - var(--safe-top) - 64px); padding: 0 16px calc(var(--safe-bottom) + 12px); border-radius: 25px 25px 0 0; background: rgba(29,32,37,.97); box-shadow: 0 -10px 34px rgba(0,0,0,.3); transform: translateY(58%); transition: transform .28s cubic-bezier(.2,.8,.2,1); touch-action: none; }
.navigation-mode .top-controls { transform: translateY(-110%); opacity: 0; pointer-events: none; }
.navigation-mode:not(.controls-visible) .sheet { transform: translateY(calc(100% + var(--safe-bottom) + 40px)) !important; pointer-events: none; }
.navigation-mode .map-actions { display: none; }
.navigation-mode.controls-visible .top-controls { transform: translateY(0); opacity: 1; }
.navigation-mode.controls-visible .sheet { transform: translateY(58%); }
.navigation-hud { position: absolute; z-index: 750; left: 12px; right: 12px; bottom: calc(var(--safe-bottom) + 14px); display: grid; grid-template-columns: 1fr 1fr auto auto; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 19px; color: var(--text); background: rgba(31,34,40,.94); box-shadow: 0 8px 30px rgba(0,0,0,.38); backdrop-filter: blur(10px); }
.route-progress { grid-column: 1 / -1; height: 4px; overflow: hidden; border-radius: 3px; background: rgba(255,255,255,.14); }
.route-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .35s ease; }
.navigation-message { grid-column: 1 / -1; margin: -2px 2px 0; color: var(--muted); font-size: 10px; }
.nav-stat { display: grid; gap: 2px; min-width: 0; }
.nav-stat strong { font-size: 16px; white-space: nowrap; }
.nav-stat span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .7px; }
.nav-button { min-height: 44px; padding: 0 11px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: #3a3f47; font-size: 11px; font-weight: 780; }
.nav-button.danger { color: #ffb8bc; }
.theme-light .navigation-hud { background:rgba(255,255,255,.95); }
.theme-light .nav-button { color:#17191d; background:#e5e8eb; }
.theme-light .nav-button.danger { color:#a2252e; }
.sheet.sheet-low { transform: translateY(calc(100% - 126px - var(--safe-bottom))); }
.sheet.sheet-high { transform: translateY(0); }
.sheet.dragging { transition: none; }
.sheet-handle-area { display: grid; place-items: center; width: 100%; height: 32px; padding: 0; border: 0; background: transparent; touch-action: none; }
.sheet-handle { width: 42px; height: 5px; border-radius: 5px; background: #5d626b; }
.sheet-heading { display: flex; align-items: center; justify-content: space-between; min-height: 62px; }
.sheet-heading h1 { margin: 1px 0 0; font-size: 22px; line-height: 1.2; letter-spacing: -.5px; }
.eyebrow { margin: 0; color: var(--accent-text); font-size: 10px; font-weight: 850; letter-spacing: 1.5px; }
.icon-button { width: 44px; height: 44px; box-shadow: none; font-size: 22px; }
.status { display: none; padding: 22px 12px; color: var(--muted); text-align: center; line-height: 1.5; }
.status.visible { display: block; }
.spinner { display: inline-block; width: 22px; height: 22px; margin-bottom: 8px; border: 3px solid #4a4f57; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.results { height: calc(100% - 105px); overflow-y: auto; overscroll-behavior: contain; padding: 3px 0 18px; touch-action: pan-y; }
.place-card { display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; width: 100%; min-height: 76px; margin: 0 0 10px; padding: 11px; border: 1px solid var(--line); border-radius: 18px; color: var(--text); background: var(--panel-2); text-align: left; }
.place-card.selected { grid-template-columns: 52px 1fr; padding: 14px; border-color: rgba(200,255,98,.65); background: #30352f; }
.card-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: #383d45; font-size: 21px; }
.place-card.selected .card-icon { width: 52px; height: 52px; color: #171b11; background: var(--accent); }
.card-content { min-width: 0; }
.card-title { display: block; overflow: hidden; margin: 0 0 4px; font-size: 15px; font-weight: 780; text-overflow: ellipsis; white-space: nowrap; }
.place-card.selected .card-title { font-size: 18px; }
.card-meta, .card-address { display: block; overflow: hidden; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.card-address { margin-top: 2px; padding-right: 4px; }
.card-distance { color: var(--accent-text); font-size: 12px; font-weight: 800; }
.place-actions { grid-column: 1 / -1; display: grid; grid-template-columns: .8fr .9fr 1.45fr; gap: 8px; margin-top: 7px; }
.place-action { min-height: 50px; padding: 0 10px; border: 1px solid var(--line); border-radius: 15px; color: var(--text); background: #3a3f47; font-weight: 800; font-size: 13px; }
.place-action.walk { border-color: var(--accent); color: #151811; background: var(--accent); font-size: 14px; }
.route-stats { grid-column: 1 / -1; display: flex; gap: 8px; }
.route-stat { flex: 1; padding: 10px; border-radius: 12px; background: rgba(0,0,0,.18); text-align: center; }
.route-stat strong { display: block; font-size: 16px; }
.route-stat span { color: var(--muted); font-size: 10px; }
.attribution { position: absolute; right: 15px; bottom: calc(var(--safe-bottom) + 5px); color: #777d85; font-size: 9px; }
.attribution a { color: #9298a1; }
.permission-backdrop { position: absolute; z-index: 1000; inset: 0; display: grid; align-items: end; padding: 18px 18px calc(var(--safe-bottom) + 18px); background: rgba(10,11,13,.74); backdrop-filter: blur(7px); }
.permission-card { padding: 28px 22px 20px; border: 1px solid var(--line); border-radius: 27px; background: #22252b; box-shadow: 0 18px 60px rgba(0,0,0,.5); text-align: center; }
.permission-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 16px; border-radius: 18px; color: #14170f; background: var(--accent); font-size: 32px; }
.permission-card h2 { margin: 7px auto 10px; max-width: 280px; font-size: 27px; line-height: 1.1; letter-spacing: -.8px; }
.permission-card > p:not(.eyebrow) { margin: 0 auto 20px; max-width: 330px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.primary-button { width: 100%; min-height: 54px; border: 0; border-radius: 17px; color: #151811; background: var(--accent); font-weight: 850; }
.filter-backdrop { position: absolute; z-index: 1050; inset: 0; display: grid; align-items: end; padding: 14px 14px calc(var(--safe-bottom) + 14px); background: rgba(10,11,13,.62); backdrop-filter: blur(4px); }
.filter-card { max-height: 72dvh; overflow: auto; padding: 20px; border: 1px solid var(--line); border-radius: 25px; background: #22252b; box-shadow: 0 18px 60px rgba(0,0,0,.5); }
.filter-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.filter-header h2 { margin: 4px 0 0; font-size: 23px; letter-spacing: -.5px; }
.filter-help { margin: 12px 0 16px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.place-details-card { width: 100%; max-height: 82dvh; }
.place-details-content { display: grid; gap: 10px; }
.place-detail-photo { display: block; width: 100%; max-height: 230px; border-radius: 16px; background: var(--panel-2); object-fit: cover; }
.place-detail-row { display: grid; gap: 4px; padding: 11px 12px; border-radius: 13px; background: var(--panel-2); }
.place-detail-row > span { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .7px; text-transform: uppercase; }
.place-detail-row > strong, .place-detail-row > a { overflow-wrap: anywhere; color: var(--text); font-size: 14px; line-height: 1.4; }
.place-detail-row > a, .detail-source { color: var(--accent-text); }
.detail-source { display: block; min-height: 44px; padding: 13px 4px 0; font-size: 13px; font-weight: 750; text-align: center; }
.detail-empty { margin: 2px 0; padding: 18px 12px; border-radius: 13px; color: var(--muted); background: var(--panel-2); font-size: 13px; line-height: 1.45; text-align: center; }
.cuisine-options { display: flex; flex-wrap: wrap; gap: 9px; max-height: 34dvh; overflow-y: auto; }
.cuisine-option { min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 22px; color: var(--text); background: #30343b; font-size: 13px; font-weight: 720; }
.cuisine-option.active { border-color: var(--accent); color: #151811; background: var(--accent); }
.cuisine-option.unavailable:not(.active) { opacity: .5; }
.filter-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 10px; margin-top: 18px; }
.secondary-button { min-height: 54px; border: 1px solid var(--line); border-radius: 17px; color: var(--text); background: #30343b; font-weight: 780; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 76px; border-bottom: 1px solid var(--line); }
.setting-row span { display: grid; gap: 4px; }
.setting-row strong { font-size: 14px; }
.setting-row small { color: var(--muted); font-size: 11px; line-height: 1.3; }
.setting-row select { max-width: 142px; min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: #30343b; }
.setting-row input[type="color"] { width: 50px; height: 44px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #30343b; }
.setting-row input[type="checkbox"] { width: 25px; height: 25px; flex: 0 0 auto; accent-color: var(--accent); }
.settings-save { margin-top: 18px; }
.saved-settings { display: grid; gap: 10px; padding-top: 16px; }
.saved-settings > div:first-child { display: grid; gap: 3px; }
.saved-settings small { color: var(--muted); font-size: 11px; }
.saved-manager { display: grid; gap: 8px; max-height: 180px; overflow-y: auto; }
.saved-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 7px; padding: 9px 10px; border-radius: 12px; background: var(--panel-2); }
.saved-row span { overflow: hidden; font-size: 13px; font-weight: 720; text-overflow: ellipsis; white-space: nowrap; }
.saved-row button { width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: #3a3f47; }
.history-settings { display: grid; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.history-settings > div:first-child { display: grid; gap: 3px; }
.history-settings small { color: var(--muted); font-size: 11px; }
.recent-history { display: grid; gap: 6px; max-height: 132px; overflow-y: auto; }
.history-row { display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 8px; min-height: 42px; padding: 6px 9px; border-radius: 11px; background: var(--panel-2); }
.history-row span:first-child { text-align: center; }
.history-row div { min-width: 0; }
.history-row strong, .history-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-row strong { font-size: 12px; }
.save-pin-card { display: grid; gap: 13px; }
.pin-name-label { color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.pin-name-input { width: 100%; min-height: 52px; padding: 0 15px; border: 1px solid var(--line); border-radius: 14px; outline: none; color: var(--text); background: var(--panel-2); font: inherit; font-size: 16px; }
.pin-name-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(200,255,98,.12); }
.direction-arrow { display: grid; place-items: center; width: 38px; height: 38px; border: 3px solid white; border-radius: 50%; background: #5b98ff; box-shadow: 0 2px 12px rgba(0,0,0,.45); }
.direction-arrow::after { content: ''; width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 18px solid white; transform: translateY(-3px); }
.theme-light { --bg:#eef0f2; --panel:#ffffff; --panel-2:#f4f5f6; --text:#17191d; --muted:#626975; --line:rgba(20,25,30,.12); --accent-text:#507800; color-scheme:light; }
.theme-light .top-controls { background: linear-gradient(to bottom, rgba(238,240,242,.92), transparent); }
.theme-light .brand-row { color:#17191d; text-shadow:none; }
.theme-light .brand-mark { border-color:rgba(20,25,30,.18); }
.theme-light .header-icon, .theme-light .chip, .theme-light .radius-control { color:#17191d; background:rgba(255,255,255,.94); box-shadow:0 3px 12px rgba(0,0,0,.12); }
.theme-light .chip.active { color:#151811; background:var(--accent); }
.theme-light .radius-control button.active { color:#17191d; background:#dfe2e6; }
.theme-light .sheet, .theme-light .filter-card { background:rgba(255,255,255,.97); }
.theme-light .permission-card { background:#fff; }
.theme-light .result-count { color:#30343b; }
.theme-light .map-button, .theme-light .icon-button { color:#17191d; background:rgba(255,255,255,.96); }
.theme-light .setting-row select, .theme-light .setting-row input[type="color"], .theme-light .secondary-button, .theme-light .cuisine-option { color:#17191d; background:#eef0f2; }
.theme-light .place-action, .theme-light .saved-row button { color:#17191d; background:#e5e8eb; }
.theme-light .navigation-hud { background: rgba(248,249,250,.95); }
.theme-light .place-action.walk { color:#151811; background:var(--accent); }
.permission-card .privacy-note { margin: 12px 0 0 !important; font-size: 10px !important; }
.toast { position: absolute; z-index: 1200; left: 16px; right: 16px; bottom: calc(var(--safe-bottom) + 18px); padding: 13px 16px; border-radius: 14px; color: white; background: #b33b45; box-shadow: 0 6px 30px rgba(0,0,0,.4); font-size: 13px; font-weight: 650; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(24px); transition: transform .25s ease, opacity .25s ease, visibility .25s; }
.toast.show { opacity: 1; visibility: visible; transform: translateY(0); }
@media (min-width: 521px) { body { background: #0e0f11; } }
@media (max-height: 650px) { .sheet { transform: translateY(64%); } .sheet.sheet-low { transform: translateY(calc(100% - 110px - var(--safe-bottom))); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }
