:root { --glass: rgba(58,61,64,.52); --glass-deep: rgba(43,46,49,.66); --line: rgba(255,255,255,.24); --text: rgba(255,255,255,.86); --muted: rgba(255,255,255,.66); --blue: #8ab4f8; --h: 64px; --r: 999px; }
* { box-sizing: border-box; }
html, body, .app { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { color: var(--text); background: #222629; font-family: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif; font-weight: 300; }
button, input { color: inherit; font: inherit; }
button { cursor: pointer; }
#map { position: absolute; inset: 0; background: #5b6061; }
#map::after { content: ""; pointer-events: none; position: absolute; z-index: 500; inset: 0; background: rgba(20,23,25,.12); }
.leaflet-tile-pane { filter: grayscale(.72) saturate(.5) brightness(.72); }
.leaflet-control-container { display: none; }
.glass { border: 1px solid var(--line); background: var(--glass); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), inset 0 -10px 20px rgba(0,0,0,.08), 0 9px 28px rgba(0,0,0,.2); backdrop-filter: blur(3px) saturate(1.05); -webkit-backdrop-filter: blur(3px) saturate(1.05); }
.top-controls { position: absolute; z-index: 1100; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; }
.search-box { width: min(620px, 64vw); height: var(--h); display: flex; align-items: center; padding-left: 26px; border-radius: var(--r); overflow: hidden; }
.primary-button svg, .square-button svg, .camera-button svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 1.65; }
.search-field { flex: 1; min-width: 0; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 18px; font-weight: 300; }
.search-field input::placeholder { color: var(--muted); }
.clear-button, .primary-button { height: 100%; border: 0; background: transparent; }
.clear-button { width: 50px; display: grid; place-items: center; padding: 0 0 3px; color: var(--muted); font-size: 28px; line-height: 1; }
.clear-button[hidden] { display: none; }
.primary-button { width: 76px; display: grid; place-items: center; border-left: 1px solid rgba(255,255,255,.12); }
.primary-button span { display: none; }
.primary-button:hover, .clear-button:hover { background: rgba(255,255,255,.07); }
.primary-button.loading svg { animation: breathe .65s ease infinite alternate; }
@keyframes breathe { to { transform: scale(.75); opacity: .4; } }
.square-button { position: relative; width: var(--h); height: var(--h); display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; font-size: 25px; }
.square-button:hover, .camera-button:hover { background: rgba(105,110,114,.78); }
#savedButton span { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; border-radius: 9px; color: #2c3033; background: rgba(255,255,255,.8); font-size: 9px; font-weight: 500; }
.results-panel { position: absolute; z-index: 1000; top: 16px; bottom: 100px; left: 16px; width: 460px; display: flex; flex-direction: column; overflow: hidden; border-radius: 34px; transition: transform .25s ease, opacity .2s ease; }
.results-panel.hidden { transform: translateX(calc(-100% - 24px)); opacity: 0; pointer-events: none; }
.results-heading { min-height: 90px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px 0 26px; border-bottom: 1px solid rgba(255,255,255,.1); }
.results-heading span { color: var(--muted); font-size: 15px; }
.results-heading h1 { max-width: 285px; overflow: hidden; margin: 5px 0 0; text-overflow: ellipsis; white-space: nowrap; font-size: 23px; font-weight: 300; }
.results-actions { display: flex; }
.icon-button { width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; padding: 0 0 2px; border: 0; border-radius: 50%; background: transparent; font-size: 24px; line-height: 1; }
.icon-button:hover { background: rgba(255,255,255,.08); }
.empty-state { margin: auto; color: var(--muted); font-size: 15px; }
.result-list { flex: 1; overflow-y: auto; padding: 8px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.result-card { display: grid; grid-template-columns: 136px 1fr; min-height: 126px; padding: 10px; border-radius: 24px; outline: 0; cursor: pointer; transition: background .15s; }
.result-card:hover, .result-card.selected { background: rgba(255,255,255,.08); }
.scene-thumb { position: relative; min-height: 106px; overflow: hidden; border-radius: 20px; background: #8d9490; }
.scene-art { position: absolute; inset: 0; background: linear-gradient(155deg, #a8afaa 0 42%, #646b67 43% 52%, #343936 53%); }
.scene-art i { position: absolute; left: 10%; top: 22%; width: 37%; height: 30%; border: 5px solid #404641; background: #869b9a; box-shadow: 48px 11px 0 -7px #6b716d; }
.scene-art b { position: absolute; left: 18%; bottom: 15%; width: 70%; height: 17%; border-radius: 30px 36px 8px 8px; background: #d0d3ce; box-shadow: 9px 9px 0 -5px #242925; }
.scene-art em { position: absolute; right: 10%; top: 8%; width: 2px; height: 60%; background: #303632; }
.result-card:nth-child(2n) .scene-art { filter: sepia(.25); }
.confidence { position: absolute; left: 8px; bottom: 8px; padding: 5px 8px; border-radius: 999px; background: rgba(30,33,35,.72); font-size: 13px; }
.save-button { position: absolute; top: 7px; right: 7px; width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; background: rgba(45,48,50,.58); }
.save-button.saved { color: rgba(255,255,255,.95); background: rgba(130,137,142,.88); }
.card-body { min-width: 0; display: flex; flex-direction: column; padding: 2px 4px 1px 12px; }
.card-number { color: var(--muted); font-size: 14px; }
.card-body h3 { overflow: hidden; margin: 6px 0 10px; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; font-weight: 300; }
.tags { display: flex; gap: 4px; overflow: hidden; }
.tags span { padding: 5px 9px; border: 1px solid rgba(255,255,255,.1); border-radius: 999px; color: rgba(255,255,255,.76); font-size: 13px; white-space: nowrap; }
.card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; color: rgba(255,255,255,.74); font-size: 14px; }
.card-footer button { min-height: 32px; display: flex; align-items: center; justify-content: center; padding: 0 10px; border: 1px solid rgba(255,255,255,.13); border-radius: 999px; background: rgba(255,255,255,.06); color: rgba(255,255,255,.9); font-size: 14px; }
.show-results { position: absolute; z-index: 900; top: 18px; left: 16px; height: var(--h); padding: 0 24px; display: flex; align-items: center; gap: 12px; border-radius: var(--r); font-size: 15px; }
.show-results[hidden] { display: none; }
.show-results b { min-width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.12); font-size: 12px; font-weight: 400; }
.radius-control { position: absolute; z-index: 800; right: 18px; top: 18px; width: 300px; height: 68px; display: flex; align-items: center; gap: 18px; padding: 0 23px; border-radius: var(--r); }
.radius-label { min-width: 86px; display: grid; gap: 4px; font-size: 13px; }
.radius-label span { color: var(--muted); }
.radius-label strong { color: rgba(255,255,255,.94); font-size: 17px; font-weight: 300; }
.radius-control input { min-width: 0; width: 100%; accent-color: rgba(255,255,255,.7); }
.map-tools { position: absolute; z-index: 800; right: 18px; top: 98px; display: grid; gap: 10px; }
.map-tools .square-button { width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; padding: 0; border-radius: 50%; color: rgba(255,255,255,.9); font-size: 30px; line-height: 1; }
#zoomIn { padding-bottom: 3px; }
#zoomOut { padding-bottom: 5px; }
.attribution-note { position: absolute; z-index: 700; right: 20px; bottom: 92px; color: rgba(255,255,255,.66); font-size: 11px; text-shadow: 0 1px 3px #000; }
.toast { position: absolute; z-index: 1500; left: 50%; bottom: 20px; transform: translate(-50%, 14px); padding: 12px 18px; border-radius: 14px; font-size: 11px; opacity: 0; pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.custom-pin { width: 18px; height: 18px; border: 4px solid rgba(255,255,255,.8); border-radius: 50%; background: #686e72; box-shadow: 0 2px 8px rgba(0,0,0,.45); }

.viewer { position: absolute; z-index: 1200; inset: 0; overflow: hidden; background: #69716d; }
.viewer[hidden], .export-menu[hidden] { display: none; }
.viewer-scene { position: absolute; inset: -4%; background: linear-gradient(#9fa9a4 0 59%, #656a68 60% 68%, #373b3a 69%); transition: transform .2s; }
.facade { position: absolute; left: 5%; top: 7%; width: 72%; height: 58%; background: linear-gradient(90deg, #8f9691, #bdc1bb 56%, #929a95); box-shadow: inset -35px 0 70px rgba(0,0,0,.18); }
.window-shape { position: absolute; left: 15%; top: 18%; width: 23%; height: 27%; border: 13px solid #434b49; background: linear-gradient(145deg,#779191,#b6c2be); box-shadow: 31vw 4vh 0 -9px #59615e; }
.pole-shape { position: absolute; right: 18%; top: 8%; width: 7px; height: 67%; background: #424846; transform: rotate(1deg); box-shadow: 5px 0 10px rgba(0,0,0,.25); }
.car-shape { position: absolute; left: 47%; bottom: 22%; width: 27%; height: 10%; border-radius: 60px 70px 14px 14px; background: #d2d5d0; box-shadow: inset -45px -8px 30px rgba(0,0,0,.15), 18px 14px 0 -7px #171a19, -4px 14px 0 -7px #171a19; }
.road-shape { position: absolute; left: 0; right: 0; bottom: 13%; height: 3px; background: rgba(255,255,255,.35); transform: rotate(-2deg); }
.viewer-vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle, transparent 45%, rgba(12,14,15,.32) 125%); }
.viewer-top { position: absolute; top: 16px; left: 16px; display: flex; gap: 8px; }
.location-pill { min-width: 220px; height: var(--h); display: grid; align-content: center; gap: 2px; padding: 0 16px; border-radius: var(--r); }
.location-pill span { font-size: 12px; }
.location-pill small { color: var(--muted); font-size: 8px; }
.viewer-actions { position: absolute; right: 16px; bottom: 16px; display: flex; align-items: flex-end; gap: 8px; }
.camera-button { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 20px; }
.camera-button svg { width: 22px; }
.export-menu { width: 225px; overflow: hidden; border-radius: 18px; }
.export-menu > div { display: grid; gap: 3px; padding: 14px 16px 11px; border-bottom: 1px solid rgba(255,255,255,.1); }
.export-menu strong { font-size: 12px; font-weight: 300; }
.export-menu small { color: var(--muted); font-size: 8px; }
.export-menu button { width: 100%; display: flex; justify-content: space-between; padding: 11px 16px; border: 0; border-bottom: 1px solid rgba(255,255,255,.07); background: transparent; font-size: 11px; }
.export-menu button:hover { background: rgba(255,255,255,.08); }
.viewer-hint { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); padding: 10px 15px; border-radius: 13px; color: var(--muted); font-size: 9px; }

@media (max-width: 900px) { .search-box { width: min(560px, calc(100vw - 84px)); } }
@media (max-width: 650px) {
  .top-controls { left: 10px; right: 10px; bottom: 10px; transform: none; }
  .search-box { width: calc(100vw - 78px); padding-left: 20px; }
  .search-field input { font-size: 16px; }
  .results-panel { top: auto; left: 8px; right: 8px; bottom: 84px; width: auto; height: 48vh; border-radius: 30px; }
  .results-panel.hidden { transform: translateY(calc(100% + 16px)); }
  .result-list { display: flex; overflow-x: auto; overflow-y: hidden; }
  .result-card { flex: 0 0 280px; }
  .show-results { top: 84px; left: 10px; bottom: auto; }
  .radius-control { left: 10px; right: 10px; top: 10px; width: auto; height: 64px; }
  .map-tools { right: 10px; top: 84px; bottom: auto; }
  #zoomIn, #zoomOut { display: none; }
  .attribution-note { display: none; }
  .viewer-top { top: 10px; left: 10px; right: 10px; }
  .location-pill { min-width: 0; flex: 1; }
  .viewer-actions { right: 10px; bottom: 10px; }
  .viewer-hint { display: none; }
  .export-menu { width: 210px; }
}
