/* =============================================================
   MOTION TOOL — Studio UI
   Bachelor-Thesis · Bewegung im Raum sichtbar machen
   ============================================================= */

@font-face {
  font-family: 'ABCFavoritVariable';
  src: url('Fonts/ABC Favorit Variable/ABCFavoritVariableEdu-Regular.woff2') format('woff2'),
       url('Fonts/ABC Favorit Variable/ABCFavoritVariableEdu-Regular.woff') format('woff');
  font-weight: 100 900;
  font-style: normal;
}

@font-face {
  font-family: 'ABCFavoritMono';
  src: url('Fonts/ABC Favorit Mono/ABCFavoritMonoEdu-Light.woff2') format('woff2'),
       url('Fonts/ABC Favorit Mono/ABCFavoritMonoEdu-Light.woff') format('woff');
  font-weight: 300;
  font-style: normal;
}
@font-face {
  font-family: 'ABCFavoritMono';
  src: url('Fonts/ABC Favorit Mono/ABCFavoritMonoEdu-LightItalic.woff2') format('woff2'),
       url('Fonts/ABC Favorit Mono/ABCFavoritMonoEdu-LightItalic.woff') format('woff');
  font-weight: 300;
  font-style: italic;
}
@font-face {
  font-family: 'ABCFavoritMono';
  src: url('Fonts/ABC Favorit Mono/ABCFavoritMonoEdu-Book.woff2') format('woff2'),
       url('Fonts/ABC Favorit Mono/ABCFavoritMonoEdu-Book.woff') format('woff');
  font-weight: 350;
  font-style: normal;
}
@font-face {
  font-family: 'ABCFavoritMono';
  src: url('Fonts/ABC Favorit Mono/ABCFavoritMonoEdu-BookItalic.woff2') format('woff2'),
       url('Fonts/ABC Favorit Mono/ABCFavoritMonoEdu-BookItalic.woff') format('woff');
  font-weight: 350;
  font-style: italic;
}
@font-face {
  font-family: 'ABCFavoritMono';
  src: url('Fonts/ABC Favorit Mono/ABCFavoritMonoEdu-Regular.woff2') format('woff2'),
       url('Fonts/ABC Favorit Mono/ABCFavoritMonoEdu-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'ABCFavoritMono';
  src: url('Fonts/ABC Favorit Mono/ABCFavoritMonoEdu-RegularItalic.woff2') format('woff2'),
       url('Fonts/ABC Favorit Mono/ABCFavoritMonoEdu-RegularItalic.woff') format('woff');
  font-weight: 400;
  font-style: italic;
}
@font-face {
  font-family: 'ABCFavoritMono';
  src: url('Fonts/ABC Favorit Mono/ABCFavoritMonoEdu-Medium.woff2') format('woff2'),
       url('Fonts/ABC Favorit Mono/ABCFavoritMonoEdu-Medium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
}
@font-face {
  font-family: 'ABCFavoritMono';
  src: url('Fonts/ABC Favorit Mono/ABCFavoritMonoEdu-MediumItalic.woff2') format('woff2'),
       url('Fonts/ABC Favorit Mono/ABCFavoritMonoEdu-MediumItalic.woff') format('woff');
  font-weight: 500;
  font-style: italic;
}
@font-face {
  font-family: 'ABCFavoritMono';
  src: url('Fonts/ABC Favorit Mono/ABCFavoritMonoEdu-Bold.woff2') format('woff2'),
       url('Fonts/ABC Favorit Mono/ABCFavoritMonoEdu-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: 'ABCFavoritMono';
  src: url('Fonts/ABC Favorit Mono/ABCFavoritMonoEdu-BoldItalic.woff2') format('woff2'),
       url('Fonts/ABC Favorit Mono/ABCFavoritMonoEdu-BoldItalic.woff') format('woff');
  font-weight: 700;
  font-style: italic;
}

:root {
  --bg:         #050505;
  --bg-2:       #050505;
  --panel:      #050505;
  --panel-2:    #1e1e1e;
  --line:       #555555;
  --line-soft:  #1e1e1e;
  --text:       #f5f5f5;
  --text-soft:  #a5a5a5;
  --muted:      #555555;
  --accent:     #f5f5f5;
  --accent-2:   #a5a5a5;
  --danger:     #ff5050;
  --good:       #71d99e;

  --radius:     0;
  --radius-sm:  0;
  --shadow:     none;

  --font:       'ABCFavoritVariable', sans-serif;
  --mono:       'ABCFavoritMono', 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

body {
  font-family: var(--font);
  font-size: 20px;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============== APP GRID ============== */
.app {
  display: grid;
  grid-template-rows: auto 1fr;
  grid-template-columns: 320px 1fr;
  grid-template-areas:
    "topbar topbar"
    "sidebar stage";
  height: 100vh;
}

.app {
  transition: grid-template-columns 0.22s ease;
}
.app.sidebar-collapsed {
  grid-template-columns: 0 1fr;
}
.app.sidebar-collapsed .sidebar {
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  border-right: none;
}
.app.sidebar-collapsed .obj-toolbar { display: none !important; }

/* ============== TOPBAR ============== */
.topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  padding: 8px 18px;
  background: var(--bg);
  border-bottom: none;
  z-index: 5;
}

.brand {
  flex: 1 1 auto;
  min-width: 0;
  margin-right: 20px;
  white-space: nowrap;
  overflow: hidden;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  font-size: 14px;
  color: var(--text);
}

/* Mode-Toggle — Learning ↔ Kreativ. Sliding-Pill-Control. */
.mode-switch {
  flex: 0 0 auto;
  margin-right: 140px;
  display: inline-flex;
  align-items: center;
  gap: 0;
  position: relative;
  background: #1e1e1e;
  border: none;
  border-radius: var(--radius-sm);
  padding: 3px;
  cursor: pointer;
  user-select: none;
}
.mode-switch::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  background: var(--text);
  box-shadow: 0 1px 3px rgba(5,5,5,0.25);
  transition: transform 0.22s ease;
  pointer-events: none;
  z-index: 0;
}
.mode-switch[data-value=creative]::before {
  transform: translateX(100%);
}
.mode-switch-left,
.mode-switch-right {
  flex: 1;
  text-align: center;
  position: relative;
  z-index: 1;
  padding: 6px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-soft);
  transition: color 0.22s;
  white-space: nowrap;
}
.mode-switch[data-value="learning"] .mode-switch-left { color: var(--bg); }
.mode-switch[data-value="creative"] .mode-switch-right { color: var(--bg); }

/* =============== MODE-Sichtbarkeit =============== */
/* Im Learning-Mode: 20% heller als Creative Mode (Dunkelgrau) */
body.mode-learning {
  --bg:        #555555;
  --bg-2:      #555555;
  --panel:     #555555;
  --panel-2:   #a5a5a5;
  --line:      #a5a5a5;
  --line-soft: #a5a5a5;
  --muted:     #a5a5a5;
}

/* Topbar matches the Three.js canvas background color exactly (0x4d4d4d) */
body.mode-learning .topbar {
  background: #484848;
}

/* Im Learning-Mode: Sidebar weg, Stage volle Breite, creative-only-Elemente versteckt */
body.mode-learning .app {
  grid-template-columns: 0 1fr !important;
}
body.mode-learning .sidebar,
body.mode-learning .sidebar-edge,
body.mode-learning .creative-only {
  display: none !important;
}
/* Kreativ-Mode = Standard, nichts versteckt */
body.mode-creative .learning-only {
  display: none !important;
}

/* Moving-Fields-Kreativ-Mode: Topbar radikal reduziert auf Eingabe + Basis-Tools.
   Versteckt werden Preset/Gangart/Tutorial/Anwendung-Dropdowns + Save/Load. */
body.mode-creative.app-moving-fields .mf-creative-hide {
  display: none !important;
}

/* General-Einstellungen Panel: Anwendungs-spezifische Controls.
   mf-hide:  versteckt bei Moving Fields
   gen-hide: dauerhaft versteckt (nie im allgemeinen Panel angezeigt) */
body.app-moving-fields .panel-general .mf-hide { display: none; }
.panel-general .gen-hide { display: none; }
.panel-general .mf-show { display: none; }
body.app-moving-fields .panel-general .mf-show { display: flex; }

/* General panel: nur sichtbar wenn >1 Objekt vorhanden */
.panel-general { display: none; }
body.has-multi-objects .panel-general { display: block; }

/* Action panels: hidden by default, shown when the corresponding action is active */
.panel-settings-preset,
.panel-settings-video,
.panel-settings-gait,
.panel-settings-mf { display: none; }
body.action-preset .panel-settings-preset { display: block; }
body.action-video  .panel-settings-video  { display: block; }
body.action-gait   .panel-settings-gait   { display: block; }
body.action-mf     .panel-settings-mf     { display: block; }

/* In action modes: panel-general appears AFTER the action panel using flex order */
body.action-preset .panel-general,
body.action-video  .panel-general,
body.action-gait   .panel-general,
body.action-mf     .panel-general { order: 10; }

/* In action modes: object cards, add button and toolbar appear last (after all setting panels) */
body.action-preset .objects-container,
body.action-video  .objects-container,
body.action-gait   .objects-container,
body.action-mf     .objects-container,
body.action-preset .add-inline,
body.action-video  .add-inline,
body.action-gait   .add-inline,
body.action-mf     .add-inline,
body.action-preset #objToolbar,
body.action-video  #objToolbar,
body.action-gait   #objToolbar,
body.action-mf     #objToolbar { order: 20; }

/* In gait mode: merge panel-general visually into panel-settings-gait */
body.action-gait .panel-general .panel-head { display: none; }
body.action-gait .panel-general { margin-top: -4px; }

/* In MF mode: merge panel-general visually into panel-settings-mf */
body.action-mf .panel-general .panel-head { display: none; }
body.action-mf .panel-general { margin-top: -4px; }

/* In video mode: also show panel-general when video objects exist (even if only 1 object) */
body.action-video.has-video-objects .panel-general { display: block; }

/* Preset select: no border */
#preset, #anwendungSel { border: none; }

/* gait-show: realistisch + abstrakt (Easing im Raum) */
.panel-general .gait-show { display: none; }
body.app-gait .panel-general .gait-show { display: flex; }

/* gait-realistic-switch: nur realistisch (Interpolation + Distanz) */
.panel-general .gait-realistic-switch { display: none; }
body.app-gait.gait-realistic .panel-general .gait-realistic-switch { display: flex; }

/* gait-realistic-show / gait-abstract-show: Geschwindigkeits-Slider */
.panel-general .gait-realistic-show { display: none; }
body.app-gait.gait-realistic .panel-general .gait-realistic-show { display: flex; }
.panel-general .gait-abstract-show { display: none; }
body.app-gait.gait-abstract .panel-general .gait-abstract-show { display: flex; }

/* gait-hide: versteckt bei allen Gangarten (Easing, Amplitude, Rhythmus, Gewicht, Easing-Kurve) */
body.app-gait .panel-general .gait-hide { display: none; }

/* Step-Slider: range + Beschriftungszeile */
.step-slider-wrap { display: flex; flex-direction: column; width: 100%; gap: 4px; }
.step-labels {
  display: flex;
  justify-content: space-between;
  padding: 0 6px;
}
.step-labels span {
  font-size: 11px;
  color: var(--text-soft);
  font-family: var(--mono);
  text-align: center;
  font-weight: 500;
}
.sidebar-edge {
  position: fixed;
  left: 312px;
  top: 56px;
  width: 16px;
  height: calc(100vh - 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 120;
  transition: left 0.22s ease;
}
.sidebar-edge-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 52px;
  background: var(--bg-2);
  border: none;
  color: var(--text-soft);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, color 0.1s;
}
.sidebar-edge:hover .sidebar-edge-btn {
  opacity: 1;
  pointer-events: auto;
}
.sidebar-edge-btn:hover { color: var(--text); }
.sidebar-edge-btn svg { transition: transform 0.22s ease; }
body.sidebar-collapsed .sidebar-edge { left: 0; }
body.sidebar-collapsed .sidebar-edge-btn {
  opacity: 1;
  pointer-events: auto;
}
body.sidebar-collapsed .sidebar-edge-btn svg { transform: rotate(180deg); }

.steuerung {
  flex: 0 0 auto;
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: flex-start;
  gap: 8px;
}
.st-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============== BUTTONS / TOGGLES / SELECTS ============== */
.ctrl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  background: var(--bg);
  color: var(--text);
  border: none;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  transition: background 0.1s;
  user-select: none;
  font-weight: 500;
}
.ctrl:hover { background: var(--panel); }
.ctrl:active { background: var(--panel-2); }

/* Reset + Info: no resting background, only hover/active feedback */
#reset,
.info-btn {
  background: transparent;
}
#reset:hover,
.info-btn:hover {
  background: var(--panel);
}
#reset:active,
.info-btn:active {
  background: var(--panel-2);
}

/* Create mode: Reset, Save, Import & Info share the Actions-button hover */
body.mode-creative #reset:hover,
body.mode-creative .info-btn:hover,
body.mode-creative #savePreset:hover,
body.mode-creative #loadPreset:hover {
  background: var(--panel-2);
}
.ctrl[data-state="an"] {
  background: var(--danger);
  color: #f5f5f5;
}
.ctrl.primary {
  background: var(--text);
  color: var(--bg);
  font-weight: 500;
}
.ctrl.primary:hover { background: #f5f5f5; }

/* Play — most important action, always visually primary */
.ctrl-play {
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  padding: 0 18px;
}
.ctrl-play:hover { background: #f5f5f5 !important; color: var(--bg); }
.ctrl-play[data-state="an"] {
  background: var(--danger);
  color: #f5f5f5;
}
.ctrl-play[data-state="an"]:hover { background: #ff6060 !important; }

/* Add Object — distinct secondary action, outlined */
.ctrl-add {
  color: var(--text);
}
.ctrl-add:hover { background: var(--panel); }

/* Topbar visual group separator */
.topbar-sep {
  width: 1px;
  height: 20px;
  background: var(--line);
  flex-shrink: 0;
  margin: 0 2px;
}

.icon {
  width: 12px; height: 12px;
  display: inline-block;
  background: currentColor;
  -webkit-mask-size: contain;  mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
}
/* Play/Pause-Icon etwas grösser als die übrigen Steuer-Icons */
.ctrl-play .icon { width: 15px; height: 15px; }
.icon-play  { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M8 5v14l11-7z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M8 5v14l11-7z'/></svg>"); }
.icon-pause { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M6 5h4v14H6zM14 5h4v14h-4z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M6 5h4v14H6zM14 5h4v14h-4z'/></svg>"); }
.icon-reset { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><path d='M22.21,41.51c.24-.84,6.07-20.56,27.21-20.56,10.75,0,17.55,5.19,21.65,10.3h-14.45v11.36h32.85V9.4h-11.14v11.69c-7.32-7.62-17.06-11.62-28.4-11.62-31.99,0-39.27,31.03-39.34,31.34l-.38,1.73h11.73s.29-1.03.29-1.03Z'/><path d='M78.08,57.46l-.29,1.03c-.24.84-6.07,20.56-27.21,20.56-10.75,0-17.55-5.19-21.65-10.3h14.45v-11.36H10.54v33.21h11.14v-11.69c7.32,7.62,17.06,11.62,28.4,11.62,31.99,0,39.27-31.03,39.34-31.34l.38-1.73h-11.73Z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><path d='M22.21,41.51c.24-.84,6.07-20.56,27.21-20.56,10.75,0,17.55,5.19,21.65,10.3h-14.45v11.36h32.85V9.4h-11.14v11.69c-7.32-7.62-17.06-11.62-28.4-11.62-31.99,0-39.27,31.03-39.34,31.34l-.38,1.73h11.73s.29-1.03.29-1.03Z'/><path d='M78.08,57.46l-.29,1.03c-.24.84-6.07,20.56-27.21,20.56-10.75,0-17.55-5.19-21.65-10.3h14.45v-11.36H10.54v33.21h11.14v-11.69c7.32,7.62,17.06,11.62,28.4,11.62,31.99,0,39.27-31.03,39.34-31.34l.38-1.73h-11.73Z'/></svg>"); }
.icon-plus  { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><path d='M39.31,59.18H15.32v-18.37h23.99v-24.54h21.38v24.54h23.99v18.37h-23.99v24.54h-21.38v-24.54Z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><path d='M39.31,59.18H15.32v-18.37h23.99v-24.54h21.38v24.54h23.99v18.37h-23.99v24.54h-21.38v-24.54Z'/></svg>"); }
.icon-save  { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='76.79 88.75 50 66.75 23.21 88.75 23.21 11.25 76.79 11.25 76.79 88.75'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='76.79 88.75 50 66.75 23.21 88.75 23.21 11.25 76.79 11.25 76.79 88.75'/></svg>"); }
.icon-load  { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50 11.25 58.91 11.25 58.91 52.43 74.73 36.61 88.43 50.32 50 88.75 11.57 50.32 25.27 36.61 41.09 52.43 41.09 11.25 50 11.25'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50 11.25 58.91 11.25 58.91 52.43 74.73 36.61 88.43 50.32 50 88.75 11.57 50.32 25.27 36.61 41.09 52.43 41.09 11.25 50 11.25'/></svg>"); }

/* Toggle (Gitter, Spur) */
.gitter-wrap {
  position: relative;
  display: inline-flex;
}
.gitter-popup {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 200;
  background: var(--bg);
  border: none;
  padding: 14px 12px 10px;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
  font-size: 11px;
  letter-spacing: 0;
  color: var(--text-soft);
  min-width: 160px;
  font-weight: 500;
}
.gitter-popup-label { text-transform: none; }
.gitter-popup input[type="range"] { flex: 1; min-width: 80px; }
.gitter-popup #gitterOpacityVal { width: 22px; text-align: right; color: var(--text); }
.gitter-wrap:hover .gitter-popup { display: flex; }

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
}
.toggle:hover { border-color: var(--text-soft); }
.toggle input { display: none; }
.toggle .track {
  position: relative;
  width: 22px; height: 12px;
  background: transparent;
  border: 1px solid var(--text-soft);
  border-radius: 0;
  transition: border-color 0.15s, background 0.15s;
}
.toggle .track::after {
  content: "";
  position: absolute;
  left: 1px; top: 1px;
  width: 8px; height: 8px;
  background: var(--text-soft);
  border-radius: 0;
  transition: transform 0.15s, background 0.15s;
}
.toggle input:checked + .track { border-color: var(--text); background: transparent; }
.toggle input:checked + .track::after {
  transform: translateX(10px);
  background: var(--text);
}

.toggle .toggle-label {
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-soft);
  font-weight: 500;
}

/* Select */
.select, select {
  height: 32px;
  padding: 0 28px 0 10px;
  background-color: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 14px;
  letter-spacing: 0.05em;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='11.57 39.9 25.2 26.13 50.06 50.73 74.66 25.87 88.43 39.5 50.2 78.13 11.57 39.9' fill='%23a8a8ad'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 12px;
  cursor: pointer;
  font-weight: 500;
}
select:hover { border-color: var(--text-soft); }
select:focus { outline: none; border-color: var(--text); }

/* ============== SIDEBAR ============== */
.sidebar {
  grid-area: sidebar;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  min-width: 0;
  transition: opacity 0.15s;
  display: flex;
  flex-direction: column;
}

.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #1e1e1e; border-radius: 4px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: #555555; }

.panel {
  border-bottom: none;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 8px;
}
.panel-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
}
/*
.panel-head h3::before { content: '[ '; color: var(--muted); }
.panel-head h3::after  { content: ' ]'; color: var(--muted); }
*/

/* Kamera — globale Szenen-Einstellungen */
.panel-kamera {
  background: #1e1e1e;
  border-bottom: none;
  margin-bottom: 4px;
}
.panel-kamera .panel-head {
  padding-bottom: 10px;
  cursor: pointer;
  user-select: none;
}
.panel-kamera .panel-chevron {
  color: var(--muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.panel-kamera.collapsed .panel-chevron { transform: rotate(-90deg); }
.panel-kamera.collapsed .panel-body    { display: none; }
.panel-tag {
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  border: none;
  padding: 2px 6px;
  font-weight: 700;
}

/* Schnellwahl-Buttons — Sliding-Pill-Control, gleich wie beim Mode-Switch */
.quick-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: none;
  position: relative;
  background: var(--bg);
}
.quick-buttons::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background: var(--text);
  box-shadow: 0 1px 3px rgba(5,5,5,0.25);
  transition: transform 0.22s ease;
  pointer-events: none;
  z-index: 0;
}
.quick-buttons:not([data-active])::before { opacity: 0; }
.quick-buttons[data-active="tele"]::before { transform: translateX(100%); }
.quick-buttons > .quick-btn + .quick-btn {
  border-left: none;
}
.quick-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 12px;
  background: transparent;
  color: var(--text);
  border: 0;
  border-radius: 0;
  cursor: pointer;
  font: inherit;
  position: relative;
  z-index: 1;
  transition: color 0.22s ease;
  text-align: left;
}
.quick-btn:hover { background: rgba(245,245,245,0.05); }
.quick-btn.active { background: transparent; }
.quick-btn.active .quick-title { color: var(--bg); }
.quick-btn.active .quick-sub { color: var(--bg); opacity: 0.55; }
.quick-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0;
  text-transform: none;
  transition: color 0.22s ease;
}
.quick-sub {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-soft);
  transition: color 0.22s ease;
}
.panel-body {
  padding: 4px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.objects-container {
  display: flex;
  flex-direction: column;
}

/* Inline „Objekt hinzufügen" am Ende der Liste */
.add-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 10px 14px 14px;
  padding: 10px 12px;
  background: transparent;
  color: var(--text-soft);
  border: none;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  transition: color 0.1s;
  font-weight: 500;
}
.add-inline:hover {
  color: var(--text);
}
.add-inline .icon { width: 11px; height: 11px; }

.obj-toolbar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 320px;
  display: none;
  gap: 0;
  z-index: 50;
  border-top: none;
}
.obj-toolbar.visible { display: flex; }
.foot-btn {
  flex: 1;
  padding: 9px 10px;
  background: var(--bg-2);
  border: none;
  border-right: none;
  color: var(--text-soft);
  font: inherit;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  font-weight: 700;
}
.foot-btn:last-child { border-right: none; }
.foot-btn:hover { background: var(--bg); color: var(--text); }
.foot-btn-danger:hover { color: #c0392b; }
.objects-container.has-objects ~ .add-inline { margin-bottom: 50px; }

/* ============== ROWS / INPUTS ============== */
.row { display: flex; flex-direction: column; gap: 6px; }
.row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.row-head > label:first-child {
  flex: 1 1 auto;
  min-width: 0;
}
/* Fixe Breite für die Wertspalte: alle Value-Boxen stehen auf gleicher Höhe,
   dahinter bleibt reservierter Platz für die Einheit (z.B. "fps", "mm"). */
.row-head > input.value,
.row-head > .value-pair {
  flex: 0 0 88px;
  justify-content: flex-end;
}
.row label, .row-head label {
  font-size: 14px;
  color: var(--text-soft);
  letter-spacing: 0;
  text-transform: none;
  font-weight: 700;
}
.row .value {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text);
  background: transparent;
  border: none;
  padding: 2px 0;
  min-width: 56px;
  text-align: right;
  font-weight: 500;
}

/* Number-Input als Wertanzeige (manuell editierbar) */
input.value {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text);
  background: transparent;
  border: none;
  padding: 2px 0;
  min-width: 56px;
  width: 56px;
  text-align: right;
  appearance: textfield;
  -moz-appearance: textfield;
  cursor: text;
  outline: none;
  transition: background 0.1s;
  font-weight: 500;
}
input.value::-webkit-inner-spin-button,
input.value::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input.value:focus {
  background: var(--panel-2);
}

/* Value mit Einheit nebeneinander */
.value-pair {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.unit-suffix {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

/* Range slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 16px;
  background: transparent;
  cursor: pointer;
  padding: 0;
  margin: 0;
}

/* Webkit track — dünne graue Linie */
input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: var(--line);
  border: none;
}

/* Webkit thumb — kleines weisses Quadrat */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 5px;
  background: var(--text);
  border: none;
  border-radius: 0;
  margin-top: -2.5px;
}

/* Firefox track */
input[type="range"]::-moz-range-track {
  height: 1px;
  background: var(--line);
  border: none;
}

/* Firefox thumb */
input[type="range"]::-moz-range-thumb {
  width: 6px;
  height: 6px;
  background: var(--text);
  border: none;
  border-radius: 0;
}

/* Text + color */
input[type="text"] {
  height: 28px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
}
input[type="text"]::placeholder { color: var(--muted); }
input[type="text"]:focus { outline: none; }

.color-row { display: flex; align-items: center; gap: 8px; }

/* Farb-Swatch-Button (ersetzt input[type=color] in der Einstellungen-Leiste) */
.farbe-swatch-btn {
  width: 32px; height: 26px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

/* Farb-Palette-Popup */
.farbe-palette-popup {
  position: fixed;
  z-index: 9000;
  background: var(--panel);
  border: none;
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(5, 22px);
  gap: 4px;
}
.farbe-palette-popup[hidden] { display: none; }
.farbe-palette-popup .pal-swatch {
  width: 22px; height: 22px;
  border: none;
  cursor: pointer;
  padding: 0;
}
.farbe-palette-popup .pal-swatch.active { outline: 2px solid var(--text); outline-offset: 1px; }
input[type="color"] {
  width: 32px; height: 26px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 2px;
  cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 0; }
.color-hex {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text-soft);
  text-transform: none;
  font-weight: 500;
}

/* Segmented control */
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0;
}
.segmented button {
  flex: 1 1 auto;
  height: 26px;
  padding: 0 8px;
  font: inherit;
  font-size: 14px;
  letter-spacing: 0;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 500;
}
.segmented button:hover { color: var(--text); }
.segmented button.active {
  background: var(--text);
  color: var(--bg);
}
.segmented.compact button { font-size: 14px; padding: 0 6px;  font-weight: 700;}

