/* Szenario-Editor (2026-09-21) -- Farben wie die Leitstelle (styles.css :root). */
:root {
  --bg-1: #07151a;
  --bg-2: #0d2730;
  --panel: rgba(9, 29, 36, 0.92);
  --panel-strong: #0f323d;
  --line: rgba(108, 195, 221, 0.22);
  --text: #e6f3f7;
  --muted: #8cb7c4;
  --accent: #f2b134;
  --danger: #ff5f56;
  --ok: #58d68d;
  --blue: #2563eb;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  color: var(--text);
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 14px;
  background: linear-gradient(140deg, var(--bg-1), var(--bg-2));
  overflow: hidden;
}

h2 {
  margin: 14px 0 6px;
  font: 600 13px "Chakra Petch", sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Kopfleiste ─────────────────────────────────────────────────────── */
.ed-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 8px 14px;
  background: #0a1c24;
  border-bottom: 1px solid var(--line);
}
.ed-logo { height: 26px; }
.ed-title { font: 700 17px "Chakra Petch", sans-serif; }
.ed-select {
  min-width: 260px;
  max-width: 420px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
  font: inherit;
}
.ed-badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(140, 183, 196, 0.18);
  color: var(--muted);
}
.ed-badge.is-entwurf { background: rgba(242, 177, 52, 0.18); color: var(--accent); }
.ed-badge.is-eingereicht { background: rgba(37, 99, 235, 0.25); color: #93c5fd; }
.ed-badge.is-freigegeben { background: rgba(88, 214, 141, 0.18); color: var(--ok); }
.ed-dirty { color: var(--accent); font-size: 12px; font-weight: 700; }
.ed-bar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.ed-user { color: var(--muted); font-size: 12px; margin-left: 6px; }

.ed-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
  font: 600 13px "Manrope", sans-serif;
  cursor: pointer;
}
.ed-btn:hover { border-color: rgba(108, 195, 221, 0.55); }
.ed-btn:disabled { opacity: 0.4; cursor: default; }
.ed-btn[hidden] { display: none; }
.ed-btn-primary { background: var(--accent); border-color: var(--accent); color: #1a1204; }
.ed-btn-discord { background: #5865f2; border-color: #5865f2; color: #fff; width: 100%; padding: 10px 14px; }
.ed-btn-discord:hover { background: #4752c4; border-color: #4752c4; }
.ed-btn-ok { background: rgba(88, 214, 141, 0.2); border-color: rgba(88, 214, 141, 0.5); }
.ed-btn-danger { border-color: rgba(255, 95, 86, 0.5); color: #ffb4ae; }

/* ── Aufteilung ─────────────────────────────────────────────────────── */
.ed-main {
  flex: 1;
  display: grid;
  grid-template-columns: 250px 1fr 320px;
  min-height: 0;
}
.ed-side {
  overflow-y: auto;
  padding: 4px 14px 16px;
  background: var(--panel);
}
.ed-left { border-right: 1px solid var(--line); }
.ed-right { border-left: 1px solid var(--line); }
.ed-hint { margin: 4px 0 8px; color: var(--muted); font-size: 12px; }

/* ── Bibliothek ─────────────────────────────────────────────────────── */
.ed-library { display: grid; gap: 8px; }
.ed-asset {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  align-items: center;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(15, 50, 61, 0.6);
  color: var(--text);
  text-align: left;
  cursor: grab;
  font: inherit;
}
.ed-asset:hover { border-color: rgba(242, 177, 52, 0.6); }
.ed-asset img, .ed-asset .ed-thumb {
  width: 72px;
  height: 48px;
  border-radius: 6px;
  background: #16323c;
  object-fit: contain;
}
.ed-asset-name { font-weight: 700; font-size: 13px; line-height: 1.2; }
.ed-asset-meta { color: var(--muted); font-size: 11px; }

/* ── Ansicht ────────────────────────────────────────────────────────── */
.ed-view { position: relative; min-width: 0; }
.ed-viewport { position: absolute; inset: 0; }
.ed-viewport canvas { display: block; }
.ed-toolbar {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 6px;
  border-radius: 10px;
  background: rgba(7, 21, 26, 0.82);
  border: 1px solid var(--line);
}
.ed-tool {
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: 600 12px "Manrope", sans-serif;
  cursor: pointer;
}
.ed-tool.is-on { background: var(--blue); border-color: var(--blue); }
.ed-check { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; color: var(--muted); }
.ed-viewhint {
  position: absolute;
  left: 10px;
  bottom: 8px;
  right: 10px;
  margin: 0;
  color: rgba(230, 243, 247, 0.75);
  font-size: 12px;
  text-shadow: 0 1px 3px #000;
  pointer-events: none;
}

/* ── Eigenschaften ──────────────────────────────────────────────────── */
.ed-field {
  display: grid;
  gap: 3px;
  margin: 6px 0;
  font-size: 12px;
  color: var(--muted);
}
.ed-field input, .ed-field select {
  padding: 6px 8px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.ed-field input:disabled { opacity: 0.6; }
.ed-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ed-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.ed-chip {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.25);
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 700;
}
.ed-chip button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }
.ed-match { margin: 8px 0 2px; font-size: 12px; color: var(--muted); }
/* Einsatzarten zum Anhaken (Lagen der Leitstelle + KI-Disponent) */
.ed-arts { max-height: 280px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; margin-top: 6px; }
.ed-arts details { border-bottom: 1px solid var(--line); }
.ed-arts details:last-child { border-bottom: 0; }
.ed-arts summary { cursor: pointer; padding: 6px 8px; font-size: 12px; font-weight: 700; color: var(--text); }
.ed-arts summary .ed-art-n { color: var(--accent); font-weight: 600; margin-left: 4px; }
.ed-art { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 8px; align-items: start; padding: 5px 8px 5px 12px; cursor: pointer; font-size: 12px; }
.ed-art:hover { background: rgba(255, 255, 255, 0.04); }
.ed-art input { margin: 2px 0 0; grid-row: span 2; }
.ed-art-label { color: var(--text); }
.ed-art-kw { grid-column: 2; color: var(--muted); font-size: 11px; }
.ed-art-count { color: var(--muted); font-size: 11px; white-space: nowrap; }
.ed-arts-empty { padding: 8px; font-size: 12px; color: var(--muted); }
.ed-match strong { color: var(--text); }
.ed-match ul { margin: 4px 0 0; padding-left: 16px; }
.ed-warn {
  margin: 8px 0;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(242, 177, 52, 0.14);
  border: 1px solid rgba(242, 177, 52, 0.4);
  color: #fde68a;
  font-size: 12px;
}
.ed-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.ed-list { margin: 0; padding-left: 20px; }
.ed-list li { padding: 3px 4px; border-radius: 6px; cursor: pointer; }
.ed-list li:hover { background: rgba(108, 195, 221, 0.12); }
.ed-list li.is-sel { background: rgba(37, 99, 235, 0.3); }

/* ── Meldungen, Anmeldung ───────────────────────────────────────────── */
.ed-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  max-width: min(640px, 92vw);
  padding: 10px 16px;
  border-radius: 10px;
  background: #0f323d;
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  z-index: 40;
}
.ed-toast.is-error { border-color: var(--danger); color: #ffd1ce; }
.ed-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(3, 10, 13, 0.82);
  z-index: 50;
}
.ed-overlay[hidden] { display: none; }
.ed-login {
  width: min(380px, 92vw);
  padding: 22px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.ed-login img { height: 30px; }
.ed-login h1 { margin: 10px 0 4px; font: 700 20px "Chakra Petch", sans-serif; }
.ed-login p { color: var(--muted); margin: 0 0 10px; }
.ed-details { margin: 6px 0; color: var(--muted); font-size: 12px; }
.ed-error { color: #ffb4ae; font-size: 13px; }

/* Schmale Fenster: Seitenleisten untereinander, Ansicht oben. */
@media (max-width: 980px) {
  body { overflow: auto; }
  .ed-main { grid-template-columns: 1fr; grid-template-rows: 55vh auto auto; }
  .ed-view { order: -1; min-height: 55vh; }
  .ed-left, .ed-right { border: 0; border-top: 1px solid var(--line); }
}
