/* 74IT Metadaten-Editor. Keine fremden Schriften, keine fremden Dateien. */
:root {
  --grund: #f3f5f8;
  --flaeche: #ffffff;
  --flaeche-2: #f8f9fb;
  --tinte: #12233f;
  --text: #1c2738;
  --leise: #5b6779;
  --linie: #d9dee6;
  --linie-stark: #b8c0cc;
  --akzent: #0f5fd7;
  --akzent-dunkel: #0b4aa8;
  --akzent-hell: #e8f0fd;
  --gruen: #0d7a52;
  --gruen-hell: #e3f6ee;
  --marke: #3ddc97;
  --warn: #9a5b00;
  --warn-hell: #fff4dc;
  --rot: #b3261e;
  --rot-hell: #fdecea;
  --radius: 10px;
  --schatten: 0 1px 2px rgba(18, 35, 63, .06), 0 4px 16px rgba(18, 35, 63, .05);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #0e141d;
    --flaeche: #161e2a;
    --flaeche-2: #1b2532;
    --tinte: #eef2f8;
    --text: #dfe5ee;
    --leise: #9aa6b8;
    --linie: #2a3545;
    --linie-stark: #3b485b;
    --akzent: #6ea8ff;
    --akzent-dunkel: #9cc3ff;
    --akzent-hell: #1b2c47;
    --gruen: #5fd6a4;
    --gruen-hell: #14302a;
    --warn: #f0b95a;
    --warn-hell: #33290f;
    --rot: #ff8a80;
    --rot-hell: #3a1b19;
    --schatten: 0 1px 2px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--grund);
  color: var(--text);
  font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
main { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 24px 20px 48px; }
h1, h2, h3 { color: var(--tinte); line-height: 1.25; margin: 0; }
p { margin: 0 0 12px; }
a { color: var(--akzent); }
code { font: 12px/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--leise); }

:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }

/* Kopf */
.kopf {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px;
  padding: 12px 20px; background: #12233f; color: #fff;
}
.marke { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.marke-zeichen {
  font-weight: 800; font-size: 18px; letter-spacing: .02em; padding: 3px 9px 4px;
  border-radius: 7px; background: #fff; color: #12233f; box-shadow: inset 0 -3px 0 var(--marke);
}
.marke-name { font-weight: 600; font-size: 16px; }
.lokal { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; color: #d5e9df; }
.lokal svg { width: 18px; height: 18px; fill: var(--marke); flex: none; }

/* Startseite */
.start { max-width: 820px; margin: 24px auto 0; }
.start h1 { font-size: clamp(24px, 4vw, 34px); letter-spacing: -.01em; }
.einleitung { margin: 12px 0 24px; font-size: 17px; color: var(--leise); }
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 44px 20px; border: 2px dashed var(--linie-stark); border-radius: 16px;
  background: var(--flaeche); color: var(--leise); cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .zieht .dropzone, .dropzone:focus-within { border-color: var(--akzent); background: var(--akzent-hell); }
.dropzone svg { width: 48px; height: 48px; color: var(--akzent); }
.dropzone-titel { font-size: 19px; font-weight: 650; color: var(--tinte); }
.dropzone-link { color: var(--akzent); font-weight: 600; text-decoration: underline; }
.datei-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip-path: inset(50%); }
.zusagen { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.zusagen li {
  padding: 16px; border-radius: var(--radius); background: var(--flaeche); border: 1px solid var(--linie);
  font-size: 14px; color: var(--leise);
}
.zusagen strong { display: block; margin-bottom: 4px; color: var(--tinte); font-size: 15px; }

/* Arbeitsbereich */
.arbeit { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
.seite {
  position: sticky; top: 16px; display: flex; flex-direction: column; gap: 14px;
  padding: 16px; border-radius: var(--radius); background: var(--flaeche); border: 1px solid var(--linie); box-shadow: var(--schatten);
}
.seite-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.seite h2 { font-size: 17px; }
.seite h3 { font-size: 14px; }
.zahl {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px;
  background: var(--flaeche-2); border: 1px solid var(--linie); color: var(--leise); font-size: 12px; font-weight: 600; vertical-align: 2px;
}
.zahl:empty { display: none; }
.datei-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 44vh; overflow: auto; }
.datei { display: flex; align-items: stretch; border: 1px solid var(--linie); border-radius: 8px; background: var(--flaeche-2); }
.datei.aktiv { border-color: var(--akzent); background: var(--akzent-hell); }
.datei-knopf {
  flex: 1; min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: center;
  padding: 9px 10px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: 8px 0 0 8px;
}
.typ {
  grid-row: span 2; min-width: 42px; padding: 4px 6px; border-radius: 6px; text-align: center;
  font: 700 11px/1.2 ui-monospace, Consolas, monospace; text-transform: uppercase; color: #fff; background: #2b579a;
}
.typ-x { background: #1d6f42; }
.typ-p { background: #c43e1c; }
.datei-name { font-weight: 600; color: var(--tinte); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.datei-stand { font-size: 12px; color: var(--leise); }
.datei-stand.hat, .editor-stand.hat { color: var(--warn); font-weight: 600; }
.datei-weg {
  width: 36px; border: 0; border-left: 1px solid var(--linie); background: none; color: var(--leise);
  font-size: 20px; line-height: 1; cursor: pointer; border-radius: 0 8px 8px 0;
}
.datei-weg:hover { color: var(--rot); background: var(--rot-hell); }
.alle { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--linie); }
.feld-alle { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 8px; background: var(--flaeche-2); border: 1px solid var(--linie); }
.feld-alle label { font-size: 13px; font-weight: 600; color: var(--tinte); }
.option { padding-top: 12px; border-top: 1px solid var(--linie); font-size: 14px; }

/* Bedienelemente */
input[type="text"], input[type="datetime-local"], select, textarea {
  width: 100%; min-height: 38px; padding: 7px 10px; border: 1px solid var(--linie-stark); border-radius: 7px;
  background: var(--flaeche); color: var(--text); font: inherit;
}
textarea { resize: vertical; min-height: 76px; }
input[readonly] { background: var(--flaeche-2); color: var(--leise); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; border-color: var(--akzent); }
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 7px 14px;
  border: 1px solid var(--linie-stark); border-radius: 7px; background: var(--flaeche); color: var(--tinte);
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.knopf:hover { border-color: var(--akzent); color: var(--akzent); }
.knopf:focus-within { outline: 2px solid var(--akzent); outline-offset: 2px; }
.knopf.haupt { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.knopf.haupt:hover { background: var(--akzent-dunkel); border-color: var(--akzent-dunkel); color: #fff; }
.knopf.klein { min-height: 32px; padding: 4px 10px; font-size: 14px; }
.knopf.breit { width: 100%; }
.knopf:disabled { opacity: .5; cursor: not-allowed; }
@media (prefers-color-scheme: dark) {
  .knopf.haupt, .knopf.haupt:hover { color: #0e141d; }
}
.haken { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.haken input { width: 17px; height: 17px; margin: 3px 0 0; flex: none; accent-color: var(--akzent); }

/* Editor */
.editor { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.editor-kopf {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px;
  padding: 16px; border-radius: var(--radius); background: var(--flaeche); border: 1px solid var(--linie); box-shadow: var(--schatten);
}
.editor-titel { min-width: 0; flex: 1 1 240px; }
.editor-titel h2 { font-size: 19px; overflow-wrap: anywhere; }
.editor-stand { margin: 2px 0 0; font-size: 13px; color: var(--leise); }
.editor-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; }
.karte { padding: 16px; border-radius: var(--radius); background: var(--flaeche); border: 1px solid var(--linie); box-shadow: var(--schatten); }
.karte-kopf { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 14px; }
.karte-kopf h3 { font-size: 16px; }
.karte-hinweis { margin: -6px 0 14px; padding: 8px 10px; border-radius: 7px; background: var(--flaeche-2); color: var(--leise); font-size: 13px; }
.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px 16px; }
.feld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.feld.ganz { grid-column: 1 / -1; }
.feld-name { font-size: 13px; font-weight: 600; color: var(--tinte); }
.feld-hinweis { font-size: 12px; color: var(--leise); overflow-wrap: anywhere; }
.feld.geaendert .feld-name::after {
  content: "geändert"; margin-left: 8px; padding: 0 7px; border-radius: 999px;
  background: var(--warn-hell); color: var(--warn); font-size: 11px; font-weight: 700;
}
.feld.geaendert input, .feld.geaendert textarea, .c-zeile.geaendert input, .c-zeile.geaendert select { border-color: var(--warn); }
.statistik { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 18px 0 8px; }
.statistik div { padding: 9px 12px; border-radius: 8px; background: var(--flaeche-2); border: 1px solid var(--linie); }
.statistik dt { font-size: 12px; color: var(--leise); }
.statistik dd { margin: 0; font-size: 18px; font-weight: 650; color: var(--tinte); font-variant-numeric: tabular-nums; }
.custom { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.c-zeile { display: grid; grid-template-columns: minmax(0, 1.1fr) 120px minmax(0, 1.4fr) auto; gap: 8px; width: 100%; }
.autoren-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.autoren-zeile input[type="text"] { flex: 1 1 200px; max-width: 320px; }
.leer-text { margin: 0; color: var(--leise); }
.klein-text { margin: 4px 0 0; font-size: 13px; color: var(--leise); }
.fehlerliste { margin: 0; padding: 10px 14px 10px 30px; border-radius: 8px; background: var(--rot-hell); color: var(--rot); font-size: 14px; }
.fehlerhinweis { padding: 10px 14px; border-radius: 8px; background: var(--rot-hell); color: var(--rot); font-weight: 600; }

/* Dialoge */
.dialog {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; border: 1px solid var(--linie);
  border-radius: 14px; background: var(--flaeche); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.dialog.breit-dialog { width: min(900px, calc(100vw - 24px)); }
.dialog::backdrop { background: rgba(10, 18, 32, .55); }
.dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 26px); }
.dialog h2 { padding: 18px 20px 0; font-size: 20px; }
.dialog-inhalt { display: flex; flex-direction: column; gap: 12px; padding: 14px 20px; overflow: auto; }
.dialog-inhalt p { margin: 0; }
.dialog-ziel { font-weight: 600; color: var(--tinte); overflow-wrap: anywhere; }
.dialog-knoepfe { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--linie); background: var(--flaeche-2); border-radius: 0 0 14px 14px; }
.vergleich-datei { display: flex; flex-direction: column; gap: 8px; }
.vergleich-datei + .vergleich-datei { padding-top: 14px; border-top: 1px solid var(--linie); }
.vergleich-datei h3 { font-size: 15px; overflow-wrap: anywhere; }
.tabelle-rahmen { overflow-x: auto; border: 1px solid var(--linie); border-radius: 8px; }
.vergleich { width: 100%; border-collapse: collapse; font-size: 14px; }
.vergleich th, .vergleich td { padding: 7px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--linie); overflow-wrap: anywhere; white-space: pre-wrap; }
.vergleich tbody tr:last-child > * { border-bottom: 0; }
.vergleich thead th { background: var(--flaeche-2); font-size: 12px; color: var(--leise); white-space: nowrap; }
.vergleich tbody td:first-child { color: var(--leise); white-space: nowrap; }
.vergleich tbody th { color: var(--tinte); min-width: 110px; }
.vergleich tbody td:nth-child(3) { background: var(--rot-hell); }
.vergleich tbody td:nth-child(4) { background: var(--gruen-hell); }
.vergleich .leer { color: var(--leise); font-style: italic; }

/* Meldung */
.meldung {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 20; max-width: min(640px, calc(100vw - 24px));
  padding: 11px 16px; border-radius: 10px; background: #12233f; color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); white-space: pre-line;
}
.meldung.fehler { background: #8f1d16; }

/* Fuß und Textseite */
.fuss {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; padding: 18px 20px;
  border-top: 1px solid var(--linie); color: var(--leise); font-size: 14px;
}
.textseite { max-width: 640px; margin: 24px auto; }
.textseite h1 { margin-bottom: 16px; font-size: 28px; }

@media (max-width: 900px) {
  .arbeit { grid-template-columns: minmax(0, 1fr); }
  .seite { position: static; }
  .datei-liste { max-height: 30vh; }
  .zusagen { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  main { padding: 16px 12px 40px; }
  .kopf { padding: 10px 12px; }
  .c-zeile { grid-template-columns: minmax(0, 1fr) 110px; padding-bottom: 10px; border-bottom: 1px solid var(--linie); }
  .editor-knoepfe { width: 100%; }
  .editor-knoepfe .knopf { flex: 1 1 auto; }
  .dialog-knoepfe { flex-wrap: wrap; }
  .dialog-knoepfe .knopf { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