/* Ausrichtung D-Pad */
.ausrichtung-dpad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.dpad-mid {
  display: flex;
  align-items: center;
  gap: 2px;
}
.dpad-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--bg);
  border: none;
  color: var(--text-soft);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.dpad-btn:hover { color: var(--text); }
.dpad-reset { width: 26px; }

.segmented.muster-icons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: transparent;
  border: none;
  padding: 0;
}
.form-selector { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.form-main-row {
  display: grid;
  grid-template-columns: repeat(3, 93px);
  gap: 4px;
}
/* Buttons participate directly in the parent 3-col grid */
.form-main-row .segmented.form-icons { display: contents; }
.form-expand-btn {
  display: flex; align-items: center; justify-content: center;
  width: 93px; height: 49px;
  background: transparent; border: none; cursor: pointer; color: var(--text-soft);
}
.form-expand-btn svg { transform: rotate(-90deg); transition: transform 0.2s ease; }
.form-expand-btn.open svg { transform: rotate(0deg); }
.form-extra-panel { width: 100%; }
.segmented.form-icons { background: transparent; border: none; padding: 0; }
.segmented.form-icons-extra {
  display: grid;
  grid-template-columns: repeat(3, 93px);
  gap: 4px;
  background: transparent;
  border: none;
  padding: 0;
}
.muster-icons.form-icons button,
.muster-icons.form-icons-extra button {
  width: 93px;
  height: 49px;
}

/* Moving Fields pixel-shape selector: all 4 shapes on one row */
#genPixelShape {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
#genPixelShape button {
  width: 100%;
  height: 49px;
}
.muster-icons button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 2px 5px;
  height: auto;
  border: none;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  font-weight: 500;
}
.muster-icons button svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.muster-icons button:hover { color: var(--text); }
.muster-icons button.active {
  background: var(--text);
  color: var(--bg);
}

