/* ASIM-Systematik.
   Farben, Schrift und Aufbau folgen argesim.org: warmgrauer Grund, weiße
   Inhaltsfläche mit feinem Rahmen und 6px Radius, Verdana, Überschriften in
   ARGESIM-Blau, Hauptmenü über einer grauen Linie, Untermenü über einer blauen,
   dunkler Fußbalken. */

:root {
  --grund: #e9e6e6;
  --flaeche: #ffffff;
  --flaeche-2: #f6f6f6;
  --rand: #dadada;
  --rand-stark: #999999;
  --text: #333333;
  --text-leise: #666666;
  --akzent: #274e90;
  --link: #003399;
  --akzent-flaeche: #e4eaf5;
  --trenner-unten: #006699;
  /* Rot ist ausschliesslich fuer echte Fehler reserviert. Der Vorschlag-Hinweis
     ist keiner, deshalb bekommt er eigene, neutrale Werte. */
  --warn: #cc0000;
  --warn-flaeche: #fdecec;
  --hinweis: #4b4b4b;
  --hinweis-flaeche: #f6f6f6;
  --hinweis-rand: #999999;
  --fuss: #2e2e2e;
  --radius: 6px;
  --schatten: 0 1px 2px -1px rgba(0, 0, 0, .25);
  --logo-grund: transparent;
  --logo-luft: 0;
}

/* Hell ist die Voreinstellung, unabhängig von der Einstellung des Betriebssystems:
   die Vorlage argesim.org ist hell, und der Demonstrator wird auf fremden Rechnern
   und über Bildschirmfreigabe gezeigt. Dunkel gibt es über den Umschalter im Kopf,
   die Wahl merkt sich der Browser. */
:root[data-thema="dunkel"] {
  --grund: #17191c;
  --flaeche: #202429;
  --flaeche-2: #282d33;
  --rand: #383e45;
  --rand-stark: #5a626b;
  --text: #e2e5e8;
  --text-leise: #9aa2aa;
  --akzent: #8fb0e4;
  --link: #9dbcf0;
  --akzent-flaeche: #1e2b44;
  --trenner-unten: #4a90b8;
  --warn: #f08a8a;
  --warn-flaeche: #3a1f1f;
  --hinweis: #b3bcc4;
  --hinweis-flaeche: #2a2f35;
  --hinweis-rand: #5a626b;
  --fuss: #101215;
  --schatten: 0 1px 2px -1px rgba(0, 0, 0, .6);
  --logo-grund: #ffffff;
  --logo-luft: 4px;
}

/* Schalter im Menü sehen aus wie Menüpunkte, nicht wie Knöpfe. <button> bleiben
   sie, weil sie nirgendwohin verlinken. */
.menue-knopf {
  font: inherit; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--link); text-decoration: underline; text-underline-offset: 2px;
}
.menue-knopf:hover { text-decoration-thickness: 2px; background: none; }
.menue-knopf[hidden] { display: none; }

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font: 10pt/1.6 Verdana, Arial, Helvetica, sans-serif;
  font-variant-numeric: tabular-nums;
}

a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

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

h1, h2, h3, h4 { color: var(--akzent); margin: .75em 0 .5em; line-height: 1.3; font-weight: 700; }
h1 { font-size: 1.3em; margin-top: 0; }
h2 { font-size: 1.2em; }
h3 { font-size: 1.1em; }

