/* Perspektiv-Labor — App-Stile (Panel-Chrome kommt aus ../_shared/visukit.css) */
html, body { touch-action: none; overscroll-behavior: none; margin: 0; overflow: hidden; }
canvas { touch-action: none; }
body.theme-dark { background: #070b14; color: #e6e8f2; }
body.theme-light { background: #e4e9ee; color: #1e293b; }

/* 3D-Labor: Leinwand über das ganze Fenster, per clip-path auf die Karte beschnitten (die Kamera rechnet im Fensterraster,
   damit Tutor-Show-Anker und Picking exakt sitzen). Skizze: eigene Karte. */
#scene { position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 1; display: block; }
#skizze { position: fixed; z-index: 2; border-radius: 16px; display: block; }
.karte-rand { position: fixed; z-index: 3; border-radius: 16px; pointer-events: none; box-sizing: border-box; }
body.theme-dark .karte-rand { border: 1px solid rgba(255, 255, 255, 0.075); }
body.theme-light .karte-rand { border: 1px solid rgba(15, 23, 42, 0.06); }
.karte-kopf { position: fixed; z-index: 6; pointer-events: none; font: 700 10.5px/1 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.5; white-space: nowrap; }
#sk-readout { position: fixed; z-index: 6; pointer-events: none; text-align: right; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
#sk-readout .ro-zahl { font-size: 22px; font-weight: 750; letter-spacing: -0.01em; line-height: 1; font-variant-numeric: tabular-nums; }
#sk-readout .ro-chips { display: flex; gap: 10px; justify-content: flex-end; margin-top: 7px; font-size: 10.5px; font-weight: 650; }
#sk-readout .ro-chips span { display: inline-flex; align-items: center; gap: 5px; transition: opacity 0.25s; }
#sk-readout .ro-chips span.aus { opacity: 0.38; }
#sk-readout .ro-chips i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
#sk-readout .ro-chips span.aus i { background: transparent !important; box-shadow: inset 0 0 0 1.5px currentColor; }
.hit { position: fixed; pointer-events: none; border-radius: 16px; z-index: 0; }
.hit.klein { border-radius: 10px; }

#tags { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.tag[hidden] { display: none !important; }
.tag { position: absolute; left: 0; top: 0; padding: 3px 8px; border-radius: 8px; font: 650 10.5px/1.2 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  white-space: nowrap; will-change: transform; letter-spacing: 0.02em; }
body.theme-dark .tag { background: rgba(10, 13, 26, 0.78); color: #e6e8f2; }
body.theme-light .tag { background: rgba(255, 255, 255, 0.92); color: #1e293b; }
body.buehne-film:not(.film-handy) .karte-kopf, body.buehne-film:not(.film-handy) #sk-readout, body.buehne-film:not(.film-handy) #tags { display: none !important; }
/* Expeditionsfilm, Eingreifen am Handy (body.film-handy): echte Größe, Handy-Layout der App. Wertekarte und Grundriss gehören zur Filmkomposition. */
body.film-handy #film-werte, body.film-handy [data-modellkarte] { display: none !important; }
/* Eingriff am Handy: Der Player legt oben seinen Hinweis über das Bild, die Kartenköpfe würden darunter kollidieren */
body.film-handy .karte-kopf { display: none !important; }

/* Panels */
#panel-steuerung { top: 16px; left: 16px; width: 292px; max-height: calc(100vh - 110px); }
#panel-ansicht { top: 16px; right: 16px; width: 284px; max-height: calc((100vh - 110px) * 0.47); }
#panel-werte { bottom: 78px; right: 16px; width: 330px; max-height: calc((100vh - 110px) * 0.53 - 8px); }
#panel-info { left: 50%; right: auto; bottom: 78px; transform: translateX(-50%); width: 560px; max-height: calc(100vh - 110px); z-index: 22; }
.panel { touch-action: pan-y; }
.panel p + p { margin-top: 8px; }
.panel .hint { line-height: 1.5; }
.panel .seg { flex-wrap: wrap; }
.panel .seg button { white-space: normal; line-height: 1.15; justify-content: center; min-width: 0; overflow-wrap: break-word; flex: 1 1 0; }
.panel .seg.seg-4 button { flex: 1 1 calc(50% - 3px); }
.panel .gruppe { margin-top: 2px; }
.panel .gruppe .lab { margin-top: 14px; }
.panel .regler { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 11.5px; margin: 7px 0 3px; }
.panel .regler .rl { opacity: 0.78; min-width: 0; }
.panel .regler b { font-variant-numeric: tabular-nums; font-family: 'SF Mono', ui-monospace, monospace; font-size: 11px; font-weight: 650; white-space: nowrap; }
.panel input[type="range"] { width: 100%; display: block; }
.panel .check { margin-top: 5px; line-height: 1.3; }
#panel-ansicht .lab { margin-top: 11px; }
.panel .ghost.klein { width: auto; padding: 6px 12px; font-size: 11px; margin-top: 14px; }
body.theme-dark .panel .ghost { background: rgba(255, 255, 255, 0.07); }
body.theme-light .panel .ghost { background: rgba(15, 23, 42, 0.06); }
body.theme-dark .panel .ghost:hover { background: rgba(255, 255, 255, 0.13); }
body.theme-light .panel .ghost:hover { background: rgba(15, 23, 42, 0.11); }

/* Werte */
.w-kopf { display: flex; align-items: baseline; gap: 8px; margin: 0 0 8px; }
.w-kopf b { font-size: 26px; font-weight: 760; font-variant-numeric: tabular-nums; line-height: 1; }
.w-kopf span { font-size: 11.5px; opacity: 0.7; }
.w-fp { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 8px; align-items: start; margin-top: 6px; font-size: 11.5px; line-height: 1.4; }
.w-fp .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 3px; display: inline-block; }
.w-fp.aus .dot { background: transparent !important; box-shadow: inset 0 0 0 1.5px currentColor; opacity: 0.5; }
.w-fp .w-n { display: block; font-weight: 650; }
.w-fp .w-t { display: block; opacity: 0.72; }
.trenner { height: 1px; margin: 10px 0 6px; border-radius: 1px; }
body.theme-dark .trenner { background: rgba(255, 255, 255, 0.08); }
body.theme-light .trenner { background: rgba(15, 23, 42, 0.08); }
.panel .stat { font-size: 11.5px; gap: 10px; }
.panel .stat b { font-size: 11px; white-space: nowrap; }
.w-lage { margin-top: 8px; font-size: 11px; line-height: 1.45; opacity: 0.72; }
.panel .status { margin-top: 10px; font-size: 11.5px; line-height: 1.5; padding: 9px 11px; border-radius: 10px; background: var(--vk-panel-surface); }
.modell { font-size: 10.5px; opacity: 0.78; line-height: 1.55; }

@media (max-width: 768px), (max-height: 500px) {
  .tag { font-size: 12px; padding: 3px 7px; }
  #sk-readout .ro-zahl { font-size: 19px; }
  #sk-readout .ro-chips { gap: 8px; font-size: 12px; margin-top: 5px; }
  .karte-kopf { font-size: 12px; letter-spacing: 0.05em; }
}
/* Schmale Karten (Handy mit offenem Sheet: Karten nebeneinander): Kopf und Chips weg, nur die FP-Zahl bleibt */
body.eng .karte-kopf, body.eng #sk-readout .ro-chips { display: none; }

/* Scrollbalken wie heyprof global — für JEDEN Scroll-Container. */
@supports (-moz-appearance: none) {
  * { scrollbar-width: thin; }
  body.theme-light { scrollbar-color: rgba(0,0,0,0.15) transparent; }
  body.theme-dark  { scrollbar-color: rgba(255,255,255,0.15) transparent; }
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; margin: 10px 0; }
.panel::-webkit-scrollbar-track { margin: 15px 0; }
::-webkit-scrollbar-thumb { border-radius: 4px; }
::-webkit-scrollbar-button { display: none; height: 0; width: 0; }
*::-webkit-scrollbar-button { display: none; height: 0; width: 0; }
body.theme-light ::-webkit-scrollbar-thumb { background-color: rgba(0,0,0,0.15); }
body.theme-light ::-webkit-scrollbar-thumb:hover { background-color: rgba(0,0,0,0.30); }
body.theme-dark  ::-webkit-scrollbar-thumb { background-color: rgba(255,255,255,0.15); }
body.theme-dark  ::-webkit-scrollbar-thumb:hover { background-color: rgba(255,255,255,0.30); }
html::-webkit-scrollbar-thumb { background-color: rgba(127,127,160,0.35); }



/* Objektwahl: drei Pills je Reihe */
.panel .seg.seg-3 button { flex: 1 1 calc(33.333% - 4px); }

/* ── Handy (Hochformat ≤ 768 px) und Querformat (Höhe ≤ 500 px): Daumenmaß ─────────────────────────
   Tippflächen ≥ 44 px, Schrift ≥ 12 px, EIN Abstand 10 px. Sheets höchstens 55 % hoch, scrollbar; die Karten
   rücken darüber (layout() in app.js), die Szene bleibt sichtbar. */
@media (max-width: 768px) {
  #mobile-navbar { left: 10px; right: 10px; bottom: 10px; padding: 5px; gap: 4px; }
  #mobile-navbar .nav-btn { min-height: 50px; padding: 6px 2px; gap: 4px; }
  #mobile-navbar .nav-btn svg { width: 20px; height: 20px; }
  #mobile-navbar .nav-btn span { display: block; font-size: 12px; font-weight: 700; line-height: 1.1; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
  @media (max-width: 360px) { #mobile-navbar .nav-btn span { font-size: 11px; letter-spacing: -0.01em; } }   /* schmal (Expeditionsfilm im Eingriff): kein Umbruch mitten im Wort */
  #panel-steuerung, #panel-ansicht, #panel-werte, #panel-info {
    bottom: 80px !important; width: calc(100vw - 20px) !important; max-width: 520px; max-height: 55vh; max-height: 55dvh;
    padding: 6px 16px 16px; overscroll-behavior: contain; }
  .panel-hd { margin: 0 -10px 4px 0; min-height: 44px; }
}
@media (max-width: 768px), (max-height: 500px) {
  .panel h3 { font-size: 12px; }
  .panel-x { width: 44px; height: 44px; border-radius: 12px; opacity: 0.55; }
  .panel-x svg { width: 15px !important; height: 15px !important; }
  .panel .lab { font-size: 12px; opacity: 0.55; }
  .panel .seg { gap: 4px; padding: 4px; border-radius: 12px; }
  .panel .seg button { min-height: 44px; font-size: 13px; border-radius: 9px; padding: 6px 6px; }
  .panel .seg.seg-3 button { flex: 1 1 calc(33.333% - 4px); }
  .panel .regler { font-size: 13px; margin: 10px 0 0; }
  .panel .regler b { font-size: 12.5px; }
  .panel input[type="range"] { height: 44px; }
  .panel input[type="range"]::-webkit-slider-runnable-track { height: 6px; }
  .panel input[type="range"]::-webkit-slider-thumb { width: 26px; height: 26px; margin-top: -10px; }
  .panel input[type="range"]::-moz-range-thumb { width: 26px; height: 26px; }
  .panel .check { min-height: 44px; font-size: 13px; margin-top: 0; }
  .panel .check input[type="checkbox"] { width: 40px; height: 24px; }
  .panel .check input[type="checkbox"]::after { width: 20px; height: 20px; }
  .panel .check input[type="checkbox"]:checked::after { transform: translateX(16px); }
  .panel .ghost.klein { width: 100%; min-height: 44px; font-size: 13px; }
  .panel .hint { font-size: 13px; }
  .panel .stat, .panel .stat b { font-size: 13px; }
  .w-fp { font-size: 13px; }
  .w-lage, .panel .status { font-size: 13px; }
  .modell { font-size: 12px; }
}
/* Querformat am Handy: Desktop-Dock und schwebende Panels bleiben, aber im Daumenmaß und flach */
@media (min-width: 769px) and (max-height: 500px) {
  #desktop-dock { bottom: 10px; padding: 4px; }
  #desktop-dock .dock-pill { min-height: 44px; padding: 6px 14px; font-size: 13px; }
  #panel-steuerung, #panel-ansicht, #panel-werte { top: 10px; max-height: calc(100vh - 88px); }
  #panel-steuerung { left: 10px; }
  #panel-ansicht, #panel-werte { right: 10px; }
  #panel-werte { top: auto; bottom: 78px; }
  #panel-info { bottom: 78px; max-height: calc(100vh - 98px); width: min(560px, calc(100vw - 20px)); }
}

/* ── Hauptgriff „Objekt drehen“ (nur Handy/Querformat, Lage setzt layout()) ── */
#hero { position: fixed; z-index: 8; display: flex; gap: 10px; align-items: stretch; touch-action: none; user-select: none; -webkit-user-select: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; --app-accent: var(--vk-ui-action); }
#hero[hidden] { display: none; }
body.buehne-film:not(.film-eingriff) #hero, body.vorschau #hero { display: none !important; }
.hero-bahn { position: relative; flex: 1 1 auto; min-width: 0; border-radius: 16px; overflow: hidden; cursor: grab; touch-action: none; outline: none; }
.hero-bahn:focus-visible { outline: 2px solid var(--app-accent); outline-offset: 2px; }
.hero-bahn:active { cursor: grabbing; }
.hero-fp { flex: 0 0 auto; min-width: 62px; padding: 0 10px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
body.theme-dark .hero-bahn, body.theme-dark .hero-fp { background: var(--vk-panel-bg); color: var(--vk-panel-ink); }
body.theme-light .hero-bahn, body.theme-light .hero-fp { background: var(--vk-panel-bg); color: var(--vk-panel-ink); }
.hero-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; transform-origin: 0 50%; transform: scaleX(0); will-change: transform; background: var(--app-accent); opacity: 0.16; border-radius: 16px 0 0 16px; pointer-events: none; }
body.theme-dark .hero-fill { opacity: 0.3; }
body.theme-dark .hero-bahn, body.theme-dark .hero-fp { background: rgba(255, 255, 255, 0.075); }
.hero-txt { position: absolute; top: 0; bottom: 0; left: 0; right: 0; padding: 0 4px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 700; letter-spacing: 0.01em;
  opacity: 0.62; pointer-events: none; white-space: nowrap; }
.hero-txt svg { width: 15px; height: 15px; flex: none; }
.hero-txt > span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.hero-txt.knapp svg { display: none; }
.hero-knopf { position: absolute; top: 5px; bottom: 5px; left: 5px; width: 80px; gap: 1px; border-radius: 12px; background: var(--app-accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 760; font-variant-numeric: tabular-nums; pointer-events: none; will-change: transform; }
.hero-knopf svg { width: 13px; height: 13px; flex: none; opacity: 0.75; }
.hero-knopf::before { content: ''; position: absolute; inset: -5px; border-radius: 16px; background: var(--app-accent); opacity: 0; z-index: -1; }
#hero.lockt .hero-knopf svg { width: 13px; height: 13px; flex: none; opacity: 0.75; }
.hero-knopf::before { animation: hero-lockt 1.6s ease-in-out infinite; }
@keyframes hero-lockt { 0%, 100% { opacity: 0; transform: scale(0.94); } 50% { opacity: 0.32; transform: scale(1.06); } }
.hero-fp b { font-size: 17px; font-weight: 780; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hero-fp.neu b { animation: hero-neu 0.45s ease-out; }
@keyframes hero-neu { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }
.hero-dots { display: flex; gap: 4px; }
.hero-dots i { width: 7px; height: 7px; border-radius: 50%; display: block; transition: opacity 0.25s; }
.hero-dots i.aus { opacity: 0.22; }
@media (prefers-reduced-motion: reduce) { #hero.lockt .hero-knopf::before, .hero-fp.neu b { animation: none; } }