/* ============== OBJECT CARDS ============== */
.object-card {
  border-bottom: none;
  background: var(--bg-2);
  transition: background 0.15s;
}
.object-card.collapsed .object-body { display: none; }
.object-card.collapsed .chevron svg { transform: rotate(-90deg); }

.object-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
}
.object-head:hover { background: rgba(245,245,245,0.02); }

.chevron {
  background: transparent;
  border: 0;
  color: var(--text-soft);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}
.chevron svg { transition: transform 0.2s; }

.swatch-wrap {
  position: relative;
  width: 14px; height: 14px;
  flex-shrink: 0;
  cursor: pointer;
}

.swatch {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  border-radius: 2px;
  background: var(--accent-2);
  box-shadow: 0 0 6px rgba(165,165,165,0.6);
}

.swatch-picker {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  pointer-events: none;
  border: none;
  padding: 0;
}

.object-title {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  padding: 2px 4px;
  margin: -2px 0;
  border-radius: var(--radius-sm);
  outline: none;
  border: none;
  min-width: 40px;
  cursor: text;
}
.object-title:hover { background: rgba(245,245,245,0.04); }
.object-title[contenteditable="true"] {
  background: var(--bg);
  cursor: text;
  user-select: text;
}

.icon-btn {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  border-radius: 4px;
}
.icon-btn:hover { color: var(--text); background: rgba(245,245,245,0.05); }
.icon-btn.delete:hover { color: var(--danger); background: rgba(255,107,107,0.08); }

