:root {
  --grund: #f3f5f6; --flaeche: #ffffff; --flaeche2: #f8fafb; --rand: #d9e0e4; --rand2: #c3cdd3;
  --tinte: #16212b; --tinte2: #4d5b66; --tinte3: #6f7d88;
  --akzent: #0b5c7a; --akzent-hell: #e3f0f5; --akzent-tinte: #ffffff;
  --gut: #1f7a4d; --gut-hell: #e2f3ea; --mittel: #8a6100; --mittel-hell: #fbf0d3; --schwach: #5c6973; --schwach-hell: #e9edf0;
  --warn: #b3261e; --warn-hell: #fbe6e4; --neu: #7a3db8; --neu-hell: #f0e7fa;
  --schatten: 0 1px 2px rgba(22, 33, 43, .06), 0 4px 14px rgba(22, 33, 43, .05);
  --radius: 10px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #10161b; --flaeche: #182028; --flaeche2: #1d2731; --rand: #2c3944; --rand2: #3b4b58;
    --tinte: #e8eef2; --tinte2: #b3c0ca; --tinte3: #8b99a5;
    --akzent: #5db6d6; --akzent-hell: #17323e; --akzent-tinte: #08222c;
    --gut: #6fd09c; --gut-hell: #153526; --mittel: #e6bd55; --mittel-hell: #3a2f10; --schwach: #a6b3bd; --schwach-hell: #26323c;
    --warn: #ff8d85; --warn-hell: #40201e; --neu: #c59bf0; --neu-hell: #2e2140;
    --schatten: 0 1px 2px rgba(0, 0, 0, .3);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--grund); color: var(--tinte); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--akzent); text-underline-offset: 2px; }
h1 { font-size: 1.45rem; line-height: 1.25; margin: 0 0 .35rem; letter-spacing: -.01em; text-wrap: balance; }
h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
h3 { font-size: .8rem; margin: 0 0 .4rem; text-transform: uppercase; letter-spacing: .06em; color: var(--tinte3); font-weight: 650; }
p { margin: 0 0 .7rem; }
:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.sprung { position: absolute; left: -999px; top: 0; background: var(--akzent); color: var(--akzent-tinte); padding: .5rem 1rem; z-index: 50; }
.sprung:focus { left: 0; }
.leise { color: var(--tinte3); }
.klein { font-size: .86rem; }
.zahlen { font-variant-numeric: tabular-nums; }
.nw { white-space: nowrap; }

/* Kopf */
.kopf { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .55rem 1.25rem; background: var(--flaeche); border-bottom: 1px solid var(--rand); }
.marke { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.05rem; color: var(--akzent); text-decoration: none; letter-spacing: -.01em; }
.haupt { display: flex; gap: .15rem; flex: 1; overflow-x: auto; scrollbar-width: none; }
.haupt a { padding: .4rem .7rem; border-radius: 8px; color: var(--tinte2); text-decoration: none; white-space: nowrap; font-weight: 550; }
.haupt a:hover { background: var(--flaeche2); color: var(--tinte); }
.haupt a.aktiv { background: var(--akzent-hell); color: var(--akzent); }
.zahl { display: inline-block; min-width: 1.35em; padding: 0 .4em; border-radius: 99px; background: var(--neu); color: #fff; font-size: .72rem; font-weight: 700; text-align: center; line-height: 1.5; vertical-align: 1px; }
.zahl.hinweis { background: var(--mittel); }
.punkt { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--warn); vertical-align: 1px; }
.stand { font-size: .8rem; color: var(--tinte3); white-space: nowrap; }
.stand b { color: var(--tinte2); font-weight: 600; }

main { max-width: 1500px; margin: 0 auto; padding: 1.25rem; }
.seitenkopf { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: flex-end; justify-content: space-between; margin-bottom: 1rem; }
.seitenkopf p { margin: 0; color: var(--tinte2); max-width: 70ch; }
.karte { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--schatten); }
.karte + .karte { margin-top: 1rem; }
.gitter { display: grid; gap: 1rem; }
@media (min-width: 900px) { .gitter.zwei { grid-template-columns: 1fr 1fr; } .gitter.detail { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); align-items: start; } }

