/* ============================================================== *
 *  Kachelwerk – shared tokens + base + project overview
 *  Aesthetic: dark technical workbench, signal-amber accent,
 *  Bricolage Grotesque (display) + JetBrains Mono (technical).
 * ============================================================== */

:root {
  /* Seit 04.11.2026 abends die neutral-grauen Werte des Terminals (news/style.css) statt der
     blaustichigen Werkbank-Töne: --bg = --surface, --panel = --surface-1, --panel-2 = --surface-2,
     --surface = --surface-3, --surface-2 = --surface-4, --line = --outline-soft, --line-strong = --outline. */
  --bg:          #101215;
  --bg-soft:     #131518;
  --panel:       #171a1e;
  --panel-2:     #1c2025;
  --surface:     #22262c;
  --surface-2:   #282d34;
  --line:        #262b31;
  --line-soft:   #1f2328;
  --line-strong: #333940;

  --text:        #e4e6e9;   /* = --on-surface des Terminals (vorher #ffffff) */
  --text-dim:    #e4e6e9;
  --text-faint:  #e4e6e9;

  /* gedämpfte Schrift (Hinweise, Badges, JSON-Baum, Pfeile) — seit 02.11.2026 Tokens statt
     fester Grautöne, damit das Farbschema „Individuell“ sie mitziehen kann (farbschema.css) */
  --muted:       #a9b0b8;   /* = --on-surface-var des Terminals */
  --muted-2:     #8a929b;
  --muted-3:     #737b84;   /* = --on-surface-dim */

  /* Farbschema „Individuell“: Anteil des Gegenschemas in den Flächen (0 = Hell/Dunkel pur).
     theme_kopf.php setzt ihn inline auf <html>; dieser Rückfall MUSS stehen, sonst wäre jedes
     calc(var(--kw-anteil) …) in farbschema.css ungültig und die Farbe fiele auf inherit. */
  --kw-anteil:   0%;

  /* Schrift-Vergrößerung (A-Schalter): 1 = Default, 1.2, 1.4. Wird per
     Inline-Style auf <html> aus dem kw_fs-Cookie gesetzt (flackerfrei). */
  --fs-scale: 1;

  /* gemeinsame Hoehe der kleinen Kopfzeilen-Bedienelemente
     (Icon-Knoepfe, DE/EN-Schalter, A-Schalter) — damit sie auf einer Linie sitzen */
  --ctl-h: 30px;

  --accent:      #ffb84d;
  --accent-deep: #f5972f;
  --accent-ink:  #1c1304;
  --green:       #46e0a0;
  --blue:        #74a8ff;
  --cyan:        #43c9e8;
  --violet:      #b58cff;
  --red:         #ff6470;
  --rose:        #f43f5e;

  --radius:    14px;
  --radius-sm: 9px;
  --shadow:    0 22px 48px -22px rgba(0,0,0,.75);
  --shadow-sm: 0 8px 22px -12px rgba(0,0,0,.6);

  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
}

* { box-sizing: border-box; }

/* the [hidden] attribute must always win over author display rules */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* film-grain / atmosphere overlay -------------------------------- */
/* Seit 04.11.2026 abends aus: glatter Grund wie im Terminal (vorher Bernstein-/Blau-Leuchten). */
.grain { display: none; }
.overview::before { display: none; }   /* Punktraster aus (seit 04.11.2026 abends, wie das Terminal) */

/* ---- top bar --------------------------------------------------- */
.topbar {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 16px;                     /* seit 18.10.2026 flach wie die Editor-Kopfzeile (≈ 43 px) */
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
/* Linke Gruppe: Zurück-Pfeil + Marke. Seit 04.11.2026 überall derselbe Pfeil (.kopf-zurueck, lib/partials/kopf_zurueck.php) —
   der gerahmte Text-Pfeil .topbar-back des Editors ist weg. */
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-mark { color: var(--accent); display: inline-flex; filter: drop-shadow(0 0 10px rgba(255,184,77,.35)); }
.brand-name {
  font-weight: 700; font-size: 17px; letter-spacing: -.02em;
}
/* Kopfzeilen-Reihe oben rechts (Nachrichten, Ueberwachung, Einstellungen,
   seit 04.11.2026 nur noch das Zahnrad; DE/EN und Schriftgroesse auf einstellungen.php). Seit 18.10.2026 so flach wie im Editor
   (vorher 25 % groesser, 37,5 px): die ganze Kopfzeile ist damit ≈ 43 px hoch. */
.topbar-meta {
  --ctl-h: 32px;
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  font-family: var(--font-mono); font-size: calc(12px * var(--fs-scale)); letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-faint);
}
.topbar-meta .icon-btn { border-radius: 10px; }
.topbar-meta .icon-btn svg { width: 17px; height: 17px; }