.icon-btn.visibility .eye-closed { display: none; }
.object-card.hidden .icon-btn.visibility .eye-open   { display: none; }
.object-card.hidden .icon-btn.visibility .eye-closed { display: inline; }
.object-card.hidden .object-title,
.object-card.hidden .swatch { opacity: 0.35; }
.object-card.hidden .swatch { box-shadow: none !important; }

/* Glow-Toggle inline neben Farbe */
.toggle-inline {
  margin-left: auto;
  height: 26px;
  padding: 0 8px;
  background: transparent;
  border: 0;
  gap: 6px;
}
.toggle-inline .toggle-label { font-size: 14px;  font-weight: 500;}

/* Motion-Blur Toggle als eigene Zeile */
.row-inline { flex-direction: row; align-items: center; }
.toggle-inline-left {
  margin-left: 0;
  padding: 0;
  background: transparent;
  border: 0;
  gap: 8px;
  height: 24px;
}
.toggle-inline-left .toggle-label { font-size: 14px; color: var(--text-soft);  font-weight: 500;}

/* XYZ-Positionsgrid */
.xyz-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.xyz-axis {
  display: grid;
  grid-template-columns: 14px 1fr 40px;
  align-items: center;
  gap: 10px;
}
.xyz-axis .axis-label {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-2);
  text-align: center;
}
.xyz-axis .value.mini,
.xyz-axis input.value.mini {
  font-size: 11px;
  min-width: 44px;
  width: 44px;
  padding: 1px 4px;
  text-align: right;
}

