/* Cockpit 6b — v6.0 (28.09.2026): „Pro“-Optik + Stundenseite Regie/Bühne.
   Florian 25.09.: mehr Business, bewusster Kontrast zu den Kinderdesigns der Schule — Pro-Dark (Linear/Things) gemischt mit
   Apple-Werkzeug (System-Look): Grafit, Systemschrift, EIN Akzent, Haarlinien statt Schatten, Fachfarbe nur als kleiner Punkt.
   Folgt weiter der Systemeinstellung hell/dunkel; die Bühne (Beamer) ist immer dunkel. Lädt als letztes Stylesheet. */

/* ---------- Farben ---------- */
:root {
  --v3-ground: #f6f6f7; --v3-side: #efeff1; --v3-card: #ffffff; --v3-card2: #f1f1f3; --v3-line: #e4e4e7; --v3-line2: #d4d4d8;
  --v3-ink: #18181b; --v3-ink2: #52525b; --v3-ink3: #86868f; --v3-accent: #3b6fd8;
  --v3-shadow: 0 0 0 1px var(--v3-line);
  --v6-live: #3b6fd8; --v6-livebg: #eef3fd; --v6-on: #2f5fc4; --v6-ontxt: #ffffff; --v6-pop: 0 16px 48px rgba(20, 20, 30, .18);
}
@media (prefers-color-scheme: dark) {
  :root {
    --v3-ground: #121214; --v3-side: #151518; --v3-card: #1a1a1d; --v3-card2: #232327; --v3-line: #2a2a2e; --v3-line2: #34343a;
    --v3-ink: #f2f2f3; --v3-ink2: #a8a8b0; --v3-ink3: #7f7f88; --v3-accent: #7aa2f7;
    --v3-shadow: 0 0 0 1px var(--v3-line);
    --v6-live: #3d5a8c; --v6-livebg: #1a2233; --v6-on: #2b3b5c; --v6-ontxt: #ffffff; --v6-pop: 0 16px 48px rgba(0, 0, 0, .55);
  }
}
body { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, sans-serif; font-variant-numeric: tabular-nums; }

/* ---------- ruhigere Formen überall: Haarlinien statt Schatten, kleinere Radien ---------- */
.v3card { border-radius: 10px; box-shadow: 0 0 0 1px var(--v3-line); }
.v3btn { border-radius: 8px; }
.v3nav { border-radius: 8px; }
.v3nav.on { box-shadow: 0 0 0 1px var(--v3-line); }
.v3chip { border-radius: 6px; }
.v3hdr h1 { font-weight: 700; letter-spacing: -.015em; }
.v3brand { font-weight: 700; }

/* ---------- Stundenseite v6: Vollbild (Seitenleiste weg) ---------- */
body.v6voll .v3app { grid-template-columns: minmax(0, 1fr); }
body.v6voll .v3side { display: none; }
body.v6voll .v3main { overflow: hidden; }
body.v6voll .qadd { display: none; }
.v3page.v6stunde { height: 100vh; height: 100dvh; max-width: none; padding: 0; display: flex; flex-direction: column; overflow: hidden; }