.sprung { position: absolute; left: -9999px; background: var(--akzent); color: #fff; padding: .5rem .9rem; z-index: 10; }
.sprung:focus { left: .5rem; top: .5rem; }

.nur-vorlese { position: absolute; left: -9999px; }

/* ---------- Kopf ---------- */

.kopf { background: var(--flaeche); }
.kopf-innen {
  max-width: 1400px; margin: 0 auto; padding: .9rem 2rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.marke { display: flex; align-items: center; gap: .85rem; text-decoration: none; color: var(--text); }
/* Das Logo kommt aus LOGO und ist ein fremdes Bild in fremden Farben. Es wird
   deshalb nicht eingefärbt: invert() drehte das ASIM-Blau in ein Orange, und an
   einer Marke hat man nichts zu verstellen. In dunkler Darstellung steht es
   stattdessen auf einer weissen Platte. */
.marke img {
  height: 62px; width: auto; display: block;
  background: var(--logo-grund); padding: var(--logo-luft); border-radius: 3px;
  box-sizing: content-box;
}
@media (max-width: 700px) { .marke img { height: 46px; } }
.marke-text { font-size: 1.35em; font-weight: 700; letter-spacing: -.01em; color: var(--text); }
.marke-unter { display: block; font-size: .62em; font-weight: 400; color: var(--text-leise); letter-spacing: 0; }

/* Hauptmenü: wie #main_menu, über einer grauen Linie, fett, etwas größer. */
.hauptmenue { border-top: 1px solid var(--rand-stark); background: var(--flaeche); }
.hauptmenue-innen {
  max-width: 1400px; margin: 0 auto; padding: 0 2rem;
  display: flex; align-items: stretch; gap: 0; flex-wrap: wrap; font-weight: 700; font-size: 1.05em;
}
.hauptmenue a {
  padding: .55rem 1.1rem; color: var(--text); text-decoration: none;
  border-bottom: 3px solid transparent;
}
.hauptmenue a:first-child { padding-left: 0; }
.hauptmenue a:hover { color: var(--link); text-decoration: underline; }
.hauptmenue a[aria-current="page"] { color: var(--akzent); border-bottom-color: var(--akzent); }
.hauptmenue .rechts { margin-left: auto; display: flex; align-items: center; gap: .6rem; font-weight: 400; font-size: .9em; }
.hauptmenue .rechts form { display: inline; }

/* Untermenü: wie #sub_menu, über einer blauen Linie, kleiner, hinterlegt. */
.perspektiven { border-top: 1px solid var(--trenner-unten); background: var(--flaeche-2); }
.perspektiven-innen {
  max-width: 1400px; margin: 0 auto; padding: 0 2rem;
  display: flex; gap: 0; align-items: center; flex-wrap: wrap; font-size: .92em;
}
.perspektive { padding: .4rem .9rem; text-decoration: none; color: var(--text); border-bottom: 2px solid transparent; }
.perspektive:first-child { padding-left: 0; }
.perspektive:hover { text-decoration: underline; }
.perspektive[aria-current="true"] { font-weight: 700; color: var(--akzent); border-bottom-color: var(--akzent); }
.perspektive-hinweis {
  margin: 0 0 0 auto; padding: .35rem 0; color: var(--text-leise);
  max-width: 52ch; text-align: right; font-size: .95em;
}

/* ---------- Inhaltsfläche ---------- */

.huelle {
  max-width: 1400px; margin: 2rem auto; padding: 1.4rem 1.6rem;
  background: var(--flaeche); border: 1px solid var(--rand);
  border-radius: var(--radius); box-shadow: var(--schatten);
}
@media (max-width: 700px) { .huelle { margin: 1rem .6rem; padding: 1rem; } }

.gitter { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 1.8rem; align-items: start; }
@media (max-width: 900px) {
  .gitter { grid-template-columns: 1fr; }
  .seitenleiste { order: 2; }
}

/* ---------- Suche ---------- */

.suchzeile { display: flex; gap: .5rem; margin-bottom: 1.1rem; }
.suchzeile input[type="search"] {
  flex: 1; padding: .5rem .7rem; font: inherit; font-size: 1.05em;
  border: 1px solid var(--rand-stark); border-radius: 3px;
  background: var(--flaeche); color: var(--text);
}

button, .knopf {
  font: inherit; padding: .5rem 1.1rem; cursor: pointer;
  border: 1px solid var(--rand-stark); border-radius: 3px;
  background: var(--flaeche-2); color: var(--text); text-decoration: none; display: inline-block;
}
button:hover, .knopf:hover { background: var(--rand); text-decoration: none; }
button.haupt, .knopf.haupt { background: var(--akzent); border-color: var(--akzent); color: #fff; font-weight: 700; }
button.haupt:hover, .knopf.haupt:hover { filter: brightness(1.15); }
button.klein, .knopf.klein { padding: .1rem .5rem; font-size: .85em; }

/* Knöpfe nebeneinander. Ein <form> darf nicht in einem <p> stehen, der Browser
   bricht den Absatz dort auf und stapelt die Knöpfe untereinander. Deshalb ein
   <div> mit flex statt eines Absatzes. */
.knopfzeile { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin: .7rem 0 0; }
.knopfzeile form { display: contents; }

/* ---------- Facetten ---------- */

.seitenleiste { position: sticky; top: 1rem; }

.achse { border-top: 1px solid var(--rand); padding: .6rem 0; }
.achse:first-of-type { border-top: none; padding-top: 0; }
.achse > summary {
  cursor: pointer; font-weight: 700; color: var(--akzent);
  list-style: none; display: flex; align-items: baseline; gap: .4rem;
}
.achse > summary::-webkit-details-marker { display: none; }
.achse > summary::before { content: "▾"; color: var(--text-leise); font-size: .7em; width: .9em; flex: none; }
.achse:not([open]) > summary::before { content: "▸"; }
.achse.sekundaer > summary { font-weight: 400; color: var(--text-leise); }

.achse-hinweis { font-size: .88em; color: var(--text-leise); margin: .3rem 0 .1rem 1.3rem; line-height: 1.45; }

.labels { list-style: none; margin: .3rem 0 0; padding: 0 0 0 1.3rem; }
.label {
  display: flex; align-items: baseline; gap: .45rem; padding: .12rem .3rem .12rem 0;
  text-decoration: none; color: var(--text); font-size: .92em; border-radius: 2px;
}
.label:hover { background: var(--akzent-flaeche); text-decoration: none; }
.label .kaestchen {
  flex: none; width: 12px; height: 12px; margin-top: .2rem;
  border: 1px solid var(--rand-stark); border-radius: 2px; background: var(--flaeche);
}
.label[aria-pressed="true"] { font-weight: 700; }
.label[aria-pressed="true"] .kaestchen {
  background: var(--akzent); border-color: var(--akzent); box-shadow: inset 0 0 0 2px var(--flaeche);
}
.label .name { flex: 1; }
.label .anzahl { flex: none; color: var(--text-leise); font-size: .9em; }
.label.leer { opacity: .45; }
.label.leer:hover { opacity: .8; }

/* Sagt „hierüber wird noch geredet“, nicht „hier stimmt etwas nicht“. */
.vorschlag {
  font-size: .78em; font-weight: 400; letter-spacing: .02em;
  color: var(--hinweis); background: var(--hinweis-flaeche);
  border: 1px solid var(--hinweis-rand); border-radius: 2px;
  padding: 0 .4em; vertical-align: .08em; white-space: nowrap;
}

/* ---------- Ergebnisse ---------- */

.ergebnis-kopf {
  display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap;
  padding-bottom: .5rem; border-bottom: 2px solid var(--akzent); margin-bottom: .3rem;
}
.trefferzahl { font-weight: 700; color: var(--akzent); font-size: 1.1em; }
.sortierung { margin-left: auto; font-size: .92em; color: var(--text-leise); }
.sortierung select, .matrix-waehler select, .feld select {
  font: inherit; font-size: .95em; padding: .2rem .3rem; color: var(--text);
  background: var(--flaeche); border: 1px solid var(--rand-stark); border-radius: 3px;
}

.ausgabezeile { margin: .5rem 0 0; font-size: .92em; color: var(--text-leise); }

.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: .7rem 0; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: .3rem; font-size: .9em;
  padding: .1rem .35rem .1rem .55rem; border-radius: 2px;
  background: var(--akzent-flaeche); color: var(--text);
  border: 1px solid var(--akzent); text-decoration: none;
}
.chip:hover { text-decoration: none; background: var(--flaeche-2); }
.chip .weg { color: var(--text-leise); font-size: 1.1em; line-height: 1; padding: 0 .15em; }
.chip:hover .weg { color: var(--text); }
.chip.alles-weg { background: var(--flaeche-2); border-color: var(--rand-stark); border-style: dashed; padding-right: .55rem; font-weight: 700; }

.karten { list-style: none; margin: 0; padding: 0; }
.karte { border-bottom: 1px solid var(--rand); padding: .9rem 0; }
.karte h3 { margin: 0 0 .1rem; font-size: 1.05em; }
.karte h3 a { color: var(--link); text-decoration: none; }
.karte h3 a:hover { text-decoration: underline; }
.karte .quelle { font-size: .9em; color: var(--text-leise); margin: 0 0 .35rem; }
.karte .anriss { margin: .25rem 0 .45rem; font-size: .95em; }
.karte .merkmale { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }

/* Alle Merkmale gleich gewichtet. Was auf einer Karte zuerst kommt und damit
   zählt, entscheidet die Perspektive über die Reihenfolge, nicht die Farbe. */
.merkmal {
  font-size: .85em; padding: .05rem .45rem; border-radius: 2px;
  background: var(--flaeche-2); border: 1px solid var(--rand); color: var(--text-leise);
}

.leerzustand {
  border: 1px solid var(--rand); background: var(--flaeche-2);
  border-radius: var(--radius); padding: 1.4rem 1.6rem; margin-top: 1rem;
}
.leerzustand h2 { margin-top: 0; }
.leerzustand p { margin: .4rem 0; }
.leerzustand ul { margin: .4rem 0 .8rem; padding-left: 1.2rem; }

.blaettern { display: flex; gap: .6rem; align-items: center; justify-content: center; margin: 1.4rem 0 .4rem; }
.blaettern .seite { color: var(--text-leise); font-size: .95em; }

/* ---------- Matrix ---------- */

.matrix-huelle {
  overflow-x: auto; border: 1px solid var(--rand); border-radius: var(--radius);
  background:
    linear-gradient(to right, var(--flaeche) 30%, transparent),
    linear-gradient(to left, var(--flaeche) 30%, transparent) 100% 0,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, .22), transparent),
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, .22), transparent) 100% 0;
  background-repeat: no-repeat;
  background-size: 44px 100%, 44px 100%, 15px 100%, 15px 100%;
  background-attachment: local, local, scroll, scroll;
}
table.matrix { border-collapse: collapse; width: 100%; font-size: .92em; }
table.matrix th, table.matrix td { border: 1px solid var(--rand); padding: 0; text-align: center; }
table.matrix thead th {
  background: var(--grund); color: var(--akzent); font-weight: 700; padding: .5rem .4rem;
  vertical-align: bottom; font-size: .92em; min-width: 5.6rem;
}
table.matrix tbody th {
  background: var(--grund); text-align: left; font-weight: 400;
  padding: .45rem .6rem; white-space: nowrap; position: sticky; left: 0;
}
table.matrix td a, table.matrix td span { display: block; padding: .5rem .4rem; text-decoration: none; color: var(--text); font-weight: 700; }
table.matrix td a:hover { background: var(--akzent); color: #fff; }
table.matrix td.luecke {
  background: repeating-linear-gradient(135deg, transparent, transparent 5px, var(--grund) 5px, var(--grund) 10px);
}
table.matrix td.luecke span { color: var(--rand-stark); font-weight: 400; }
table.matrix td.d1 { background: color-mix(in srgb, var(--akzent) 10%, var(--flaeche)); }
table.matrix td.d2 { background: color-mix(in srgb, var(--akzent) 24%, var(--flaeche)); }
table.matrix td.d3 { background: color-mix(in srgb, var(--akzent) 40%, var(--flaeche)); }
table.matrix td.d4 { background: color-mix(in srgb, var(--akzent) 58%, var(--flaeche)); color: #fff; }
table.matrix td.d4 a { color: #fff; }

.matrix-waehler { display: flex; gap: 1rem; flex-wrap: wrap; align-items: end; margin-bottom: 1rem; }
.matrix-waehler label { display: flex; flex-direction: column; gap: .2rem; font-size: .92em; color: var(--text-leise); }

/* ---------- Detail ---------- */

.detail { max-width: 62rem; }
.detail-kopf { border-bottom: 2px solid var(--akzent); padding-bottom: .8rem; margin-bottom: 1.1rem; }
.detail-kopf .quelle { color: var(--text-leise); margin: .3rem 0 .5rem; }

.felder { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .45rem 1.2rem; align-items: baseline; }
.felder dt { color: var(--text-leise); }
.felder dd { margin: 0; }

.achsen-block { margin: 1.3rem 0; }
.achsen-block h3 { font-size: .95em; margin: 0 0 .3rem; }
.achsen-block .werte { display: flex; flex-wrap: wrap; gap: .3rem; }

.hinweis { border-left: 4px solid var(--akzent); background: var(--flaeche-2); padding: .7rem .9rem; margin: 1rem 0; }
.hinweis.warnung { border-left-color: var(--warn); background: var(--warn-flaeche); }

/* ---------- Systematik ---------- */

.definition { color: var(--text-leise); margin: .1rem 0 .7rem; max-width: 80ch; }
.achse-doku { border-top: 1px solid var(--rand); padding: 1rem 0; }
.achse-doku:first-of-type { border-top: none; }
.label-doku { margin: 0 0 .8rem; padding-left: 1rem; border-left: 3px solid var(--rand); }

/* ---------- Formular ---------- */

.formular { max-width: 54rem; }
.feldgruppe { border: 1px solid var(--rand); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1.1rem; background: var(--flaeche); }
.feldgruppe > legend { font-weight: 700; color: var(--akzent); padding: 0 .4rem; }
.feld { margin-bottom: .85rem; }
.feld > label { display: block; margin-bottom: .15rem; }
.feld input[type="text"], .feld input[type="number"], .feld input[type="url"],
.feld input[type="password"], .feld textarea, .feld select {
  width: 100%; font: inherit; padding: .4rem .55rem;
  border: 1px solid var(--rand-stark); border-radius: 3px;
  background: var(--flaeche); color: var(--text);
}
.feld textarea { min-height: 5rem; resize: vertical; }
.feld .hilfe { font-size: .9em; color: var(--text-leise); margin-top: .15rem; }
.feld-reihe { display: flex; gap: .8rem; flex-wrap: wrap; }
.feld-reihe > .feld { flex: 1; min-width: 9rem; }

.kaestchen-liste { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 1.4rem; }
@media (max-width: 700px) { .kaestchen-liste { columns: 1; } }
.kaestchen-liste li { break-inside: avoid; margin-bottom: .3rem; }
.kaestchen-liste label { display: flex; gap: .45rem; align-items: baseline; }
.kaestchen-liste .def { display: block; font-size: .88em; color: var(--text-leise); }

.fehler { border-left: 4px solid var(--warn); background: var(--warn-flaeche); padding: .7rem .9rem; margin-bottom: 1rem; }

/* ---------- Feedback ---------- */

.zaehler {
  display: inline-block; min-width: 1.5em; text-align: center;
  font-size: .8em; font-weight: 700; padding: 0 .35em; border-radius: 999px;
  background: var(--akzent); color: var(--flaeche); vertical-align: .1em;
}

.filterzeile { display: flex; gap: 1.2rem; flex-wrap: wrap; margin: .8rem 0 .4rem; padding-bottom: .4rem; border-bottom: 1px solid var(--rand); }
.filterzeile a { color: var(--text); text-decoration: none; border-bottom: 2px solid transparent; padding-bottom: .3rem; }
.filterzeile a:hover { text-decoration: underline; }
.filterzeile a[aria-current="true"] { font-weight: 700; color: var(--akzent); border-bottom-color: var(--akzent); }
.filterzeile a .anzahl { color: var(--text-leise); font-weight: 400; }
.filterzeile.leise { font-size: .92em; border-bottom: none; margin-top: .2rem; }

.statuspunkt {
  display: inline-block; width: .65em; height: .65em; border-radius: 999px;
  margin-right: .4em; vertical-align: .02em; background: var(--rand-stark);
}
.statuspunkt.offen { background: #2f8f4e; }
.statuspunkt.in_arbeit { background: #b8860b; }
.statuspunkt.erledigt { background: var(--akzent); }
.statuspunkt.abgelehnt { background: var(--rand-stark); }

.kommentar { border-left: 3px solid var(--rand); padding: .5rem 0 .5rem .9rem; margin-bottom: .9rem; }

/* In der Liste: wie eine abgeschlossene Rueckmeldung ausgegangen ist. */
.abschluss {
  margin: .35rem 0 0; padding: .4rem .6rem; font-size: .92em;
  background: var(--flaeche-2); border-left: 3px solid var(--akzent); border-radius: 0 3px 3px 0;
}
.abschluss .marke {
  display: inline-block; font-size: .78em; font-weight: 700; padding: 0 .4em; margin-right: .3em;
  border: 1px solid var(--rand-stark); border-radius: 2px;
  color: var(--text-leise); background: var(--flaeche); vertical-align: .1em;
}
.abschluss .wer { color: var(--text-leise); font-size: .88em; white-space: nowrap; }

.bilder { display: flex; flex-wrap: wrap; gap: .9rem; margin: 1rem 0; }
.bilder figure { margin: 0; max-width: 22rem; }
.bilder img {
  max-width: 100%; height: auto; display: block;
  border: 1px solid var(--rand); border-radius: 3px; background: var(--flaeche-2);
}
.bilder figcaption { font-size: .85em; color: var(--text-leise); margin-top: .25rem; }

.label-doku .aktionen { font-size: .88em; margin-top: .2rem; display: flex; gap: .9rem; flex-wrap: wrap; }

/* ---------- Fuß ---------- */

.fuss { background: var(--fuss); color: #cfcfcf; font-size: .85em; margin-top: 2rem; }
.fuss-innen { max-width: 1400px; margin: 0 auto; padding: 1rem 2rem 1.4rem; display: flex; gap: 1.4rem; flex-wrap: wrap; }
.fuss a { color: #b9cdf0; }

.htmx-request .ergebnisse { opacity: .55; transition: opacity .12s; }

/* Kommentar ändern: aufklappbar, damit es ohne zweiten Seitenaufruf und ohne
   JavaScript geht. Speichern und Löschen liegen im aufgeklappten Bereich
   nebeneinander; ein dauerhaft sichtbarer Löschknopf je Kommentar wäre einer
   zu viel. */
.kommentar-aendern { margin-top: .4rem; }
.kommentar-aendern > summary { cursor: pointer; font-size: .88em; color: var(--link); width: max-content; }
.kommentar-aendern > summary::marker { color: var(--text-leise); }
.kommentar-aendern[open] { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.kommentar-aendern[open] > summary { flex: 1 0 100%; }
.kommentar-aendern[open] > form:first-of-type { flex: 1 0 100%; margin-bottom: .2rem; }
.kommentar-aendern .feld { margin-bottom: .4rem; }