.object-body {
  padding: 0 12px 12px;
}
.sub {
  padding: 10px 0 4px;
  border-top: none;
}
.sub:first-child { border-top: 0; padding-top: 4px; }
.sub h4 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-soft);
}
.sub .row + .row { margin-top: 10px; }

/* --- Sub-section hierarchy --- */

/* Bewegung: core section, most prominent heading */
.sub-bewegung {
  border-top: none;
}
.sub-bewegung h4 {
  color: var(--text);
  font-size: 14px;
}

/* Objekt: standard section, slightly more visible than default */
.sub-objekt h4 {
  color: var(--text-soft);
}

.sub-echo h4,
.sub-schweif h4 {
  font-size: 14px;
  color: var(--text-soft);
}

/* ============== STAGE / CANVAS ============== */
.stage {
  grid-area: stage;
  position: relative;
  background: var(--bg);
  overflow: hidden;
}
#canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}
#canvas:active { cursor: grabbing; }
.hover-overlay {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 10;
}

.draw-mode-hint {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(5,5,5,0.75);
  border: none;
  backdrop-filter: blur(4px);
  color: var(--text);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  padding: 7px 14px;
  pointer-events: none;
  z-index: 30;
  white-space: nowrap;
  font-weight: 500;
}
.draw-mode-hint[hidden] { display: none; }