/* Einheitliche Kopfzeile nach dem Terminal (seit 18.10.2026): links der rahmenlose
   Zurück-Pfeil, ganz rechts die Symbolleiste mit dem Zahnrad am Ende (lib/partials/kopf_zurueck.php,
   kopf_nav.php; bis 04.11.2026 abends nur das Zahnrad kopf_zahnrad.php) — auf Projekten, Editor, Datenbank-Viewer, Monitoring, RoRo, Einstellungen,
   Visualisierung, Reverse-Lab. Seit 04.11.2026 Maße und Farben EXAKT wie `.app-bar .icon-btn`
   im Terminal (news/style.css): runder 32-px-Knopf, Symbol 19 px, Schrift wie der Terminal-
   Nebentext (--on-surface-var: #a9b0b8, bei „Individuell" zur Hauptschrift #e4e6e9 gemischt),
   Hover hauchdünne Fläche, Druck 92 %; der Zurück-Pfeil ohne Fokusring (Wunsch 18.10.2026).
   Helle Grundlage in farbschema.css. test_kopf_zurueck.php hält beide Seiten deckungsgleich. */
.kopf-knopf {
  display: grid; place-items: center; flex: none;
  width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: transparent; cursor: pointer; text-decoration: none;
  color: color-mix(in srgb, #a9b0b8, #e4e6e9 calc(var(--kw-anteil) * 3));
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.kopf-knopf:hover { background: rgba(255,255,255,.08); color: #e4e6e9; }
.kopf-knopf:active { transform: scale(.92); }
.kopf-knopf svg { width: 19px; height: 19px; }
/* Startseite: unsichtbarer Platzhalter in Pfeilbreite, damit Symbol + Titel nicht hüpfen (seit 04.11.2026 abends). */
.kopf-platzhalter { visibility: hidden; pointer-events: none; }

/* ---- Einheitliche Kopfzeile nach dem Terminal (seit 04.11.2026 abends) ------------------------------
   Vorgabe: news/style.css .app-bar — 44 px hoch (inkl. Unterkante), 16 px Rand, links Pfeil (32 px) ·
   Symbol als 30-px-Kästchen mit 16 % getöntem Grund (Glyphe 18 px) · Titel Roboto 16 px / 500,
   je 12 px Abstand. Jede Seite hängt .kopfzeile / .kopf-links / .kopf-mark (Farbe über --k) /
   .kopf-titel an ihre eigenen Klassen; header.… schlägt die Seiten-Stile (editor.css, viz.css …).
   Messen: scratchpad-Skript kopf_mess.py bzw. Abschnitt „Kopfzeile“ in test_kopf_einheitlich.php. */
header.kopfzeile {
  box-sizing: border-box; height: 44px; min-height: 44px; flex: 0 0 44px;
  padding-top: 0; padding-bottom: 0; padding-left: 16px; padding-right: 16px;
  display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 16px;   /* schlägt die alte Handy-Spalte von .topbar */
  /* Fläche wie .app-bar: --panel (= --surface-1) zu 88 %, Unschärfe, Unterkante --line (= --outline-soft) */
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
header.kopfzeile .kopf-links { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 0 1 auto; }
header.kopfzeile .kopf-mark {
  display: grid; place-items: center; flex: none;
  width: 30px; height: 30px; border-radius: 9px;
  background: color-mix(in srgb, var(--k, var(--accent)) 16%, transparent);
  color: var(--k, var(--accent)); filter: none;
}
header.kopfzeile .kopf-mark svg { width: 18px; height: 18px; }
header.kopfzeile .kopf-titel {
  margin: 0; min-width: 0;
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: calc(16px * var(--fs-scale, 1)); font-weight: 500; letter-spacing: .1px; line-height: 24px;
  color: #e4e6e9;                       /* = --on-surface des Terminals (dunkel); hell: farbschema.css */
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
header.kopfzeile .kopf-titel * { font: inherit; letter-spacing: inherit; }
/* Symbolleiste oben rechts (lib/partials/kopf_nav.php, seit 04.11.2026 abends): Workflow · Terminal · RoRo ·
   Datenbank-Viewer · Monitoring · Einstellungen, nur Symbole, grau-weiß wie .kopf-knopf; die aktuelle Seite
   trägt ihre Kachelfarbe (--k). Die linke Gruppe gibt am Handy Platz ab (Titel mit Auslassung). */
.kopf-nav { display: flex; align-items: center; gap: 2px; flex: none; margin-left: auto; }
.kopf-nav .kopf-nav-knopf.is-aktiv { color: var(--k); }
.kopf-nav .kopf-nav-ende { margin-left: 6px; }   /* Zahnrad 8 px abgesetzt wie im Terminal (2 + 6) */
.kopf-nav .kopf-nav-anfang { margin-right: 6px; }   /* Startseite links ebenso 8 px abgesetzt (seit 05.11.2026) */
/* Aktive Seite (seit 04.11.2026): kurzer grauer Strich unter dem Symbol; das Zahnrad leuchtet aktiv
   heller — seine Kachelfarbe #9fb3c8 lag fast auf dem Grau der übrigen Symbole. */
.kopf-nav .kopf-nav-knopf { position: relative; }
.kopf-nav .kopf-nav-knopf.is-aktiv::after {
  content: ""; position: absolute; left: 9px; right: 9px; bottom: 0; height: 2px; border-radius: 1px; background: #858d97;
}
.kopf-nav .kopf-nav-ende.is-aktiv { color: #d6e6ff; }
:root[data-theme="light"] .kopf-nav .kopf-nav-knopf.is-aktiv::after { background: #a3abb5; }
/* Hell: die Grundfarbe der Kopfknöpfe (farbschema.css) darf die Kachelfarbe der aktiven Seite nicht überdecken. */
:root[data-theme="light"] .kopf-nav .kopf-nav-knopf.is-aktiv { color: var(--k); }
:root[data-theme="light"] .kopf-nav .kopf-nav-ende.is-aktiv { color: #1f5fa8; }
/* Scrollleiste wie im Terminal und immer reserviert: Kopfzeile und Knöpfe rechts stehen auf jeder
   Seite gleich breit, egal ob die Seite scrollt (vorher sprang alles um 10–15 px). */
html { scrollbar-gutter: stable; }
* { scrollbar-width: thin; scrollbar-color: #3a4149 transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #3a4149; border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #4b535c; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }
header.kopfzeile .topbar-meta { flex-wrap: nowrap; }   /* Startseite: Leiste nie in eine zweite Zeile */
/* Handy: Titel weg (das farbige Symbol zeigt die Seite), Knöpfe enger — so passen Pfeil, Symbol und Leiste in 390 px. */
@media (max-width: 620px) {
  header.kopfzeile .kopf-titel { display: none; }
  .kopf-nav .kopf-knopf { width: 28px; }
}
.kopf-zurueck:focus-visible { outline: none; }
/* Rechts in der Kopfzeile: Knöpfe wie im Terminal ohne Rahmen (Sprache und Schriftgröße seit
   04.11.2026 auf der Einstellungs-Seite, Abmelden seit 04.11.2026 abends ganz raus). */
.topbar-meta .icon-btn { border-color: transparent; background: transparent; }
.topbar-meta .icon-btn { border-radius: 50%; }
.topbar-meta .icon-btn:hover { border-color: transparent; background: rgba(255,255,255,.08); }

/* ---- shell / hero ---------------------------------------------- */
.shell { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 34px 34px 90px; }

.hero { margin-bottom: 34px; }
.eyebrow {
  font-family: var(--font-mono); font-size: calc(12px * var(--fs-scale)); letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 18px;
}
.hero-title {
  max-width: 680px;                      /* Textmass bleibt gekappt, die Knopfreihe darunter nicht */
  font-size: clamp(24px, 4.5vw, 52px);   /* halbe Groesse (vorher 48/9vw/104) */
  line-height: .92; letter-spacing: -.045em; font-weight: 800; margin: 0;
}
/* Knopfreihe der Startseite: eine umbrechende Zeile (Neues Projekt, Prompt,
   Kalender, Neuer Ordner) — Abstaende kommen aus gap, nicht aus Inline-Margins */
.hero-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px;
}

/* ---- buttons --------------------------------------------------- */
.btn {
  --bg-btn: var(--surface);
  display: inline-flex; align-items: center; vertical-align: middle; gap: 9px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--bg-btn);
  color: var(--text); font-size: calc(14px * var(--fs-scale)); font-weight: 500; cursor: pointer;
  transition: transform .12s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--text-faint); }
.btn:active { transform: translateY(0); }
.btn-accent {
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  color: var(--accent-ink); border-color: transparent; font-weight: 600;
  box-shadow: 0 10px 26px -12px rgba(255,160,60,.7);
}
.btn-accent:hover { border-color: transparent; box-shadow: 0 14px 30px -12px rgba(255,160,60,.85); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); }
.btn-danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, var(--line)); background: transparent; }
.btn-danger:hover { background: color-mix(in srgb, var(--red) 14%, transparent); }
.btn-lg { padding: 14px 22px; font-size: 16px; border-radius: 11px; }
.btn-icon { padding: 9px; }
.plus { font-size: 19px; line-height: 0; margin-top: -2px; }

/* Monitoring-Knopf in der Kopfzeile, links vom Zahnrad. Der Warnpunkt sitzt
   in der Ecke des Knopfs und erscheint nur, wenn die zuletzt festgehaltene
   Prüfung nicht grün war (assets/js/overview.js setzt hidden + Klasse). */

/* ---- project grid ---------------------------------------------- */
.projects {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}
.loading { color: var(--text-faint); font-family: var(--font-mono); font-size: calc(13px * var(--fs-scale)); padding: 30px 4px; }

.project-card {
  position: relative; display: flex; flex-direction: column;
  padding: 22px; min-height: 168px;
  background:
     linear-gradient(180deg, rgba(255,255,255,.02), transparent 40%),
     var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer; overflow: hidden;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.project-card::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 60%);
  transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.project-card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.project-card:hover::after { transform: scaleX(1); }
.project-card.opening {
  pointer-events: none;
  border-color: var(--accent);
  box-shadow: var(--shadow);
  opacity: .72;
}
.project-card.opening::after { transform: scaleX(1); }

.project-name {
  font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin: 4px 0 0;
  padding-right: 132px;       /* clear the action icons (top-right, 4 Stück) so the name wraps instead of sliding under them */
  overflow-wrap: anywhere;    /* break overly long unbroken names too */
}
.project-meta {
  margin-top: auto; padding-top: 18px; padding-right: 24px;   /* rechts Platz für die Zeitplan-LED */
  display: flex; align-items: center; gap: 14px;
  font-family: var(--font-mono); font-size: calc(11.5px * var(--fs-scale)); color: var(--text-faint);
}
.project-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--text-faint); }

/* Zeitplan-LED – unten rechts auf jeder Projektkarte.
   Grün = Zeitplan aktiv (atmet leise „läuft nach Plan"); Gelb = inaktiv/pausiert
   (ruhig, kein Alarm — passt zum Amber-Brandton). */
.sched-led {
  position: absolute; right: 16px; bottom: 18px;
  width: 10px; height: 10px; border-radius: 50%; pointer-events: none;
}
.sched-led::after {                 /* Glanzpunkt für physischen LED-Look */
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 33% 28%, rgba(255,255,255,.75), transparent 46%);
}
.sched-led.is-on {
  background: radial-gradient(circle at 50% 45%, #6ef0b0, #1f9d63 72%);
  box-shadow: 0 0 0 1px rgba(0,0,0,.4) inset,
              0 0 7px 1px rgba(60,220,150,.55), 0 0 15px 3px rgba(60,220,150,.22);
  animation: sched-led-breath 2.8s ease-in-out infinite;
}
.sched-led.is-off {
  background: radial-gradient(circle at 50% 45%, #f4d36a, #b78a1e 74%);
  box-shadow: 0 0 0 1px rgba(0,0,0,.4) inset, 0 0 5px 1px rgba(232,193,74,.30);
  opacity: .85;
}
@keyframes sched-led-breath {
  0%, 100% { box-shadow: 0 0 0 1px rgba(0,0,0,.4) inset,
                         0 0 6px 1px rgba(60,220,150,.45), 0 0 12px 2px rgba(60,220,150,.16); }
  50%      { box-shadow: 0 0 0 1px rgba(0,0,0,.4) inset,
                         0 0 10px 2px rgba(60,220,150,.70), 0 0 20px 5px rgba(60,220,150,.28); }
}
@media (prefers-reduced-motion: reduce) {
  .sched-led.is-on { animation: none; }
}
.project-id {
  font-family: var(--font-mono); font-size: calc(10.5px * var(--fs-scale)); color: var(--text-faint);
  letter-spacing: .04em; opacity: .7;
}
.card-actions {
  position: absolute; top: 14px; right: 14px; display: flex; gap: 6px;
  opacity: 0; transform: translateY(-4px); transition: .16s ease;
}
.project-card:hover .card-actions { opacity: 1; transform: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: var(--ctl-h); height: var(--ctl-h);
  border-radius: 8px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text-dim); cursor: pointer; transition: .14s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--text-faint); }
