:root {
  --ink: #23272b; --muted: #5d646b; --card: rgba(255, 255, 255, 0.92); --line: rgba(35, 39, 43, 0.12);
  --accent: #2f3a45; --accent-ink: #fff; --red: #c83c28; --r: 14px;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #cfd6dc; color: var(--ink); }
body { -webkit-tap-highlight-color: transparent; user-select: none; }
#view, #view canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
button, a { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
.card { background: var(--card); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: var(--r); box-shadow: var(--shadow); }
.pill { background: var(--card); border-radius: 999px; padding: 8px 14px; text-decoration: none; box-shadow: var(--shadow); white-space: nowrap; font-size: 14px; }
.round { width: 38px; height: 38px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); font-weight: 700; }
.primary { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 9px 16px; font-weight: 600; white-space: nowrap; }
.klein { font-size: 12px; color: var(--muted); }

#top { position: fixed; top: 12px; left: 12px; right: 12px; display: flex; align-items: center; gap: 10px; z-index: 5; pointer-events: none; }
#top > * { pointer-events: auto; }
.brand { background: var(--card); border-radius: 999px; padding: 7px 16px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: baseline; }
.brand span { color: var(--muted); font-size: 13px; }
#top .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.seg { display: flex; background: var(--card); border-radius: 999px; padding: 3px; box-shadow: var(--shadow); }
.seg button { padding: 6px 13px; border-radius: 999px; font-size: 14px; }
.seg button.on { background: var(--accent); color: #fff; }

#optPanel { position: fixed; top: 62px; right: 12px; padding: 12px 16px; z-index: 6; width: 240px; }
#optPanel h4 { margin: 0 0 8px; }
#optList label { display: flex; gap: 8px; align-items: center; padding: 5px 0; cursor: pointer; }

#mapBox { position: fixed; top: 62px; right: 12px; width: 190px; height: 300px; padding: 8px; z-index: 4; }
#optPanel:not([hidden]) ~ #mapBox { display: none; }
#map { width: 100%; height: calc(100% - 30px); display: block; cursor: pointer; }
.mapTabs { display: flex; gap: 6px; margin-bottom: 4px; }
.mapTabs button { flex: 1; padding: 4px 0; border-radius: 8px; background: rgba(0, 0, 0, 0.05); font-weight: 600; font-size: 13px; }
.mapTabs button.on { background: var(--accent); color: #fff; }

#bottom { position: fixed; left: 12px; right: 12px; bottom: 30px; display: flex; gap: 8px; align-items: center; z-index: 5; pointer-events: none; }
#bottom > * { pointer-events: auto; }
#bottom .lbl { font-size: 13px; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); white-space: nowrap; }
#chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; padding: 4px 2px; }
#chips::-webkit-scrollbar { display: none; }
#chips button { background: var(--card); border-radius: 999px; padding: 7px 12px; white-space: nowrap; box-shadow: var(--shadow); font-size: 14px; }
#chips button.on { background: var(--accent); color: #fff; }
.hinweis { position: fixed; left: 0; right: 0; bottom: 6px; text-align: center; font-size: 12px; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); z-index: 5; pointer-events: none; }
.lbox .hinweis, .modal .hinweis { position: static; color: var(--muted); text-shadow: none; }

#caption { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); max-width: min(560px, calc(100% - 24px)); padding: 12px 16px; z-index: 5; }
#caption p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
#panel { position: fixed; left: 12px; top: 62px; width: 260px; padding: 14px 16px; z-index: 6; }
#panel h3 { margin: 0 0 6px; } #panel p { margin: 4px 0; }
#panel .x { position: absolute; right: 8px; top: 6px; font-size: 22px; }

#labels { position: fixed; inset: 0; pointer-events: none; z-index: 3; }
.info { position: absolute; left: 0; top: 0; pointer-events: auto; background: rgba(255, 255, 255, 0.9); border-radius: 10px; padding: 5px 10px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.info b { font-size: 13px; } .info span { font-size: 12px; color: var(--muted); }
.info::after { content: ""; position: absolute; bottom: -6px; left: 50%; margin-left: -6px; border: 6px solid transparent; border-top-color: rgba(255, 255, 255, 0.9); border-bottom: 0; }
.optlabel { position: absolute; left: 0; top: 0; background: #f3c14b; color: #2b2208; font-weight: 700; font-size: 12px; padding: 3px 8px; border-radius: 6px; }

.joy { position: fixed; left: 22px; bottom: 96px; width: 112px; height: 112px; border-radius: 50%; background: rgba(255, 255, 255, 0.28); border: 2px solid rgba(255, 255, 255, 0.7); z-index: 5; touch-action: none; display: none; }
body.touch .joy { display: block; }
#joyKnob { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgba(255, 255, 255, 0.9); box-shadow: var(--shadow); }

.modal { position: fixed; inset: 0; background: rgba(20, 24, 28, 0.35); display: grid; place-items: center; z-index: 20; padding: 16px; }
.modal .card { padding: 20px 24px; max-width: 460px; }
.modal h2 { margin: 0 0 8px; } .modal ol { padding-left: 18px; line-height: 1.45; font-size: 14px; }
.modal .row { display: flex; gap: 10px; margin: 14px 0 8px; }
.modal .row button:not(.primary) { background: rgba(0, 0, 0, 0.07); border-radius: 999px; padding: 9px 16px; }
[hidden] { display: none !important; }

#fade { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; transition: opacity 0.35s; z-index: 15; }
#fade.on { opacity: 1; }
#loader { position: fixed; inset: 0; background: linear-gradient(#dfe6ec, #f4f2ee); display: grid; place-items: center; z-index: 30; transition: opacity 0.6s; }
#loader.done { opacity: 0; pointer-events: none; }
.lbox { display: flex; flex-direction: column; gap: 10px; align-items: center; width: min(360px, 86vw); text-align: center; }
.lbox b { font-size: 22px; } .lbox span { color: var(--muted); }
.track { width: 100%; height: 8px; background: rgba(0, 0, 0, 0.08); border-radius: 99px; overflow: hidden; }
#bar { height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }

@media (max-width: 720px) {
  .brand span, #bottom .lbl, #kontakt, #zurueck { display: none; }
  #mapBox { width: 120px; height: 190px; top: 58px; right: 8px; }
  #top { top: 8px; left: 8px; right: 8px; }
  #bottom { left: 8px; right: 8px; bottom: 26px; }
  #caption { bottom: 80px; }
  .joy { bottom: 88px; }
  .brand { padding: 7px 12px; font-size: 14px; }
}
#optList label.qual { border-top: 1px solid rgba(0,0,0,.08); margin-top: 6px; padding-top: 10px; justify-content: space-between; cursor: default; }
#optList label.qual select { font: inherit; padding: 3px 6px; border-radius: 8px; border: 1px solid rgba(0,0,0,.18); background: #fff; }
#view canvas { touch-action: none; }

/* Projektangaben (Sonnenhäuser Angersdorf) */
:root { --sonne: #c9772e; --sonne-hover: #b4661f; }
.anfrage { background: var(--sonne); color: #fff; border-radius: 999px; padding: 9px 18px; font-weight: 600; white-space: nowrap;
  text-decoration: none; box-shadow: var(--shadow); transition: background .15s; }
.anfrage:hover, .anfrage:focus-visible { background: var(--sonne-hover); }
.anfrage::after { content: " →"; }
#hinweis { display: flex; justify-content: center; gap: 6px 14px; flex-wrap: wrap; padding: 0 12px; }
#hinweis .projektzeile { opacity: .9; }
.modal .kicker { margin: 0 0 2px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--sonne); font-weight: 700; }
.modal .unterzeile { margin: 0 0 12px; color: var(--muted); }
.kennzahlen { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 12px; }
.kennzahlen div { background: rgba(0, 0, 0, .045); border-radius: 10px; padding: 8px 6px; text-align: center; }
.kennzahlen dt { font-weight: 700; font-size: 15px; white-space: nowrap; }
.kennzahlen dd { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.25; }
.lbox .unterzeile { font-size: 14px; }
.lbox .anbieter { font-size: 12px; }
.modal .card { max-height: calc(100vh - 32px); overflow-y: auto; }
@media (max-width: 720px) {
  .kennzahlen { grid-template-columns: repeat(2, 1fr); }
  .anfrage { padding: 9px 14px; }
  #hinweis .projektzeile { display: none; }
  #chips { min-width: 0; }
  /* Kopfzeile: langer Projektname darf die Knöpfe nicht verdrängen */
  #top { gap: 6px; }
  .brand { min-width: 0; flex: 1 1 auto; padding: 7px 11px; }
  .brand b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  #top .right { gap: 5px; flex-shrink: 0; }
  #top .round { width: 34px; height: 34px; }
  .seg button { padding: 6px 9px; font-size: 13px; }
  #btnOpt { padding: 8px 10px; font-size: 13px; }
}

/* Vogelperspektive */
#btnVogel { border: 0; cursor: pointer; }
#btnVogel.on { background: var(--accent); color: #fff; }
#btnVogel .kurz { display: none; }
body.vogel #labels, body.vogel .joy { display: none !important; }
body.vogel #view canvas { cursor: grab; }
@media (max-width: 720px) {
  #btnVogel { padding: 8px 11px; }
  #btnVogel .lang { display: none; } #btnVogel .kurz { display: inline; }
  body.vogel #mapBox { display: none; }
}

/* Sprecher aus */
.round.aus { opacity: .5; }