.v6head { display: flex; align-items: center; gap: 14px; padding: calc(12px + env(safe-area-inset-top)) 24px 10px; flex: none; min-width: 0; }
.v6back { width: 44px; height: 44px; flex: none; border: 1px solid var(--v3-line); border-radius: 8px; background: var(--v3-card); color: var(--v3-ink2); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.v6back svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.v6tit { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.v6meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--v3-ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v6dot { width: 7px; height: 7px; border-radius: 50%; background: var(--fc, var(--v3-ink3)); flex: none; }
.v6title { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.01em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v6tools { display: flex; gap: 6px; flex: none; }
.v6tool { height: 36px; padding: 0 12px; border: 1px solid var(--v3-line); border-radius: 8px; background: transparent; color: var(--v3-ink2); font: 600 13px/1 inherit; display: inline-flex; align-items: center; text-decoration: none; cursor: pointer; white-space: nowrap; }
.v6tool.held.on { color: #3fbf7a; border-color: rgba(63, 191, 122, .45); }

.v6stunde .v5prep { margin: 0 24px 8px; flex: none; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; border-radius: 8px; padding: 6px 8px; gap: 6px; }
.v6stunde .v5prep::-webkit-scrollbar { display: none; }
.v6stunde .v5prep .v5pc { flex: none; max-width: 340px; }

.v6leiste { display: flex; gap: 3px; padding: 0 24px; flex: none; height: 50px; }
.v6seg { flex-basis: 0; min-width: 0; border: 0; background: var(--v3-card2); color: var(--v3-ink2); text-align: left; padding: 0 10px; display: flex; flex-direction: column; justify-content: center; gap: 2px; cursor: pointer; position: relative; font-family: inherit; }
.v6seg::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--bc, transparent); opacity: .85; }
.v6seg:first-child { border-radius: 8px 0 0 8px; }
.v6seg:last-child { border-radius: 0 8px 8px 0; }
.v6seg span { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v6seg small { font-size: 12px; color: var(--v3-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v6seg.on { background: var(--v6-on); color: var(--v6-ontxt); }
.v6seg.on small { color: rgba(255, 255, 255, .78); }
.v6seg.mark { background: transparent; border: 1px dashed var(--v3-line2); color: var(--v3-ink3); cursor: default; max-width: 72px; }
.v6seg.mark::before { display: none; }
.v6seg.mark span { font-weight: 500; font-size: 12.5px; }
.v6seg.res { flex: none; width: 76px; background: transparent; border: 1px dashed var(--v3-line2); }
.v6seg.res::before { display: none; }
.v6seg.res.on { background: var(--v6-on); border-style: solid; }

.v6body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 470px; gap: 22px; padding: 16px 24px 12px; }
.v6lbl { font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--v3-ink3); }

/* Regie */
.v6regie { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-right: 6px; -webkit-overflow-scrolling: touch; }
.v6rchips { display: flex; flex-wrap: wrap; gap: 6px; }
.v6rc { font-size: 12.5px; font-weight: 600; padding: 3px 9px; border-radius: 6px; background: var(--v3-card2); color: var(--v3-ink2); }
.v6rc.form { color: var(--bc); }
.v6rc.akz { color: var(--v3-accent); }
.v6auftrag { font-size: 25px; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; color: var(--v3-ink); }
.v6auftrag.soft { color: var(--v3-ink2); font-weight: 500; }
.v6auftrag a { color: var(--v3-accent); }
.v6regie .v5rows { display: grid; grid-template-columns: 108px minmax(0, 1fr); row-gap: 10px; column-gap: 14px; font-size: 15px; line-height: 1.38; padding-top: 12px; border-top: 1px solid var(--v3-line); margin: 0; }
.v6regie .v5k { color: var(--v3-ink3); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding-top: 2px; }
.v6regie .v5v { color: var(--v3-ink); }
.v6regie .v5loes { background: var(--v3-card); border: 1px solid var(--v3-line); border-radius: 8px; padding: 10px 12px; margin: 0; }
.v6regie .v5end { margin: 0; }
.v6resbox { margin-top: auto; text-align: left; border: 1px solid var(--v3-line); border-radius: 8px; background: var(--v3-card); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; font: 500 14px/1.35 inherit; color: var(--v3-ink2); cursor: pointer; }

/* Bühne */
.v6buehne { min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.v6bhd { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 28px; }
.v6status { border: 0; background: transparent; color: var(--v3-ink3); font: 600 12px/1 inherit; padding: 6px 8px; border-radius: 6px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.v6status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .7; }
.v6status.an { color: var(--v3-accent); }
.v6status.an::before { opacity: 1; }
.v6status.fehler { color: #ff6b5e; }
.v6vorschau { position: relative; width: 470px; height: 294px; flex: none; border: 1px solid var(--v3-line); border-radius: 8px; overflow: hidden; background: #0f0f11; }
.v6vorschau.live { border-color: var(--v6-live); }
.v6skal { position: absolute; left: 0; top: 0; width: 1280px; height: 800px; transform: scale(.36719); transform-origin: top left; pointer-events: none; }
.v6skal [data-timer] { pointer-events: auto; }
.v6steuer { display: flex; gap: 6px; flex: none; }
.v6sb { flex: 1; min-width: 0; height: 40px; border-radius: 8px; border: 1px solid var(--v3-line); background: var(--v3-card); color: var(--v3-ink); font: 600 14px/1 inherit; cursor: pointer; white-space: nowrap; padding: 0 8px; }
.v6sb.haupt { background: var(--v6-on); color: var(--v6-ontxt); border-color: var(--v6-on); flex: 2; }
.v6sb.rot { color: #ff6b5e; }
.v6sb:disabled { opacity: .4; cursor: default; }
.v6mini { border: 1px solid var(--v3-line); background: transparent; color: var(--v3-ink2); font: 600 12.5px/1 inherit; height: 30px; padding: 0 10px; border-radius: 6px; cursor: pointer; }
.v6karten { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; overflow-y: auto; min-height: 0; align-content: start; }
.v6karte { height: 58px; border: 1px solid var(--v3-line); border-radius: 8px; background: var(--v3-card); color: var(--v3-ink); text-align: left; padding: 0 12px; display: flex; flex-direction: column; justify-content: center; gap: 4px; cursor: pointer; min-width: 0; font-family: inherit; }
.v6karte .v6kart { font-size: 12px; color: var(--v3-ink3); font-weight: 500; }
.v6karte .v6ktit { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v6karte.an { border-color: var(--v6-live); background: var(--v6-livebg); }
.v6karte.an .v6kart { color: var(--v3-accent); font-weight: 600; }
.v6karte.leer { border-style: dashed; background: transparent; }
.v6karte.leer.an { border-style: solid; background: var(--v6-livebg); }
.v6regie.v6edit { overflow: hidden; gap: 10px; }
.v6edhd { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.v6edta { width: 100%; box-sizing: border-box; flex: 1; min-height: 140px; max-height: 300px; resize: none; border: 1px solid var(--v6-live); border-radius: 8px; background: var(--v3-card); color: var(--v3-ink);
  font: 16px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; padding: 10px 12px; }

/* Dock */
.v6dock { flex: none; height: 64px; box-sizing: content-box; padding: 0 24px env(safe-area-inset-bottom); border-top: 1px solid var(--v3-line); background: var(--v3-side); display: flex; align-items: center; justify-content: center; gap: 4px; }
.v6dk { height: 48px; min-width: 84px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--v3-ink2); font: 500 14px/1 inherit; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; white-space: nowrap; }
.v6dk svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.v6dk.on { background: var(--v3-card2); color: var(--v3-ink); }
.v6trenn { width: 1px; height: 28px; background: var(--v3-line); margin: 0 6px; }

/* Popover */
.v6pop { position: fixed; right: 24px; bottom: calc(76px + env(safe-area-inset-bottom)); width: 400px; max-height: min(70vh, 560px); overflow: auto; background: var(--v3-card); border: 1px solid var(--v3-line); border-radius: 12px; box-shadow: var(--v6-pop); padding: 14px 16px; z-index: 60; display: flex; flex-direction: column; gap: 12px; }
.v6pop.v6popfb, .v6pop.v6popbeamer { top: calc(66px + env(safe-area-inset-top)); bottom: auto; }
.v6pophd { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.v6pophd b { font-size: 15px; }
.v6popx { border: 0; background: var(--v3-card2); color: var(--v3-ink2); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.v6chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.v6chip { height: 38px; min-width: 44px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--v3-line); background: var(--v3-card2); color: var(--v3-ink); font: 600 14px/1 inherit; cursor: pointer; }
.v6chip.akz { background: var(--v3-accent); border-color: var(--v3-accent); color: #0b1020; }
@media (prefers-color-scheme: light) { .v6chip.akz { color: #fff; } }
.v6chip.on { border-color: var(--v3-accent); color: var(--v3-accent); }
.v6chip.rot { color: #ff6b5e; }
.v6klein { font-size: 13px; color: var(--v3-ink3); line-height: 1.4; }
.v6popsect { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding-top: 10px; border-top: 1px solid var(--v3-line); }
.v6popsect:first-of-type { border-top: 0; padding-top: 0; }
.v6adresse { font: 13px/1.35 ui-monospace, "SF Mono", Menlo, monospace; background: var(--v3-card2); padding: 8px 10px; border-radius: 6px; word-break: break-all; user-select: all; -webkit-user-select: all; }
.v6matrow { display: flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; color: var(--v3-ink); border-bottom: 1px solid var(--v3-line); }
.v6matrow:last-child { border-bottom: 0; }
.v6matsym { width: 22px; text-align: center; flex: none; }
.v6mattxt { display: flex; flex-direction: column; min-width: 0; }
.v6mattxt b { font-size: 14px; font-weight: 600; }
.v6mattxt small { font-size: 12px; color: var(--v3-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v6popfb .v5fb { margin: 0; }
.v6tbgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.v6tb { border: 1px solid var(--v3-line); border-radius: 8px; background: #0f0f11; padding: 0; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; }
.v6tb img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.v6tb small { font-size: 12px; color: #a8a8b0; padding: 4px 8px; text-align: left; }

/* Stift: Vollbild-Zeichenfläche */
body.v6stift-offen { overflow: hidden; }
.v6stift { position: fixed; inset: 0; z-index: 100; background: #09090b; display: flex; flex-direction: column; color: #d6d6db; }
/* Leiste bricht um, statt seitlich zu scrollen — „Fertig“ ist immer sichtbar (auch iPad hoch) */
.v6sleiste { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; border-bottom: 1px solid #2a2a2e; }
.v6sgruppe { display: flex; align-items: center; gap: 4px; flex: none; }
.v6sk { height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid #2f2f34; background: #1a1a1d; color: #d6d6db; font: 500 14px/1 -apple-system, "Segoe UI", sans-serif; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; white-space: nowrap; }
.v6sk.on { background: #2b3b5c; border-color: #3d5a8c; color: #fff; }
.v6sfarbe { width: 34px; height: 34px; border-radius: 50%; background: var(--c); border: 3px solid #09090b; box-shadow: 0 0 0 1px #3a3a40; cursor: pointer; padding: 0; }
.v6sfarbe.on { box-shadow: 0 0 0 2px #f2f2f3; }
.v6sdot { display: inline-block; width: var(--d); height: var(--d); border-radius: 50%; background: currentColor; }
.v6sfertig { height: 40px; padding: 0 22px; border-radius: 8px; border: 0; background: #7aa2f7; color: #0b1020; font: 600 15px/1 -apple-system, "Segoe UI", sans-serif; cursor: pointer; margin-left: 6px; }
.v6sleiste > .v6sgruppe:last-child { margin-left: auto; }
.v6sflaeche { flex: 1; position: relative; overflow: hidden; touch-action: none; cursor: crosshair; }
.v6sskal { position: absolute; width: 1280px; height: 800px; transform-origin: top left; box-shadow: 0 0 0 1px #2a2a2e; }

/* Vorher (v6): ruhig statt gelb, einklappbar, erledigte Punkte blass */
.v6vorher { margin: 0 24px 8px; flex: none; display: flex; align-items: center; gap: 10px; min-height: 40px; min-width: 0; }
.v6vlbl { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px 0 0; border: 0; background: transparent; color: var(--v3-ink3);
  font: 600 12px/1 inherit; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.v6vzahl { font-size: 12px; letter-spacing: 0; font-weight: 600; color: #e0a33b; background: rgba(224, 163, 59, .12); padding: 3px 7px; border-radius: 6px; }
.v6vzahl.ok { color: #3fbf7a; background: rgba(63, 191, 122, .12); }
.v6vfertig { font-size: 13px; color: var(--v3-ink3); }
.v6vliste { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.v6vliste::-webkit-scrollbar { display: none; }
.v6vp { flex: none; max-width: 330px; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border: 1px solid var(--v3-line); border-radius: 8px;
  background: var(--v3-card); font-size: 13.5px; color: var(--v3-ink); cursor: pointer; user-select: none; -webkit-user-select: none; box-sizing: border-box; }
.v6vbox { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--v3-ink3); display: grid; place-items: center; font-size: 10px; font-weight: 800; color: #fff; flex: none; box-sizing: border-box; }
.v6vt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v6vlink { color: var(--v3-accent); text-decoration: none; font-weight: 700; padding: 4px 0 4px 4px; }
.v6vp.done { background: transparent; }
.v6vp.done .v6vbox { background: #3fbf7a; border-color: #3fbf7a; }
.v6vp.done .v6vt { color: var(--v3-ink3); text-decoration: line-through; }
.v6vp:focus-visible { outline: 2px solid var(--v3-accent); }
/* Timer/Stoppuhr-Fenster links über der Regie — die Vorschau (dort wird der Timer gezogen) bleibt frei */
.v6pop.v6poptimer { right: auto; left: 24px; }
.v6einst { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; }
.v6einst p { margin: 0; font-size: 13.5px; line-height: 1.45; }

/* iPad hoch (und schmale Fenster): Regie oben groß, Bühne unten kompakt — Vorschau links, Karten rechts */
@media (max-width: 1040px) and (orientation: portrait) {
  .v6body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 14px; padding-top: 12px; }
  .v6buehne { display: grid; grid-template-columns: 400px minmax(0, 1fr); grid-template-areas: "h1 h2" "v k" "s k"; grid-template-rows: auto 250px auto; column-gap: 16px; row-gap: 8px; }
  .v6buehne > .v6bhd.eins { grid-area: h1; }
  .v6buehne > .v6bhd.zwei { grid-area: h2; }
  .v6buehne > .v6vorschau { grid-area: v; width: 400px; height: 250px; }
  .v6buehne > .v6vorschau .v6skal { transform: scale(.3125); }
  .v6buehne > .v6steuer { grid-area: s; }
  .v6buehne > .v6karten { grid-area: k; grid-template-columns: minmax(0, 1fr); max-height: 300px; }
  .v6karte { height: 56px; }
  .v6tools .v6tool { padding: 0 9px; }
  .v6dk { min-width: 0; padding: 0 10px; }
}
.v6regie .v5loes { align-self: stretch; }
.v6regie .v5loes.lang .v5loesg { grid-auto-flow: row; grid-template-rows: none; grid-template-columns: minmax(0, 1fr); row-gap: 5px; }
.v6regie .v5loesg .v5l { min-width: 0; }

/* Querformat mit wenig Breite (iPad 10,2″/mini, 1024 × 768): Bühne etwas schmaler, Regie behält Platz */
@media (max-width: 1120px) and (orientation: landscape) {
  .v6body { grid-template-columns: minmax(0, 1fr) 400px; gap: 18px; }
  .v6vorschau { width: 400px; height: 250px; }
  .v6skal { transform: scale(.3125); }
  .v6tools .v6tool { padding: 0 9px; }
  .v6dk { min-width: 0; padding: 0 10px; }
}
/* iPad hoch: Timer-Fenster rechts über den Karten — links unten liegt die Vorschau, in der der Timer gezogen wird */
@media (max-width: 1040px) and (orientation: portrait) {
  .v6pop.v6poptimer { left: auto; right: 24px; }
}
/* Tippen ohne Doppeltipp-Zoom und ohne Verzögerung */
.v6stunde button, .v6dock button, .v6stift button, .v6pop button, .v6karte, .v6seg { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
/* Hinweise (Toast) auch über der Zeichenfläche sichtbar */
.toast { z-index: 300; }