.icon-btn.danger:hover { color: var(--red); border-color: var(--red); }

/* ---- Projektordner (Übersicht) --------------------------------- */
.folder-card .project-name { padding-right: 84px; }   /* nur 2 Aktions-Icons */
.folder-glyph { color: var(--accent); opacity: .9; line-height: 0; }
.folder-glyph svg { display: block; }

.folder-back {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px;
  padding: 6px 12px; border: 1px dashed transparent; border-radius: var(--radius-sm);
  color: var(--text-dim); text-decoration: none;
  font-family: var(--font-mono); font-size: calc(13px * var(--fs-scale));
}
.folder-back:hover { color: var(--text); }
.folder-back.drop-hover { border-color: var(--accent); color: var(--accent); }

.project-card.dragging { opacity: .45; }
.folder-card.drop-hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent), var(--shadow);
}

.move-options { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 4px; max-height: 320px; overflow-y: auto; }
.move-option {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; text-align: left;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); cursor: pointer; font-size: calc(14px * var(--fs-scale));
  transition: border-color .14s ease, color .14s ease;
}
.move-option:hover { border-color: var(--text-faint); }
.move-option svg { color: var(--accent); flex: none; }
.move-option.is-current { border-color: var(--accent); cursor: default; opacity: .7; }

/* empty state */
.empty {
  grid-column: 1 / -1; text-align: center; padding: 70px 20px;
  border: 1px dashed var(--line); border-radius: var(--radius); color: var(--text-faint);
}
.empty h3 { font-size: 26px; color: var(--text-dim); font-weight: 500; margin: 0 0 8px; letter-spacing: -.02em; }

