/* -- Schale: Kategorien, Seitenleiste, Reiter, untere Leiste, Statuszeile ----
   Lädt nach app.css; die alten Regeln für .side/.nav bleiben dort ungenutzt,
   .tree*, .nav__zahl und .side__foot werden hier weiterverwendet. */
:root {
  --aktiv-breite: 48px; --panel-breite: 260px; --unten-hoehe: 220px;
  --status-hoehe: 22px; --reiter-hoehe: 35px; --aktiv-bg: #0b1220;
}
.shell { display: grid; height: 100vh;
  grid-template-columns: var(--aktiv-breite) var(--panel-breite) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) var(--status-hoehe);
  grid-template-areas: "aktiv panel editor" "status status status"; }
.shell.mit-assistent {
  grid-template-columns: var(--aktiv-breite) var(--panel-breite) minmax(0, 1fr) 380px;
  grid-template-areas: "aktiv panel editor assistent" "status status status status"; }
.shell.panel-zu { --panel-breite: 0px; }
.shell.panel-zu .panel { display: none; }

/* Kategorien */
.aktiv { grid-area: aktiv; background: var(--aktiv-bg); display: flex; flex-direction: column;
  align-items: center; padding: 6px 0; gap: 2px; }
.aktiv__marke { color: var(--accent); font-size: 20px; padding: 8px 0 12px; text-decoration: none; }
.aktiv button[data-aktivitaet] { position: relative; width: 44px; height: 42px; background: none; border: 0;
  border-left: 2px solid transparent; color: #64748b; font-size: 18px; cursor: pointer; }
.aktiv button[data-aktivitaet]:hover { color: #e2e8f0; }
.aktiv button[data-aktivitaet].is-active { color: #fff; border-left-color: var(--accent); }
.aktiv button[data-aktivitaet]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.aktiv button[data-aktivitaet] .nav__zahl { position: absolute; right: 3px; bottom: 3px; font-size: 10px;
  min-width: 16px; padding: 0 4px; }
.aktiv__unten { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding-bottom: 8px; }
.aktiv__unten a, .aktiv__unten button { color: #64748b; font-size: 16px; text-decoration: none;
  background: none; border: 0; cursor: pointer; }
.aktiv__unten a:hover, .aktiv__unten button:hover { color: #fff; }
.aktiv__unten form { display: contents; }
#kontoname.klickbar { text-decoration: none; }

/* Seitenleiste mit Abschnitten */
.panel { grid-area: panel; position: relative; background: var(--side); color: #fff;
  display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.panel__gruppe { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow-y: auto; }
.panel__titel { color: var(--side-text); font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; padding: 14px 16px 8px; }
.abschnitt { border-top: 1px solid #1e293b; }
.abschnitt > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px;
  padding: 7px 10px 7px 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: #cbd5e1; user-select: none; }
.abschnitt > summary::-webkit-details-marker { display: none; }
.abschnitt__pfeil { font-size: 9px; width: 10px; transition: transform .12s; color: var(--side-text); }
.abschnitt[open] > .abschnitt__pfeil, .abschnitt[open] > summary .abschnitt__pfeil { transform: rotate(90deg); }
.abschnitt__aktionen { margin-left: auto; display: inline-flex; gap: 10px; opacity: 0; }
.abschnitt:hover .abschnitt__aktionen, .abschnitt:focus-within .abschnitt__aktionen { opacity: 1; }
.abschnitt__aktionen button { background: none; border: 0; color: var(--side-text); cursor: pointer;
  font-size: 13px; line-height: 1; padding: 0; }
.abschnitt__aktionen button:hover { color: #fff; }
.abschnitt__inhalt { padding-bottom: 6px; }
.abschnitt__inhalt a[data-view] { display: flex; align-items: center; gap: 11px; padding: 6px 12px 6px 20px;
  color: var(--side-text); text-decoration: none; border-left: 3px solid transparent; cursor: pointer;
  font-size: 13px; }
.abschnitt__inhalt a[data-view] i { width: 17px; text-align: center; font-size: 13px; opacity: .85; }
.abschnitt__inhalt a[data-view]:hover { background: var(--side-active); color: #fff; }
.abschnitt__inhalt a[data-view].is-active { background: var(--side-active); color: #fff;
  border-left-color: var(--accent); font-weight: 600; }
.abschnitt__inhalt a[data-view].is-active i { opacity: 1; color: var(--accent-icon, #a5b4fc); }
.abschnitt__inhalt a[data-view]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.griff { position: absolute; z-index: 5; }
.griff--senkrecht { top: 0; right: 0; width: 5px; height: 100%; cursor: col-resize; }
.griff--waagerecht { top: 0; left: 0; width: 100%; height: 5px; cursor: row-resize; }
.griff:hover, .griff.is-aktiv { background: var(--accent); opacity: .5; }

/* Reiter und Flächen */
.editor { grid-area: editor; display: flex; flex-direction: column; min-width: 0; min-height: 0;
  background: var(--bg); }
.reiter { display: flex; align-items: stretch; height: var(--reiter-hoehe); background: #eef0f4;
  border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; flex: none; }
.reiter:empty { display: none; }
.reiter__tab { display: inline-flex; align-items: center; gap: 7px; padding: 0 8px 0 12px;
  border-right: 1px solid var(--line); color: var(--muted); font-size: 13px; cursor: pointer;
  white-space: nowrap; background: none; border-top: 0; border-bottom: 0; border-left: 0; font: inherit; }
.reiter__tab i { font-size: 12px; }
.reiter__tab:hover { background: #f5f6f8; color: var(--text); }
.reiter__tab.is-active { background: var(--card); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.reiter__tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.reiter__zu { background: none; border: 0; color: var(--faint); cursor: pointer; font-size: 12px;
  width: 20px; height: 20px; border-radius: 4px; padding: 0; margin-left: 2px; }
.reiter__zu:hover { background: var(--line); color: var(--text); }
.reiter__tab.is-dreckig .reiter__zu i::before { content: "\25cf"; font-family: inherit; }
.reiter__tab.is-dreckig:hover .reiter__zu i::before { content: "\f00d"; }
.tab-inhalte { flex: 1; position: relative; min-height: 0; }
.tab-inhalt { position: absolute; inset: 0; overflow: auto; }
.tab-inhalt.content { padding: 18px 24px 28px; }
.tab-inhalt--datei { overflow: hidden; display: flex; flex-direction: column; background: var(--card); }

/* untere Leiste */
.unten { position: relative; height: var(--unten-hoehe); flex: none; display: flex; flex-direction: column;
  border-top: 1px solid var(--line); background: var(--card); min-height: 80px; }
.reiter--unten { background: var(--card); height: 30px; border-bottom: 1px solid var(--line-soft); }
.reiter--unten .reiter__tab { border-right: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.reiter--unten .reiter__tab.is-active { box-shadow: inset 0 -2px 0 var(--accent); }
.reiter--unten .spacer { flex: 1; }
.unten__inhalt { flex: 1; min-height: 0; overflow: auto; }

/* Statuszeile */
.status { grid-area: status; background: var(--accent); color: #fff; font-size: 12px;
  display: flex; align-items: center; justify-content: space-between; padding: 0 10px; gap: 12px; }
.status__links, .status__rechts { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.status button { background: none; border: 0; color: #fff; cursor: pointer; font-size: 13px; padding: 0 2px;
  opacity: .85; }
.status button:hover { opacity: 1; }
.status__punkt { width: 8px; height: 8px; border-radius: 50%; background: #f87171; flex: none; }
.status__punkt.is-an { background: #4ade80; }

/* Schmale Bildschirme: die Seitenleiste legt sich über den Inhalt */
@media (max-width: 900px) {
  .shell, .shell.mit-assistent { grid-template-columns: var(--aktiv-breite) minmax(0, 1fr);
    grid-template-areas: "aktiv editor" "status status"; }
  .shell.mit-assistent .assistent { display: none; }
  .panel { display: none; position: fixed; left: var(--aktiv-breite); top: 0; bottom: var(--status-hoehe);
    width: min(300px, 80vw); z-index: 20; box-shadow: 0 0 24px rgba(0, 0, 0, .35); }
  .shell.panel-offen:not(.panel-zu) .panel { display: flex; }
  .kpis { display: none; }
}

/* Monaco unter den globalen Formularregeln von app.css */
.monaco-editor textarea, .monaco-editor input { width: auto; padding: 0; border: 0; border-radius: 0;
  box-shadow: none; background: transparent; font: inherit; }
.monaco-editor label { display: inline; margin: 0; font: inherit; color: inherit; text-transform: none;
  letter-spacing: 0; }
.monaco-editor a { color: inherit; }
.monaco-editor .monaco-inputbox input { width: 100%; }

/* Befehlspalette */
dialog.palette { top: 12vh; margin: 0 auto; width: min(600px, 92vw); padding: 0; border: 0;
  border-radius: var(--radius); box-shadow: 0 20px 60px rgba(15, 23, 42, .35); background: var(--card); }
dialog.palette::backdrop { background: rgba(15, 23, 42, .25); }
.palette__form { display: flex; flex-direction: column; padding: 8px; gap: 6px; }
.palette__form input { margin: 0; font-size: 15px; padding: 9px 12px; }
.palette__liste { max-height: 50vh; overflow: auto; }
.palette__eintrag { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px;
  cursor: pointer; font-size: 13px; }
.palette__eintrag i { width: 16px; text-align: center; color: var(--muted); }
.palette__eintrag.is-active, .palette__eintrag:hover { background: var(--accent-soft); }
.palette__titel { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette__eintrag kbd { font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.palette__leer { padding: 12px; color: var(--muted); font-size: 13px; }