.ghost-dog-overlay {
  position: absolute;
  top: 16px;
  left: 16px;
  height: 220px;
  width: auto;
  pointer-events: none;
  z-index: 20;
  opacity: 0.9;
}
.ghost-dog-overlay[hidden] { display: none; }

.stage-meta {
  position: absolute;
  bottom: 14px;
  left: 14px;
  display: flex;
  gap: 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: none;
  color: var(--text-soft);
  background: rgba(5,5,5,0.7);
  backdrop-filter: blur(4px);
  border: none;
  border-radius: var(--radius);
  padding: 6px 10px;
  pointer-events: none;
  font-weight: 500;
}
.meta-item { display: flex; align-items: center; gap: 6px; }
.meta-item .dot {
  width: 5px; height: 5px;
  border-radius: 0;
  background: var(--good);
}

/* ============== TUTORIAL OVERLAY ============== */
.tutorial-overlay {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(620px, calc(100vw - 60px));
  background: rgba(5,5,5,0.92);
  border-radius: var(--radius);
  padding: 14px 16px 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--text);
  animation: tutFadeIn 0.2s ease-out;
}
.tutorial-overlay[hidden] { display: none; }

@keyframes tutFadeIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.tut-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tut-title {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
}
/*
.tut-title::before { content: '[ '; color: var(--muted); }
.tut-title::after  { content: ' ]'; color: var(--muted); }
*/
.tut-step {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--text-soft);
  font-weight: 500;
}
.tut-exit {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
}
.tut-exit:hover { color: var(--danger); background: rgba(255,107,107,0.08); }
.tut-speak {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
}
.tut-speak:hover { color: var(--text); background: var(--panel-2); }
.tut-speak.active { color: var(--text); }
.tut-speak .tut-speak-icon-on  { display: none; }
.tut-speak .tut-speak-icon-off { display: block; }
.tut-speak.active .tut-speak-icon-on  { display: block; }
.tut-speak.active .tut-speak-icon-off { display: none; }

.tut-caption {
  font-size: 20px;
  line-height: 1.55;
  color: var(--text);
  min-height: 1.5em;
  font-weight: 700;
}

.tut-progress {
  height: 1px;
  background: var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.tut-progress-fill {
  height: 100%;
  background: var(--text);
  width: 0%;
  transition: width 0.1s linear, background 0.2s;
}
.tut-progress-fill.transition { background: var(--text-soft); }

.tut-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.tut-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: none;
  color: var(--text);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  transition: background 0.1s;
}
.tut-btn[hidden] { display: none; }
.tut-btn:hover { background: var(--panel); }
.tut-btn.primary {
  background: var(--text);
  color: var(--bg);
  font-weight: 500;
}
.tut-btn.primary:hover { background: #f5f5f5; }
.tut-btn.tut-btn-soft {
  background: transparent;
  color: var(--text-soft);
  margin-right: auto;
}
.tut-btn.tut-btn-soft:hover { background: var(--panel); color: var(--text); }

/* =============== ONBOARDING-OVERLAY =============== */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,5,5, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  animation: tutFadeIn 0.3s ease-out;
}
.onboarding-overlay[hidden] { display: none; }

