@font-face { font-family: "Inter"; src: url("fonts/inter-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-300.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --sky: #e6ebec;
  --ink: #1e2b2c;
  --ink-2: #5a6869;
  --larch: #b07a3b;
  --larch-soft: rgba(176, 122, 59, .16);
  --river: #4f7078;
  --panel: rgba(250, 251, 251, .9);
  --solid: #fbfcfc;
  --line: rgba(30, 43, 44, .1);
  --shadow: 0 1px 2px rgba(30, 43, 44, .06), 0 10px 30px -12px rgba(30, 43, 44, .28);
  --gap: clamp(10px, 1.6vw, 18px);
  --side-w: 340px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--sky); color: var(--ink);
  font: 14px/1.45 "Inter", system-ui, sans-serif; font-feature-settings: "tnum" 1, "cv11" 1; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--larch); outline-offset: 2px; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.muted { color: var(--ink-2); }
svg { flex: none; }

/* ---------- Intro ---------- */
#intro { position: fixed; inset: 0; z-index: 30; display: grid; place-content: center; justify-items: center; gap: 6px;
  background: var(--sky); transition: opacity .9s var(--ease), visibility 0s .9s; }
[data-state="ready"] #intro { opacity: 0; visibility: hidden; }
.intro-title { font: 300 clamp(48px, 9vw, 96px)/1 "Fraunces", Georgia, serif; letter-spacing: -.01em; }
.intro-sub { font: 300 clamp(18px, 2.6vw, 26px)/1.2 "Fraunces", Georgia, serif; color: var(--ink-2); }
.intro-bar { width: 160px; height: 2px; margin-top: 26px; background: var(--line); overflow: hidden; border-radius: 2px; }
.intro-bar span { display: block; width: 40%; height: 100%; background: var(--larch); animation: bar 1.3s var(--ease) infinite; }
@keyframes bar { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
#intro-status { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-2); max-width: 34ch; text-align: center; }
[data-state="error"] .intro-bar { display: none; }

/* ---------- Kopf (kompakt) ---------- */
.masthead { position: fixed; top: var(--gap); left: var(--gap); z-index: 5; pointer-events: none; }
.masthead::before { content: ""; position: absolute; z-index: -1; inset: -40px -90px -30px -40px; background: radial-gradient(closest-side, rgba(244,247,247,.85), rgba(244,247,247,0)); }
.masthead h1 { margin: 0; font-weight: 300; font-family: "Fraunces", Georgia, serif; line-height: 1; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.t-title { font-size: 30px; letter-spacing: -.01em; }
.t-sub { font-size: 17px; color: var(--ink-2); }
.t-place { margin: 5px 0 0; font-size: 12.5px; font-weight: 500; color: var(--river); }

/* ---------- Werkzeuge oben rechts ---------- */
.tools { position: fixed; top: var(--gap); right: var(--gap); z-index: 8; display: flex; gap: 6px; align-items: center; }
.compass { width: 40px; height: 40px; border-radius: 50%; background: var(--panel); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow); }
.compass svg { width: 100%; height: 100%; display: block; }
.c-ring { fill: none; stroke: var(--line); }
.n-north { fill: var(--ink); } .n-south { fill: #c3cbcb; }
.compass text { font: 600 8.5px "Inter", sans-serif; fill: var(--ink); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--panel); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow); transition: background .2s; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { background: #fff; }
.icon-btn[aria-expanded="true"], .icon-btn.on { background: var(--ink); } .icon-btn[aria-expanded="true"] svg, .icon-btn.on svg { stroke: #fff; }
.icon-btn.small { width: 34px; height: 34px; box-shadow: none; background: transparent; }
.icon-btn.small:hover { background: rgba(30, 43, 44, .06); }

/* ---------- Popover ---------- */
.pop { position: fixed; z-index: 9; background: var(--solid); border-radius: 14px; box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.layers-pop { top: calc(var(--gap) + 48px); right: var(--gap); width: 220px; padding: 6px; display: grid; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; padding: 0 10px; border: 0; background: transparent; border-radius: 9px; font-size: 13px; text-align: left; }
.toggle:hover { background: rgba(30, 43, 44, .05); }
.toggle .sw { width: 30px; height: 18px; border-radius: 9px; background: rgba(30, 43, 44, .18); position: relative; transition: background .2s; }
.toggle .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle[aria-pressed="true"] .sw { background: var(--larch); }
.toggle[aria-pressed="true"] .sw::after { transform: translateX(12px); }

/* ---------- Segmente (klein) ---------- */
.seg { display: flex; padding: 3px; gap: 2px; border-radius: 10px; background: rgba(30, 43, 44, .05); }
.seg button { border: 0; background: transparent; min-height: 30px; padding: 0 9px; border-radius: 7px; font-weight: 500; font-size: 12px; color: var(--ink-2); white-space: nowrap; transition: background .15s, color .15s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.seg-sm button { min-height: 28px; padding: 0 8px; font-size: 12px; }

/* ---------- Leiste unten ---------- */
.bar { position: fixed; z-index: 6; right: var(--gap); bottom: var(--gap); display: flex; align-items: center; gap: 6px; padding: 5px;
  border-radius: 14px; background: var(--panel); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow); max-width: calc(100vw - 2 * var(--gap)); }
.bar .seg { background: transparent; padding: 0; }
.bar .seg + .seg, .bar .seg + .sun-pill { border-left: 1px solid var(--line); padding-left: 6px; }
.bar-btn { border: 0; background: transparent; min-height: 30px; padding: 0 10px; border-radius: 8px; font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.bar-btn:hover { background: rgba(30, 43, 44, .06); }
.bar-btn svg { width: 16px; height: 16px; fill: none; stroke: var(--larch); stroke-width: 1.7; stroke-linecap: round; }
.sun-pill[aria-expanded="true"] { background: var(--ink); color: #fff; }
.units-btn { display: none; background: var(--ink); color: #fff; }
.units-btn:hover { background: #2b3b3c; }

/* ---------- Sonnenstand (Popover) ---------- */
.sun { right: var(--gap); bottom: calc(var(--gap) + 52px); width: 320px; padding: 14px 16px 12px; }
.sun-head { display: flex; align-items: baseline; gap: 10px; }
.sun-time { font-size: 26px; font-weight: 500; letter-spacing: -.02em; line-height: 1; }
.sun-date { font-size: 13px; color: var(--ink-2); }
.seasons { display: flex; gap: 4px; margin: 10px 0 2px; }
.seasons button { flex: 1; min-height: 30px; border: 1px solid var(--line); background: transparent; border-radius: 8px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.seasons button[aria-checked="true"] { border-color: var(--larch); color: var(--ink); background: var(--larch-soft); }
.arc { position: relative; margin: 2px -4px 0; }
.arc svg { display: block; overflow: visible; }
.arc .horizon { stroke: rgba(30, 43, 44, .28); stroke-width: 1; }
.arc .tick { stroke: rgba(30, 43, 44, .3); }
.arc .tick-l { font: 500 9px "Inter", sans-serif; fill: var(--ink-2); }
.arc .arc { fill: none; stroke: rgba(30, 43, 44, .16); stroke-width: 1.3; stroke-dasharray: 2 3; }
.arc .arc.sel { stroke: var(--larch); stroke-width: 2; stroke-dasharray: none; }
.sun-dot { fill: #fff; stroke: var(--larch); stroke-width: 2.5; }
.sun-glow { fill: var(--larch-soft); }
#sun-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; }
.arc:has(#sun-range:focus-visible) { outline: 2px solid var(--larch); outline-offset: 2px; border-radius: 6px; }
.sun-foot { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-2); margin-top: 2px; }

/* ---------- Wohnungs-Panel ---------- */
.side { position: fixed; z-index: 7; left: var(--gap); top: 96px; bottom: var(--gap); width: var(--side-w); display: flex; flex-direction: column;
  background: var(--solid); border-radius: 16px; box-shadow: var(--shadow), 0 0 0 1px var(--line); overflow: hidden;
  transition: transform .3s var(--ease), opacity .3s var(--ease); }
.side.collapsed { transform: translateX(calc(-100% - var(--gap) - 4px)); opacity: 0; pointer-events: none; }
.view { display: flex; flex-direction: column; min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 16px 18px; scrollbar-width: thin; }
.side-grip { display: none; }
.side-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.side-head h2 { margin: 0; font: 400 22px/1.15 "Fraunces", Georgia, serif; }
.side-head p { margin: 3px 0 0; font-size: 12.5px; }
.filters { display: grid; gap: 6px; margin: 12px 0 8px; }
.filters .seg { flex-wrap: wrap; }
.unit-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.unit-list li { border-bottom: 1px solid var(--line); }
.u-item { width: 100%; display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 10px; padding: 10px 6px; border: 0; background: transparent; text-align: left; border-radius: 8px; }
.u-item:hover, .u-item.hl { background: rgba(30, 43, 44, .045); }
.u-item .dot { width: 8px; height: 8px; border-radius: 50%; }
.u-item b { display: block; font-weight: 600; font-size: 13.5px; }
.u-item small { display: block; color: var(--ink-2); font-size: 12px; }
.u-item .u-p { font-size: 12.5px; font-weight: 600; text-align: right; }
.u-item .u-p.off { font-weight: 500; color: var(--ink-2); }
.empty { padding: 18px 4px; color: var(--ink-2); font-size: 13px; }
.dot.frei { background: #3fae5a; } .dot.reserviert { background: #e59f2a; } .dot.verkauft { background: #a3abb1; }

.detail-top { margin: -4px 0 8px; }
.text-link { border: 0; background: transparent; padding: 6px 4px; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); border-radius: 6px; }
.text-link:hover { color: var(--ink); }
.text-link svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.u-head { display: flex; align-items: center; gap: 10px; }
.u-head h2 { margin: 0; font: 300 32px/1 "Fraunces", Georgia, serif; letter-spacing: -.01em; }
.pill { font-size: 12px; font-weight: 600; padding: 4px 9px 4px 8px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.frei { color: #2f7a3f; background: rgba(63, 174, 90, .13); }
.pill.reserviert { color: #9a6411; background: rgba(229, 159, 42, .17); }
.pill.verkauft { color: #5d666b; background: rgba(152, 160, 166, .18); }
.u-sub { margin: 6px 0 12px; color: var(--ink-2); font-size: 13px; }
.u-plan { margin: 0 0 12px; }
.u-plan button { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #f8f6f1; cursor: zoom-in; }
.u-plan img { display: block; width: 100%; height: auto; max-height: 300px; object-fit: contain; }
.u-plan figcaption { font-size: 11.5px; margin-top: 5px; }
.u-facts { margin: 0; display: grid; border-top: 1px solid var(--line); }
.u-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.u-row dt { color: var(--ink-2); } .u-row dd { margin: 0; font-weight: 500; }
.u-note { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-2); }
.u-price { margin-top: 14px; display: grid; gap: 2px; }
.u-price s { color: var(--ink-2); font-size: 13px; }
.u-price strong { font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
.u-price small { color: var(--ink-2); font-size: 12px; }
.u-price p { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.u-cta { display: flex; align-items: center; justify-content: center; margin-top: 14px; min-height: 44px; border-radius: 10px; background: var(--ink); color: #fff; font-weight: 500; text-decoration: none; }
.u-cta:hover { background: #2b3b3c; }
.docs-block { margin-top: 18px; }
.docs-block h3 { margin: 0 0 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.docs a { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; padding: 8px; border-radius: 9px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: 13px; }
.docs a:hover { border-color: rgba(30, 43, 44, .25); background: #fff; }
.docs .ic { width: 28px; height: 32px; border-radius: 4px; background: #f1ece4; display: grid; place-items: center; font-size: 9px; font-weight: 700; color: var(--larch); letter-spacing: .02em; }
.docs small { color: var(--ink-2); font-size: 11.5px; }

.side-open { position: fixed; z-index: 7; left: var(--gap); top: 96px; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 12px; border: 0; border-radius: 999px;
  background: var(--panel); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow); font-size: 13px; font-weight: 500; }
.side-open svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; }

/* ---------- Hinweis, Tooltip, Lightbox, Info ---------- */
#hint { position: fixed; left: 50%; top: var(--gap); transform: translateX(-50%); z-index: 4; padding: 8px 14px; border-radius: 999px;
  background: rgba(30, 43, 44, .82); color: #fff; font-size: 12.5px; white-space: nowrap; pointer-events: none; transition: opacity .6s; }
#hint.gone, [data-state="loading"] #hint { opacity: 0; }
.tip { position: fixed; left: 0; top: 0; z-index: 20; pointer-events: none; padding: 7px 10px; border-radius: 8px; background: rgba(30, 43, 44, .92); color: #fff; font-size: 12.5px; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.tip strong { font-weight: 600; } .tip i.dot { width: 7px; height: 7px; border-radius: 50%; margin: 0 2px 0 8px; display: inline-block; }
.lightbox { position: fixed; inset: 0; z-index: 25; background: rgba(240, 238, 233, .96); display: grid; place-items: center; padding: 48px 24px 24px; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: var(--shadow); border-radius: 8px; background: #f8f6f1; }
.lightbox .icon-btn { position: absolute; top: var(--gap); right: var(--gap); }
.info { position: fixed; top: calc(var(--gap) + 48px); right: var(--gap); z-index: 10; width: min(360px, calc(100vw - 2 * var(--gap)));
  padding: 18px 18px 14px; border-radius: 14px; background: var(--solid); box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.info h2 { margin: 0 0 8px; font: 400 20px/1.2 "Fraunces", Georgia, serif; }
.info p { margin: 0 0 10px; max-width: 60ch; }
.info-small { font-size: 12.5px; color: var(--ink-2); }
.text-btn { border: 0; background: var(--ink); color: #fff; min-height: 38px; padding: 0 16px; border-radius: 8px; font-weight: 500; font-size: 13px; }

/* ---------- Ladezustand ---------- */
.masthead, .tools, .side, .bar, .side-open { transition: opacity .6s .5s var(--ease), transform .3s var(--ease); }
[data-state="loading"] :is(.masthead, .tools, .side, .bar, .side-open),
[data-state="error"] :is(.masthead, .tools, .side, .bar, .side-open) { opacity: 0; pointer-events: none; }

/* ---------- schmal / mobil ---------- */
@media (max-width: 1100px) { :root { --side-w: 310px; } }
@media (max-width: 760px) {
  .t-title { font-size: 24px; } .t-sub { font-size: 14px; }
  .masthead { max-width: calc(100vw - 2 * var(--gap) - 180px); }
  .compass, .icon-btn { width: 38px; height: 38px; }
  .bar { left: var(--gap); right: var(--gap); justify-content: space-between; overflow-x: auto; scrollbar-width: none; }
  .units-btn { display: inline-flex; }
  #views button { padding: 0 6px; }
  .side { left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 56vh; border-radius: 18px 18px 0 0; z-index: 12; }
  .u-plan img { max-height: 200px; }
  .side.collapsed { transform: translateY(105%); }
  .side-grip { display: flex; flex: none; justify-content: center; align-items: center; height: 22px; margin-bottom: -10px; touch-action: none; cursor: grab; }
  .side-grip span { width: 38px; height: 4px; border-radius: 4px; background: rgba(30, 43, 44, .22); }
  .side.collapsed .side-grip { pointer-events: none; }
  .side-open { display: none !important; }
  .sun { left: var(--gap); right: var(--gap); width: auto; }
  #hint { top: auto; bottom: calc(var(--gap) + 58px); white-space: normal; text-align: center; width: max-content; max-width: calc(100vw - 2 * var(--gap)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}

/* filming: no chrome */
.no-ui .masthead, .no-ui .tools, .no-ui .bar, .no-ui .side, .no-ui #side-open, .no-ui #hint, .no-ui #tip, .no-ui .pop, .no-ui #sun { display: none !important; }
