:root {
  color-scheme: dark;
  --ink: #f5f2ea;
  --muted: rgba(245, 242, 234, .62);
  --line: rgba(255, 255, 255, .16);
  --glass: rgba(19, 22, 21, .84);
  --glass-solid: #171a19;
  --accent: #f0785d;
  --accent-ink: #231410;
  --shadow: 0 24px 80px rgba(0, 0, 0, .38);
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #111412; }
body { color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.app-shell, .map-stage, .map-root, gmp-map-3d { position: fixed; inset: 0; width: 100%; height: 100%; }
gmp-map-3d { cursor: default; }
.app-shell { isolation: isolate; background: #111412; }
.map-stage { z-index: 0; opacity: 0; transform: scale(1.012); transition: opacity .65s ease, transform 1.1s cubic-bezier(.2,.7,.2,1); }
.map-stage.is-ready { opacity: 1; transform: scale(1); }
.map-wash { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(8,10,9,.34), transparent 24%, transparent 68%, rgba(8,10,9,.22)); }

.local-demo-map { position: absolute; inset: 0; display: block; overflow: hidden; cursor: grab; background: #bac9c7; }
.local-demo-map:active { cursor: grabbing; }
.demo-sky { position: absolute; inset: 0; background: linear-gradient(180deg, #92aaa9 0 26%, #d4d0bd 48%, #66746f 100%); }
.demo-city { position: absolute; left: -12%; right: -12%; top: 23%; height: 66%; transform: perspective(900px) rotateX(57deg) rotateZ(var(--demo-rotation, -24deg)); transform-origin: 50% 65%; transition: transform .18s ease-out; }
.demo-city i { position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--h); background: repeating-linear-gradient(90deg, rgba(236,224,188,.32) 0 4%, transparent 4% 13%), repeating-linear-gradient(0deg, rgba(12,22,20,.45) 0 3%, transparent 3% 14%), var(--c); border: 1px solid rgba(255,255,255,.18); box-shadow: 18px 24px 28px rgba(18,27,25,.34); transform: skewY(-5deg); }
.demo-city i::after { content: ""; position: absolute; left: 9%; right: 9%; top: 8%; bottom: 8%; background: repeating-linear-gradient(90deg, rgba(242,199,112,.3) 0 7%, transparent 7% 19%), repeating-linear-gradient(0deg, rgba(255,255,255,.14) 0 2%, transparent 2% 16%); }
.demo-street-grid { position: absolute; inset: 58% -20% -28%; opacity: .48; background: repeating-linear-gradient(72deg, transparent 0 82px, rgba(216,222,213,.7) 83px 96px), repeating-linear-gradient(-18deg, transparent 0 115px, rgba(216,222,213,.58) 116px 130px); transform: perspective(600px) rotateX(61deg) rotateZ(var(--demo-rotation, -24deg)); transform-origin: 50% 0; }
.demo-badge { position: absolute; left: 18px; top: 90px; display: grid; gap: 3px; max-width: 260px; padding: 10px 12px; color: var(--ink); background: rgba(19,22,21,.88); border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow); pointer-events: none; }
.demo-badge strong { color: var(--accent); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.demo-badge span { color: var(--muted); font-size: 10px; line-height: 1.35; }
.demo-window-marker { position: absolute; z-index: 3; left: 50%; top: 48%; width: 18px; height: 18px; border: 2px solid var(--accent); border-radius: 50%; box-shadow: 0 0 0 5px rgba(240,120,93,.2); transform: translate(-50%,-50%); pointer-events: none; }

.loading-screen, .setup-screen, .mobile-editor-screen, .invalid-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 32px;
  background: radial-gradient(circle at 70% 20%, #2a302d 0, #171a18 34%, #101210 76%);
}
.loading-screen { align-content: center; gap: 8px; text-align: center; transition: opacity .45s ease, visibility .45s; }
.loading-screen.is-hidden { opacity: 0; visibility: hidden; }
.loading-screen p { margin: 0; color: var(--muted); font-size: 13px; }
.loading-mark { position: relative; width: 52px; height: 52px; margin: 0 auto 14px; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; }
.loading-mark span { position: absolute; left: 25px; top: 8px; width: 1px; height: 17px; background: var(--accent); transform-origin: 0 18px; animation: scan 1.8s linear infinite; }
.loading-mark span:last-child { opacity: .35; animation-delay: -.9s; }
@keyframes scan { to { transform: rotate(360deg); } }

.setup-screen[hidden], .mobile-editor-screen[hidden], .invalid-screen[hidden], .editor-ui[hidden], .view-ui[hidden], .selection-panel[hidden], .editor-look-layer[hidden], .editor-look-hint[hidden], .selection-loading[hidden], .toast[hidden] { display: none; }
.setup-screen, .mobile-editor-screen, .invalid-screen { place-items: initial; align-content: space-between; }
.mini-brand { display: inline-flex; align-items: center; gap: 11px; width: max-content; color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 650; }
.mini-brand > span, .brand-mark { display: grid; place-items: center; width: 34px; height: 34px; color: #141615; background: var(--ink); border-radius: 50%; font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.setup-copy { align-self: end; max-width: 730px; padding-bottom: 8vh; }
.setup-copy h1 { max-width: 700px; margin: 10px 0 18px; font-size: clamp(42px, 7vw, 86px); line-height: .94; letter-spacing: -.065em; font-weight: 610; }
.setup-copy > p:not(.eyebrow) { max-width: 620px; margin: 0 0 28px; color: var(--muted); font-size: clamp(16px, 2vw, 20px); line-height: 1.55; }
.text-link, .primary-link { color: var(--ink); text-underline-offset: 5px; }
.primary-link { display: inline-flex; padding: 13px 18px; color: var(--accent-ink); background: var(--accent); border-radius: 3px; text-decoration: none; font-size: 13px; font-weight: 800; }

.editor-ui, .view-ui { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
.editor-bar, .view-bar { position: absolute; z-index: 4; left: 18px; right: 18px; top: 18px; display: flex; align-items: center; gap: 12px; }
.app-brand { display: flex; align-items: center; gap: 11px; min-width: 205px; height: 54px; padding: 8px 15px 8px 9px; color: var(--ink); background: var(--glass); border: 1px solid var(--line); border-radius: 5px; box-shadow: var(--shadow); backdrop-filter: blur(18px); text-decoration: none; pointer-events: auto; }
.app-brand .brand-mark { width: 34px; height: 34px; flex: 0 0 auto; }
.app-brand > span:last-child { display: grid; gap: 2px; }
.app-brand strong { font-size: 13px; line-height: 1; }
.app-brand small { color: var(--muted); font-size: 10px; line-height: 1; letter-spacing: .02em; }
.search-wrap { width: min(480px, calc(100vw - 480px)); min-width: 260px; height: 54px; padding: 6px; background: var(--glass); border: 1px solid var(--line); border-radius: 5px; box-shadow: var(--shadow); backdrop-filter: blur(18px); pointer-events: auto; }
.search-wrap gmp-place-autocomplete { width: 100%; height: 40px; color-scheme: light; }
.demo-search-input { width: 100%; height: 40px; padding: 0 13px; color: rgba(245,242,234,.58); background: rgba(255,255,255,.06); border: 0; border-radius: 3px; outline: 0; }
.editor-tools { position: absolute; z-index: 4; left: 18px; bottom: 24px; display: grid; gap: 12px; width: min(590px, calc(100vw - 36px)); pointer-events: none; }
.editor-guide, .selection-panel { width: 100%; padding: 20px; background: var(--glass); border: 1px solid var(--line); border-radius: 5px; box-shadow: var(--shadow); backdrop-filter: blur(18px); pointer-events: auto; }
.editor-guide { width: 315px; }
.editor-guide.is-dismissed { display: none; }
.eyebrow { margin: 0; color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.editor-guide ol { display: grid; gap: 11px; margin: 16px 0 13px; padding: 0; list-style: none; }
.editor-guide li { display: grid; grid-template-columns: 30px 1fr; align-items: baseline; color: rgba(245,242,234,.92); font-size: 13px; }
.editor-guide li span { color: var(--muted); font: italic 13px Georgia, serif; }
.guide-dismiss { margin: 13px 0 0; padding: 0; color: var(--ink); background: none; border: 0; border-bottom: 1px solid rgba(255,255,255,.4); cursor: pointer; font-size: 11px; }
.selection-panel { max-height: calc(100dvh - 106px); padding: 26px; overflow-y: auto; animation: panel-in .28s ease-out both; }
.selection-panel .dialog-head { gap: 12px; }
.selection-kicker { display: flex; align-items: center; gap: 9px; }
.selection-loading { display: inline-flex; align-items: center; gap: 3px; }
.selection-loading i { width: 4px; height: 4px; background: var(--accent); border-radius: 50%; animation: selection-pulse .9s ease-in-out infinite; }
.selection-loading i:nth-child(2) { animation-delay: .12s; }
.selection-loading i:nth-child(3) { animation-delay: .24s; }
@keyframes selection-pulse { 0%, 70%, 100% { opacity: .25; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-3px); } }
@keyframes panel-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.editor-ui.is-previewing .search-wrap { opacity: .45; pointer-events: none; }
.editor-look-layer { inset: 0; }
.editor-look-hint { bottom: 24px; }

.share-dialog { width: min(590px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); margin: auto; padding: 26px; overflow: auto; color: var(--ink); background: rgba(23,26,25,.97); border: 1px solid rgba(255,255,255,.2); border-radius: 7px; box-shadow: 0 35px 120px rgba(0,0,0,.68); }
.share-dialog::backdrop { background: rgba(5,7,6,.5); backdrop-filter: blur(5px); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.dialog-head > div { flex: 1; min-width: 0; }
.dialog-head h2 { margin: 6px 0 0; font-size: 29px; line-height: 1.04; letter-spacing: -.035em; font-weight: 620; }
.selection-title-input { display: block; width: 100%; margin: 6px 0 0; padding: 7px 9px; color: var(--ink); background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.18); border-radius: 3px; outline: none; font-family: inherit; font-size: 25px; font-weight: 620; line-height: 1.08; letter-spacing: -.035em; }
.selection-title-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(240,120,93,.14); }
.selection-title-input:disabled { color: rgba(245,242,234,.72); background: transparent; border-color: transparent; }
.icon-button { width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; font-size: 25px; font-weight: 280; line-height: 1; }
.selection-address { min-height: 40px; margin: 16px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.selection-facts { display: grid; grid-template-columns: repeat(2, 1fr); margin: 20px 0 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.selection-facts div { min-width: 0; padding: 15px 10px 15px 0; }
.selection-facts div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.selection-facts dt { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.selection-facts dd { margin: 6px 0 0; overflow: hidden; font: 16px Georgia, serif; text-overflow: ellipsis; white-space: nowrap; }
.view-settings { display: grid; gap: 16px; margin-top: 22px; }
.view-settings > label { display: grid; grid-template-columns: 145px 1fr; align-items: center; color: var(--muted); font-size: 12px; }
.direction-input { display: grid; grid-template-columns: 1fr auto; align-items: center; min-height: 40px; border: 1px solid var(--line); border-radius: 3px; }
.direction-input input { width: 100%; padding: 0 11px; color: var(--ink); background: transparent; border: 0; outline: 0; }
.direction-input span { padding: 0 11px; color: var(--muted); font-size: 12px; }
.direction-input b { color: var(--accent); }
.range-input { display: grid; grid-template-columns: 1fr 44px; align-items: center; gap: 12px; }
.range-input input { accent-color: var(--accent); }
.range-input output { color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 43px; padding: 0 16px; border-radius: 3px; cursor: pointer; font-size: 12px; font-weight: 800; text-decoration: none; }
.primary-button { color: var(--accent-ink); background: var(--accent); border: 1px solid var(--accent); }
.primary-button:disabled { cursor: wait; opacity: .45; }
.secondary-button { color: var(--ink); background: transparent; border: 1px solid var(--line); }
.precision-note { margin: 16px 0 0; color: rgba(245,242,234,.42); font-size: 10px; line-height: 1.5; }

.code-block { margin-top: 22px; }
.code-block > div { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.code-block span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.code-block button { padding: 0; color: var(--accent); background: none; border: 0; cursor: pointer; font-size: 11px; font-weight: 750; }
.code-block textarea { display: block; width: 100%; padding: 12px; resize: none; color: rgba(245,242,234,.8); background: #0d0f0e; border: 1px solid var(--line); border-radius: 3px; outline: none; font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }

.toast { position: fixed; z-index: 30; left: 50%; bottom: 28px; width: min(560px, calc(100vw - 32px)); padding: 13px 16px; color: var(--ink); background: #202522; border: 1px solid rgba(255,255,255,.22); border-radius: 4px; box-shadow: var(--shadow); transform: translateX(-50%); font-size: 12px; line-height: 1.4; text-align: center; }

.view-bar { justify-content: space-between; }
.view-brand-stack { display: grid; gap: 6px; width: 232px; pointer-events: auto; }
.view-brand-stack .app-brand { width: 100%; min-width: 0; }
.view-brand-stack .app-brand > span:last-child { min-width: 0; }
.view-brand-stack .app-brand small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more-views { position: relative; width: 100%; color: var(--ink); pointer-events: auto; }
.more-views summary { display: flex; align-items: center; justify-content: space-between; min-height: 34px; padding: 0 12px; color: rgba(245,242,234,.82); background: var(--glass); border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow); backdrop-filter: blur(16px); cursor: pointer; font-size: 10px; font-weight: 800; letter-spacing: .08em; list-style: none; text-transform: uppercase; }
.more-views summary::-webkit-details-marker { display: none; }
.more-views summary span { width: 7px; height: 7px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .18s ease; }
.more-views[open] summary span { transform: translateY(2px) rotate(225deg); }
.more-views-panel { margin-top: 6px; padding: 6px; background: rgba(19,22,21,.94); border: 1px solid var(--line); border-radius: 5px; box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.more-views-panel > p { margin: 8px 9px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.more-views-panel > p[hidden] { display: none; }
.more-views-panel ul { display: grid; max-height: min(440px, calc(100dvh - 180px)); margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.more-views-panel li + li { border-top: 1px solid rgba(255,255,255,.08); }
.more-views-panel a { display: block; padding: 9px; overflow: hidden; color: rgba(245,242,234,.84); border-radius: 3px; font-size: 11px; line-height: 1.3; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.more-views-panel a:hover, .more-views-panel a:focus-visible { color: var(--ink); background: rgba(255,255,255,.08); outline: none; }
.more-views-panel a[aria-current="page"] { color: var(--accent); }
.heading-readout { display: flex; align-items: center; gap: 10px; min-width: 92px; height: 54px; padding: 8px 14px; margin-left: auto; background: var(--glass); border: 1px solid var(--line); border-radius: 5px; box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.heading-readout > span:last-child { display: grid; gap: 1px; }
.heading-readout strong { font-size: 13px; }
.heading-readout small { color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.compass-arrow { display: inline-block; color: var(--accent); font-size: 20px; transform-origin: 50% 50%; }
.look-layer { position: absolute; inset: 0 0 38px; z-index: 2; cursor: grab; pointer-events: auto; touch-action: none; outline: none; }
.look-layer.is-dragging { cursor: grabbing; }
.reticle { position: absolute; left: 50%; top: 50%; width: 38px; height: 38px; transform: translate(-50%,-50%); opacity: .7; pointer-events: none; }
.reticle span { position: absolute; background: rgba(255,255,255,.84); box-shadow: 0 0 5px rgba(0,0,0,.5); }
.reticle span:nth-child(1), .reticle span:nth-child(2) { left: 18px; width: 1px; height: 9px; }
.reticle span:nth-child(1) { top: 0; }.reticle span:nth-child(2) { bottom: 0; }
.reticle span:nth-child(3), .reticle span:nth-child(4) { top: 18px; width: 9px; height: 1px; }
.reticle span:nth-child(3) { left: 0; }.reticle span:nth-child(4) { right: 0; }
.look-hint { position: absolute; z-index: 3; left: 50%; bottom: 24px; display: flex; align-items: center; gap: 9px; padding: 9px 13px; color: rgba(245,242,234,.75); background: rgba(19,22,21,.72); border: 1px solid var(--line); border-radius: 30px; backdrop-filter: blur(12px); transform: translateX(-50%); font-size: 10px; transition: opacity .4s ease, transform .4s ease; }
.look-hint.is-hidden { opacity: 0; transform: translate(-50%, 8px); }
.drag-glyph { color: var(--accent); font-size: 14px; }
.view-actions { position: absolute; z-index: 4; right: 18px; bottom: 24px; display: flex; gap: 8px; pointer-events: auto; }
.view-actions button { min-height: 36px; padding: 0 12px; color: var(--ink); background: var(--glass); border: 1px solid var(--line); border-radius: 3px; cursor: pointer; backdrop-filter: blur(14px); font-size: 10px; font-weight: 750; }
.embed-mode [data-hide-embed] { display: none !important; }
.embed-mode .view-bar { justify-content: flex-end; }
.embed-mode .heading-readout { height: 44px; }
.embed-mode .look-hint { bottom: 18px; }
.embed-view-title { display: none; }
.embed-mode .embed-view-title { position: absolute; z-index: 3; top: max(14px, env(safe-area-inset-top)); left: 50%; display: block; max-width: calc(100vw - 220px); margin: 0; overflow: hidden; color: rgba(255,255,255,.72); font-size: 11px; font-weight: 520; letter-spacing: .035em; line-height: 1.3; text-align: center; text-overflow: ellipsis; text-shadow: 0 1px 5px rgba(0,0,0,.9), 0 0 14px rgba(0,0,0,.45); white-space: nowrap; pointer-events: none; transform: translateX(-50%); }

@media (max-width: 780px) {
  .view-bar { left: 12px; right: 12px; top: max(12px, env(safe-area-inset-top)); }
  .view-brand-stack { width: min(232px, calc(100vw - 116px)); }
  .view-bar .app-brand { min-width: 0; }
  .heading-readout { height: 48px; }
  .look-hint { bottom: max(16px, env(safe-area-inset-bottom)); }
  .view-actions { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); }
  .view-actions button:first-child { display: none; }
  .selection-facts { grid-template-columns: 1fr 1fr; }
  .view-settings > label { grid-template-columns: 1fr; gap: 8px; }
  .dialog-actions { flex-wrap: wrap; }
}

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