/* ---- dialog ---------------------------------------------------- */
.dialog { border: none; padding: 0; background: transparent; color: var(--text); }
.dialog::backdrop { background: rgba(5,7,11,.66); backdrop-filter: blur(4px); }
.dialog-card {
  width: min(440px, 92vw);
  background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow);
}
.dialog-title { margin: 0 0 6px; font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.dialog-sub { margin: 0 0 20px; color: var(--text-dim); font-size: calc(14px * var(--fs-scale)); font-weight: 300; line-height: 1.5; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ---- schedule overview ----------------------------------------- */
.dialog-schedule-overview .schedule-overview-card {
  width: min(920px, 94vw);
  max-height: 86vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.schedule-overview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.schedule-overview-head .eyebrow { margin-bottom: 8px; }
/* Werkzeugzeile ueber der Liste: „nur aktive" steht rechts ueber der Tabelle */
.schedule-tools { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.schedule-check {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none;
  color: var(--text-dim); font-family: var(--font-mono);
  font-size: calc(11.5px * var(--fs-scale)); letter-spacing: .06em;
}
.schedule-check:hover { color: var(--text); }
.schedule-check input { accent-color: var(--accent); width: 13px; height: 13px; cursor: pointer; }
.schedule-overview-body {
  min-height: 180px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}
.schedule-table-wrap { overflow-x: auto; }
.schedule-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 660px;
}
.schedule-table th,
.schedule-table td {
  padding: 15px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line-soft);
}
.schedule-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: calc(11px * var(--fs-scale));
  letter-spacing: .14em;
  text-transform: uppercase;
}
.schedule-table tr:last-child td { border-bottom: 0; }
.schedule-table tr.is-active td {
  background: color-mix(in srgb, var(--green) 9%, transparent);
}
.schedule-table tr.is-active .schedule-workflow {
  color: color-mix(in srgb, var(--green) 36%, var(--text));
}
.schedule-workflow {
  display: inline-block;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.schedule-workflow:hover { color: var(--accent); }
.schedule-project,
.schedule-triggers {
  margin-top: 5px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: calc(11px * var(--fs-scale));
  line-height: 1.45;
}
.schedule-triggers { color: var(--text-dim); }
.schedule-runs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: calc(12px * var(--fs-scale));
  line-height: 1.45;
}
.schedule-empty {
  border: 0;
  border-radius: 0;
  padding: 54px 20px;
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .hero .btn-lg {
    width: 100%;
    justify-content: center;
  }
  .schedule-table { min-width: 0; }
  .schedule-table thead { display: none; }
  .schedule-table,
  .schedule-table tbody,
  .schedule-table tr,
  .schedule-table td { display: block; width: 100%; }
  .schedule-table tr { border-bottom: 1px solid var(--line-soft); }
  .schedule-table tr:last-child { border-bottom: 0; }
  .schedule-table td { border-bottom: 0; padding: 14px; }
  .schedule-table td + td { padding-top: 0; }
}

.field { display: block; }
.field-label {
  display: block; font-family: var(--font-mono); font-size: calc(11px * var(--fs-scale)); letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 8px;
}
/* Grau bewusst als Hex: die --text-*-Tokens sind alle auf Weiß geflattet. */
.field-hint { display: block; margin-top: 6px; color: var(--muted); font-size: calc(12px * var(--fs-scale)); line-height: 1.4; }
.input, .textarea {
  width: 100%; background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 12px 14px; font-family: var(--font-display); font-size: calc(15px * var(--fs-scale)); outline: none;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.input:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

/* ---- "Erweiterte Funktionen"-Schalter (Editor-Kopfzeile + Neu-Dialog) -- */
.adv-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.adv-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.adv-toggle-track {
  position: relative; flex: 0 0 auto; width: 30px; height: 17px; border-radius: 999px;
  background: var(--line-strong); border: 1px solid var(--line); transition: background .15s ease;
}
.adv-toggle-thumb {
  position: absolute; top: 1px; left: 1px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--panel); box-shadow: 0 1px 2px rgba(0,0,0,.35); transition: transform .15s ease;
}
.adv-toggle input:checked + .adv-toggle-track { background: var(--accent); border-color: var(--accent); }
.adv-toggle input:checked + .adv-toggle-track .adv-toggle-thumb { transform: translateX(13px); }
.adv-toggle input:focus-visible + .adv-toggle-track { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.adv-toggle-label { font-size: calc(11.5px * var(--fs-scale)); color: var(--text-faint); letter-spacing: .01em; white-space: nowrap; }
.adv-toggle:hover .adv-toggle-label { color: var(--text-dim); }

/* Dialog-Variante: etwas größer, mit Erklärtext darunter */
.adv-toggle-field { margin-top: 16px; align-items: flex-start; gap: 11px; }
.adv-toggle-field .adv-toggle-track { margin-top: 1px; }
.adv-toggle-field .adv-toggle-label { font-size: calc(14px * var(--fs-scale)); color: var(--text); font-weight: 500; }
.adv-toggle-field .adv-toggle-text { display: flex; flex-direction: column; gap: 3px; }
.adv-toggle-field .adv-toggle-desc { font-size: calc(12.5px * var(--fs-scale)); color: var(--text-dim); font-weight: 300; line-height: 1.45; }

/* ---- toast ----------------------------------------------------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  z-index: 50; padding: 12px 18px; border-radius: 11px;
  background: var(--panel-2); border: 1px solid var(--line-strong);
  color: var(--text); font-size: calc(14px * var(--fs-scale)); box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: .22s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--red); }
.toast.ok { border-color: color-mix(in srgb, var(--green) 50%, var(--line-strong)); }

/* ---- Sprachschalter DE / EN — seit 04.11.2026 nur auf der Einstellungs-Seite ---- */
.lang-switch {
  display: inline-flex; align-items: stretch; gap: 0; height: var(--ctl-h);
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel); overflow: hidden;
}
.lang-switch .lang-opt {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center;
  font-weight: 600; font-size: calc(12px * var(--fs-scale)); line-height: 1;
  font-family: 'JetBrains Mono', monospace; letter-spacing: .04em;
  color: var(--text-dim); padding: 0 10px; transition: .15s ease;
}
.lang-switch .lang-opt:hover { color: var(--text); }
.lang-switch .lang-opt.is-on { background: var(--surface-2); color: var(--text); }
.lang-switch .lang-opt + .lang-opt { border-left: 1px solid var(--line); }

/* ---- Schriftgröße (A): drei Stufen nebeneinander auf der Einstellungs-Seite (seit 04.11.2026;
   vorher ein Aufklapp-Menü neben dem Sprachschalter in jeder Kopfzeile) ---- */
.fs-wahl {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--panel);
}
.fs-opt {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  color: var(--text-dim); font-weight: 700; font-family: 'JetBrains Mono', monospace;
  line-height: 1; text-align: center; border-radius: 6px; min-width: 42px; height: 30px; padding: 0 10px; transition: .12s ease;
}
.fs-opt:hover { background: var(--surface); color: var(--text); }
.fs-opt.is-on { background: var(--surface-2); color: var(--accent); }
/* feste Vorschau-Größen (skalieren NICHT mit --fs-scale) */
.fs-opt[data-fs="1"] { font-size: 12px; }
.fs-opt[data-fs="2"] { font-size: 16px; }
.fs-opt[data-fs="3"] { font-size: 20px; }