/* Bedienelemente */
button, .knopf { font: inherit; cursor: pointer; border: 1px solid var(--rand2); background: var(--flaeche); color: var(--tinte); padding: .42rem .8rem; border-radius: 8px; font-weight: 550; text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; min-height: 2.3rem; }
button:hover, .knopf:hover { background: var(--flaeche2); }
button.haupt-k, .knopf.haupt-k { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-tinte); }
button.haupt-k:hover { filter: brightness(1.08); }
button.flach { border-color: transparent; background: transparent; padding: .3rem .5rem; min-height: 0; }
button.flach:hover { background: var(--flaeche2); }
button.gefahr { color: var(--warn); }
button:disabled { opacity: .55; cursor: progress; }
input, select, textarea { font: inherit; color: var(--tinte); background: var(--flaeche); border: 1px solid var(--rand2); border-radius: 8px; padding: .4rem .55rem; width: 100%; min-height: 2.3rem; }
textarea { min-height: 4.5rem; resize: vertical; line-height: 1.45; }
input[type=checkbox] { width: 1.05rem; height: 1.05rem; min-height: 0; accent-color: var(--akzent); flex: none; margin: 0; }
label { font-size: .82rem; font-weight: 600; color: var(--tinte2); display: block; margin-bottom: .2rem; }
label.haken { display: flex; align-items: center; gap: .45rem; font-size: .92rem; font-weight: 500; color: var(--tinte); margin: 0; cursor: pointer; }
.feld { margin-bottom: .7rem; }
.reihe { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.reihe > .feld { flex: 1 1 9rem; margin: 0; }
.hilfe { font-size: .82rem; color: var(--tinte3); margin-top: .25rem; }

/* Profil-Reiter */
.reiter { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .9rem; }
.reiter button { border-radius: 99px; padding: .32rem .85rem; min-height: 0; font-weight: 550; }
.reiter button[aria-pressed=true] { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-tinte); }
.reiter .n { opacity: .75; font-weight: 500; font-variant-numeric: tabular-nums; }