.onboarding-card {
  width: min(700px, 100%);
  max-height: calc(100vh - 64px);
  overflow: auto;
  background: var(--bg);
  padding: 28px 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  color: var(--text);
}
.onboarding-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.onboarding-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
}
.onboarding-lead {
  margin: 0;
  font-size: 20px;
  line-height: 1.55;
  color: var(--text);
  font-weight: 700;
}
.onboarding-mode-label {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-soft);
}
.onboarding-lead span { display: block; }
.onboarding-lead span + span { margin-top: 0.5em; }
.onboarding-mode-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.onboarding-card .mode-switch {
  margin-right: 0;
  flex-shrink: 0;
}
.onboarding-mode-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.onboarding-mode-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
  color: var(--text-soft);
  font-weight: 500;
}
.onboarding-actions {
  display: flex;
  justify-content: center;
}
.onboarding-actions .tut-btn { padding-top: 8px; padding-bottom: 8px; padding-left: 20px; padding-right: 20px; }
.onboarding-disclaimer {
  position: absolute;
  bottom: 24px;
  left: 0;
  right: 0;
  text-align: center;
  margin: 0;
  font-size: 11px;
  line-height: 1.55;
  color: var(--text-soft);
  pointer-events: auto;
  font-weight: 500;
}
.onboarding-disclaimer a {
  color: var(--text-soft);
  text-decoration: none;
}
.onboarding-disclaimer a:hover { color: var(--text); }
@media (max-width: 560px) {
  .onboarding-modes { grid-template-columns: 1fr; }
}

/* Im create-Modus: Overlays mit weissem Glow-Shadow */
body.mode-creative .onboarding-card,
body.mode-creative .tutorial-overlay {
  box-shadow: 0 0 0 1px rgba(245,245,245,0.1), 0 8px 40px rgba(245,245,245,0.06);
}

/* =============== INFO-BUTTON & INFO-OVERLAY =============== */
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-btn {
  flex: 0 0 auto;
}
.info-btn svg { flex-shrink: 0; }

/* Freie Zahl-Eingabe für Moving Fields */
.free-field-input {
  font-family: var(--mono);
  letter-spacing: 0;
  width: 100% !important;
  height: 32px !important;
  box-sizing: border-box;
  cursor: text;
}
.free-field-input::placeholder {
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
}

.info-card {
  width: min(900px, 100%);
  box-shadow: none;
}
.info-section + .info-section {
  border-top: none;
  padding-top: 14px;
}
.info-section h3 {
  margin: 0 0 12px;
  margin-left: 178px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
}
.info-paragraph {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-soft);
  font-weight: 500;
}
.info-paragraph strong {
  color: var(--text);
  font-weight: 700;
}
.info-glossary {
  margin: 0;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px 18px;
}
.info-glossary dt {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  align-self: start;
}
.info-glossary dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-soft);
  font-weight: 500;
}
.info-glossary dd em { color: var(--text); font-style: normal; }
.info-card a {
  color: inherit;
  text-decoration: none;
}
.info-card a:hover { color: var(--text); }
@media (max-width: 560px) {
  .info-glossary { grid-template-columns: 1fr; gap: 4px 0; }
  .info-glossary dd { padding-bottom: 8px; border-bottom: none; }
  .info-section h3 { margin-left: 0; }
}

/* ============== EMPTY STATE ============== */
.objects-container:empty::before {
  content: "No object added yet.";
  display: block;
  padding: 18px 16px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  border-top: none;
  font-weight: 500;
}

/* ============== RESPONSIVE ============== */

/* Mobiles Layout (Sidebar unter Topbar) */
@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
    grid-template-areas: "topbar" "sidebar" "stage";
  }
  .sidebar { max-height: 45vh; }
}

/* ============== KLANG PANEL ============== */
.klang-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
}
.klang-settings-btn {
  width: 26px;
  height: 26px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  border: none;
}
.klang-settings-btn:hover { color: var(--text); }
.klang-settings-btn.active {
  color: var(--text);
  background: var(--panel);
}
.klang-panel {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 240px;
  background: var(--panel);
  border: none;
  z-index: 100;
  padding: 12px;
  gap: 12px;
  display: none;
  flex-direction: column;
}
.klang-panel.open { display: flex; }
.kp-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kp-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.kp-title {
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-soft);
  font-weight: 700;
}
.kp-val {
  font-size: 11px;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  font-family: var(--mono);
}
.kp-section input[type="range"] { width: 100%; }

/* ============== VIDEO-ANALYSE PANEL ============== */
.panel-video {
  background: #1e1e1e;
  border-bottom: none;
  margin-bottom: 4px;
}
.panel-video .panel-head {
  padding-bottom: 10px;
  cursor: pointer;
  user-select: none;
}
.panel-video .panel-chevron {
  color: var(--muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.panel-video.collapsed .panel-chevron { transform: rotate(-90deg); }
.panel-video.collapsed .panel-body    { display: none; }

/* General-Einstellungen Panel + Video Analysis Panel — gleiche Optik */
.panel-general,
.panel-video-general {
  background: #1e1e1e;
  border-bottom: none;
  margin-bottom: 4px;
}
.panel-general .panel-head,
.panel-video-general .panel-head {
  padding-bottom: 10px;
  cursor: pointer;
  user-select: none;
}
.panel-general .panel-chevron,
.panel-settings-preset .panel-chevron,
.panel-settings-video .panel-chevron,
.panel-settings-gait .panel-chevron,
.panel-settings-mf .panel-chevron {
  color: var(--muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.panel-general.collapsed .panel-chevron,
.panel-settings-preset.collapsed .panel-chevron,
.panel-settings-video.collapsed .panel-chevron,
.panel-settings-gait.collapsed .panel-chevron,
.panel-settings-mf.collapsed .panel-chevron { transform: rotate(-90deg); }
.panel-general.collapsed .panel-body,
.panel-settings-preset.collapsed .panel-body,
.panel-settings-video.collapsed .panel-body,
.panel-settings-gait.collapsed .panel-body,
.panel-settings-mf.collapsed .panel-body { display: none; }

/* Action panels: same dark background as panel-general */
.panel-settings-preset,
.panel-settings-video,
.panel-settings-gait,
.panel-settings-mf {
  background: #1e1e1e;
  border-bottom: none;
  margin-bottom: 4px;
}
.panel-settings-preset .panel-head,
.panel-settings-video .panel-head,
.panel-settings-gait .panel-head,
.panel-settings-mf .panel-head {
  padding-bottom: 10px;
  cursor: pointer;
  user-select: none;
}

/* Creative-nav action buttons: dark-mode styling like Lessons but inverted */
.creative-nav .learn-nav-tut-item {
  background: transparent;
}
.creative-nav .learn-nav-tut-item:hover { background: var(--panel-2); }
.creative-nav .learn-nav-tut-item.active { background: var(--panel-2); color: var(--text); }

.general-hint {
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 10px;
  letter-spacing: 0.04em;
  line-height: 1.4;
  font-weight: 500;
}
.general-hint strong {
  color: var(--text);
  font-weight: 700;
  text-transform: none;
}

/* Mixed-State: graut Controls aus, deren Werte über Objekte hinweg differieren */
.panel-general .row.mixed,
.panel-general .segmented.mixed,
.panel-general .toggle.mixed,
.panel-general .color-row.mixed-farbe > .farbe-swatch-btn,
.panel-general .color-row.mixed-farbe > .color-hex {
  opacity: 0.4;
}
.panel-general .segmented.mixed button.active {
  background: none;
  color: var(--text);
}

.video-file-label {
  cursor: pointer;
  width: 100%;
  justify-content: flex-start;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 500;
}
.video-file-label input[type="file"],
.svg-file-label input[type="file"] { display: none; }
#videoFileName {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-parts {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}
.video-part-check {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-soft);
  cursor: pointer;
  user-select: none;
  font-weight: 500;
}
.video-part-check input[type="checkbox"] {
  width: 12px;
  height: 12px;
  accent-color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}
.video-part-check.detected {
  color: #66dd88;
}
.video-part-check.detected::after {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #66dd88;
  margin-left: 4px;
  flex-shrink: 0;
}

.video-progress {
  width: 100%;
  height: 2px;
  background: var(--line);
  margin-bottom: 5px;
}
.video-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--text);
  transition: width 0.15s ease;
}
.video-status {
  font-size: 11px;
  color: var(--text-soft);
  letter-spacing: 0;
  font-weight: 500;
}

.webcam-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}
.webcam-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e04a55;
  animation: webcam-pulse 1s infinite;
}
@keyframes webcam-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