/* -- prompt dialog -------------------------------------------------------- */
.dialog-prompt .dialog-card { width: min(620px, 92vw); position: relative; }
.dialog-prompt .dialog-title { padding-right: 38px; }
.prompt-close { position: absolute; top: 18px; right: 18px; }
.prompt-input-wrap { position: relative; }
.prompt-input-wrap .textarea { width: 100%; padding-right: 2.8rem; }
.mic-btn { position: absolute; top: .5rem; right: .5rem; }
.mic-btn.listening { color: #e5484d; animation: micpulse 1.2s ease-in-out infinite; }
@keyframes micpulse { 0%,100% { opacity: 1 } 50% { opacity: .4 } }
.prompt-log { margin-top: .7rem; max-height: 220px; overflow: auto; white-space: pre-wrap;
  font-family: 'JetBrains Mono', monospace; font-size: calc(.78rem * var(--fs-scale)); line-height: 1.5;
  background: rgba(0,0,0,.25); border-radius: 10px; padding: .6rem .7rem; }
.prompt-error { margin-top: .6rem; color: #e5484d; font-size: calc(.85rem * var(--fs-scale)); }

/* prompt history dropdown */
.prompt-history { margin: 0 0 .7rem; }
.prompt-history-toggle { display: inline-flex; align-items: center; gap: .4rem;
  background: none; border: 0; cursor: pointer; color: inherit; opacity: .75;
  font: inherit; font-size: calc(.82rem * var(--fs-scale)); padding: .15rem 0; }
.prompt-history-toggle:hover { opacity: 1; }
.prompt-history-toggle .phi-chevron { transition: transform .15s ease; }
.prompt-history.open .prompt-history-toggle .phi-chevron { transform: rotate(180deg); }
.prompt-history-list { margin-top: .4rem; max-height: 200px; overflow: auto;
  display: flex; flex-direction: column; gap: .3rem; }
.prompt-history-item { display: flex; align-items: stretch; gap: .2rem;
  border-radius: 8px; border: 1px solid transparent; color: inherit; }
.prompt-history-item.is-applied  { background: rgba(70, 196, 106, .12); border-color: rgba(70, 196, 106, .30); }
.prompt-history-item.is-rejected { background: rgba(229, 72, 77, .10);  border-color: rgba(229, 72, 77, .28); }
.prompt-history-item .phi-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column;
  gap: .15rem; text-align: left; cursor: pointer; font: inherit; color: inherit;
  background: none; border: 0; padding: .4rem .55rem; border-radius: 8px; }
.prompt-history-item .phi-main:hover { filter: brightness(1.15); }
.prompt-history-item .phi-when { font-size: calc(.72rem * var(--fs-scale)); opacity: .7; }
.prompt-history-item .phi-text { font-size: calc(.82rem * var(--fs-scale)); line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prompt-history-item .phi-del { flex: 0 0 auto; display: grid; place-items: center; width: 30px;
  background: none; border: 0; color: inherit; opacity: .45; cursor: pointer; border-radius: 8px; }
.prompt-history-item .phi-del:hover { opacity: 1; color: var(--red); }
.prompt-history-item .phi-del:disabled { opacity: .25; cursor: default; }

/* ---- phone layout (≤600px) ------------------------------------- */
@media (max-width: 600px) {
  .shell { padding: 34px 18px 70px; }
  .topbar { padding: 6px 12px; }
  .hero { margin-bottom: 36px; }
  .projects { grid-template-columns: 1fr; gap: 14px; }
  .project-card { min-height: 150px; padding: 18px; }
  .project-name { padding-right: 80px; }
  .card-actions { opacity: 1; transform: none; }
}