/* Filter */
.arbeitsbereich { display: grid; gap: 1rem; align-items: start; grid-template-columns: minmax(0, 1fr); }
.arbeitsbereich > * { min-width: 0; }
@media (min-width: 1100px) { .arbeitsbereich { grid-template-columns: 290px minmax(0, 1fr); } }
.filter { padding: .9rem 1rem; }
.filter summary { font-weight: 650; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.filter summary::-webkit-details-marker { display: none; }
.filter summary::after { content: "▾"; color: var(--tinte3); }
.filter details[open] > summary::after { content: "▴"; }
.filter details > div { margin-top: .8rem; }
.filter fieldset { border: 0; padding: 0; margin: 0 0 .8rem; }
.filter legend { font-size: .82rem; font-weight: 600; color: var(--tinte2); padding: 0; margin-bottom: .25rem; }
.filter .haken { margin-bottom: .2rem; }
.aktivfilter { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: .6rem; }
.marke-f { background: var(--akzent-hell); color: var(--akzent); border-radius: 99px; padding: .1rem .3rem .1rem .65rem; font-size: .82rem; display: inline-flex; align-items: center; gap: .15rem; }
.marke-f button { border: 0; background: none; color: inherit; padding: 0 .35rem; min-height: 0; font-size: 1rem; line-height: 1; }

/* Leiste über der Liste */
.leiste { display: flex; flex-wrap: wrap; gap: .5rem .8rem; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.leiste .anzahl { font-weight: 650; }
.leiste select { width: auto; }
.menue { position: relative; }
.menue > div { position: absolute; right: 0; top: calc(100% + 4px); z-index: 10; background: var(--flaeche); border: 1px solid var(--rand2); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .16); padding: .3rem; min-width: 13rem; }
.menue > div button, .menue > div a { display: flex; width: 100%; border: 0; background: none; padding: .45rem .6rem; border-radius: 6px; font-weight: 500; color: var(--tinte); text-decoration: none; min-height: 0; }
.menue > div button:hover, .menue > div a:hover { background: var(--flaeche2); }

/* Tabelle */
.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--tinte3); font-weight: 650; padding: .5rem .6rem; border-bottom: 1px solid var(--rand); white-space: nowrap; }
.tabelle th button { all: unset; cursor: pointer; }
.tabelle th button:hover { color: var(--tinte); }
.tabelle td { padding: .65rem .6rem; border-bottom: 1px solid var(--rand); vertical-align: top; }
.tabelle tr:last-child td { border-bottom: 0; }
.tabelle tbody tr:hover { background: var(--flaeche2); }
.tabelle tr.neu td:first-child { box-shadow: inset 3px 0 0 var(--neu); }
.tabelle .titel a { color: var(--tinte); font-weight: 620; text-decoration: none; display: block; overflow-wrap: anywhere; }
.tabelle .titel a:hover { color: var(--akzent); text-decoration: underline; }
.tabelle tr.neu .titel a { font-weight: 720; }
.tabelle .unter { color: var(--tinte2); font-size: .86rem; margin-top: .1rem; overflow-wrap: anywhere; }
.tabelle .grund { color: var(--tinte3); font-size: .82rem; margin-top: .25rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tabellenkarte { padding: 0; overflow-x: auto; }
.na { color: var(--tinte3); font-style: italic; font-size: .88em; }

.passung { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 3.1rem; padding: .22rem .4rem; border-radius: 8px; font-weight: 720; line-height: 1.15; font-variant-numeric: tabular-nums; }
.passung small { font-size: .64rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.passung.hoch { background: var(--gut-hell); color: var(--gut); }
.passung.mittel { background: var(--mittel-hell); color: var(--mittel); }
.passung.gering { background: var(--schwach-hell); color: var(--schwach); }
.etikett { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: .08rem .42rem; border-radius: 5px; vertical-align: 1px; margin-right: .3rem; }
.etikett.neu { background: var(--neu-hell); color: var(--neu); }
.etikett.aenderung { background: var(--mittel-hell); color: var(--mittel); }
.etikett.aus { background: var(--warn-hell); color: var(--warn); }
.etikett.ruhig { background: var(--schwach-hell); color: var(--schwach); }
.etikett.merk { background: var(--akzent-hell); color: var(--akzent); }
.frist-nah { color: var(--warn); font-weight: 650; }
.stern { border: 0; background: none; font-size: 1.25rem; line-height: 1; padding: .15rem .3rem; min-height: 0; color: var(--tinte3); }
.stern[aria-pressed=true] { color: #d99a00; }
.seiten { display: flex; gap: .5rem; align-items: center; justify-content: center; padding: .9rem; }
.leer { padding: 2.5rem 1.2rem; text-align: center; color: var(--tinte2); }
.leer strong { display: block; color: var(--tinte); font-size: 1.05rem; margin-bottom: .3rem; }

@media (max-width: 820px) {
  .kopf { flex-wrap: wrap; padding: .5rem .8rem; gap: .4rem .8rem; }
  .haupt { order: 3; flex-basis: 100%; }
  main { padding: .8rem; }
}
@media (max-width: 1000px) {
  .tabelle thead { display: none; }
  .tabelle, .tabelle tbody, .tabelle tr, .tabelle td { display: block; width: 100%; }
  .tabelle tr { display: grid; grid-template-columns: auto 1fr auto; gap: .2rem .7rem; padding: .75rem .8rem; border-bottom: 1px solid var(--rand); }
  .tabelle td { border: 0; padding: 0; }
  .tabelle td.c-wahl { display: none; }
  .tabelle td.c-pass { grid-row: 1 / span 2; }
  .tabelle td.titel { grid-column: 2; }
  .tabelle td.c-merk { grid-column: 3; grid-row: 1; }
  .tabelle td.c-neben { grid-column: 2 / span 2; font-size: .86rem; color: var(--tinte2); }
  .tabelle td.c-neben::before { content: attr(data-name) ": "; color: var(--tinte3); }
  .tabelle tr.neu td:first-child { box-shadow: none; }
  .tabelle tr.neu { box-shadow: inset 3px 0 0 var(--neu); }
}

/* Detail */
.zurueck { display: inline-flex; align-items: center; gap: .3rem; margin-bottom: .7rem; text-decoration: none; font-weight: 550; }
.angaben { display: grid; grid-template-columns: minmax(8rem, 11rem) minmax(0, 1fr); gap: .5rem 1rem; margin: 0; }
.angaben dt { color: var(--tinte3); font-size: .86rem; }
.angaben dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .angaben { grid-template-columns: 1fr; gap: 0; } .angaben dd { margin-bottom: .6rem; } }
.beschreibung { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 78ch; }
.kasten { border-radius: var(--radius); padding: .85rem 1rem; border: 1px solid var(--rand); background: var(--flaeche2); }
.kasten + .kasten { margin-top: .7rem; }
.kasten.bewertung { border-left: 4px solid var(--akzent); }
.kasten.ki { border-left: 4px solid var(--neu); background: var(--neu-hell); border-color: transparent; }
.kasten.hinweis { border-left: 4px solid var(--mittel); background: var(--mittel-hell); border-color: transparent; }
.kasten.fehler { border-left: 4px solid var(--warn); background: var(--warn-hell); border-color: transparent; }
.herkunft { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--tinte3); margin-bottom: .35rem; display: flex; gap: .4rem; align-items: center; }
.fund { display: inline-block; background: var(--flaeche); border: 1px solid var(--rand); border-radius: 6px; padding: 0 .4rem; margin: .15rem .2rem 0 0; font-size: .84rem; }
.fund.minus { border-color: var(--warn); color: var(--warn); }
.los { border-top: 1px solid var(--rand); padding: .6rem 0; }
.los:first-child { border-top: 0; padding-top: 0; }
.los summary { cursor: pointer; font-weight: 600; }
.zeitleiste { list-style: none; margin: 0; padding: 0; }
.zeitleiste li { padding: .5rem 0 .5rem .9rem; border-left: 2px solid var(--rand2); position: relative; }
.zeitleiste li::before { content: ""; position: absolute; left: -5px; top: .95rem; width: 8px; height: 8px; border-radius: 50%; background: var(--rand2); }
.zeitleiste li.neu::before { background: var(--mittel); }
.zeitleiste time { display: block; font-size: .8rem; color: var(--tinte3); }
.aktionen { display: flex; flex-wrap: wrap; gap: .45rem; }

/* Profile */
.begriff { display: grid; grid-template-columns: minmax(0, 1fr) 7.2rem auto auto; gap: .4rem; align-items: center; margin-bottom: .35rem; }
@media (max-width: 560px) { .begriff { grid-template-columns: minmax(0, 1fr) 6.5rem auto; } .begriff .haken { grid-column: 1 / span 2; } }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip { display: inline-flex; align-items: center; gap: .25rem; background: var(--flaeche2); border: 1px solid var(--rand); border-radius: 8px; padding: .15rem .25rem .15rem .55rem; font-size: .86rem; }
.chip code { font-weight: 650; font-family: inherit; font-variant-numeric: tabular-nums; }
.chip button { border: 0; background: none; padding: 0 .3rem; min-height: 0; font-size: 1rem; color: var(--tinte3); }
.vorschlag { display: flex; gap: .5rem; align-items: baseline; justify-content: space-between; padding: .3rem 0; border-top: 1px solid var(--rand); font-size: .9rem; }
.vorschlag:first-child { border-top: 0; }
.vorschlag button { min-height: 0; padding: .1rem .55rem; flex: none; }
.profilzeile { display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding: .7rem 0; border-top: 1px solid var(--rand); flex-wrap: wrap; }
.profilzeile:first-of-type { border-top: 0; }

/* Quellen */
.ampel { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .4rem; background: var(--tinte3); }
.ampel.ok { background: var(--gut); } .ampel.fehler { background: var(--warn); } .ampel.wartet { background: var(--mittel); }
.protokoll { font-size: .84rem; max-height: 26rem; overflow: auto; }
.protokoll div { padding: .3rem 0; border-top: 1px solid var(--rand); display: grid; grid-template-columns: 8.6rem 4.6rem minmax(0, 1fr); gap: .5rem; }
.protokoll .fehler { color: var(--warn); } .protokoll .warnung { color: var(--mittel); }
@media (max-width: 560px) { .protokoll div { grid-template-columns: 1fr; gap: 0; } }

/* Anmeldung, Meldungen */
.anmeldung { max-width: 23rem; margin: 12vh auto 0; }
.anmeldung .marke { justify-content: center; font-size: 1.3rem; margin-bottom: 1.1rem; }
.meldung { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); background: var(--tinte); color: var(--grund); padding: .6rem 1rem; border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); z-index: 60; max-width: min(92vw, 34rem); }
.meldung.fehler { background: var(--warn); color: #fff; }
.lade { padding: 2rem; text-align: center; color: var(--tinte3); }
@media (prefers-reduced-motion: no-preference) { .lade::after { content: ""; display: inline-block; width: 1em; height: 1em; margin-left: .5em; border: 2px solid var(--rand2); border-top-color: var(--akzent); border-radius: 50%; animation: dreh .8s linear infinite; vertical-align: -2px; } }
@keyframes dreh { to { transform: rotate(360deg); } }
@media print { .kopf, .filter, .leiste, .aktionen, .zurueck { display: none !important; } body { background: #fff; } .karte { box-shadow: none; } }
.tabelle td.titel { width: 44%; min-width: 16rem; }
@media (max-width: 1000px) { .tabelle td.titel { width: auto; min-width: 0; } }