.ctrl-video-add {
  width: 100%;
  justify-content: center;
}
.ctrl-video-add:not(:disabled) {
  background: var(--text);
  color: var(--bg);
  font-weight: 500;
}
.ctrl-video-add:not(:disabled):hover {
  background: #f5f5f5;
}
.ctrl-video-add:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

#videoAnalyzeBtn { width: 100%; justify-content: center; }

.panel-section-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 4px;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-soft);
  font-weight: 500;
}
.panel-section-divider::before,
.panel-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ============== MODE NAVIGATIONS (Learning + Creative) ============== */
.learn-nav,
.creative-nav {
  position: fixed;
  top: 56px;
  right: 18px;
  z-index: 50;
}

.creative-nav.creative-nav-open .learn-nav-drawer { display: flex; }


.learn-nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  height: 38px;
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.1s;
}
.learn-nav-toggle:hover { background: var(--panel-2); }

/* Observe mode: Lesson button shares the Info-button hover */
body.mode-learning #learnNavToggle:hover {
  background: var(--panel);
}

.learn-nav-drawer {
  display: none;
  position: absolute;
  top: 40px;
  right: 0;
  flex-direction: column;
  background: var(--panel);
  border: none;
  border-top: none;
  min-width: 280px;
}
.learn-nav.learn-nav-open .learn-nav-drawer { display: flex; }

.learn-nav-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: none;
}
.learn-nav-section:last-child { border-bottom: none; padding-top: 4px; }

.learn-nav-va-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: inherit;
}
.learn-nav-va-toggle .panel-chevron { transition: transform 0.2s; transform: rotate(-90deg); }
.learn-nav-va-toggle.open .panel-chevron { transform: rotate(0deg); }
.learn-nav-va-body { display: flex; flex-direction: column; gap: 12px; padding-top: 6px; }
.learn-nav-va-body[hidden] { display: none; }

.learn-nav-label {
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-soft);
  font-weight: 500;
}
.learn-nav-section .select { width: 100%; }
/* Select-Wrap: animierter Dropdown-Pfeil */
.select-wrap {
  position: relative;
  width: 100%;
}
.select-wrap .select {
  background-image: none;
  width: 100%;
}
.select-wrap::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='11.57 39.9 25.2 26.13 50.06 50.73 74.66 25.87 88.43 39.5 50.2 78.13 11.57 39.9' fill='%23a8a8ad'/></svg>");
  background-repeat: no-repeat;
  background-size: 12px 12px;
  pointer-events: none;
  transition: transform 0.2s ease;
}
.select-wrap:focus-within::after {
  transform: translateY(-50%) rotate(180deg);
}
.learn-nav-section input[type="text"] { width: 100%; height: 32px; }


.learn-nav-tut-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: #484848;
  border: none;
  border-bottom: none;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s;
}
.learn-nav-tut-item:last-child { border-bottom: none; }
.learn-nav-tut-item:hover { background: var(--panel); }

/* ------------------------------------------------------------------ */
/* Easing Picker (Familie-Dropdown + In/Out-Radio-Buttons)             */
/* ------------------------------------------------------------------ */
.easing-picker {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}
.easing-select-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.easing-select-row .select-wrap { flex: 1; min-width: 0; }
.easing-info-btn {
  display: flex;
  align-items: center;
  color: var(--muted);
  text-decoration: none;
  flex-shrink: 0;
  padding: 2px;
}
.easing-info-btn:hover { color: var(--text); }
.easing-dir-row {
  display: flex;
  background: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
}
.easing-dir-row[hidden] { display: none; }
.easing-dir-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  font: inherit;
  font-size: 14px;
  color: var(--text-soft);
  cursor: pointer;
  user-select: none;
  letter-spacing: 0;
  border-right: none;
  font-weight: 500;
}
.easing-dir-btn:last-child { border-right: none; }
.easing-dir-btn input[type="radio"] { display: none; }
.easing-dir-btn:has(input:checked) {
  background: var(--text);
  color: var(--bg);
}

/* ============== TUTORIAL LABELS ============== */
.tutorial-labels {
  position: absolute;
  top: 50%;
  right: 24px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: none;
  z-index: 20;
}
.tutorial-labels[hidden] { display: none; }
.tutorial-label {
  background: #050505;
  border: none;
  color: var(--lc, #f5f5f5);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.tutorial-label[hidden] { display: none; }
