/* Ausschreibungsportal – Gestaltung
   Aufbau nach dem Vorbild des CBS-Kundenportals: dunkle Seitenleiste mit den Bereichen, helle Kopfleiste,
   Seiten aus Karten mit runden Ecken, kleine dichte Schrift (Inter), Überschriften in Manrope.
   Eigene Farben: Nachtviolett und Violett statt Marineblau und Bernstein; das Textmarker-Gelb bleibt die Leuchtfarbe.
   Geblieben ist die Leitidee der Listen: Die Frist führt – jede Ausschreibung ist eine Zeile mit der Frist links.
   Schriften liegen in assets/schriften (SIL Open Font License) – nichts wird von fremden Servern geladen. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../assets/schriften/inter-latin_v0.1.21.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../assets/schriften/inter-latin-ext_v0.1.21.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../assets/schriften/inter-cyrillic_v0.1.21.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../assets/schriften/inter-greek_v0.1.21.woff2") format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("../assets/schriften/manrope-latin_v0.1.21.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("../assets/schriften/manrope-latin-ext_v0.1.21.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- Farben und Maße: alles, was die Erscheinung bestimmt, steht in diesem einen Block ---------- */
:root {
  /* Marke */
  --nacht: #21173a;            /* Seitenleiste */
  --nacht-hell: #2e2250;       /* Flächen in der Seitenleiste */
  --nacht-linie: #3d3163;
  --nacht-schrift: #d9d3ea;
  --nacht-schrift-2: #a9a0c6;
  --akzent: #5b3fd0;           /* Hauptknöpfe, Links, Auswahl */
  --akzent-dunkel: #4730ab;
  --akzent-hell: #efebfd;
  --akzent-rand: #cfc5f5;
  --marker: #ffe45c;           /* Leuchtfarbe: aktiver Bereich, Gemerktes */
  --marker-rand: #c9a900;
  /* Flächen und Schrift */
  --grund: #f7f6fb;
  --blatt: #ffffff;
  --blatt-2: #faf9fd;
  --linie: #e6e2f0;
  --linie-2: #cdc7dc;
  --tinte: #1c1530;
  --tinte-2: #5d5870;
  --tinte-3: #736d88;
  /* Bedeutung (nicht Marke): Fristen und Zustände */
  --rot: #b3261e;
  --rot-hell: #fbeceb;
  --ocker: #9a6200;
  --ocker-hell: #fdf3dc;
  --gruen: #1d6747;
  --gruen-hell: #e3f3ea;
  /* Schrift */
  --schrift: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --schrift-titel: "Manrope", "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  /* Maße */
  --seite-b: 240px;
  --leiste-h: 64px;
  --r-klein: 6px;
  --r: 8px;
  --r-karte: 14px;
  --schatten: 0 2px 5px rgba(33, 23, 58, .03);
  --schatten-hoch: 0 18px 48px rgba(33, 23, 58, .22);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--grund); color: var(--tinte); font: 400 14px/1.55 var(--schrift); font-feature-settings: "cv11", "ss03"; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--schrift-titel); font-weight: 700; line-height: 1.3; margin: 0; }
h1 { font-size: clamp(24px, 2.2vw, 31px); font-weight: 800; line-height: 1.22; letter-spacing: -.03em; }
h2 { font-size: 17px; letter-spacing: -.01em; }
h3 { font-size: 15px; }
p { margin: 0; }
a { color: var(--akzent); text-underline-offset: 2px; }
a:hover { color: var(--akzent-dunkel); }
:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }
.laden { padding: 3rem 1.25rem; color: var(--tinte-2); }
.leise { color: var(--tinte-2); }
.klein { font-size: 12.5px; }
[hidden] { display: none !important; }

/* ---------- Gestell: Seitenleiste, Kopfleiste, Seite ---------- */
.gestell { display: grid; grid-template-columns: var(--seite-b) minmax(0, 1fr); min-height: 100vh; }
.seite { background: var(--nacht); color: var(--nacht-schrift); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto; scrollbar-width: thin; z-index: 12; }
.marke { display: flex; align-items: center; gap: 12px; padding: 22px 20px 21px; border-bottom: 1px solid rgba(255, 255, 255, .1); color: #fff; text-decoration: none; }
.marke:hover { color: #fff; }
.marke-zeichen { flex: none; width: 34px; height: 34px; }
.marke-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.marke-text b { font: 800 15px/1.2 var(--schrift-titel); letter-spacing: -.02em; }
.marke-text b, .marke-text small { white-space: nowrap; }
.marke-text small { font-size: 11px; color: var(--nacht-schrift-2); margin-top: 3px; }
.seite-teil { padding: 22px 12px 12px; }
.seite-etikett { padding: 0 12px 12px; font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--nacht-schrift-2); }
.nav { display: flex; flex-direction: column; }
.nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 9px 12px; margin-bottom: 4px; border: 1px solid transparent; border-radius: var(--r);
  color: var(--nacht-schrift); text-decoration: none; font-size: 13.5px; font-weight: 500; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a[aria-current="page"] { background: rgba(255, 255, 255, .05); border-color: var(--marker); color: #fff; box-shadow: inset 3px 0 var(--marker); }
.nav a:focus-visible, .seite a:focus-visible, .seite button:focus-visible { outline-color: var(--marker); }
.zeichen { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav a .zeichen { color: var(--nacht-schrift-2); }
.nav a:hover .zeichen { color: #fff; }
.nav a[aria-current="page"] .zeichen { color: var(--marker); }
.nav .zaehler { margin-left: auto; background: var(--marker); color: var(--tinte); border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 1; padding: 4px 7px; font-variant-numeric: tabular-nums; }
.seite-fuss { margin-top: auto; padding: 14px 12px 16px; border-top: 1px solid rgba(255, 255, 255, .1); display: flex; flex-direction: column; gap: 8px; }
.seite-fuss a { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--r); color: #fff; text-decoration: none; min-width: 0; }
.seite-fuss a:hover { background: rgba(255, 255, 255, .07); }
.seite-fuss a[aria-current="page"] { background: rgba(255, 255, 255, .05); box-shadow: inset 3px 0 var(--marker); }
.seite-fuss a .zeichen { color: var(--nacht-schrift-2); }
.ich { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.ich b { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ich small { font-size: 11px; color: var(--nacht-schrift-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seite-fuss button { display: flex; align-items: center; gap: 12px; min-height: 38px; padding: 8px 12px; background: none; border: 1px solid var(--nacht-linie); color: var(--nacht-schrift); font-size: 13px; text-align: left; }
.seite-fuss button:hover { background: rgba(255, 255, 255, .07); border-color: var(--nacht-linie); color: #fff; }
.seite-version { padding: 0 12px; font-size: 11px; color: var(--nacht-schrift-2); }

.buehne { min-width: 0; display: flex; flex-direction: column; }
.leiste { position: sticky; top: 0; z-index: 10; min-height: var(--leiste-h); background: var(--blatt); border-bottom: 1px solid var(--linie); display: flex; align-items: center; gap: 14px; padding: 0 28px; }
.pfad { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--tinte-2); min-width: 0; }
.pfad strong { font-weight: 600; color: var(--tinte); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfad .pfad-strich { color: var(--linie-2); }
.leiste-rechts { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.firma { display: inline-flex; align-items: center; gap: 8px; max-width: 26rem; padding: 6px 12px; border: 1px solid var(--linie); border-radius: 999px; background: var(--blatt-2); font-size: 12px; font-weight: 600; color: var(--tinte); }
.firma > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.firma::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--akzent); }
.firma.test::before { background: var(--ocker); }
.menue { display: none; }
.seite-schleier { display: none; }
.kontext { background: var(--marker); color: var(--tinte); border-bottom: 1px solid var(--marker-rand); }
.kontext-innen { padding: 8px 28px; display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; font-size: 13px; font-weight: 500; }
.kontext button.schlicht { color: var(--tinte); min-height: 0; padding: 2px 4px; font-weight: 600; }
.kontext button.schlicht:hover { background: rgba(0, 0, 0, .08); color: var(--tinte); }

main { width: 100%; max-width: 1480px; padding: 28px 28px 72px; }
#app > main { margin: 0 auto; max-width: 40rem; padding-top: 4rem; }     /* Fehler vor dem Aufbau des Gestells */
.titelzeile { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 18px; margin-bottom: 22px; }
.titelzeile .rechts { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.unternav { display: flex; gap: 6px 26px; flex-wrap: wrap; border-bottom: 1px solid var(--linie); margin-bottom: 22px; }
.unternav a { padding: 10px 0 11px; text-decoration: none; color: var(--tinte-2); font-size: 13px; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.unternav a:hover { color: var(--tinte); }
.unternav a[aria-current="page"] { color: var(--akzent-dunkel); border-bottom-color: var(--akzent); }

/* ---------- Formulare ---------- */
label, .feld > span.beschriftung { display: block; font-size: 12px; font-weight: 600; color: var(--tinte-2); margin-bottom: 6px; }
input, select, textarea, button { font: inherit; color: inherit; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="search"], select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--linie-2); border-radius: var(--r); background: #fff; font-size: 13.5px; }
input:hover, select:hover, textarea:hover { border-color: #b3abc9; }
input[type="text"]:focus-visible, input[type="email"]:focus-visible, input[type="password"]:focus-visible, input[type="number"]:focus-visible, input[type="date"]:focus-visible,
input[type="search"]:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--akzent); box-shadow: 0 0 0 3px rgba(91, 63, 208, .2); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--akzent); }
::placeholder { color: var(--tinte-3); opacity: 1; }
textarea { min-height: 5rem; resize: vertical; }
.feld { margin-bottom: 14px; }
.feld > .klein, .feld > small { display: block; margin-top: 5px; }
.feldreihe { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 14px; }
button, .knopf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 15px; border-radius: var(--r); border: 1px solid var(--linie-2); background: var(--blatt);
  color: var(--tinte); font-size: 13px; font-weight: 600; line-height: 1.35; cursor: pointer; text-decoration: none; text-align: center; }
button:hover, .knopf:hover { background: var(--akzent-hell); border-color: var(--akzent-rand); color: var(--akzent-dunkel); }
button.haupt, .knopf.haupt { background: var(--akzent); border-color: var(--akzent); color: #fff; }
button.haupt:hover, .knopf.haupt:hover { background: var(--akzent-dunkel); border-color: var(--akzent-dunkel); color: #fff; }
button.schlicht { border-color: transparent; background: none; color: var(--akzent); padding-left: 8px; padding-right: 8px; }
button.schlicht:hover { background: var(--akzent-hell); border-color: transparent; }
button.gefahr { border-color: #e3b6b2; color: var(--rot); }
button.gefahr:hover { background: var(--rot-hell); border-color: var(--rot); color: var(--rot); }
button:disabled { opacity: .5; cursor: default; }
.knopfzeile { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.hinweis { padding: 12px 16px; border: 1px solid var(--akzent-rand); border-radius: var(--r); background: var(--akzent-hell); margin-bottom: 18px; font-size: 13.5px; }
.hinweis.fehler { border-color: #e9bdb9; background: var(--rot-hell); }
.hinweis.gut { border-color: #b9dcc8; background: var(--gruen-hell); }
.hinweis ul { margin: 6px 0 0 18px; padding: 0; }

/* Auswahl-Box: zeigt das Gewählte; der Klick öffnet die Auswahl groß im Dialog */
.wahl { margin-bottom: 14px; min-width: 0; }
.wahl-box { display: block; width: 100%; min-height: 0; text-align: left; background: #fff; color: var(--tinte); border: 1px solid var(--linie-2); border-radius: var(--r);
  padding: 9px 12px 10px; font-weight: 400; cursor: pointer; }
.wahl-box:hover { border-color: var(--akzent); background: #fff; color: var(--tinte); }
.wahl-box:hover .wahl-aendern { text-decoration: underline; }
.wahl-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.wahl-titel { font-weight: 600; font-size: 12px; color: var(--tinte-2); }
.wahl-aendern { color: var(--akzent); font-size: 12px; font-weight: 600; white-space: nowrap; }
.wahl-inhalt { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; min-width: 0; font-size: 13.5px; }
.wahl-leer { color: var(--tinte); }
.wahl-marke { display: inline-flex; align-items: center; max-width: 100%; background: var(--akzent-hell); color: var(--akzent-dunkel); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.wahl-marke > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.wahl-marke .flagge { margin-right: .4em; flex: none; }
.wahl-mehr { align-self: center; font-size: 12px; color: var(--tinte-2); }
.branchen .wahl { margin-bottom: 8px; }
.branchen { margin-bottom: 14px; }
.branchen > p:last-child { margin-bottom: 0; }
.haken { display: flex; gap: 8px; align-items: baseline; color: var(--tinte); font-size: 13px; font-weight: 400; cursor: pointer; margin: 0; }

/* Auswahl im Dialog: Suchfeld, Listen in Spalten, Zahl rechts; die Knöpfe bleiben unten sichtbar */
.dialog.breit { width: min(64rem, 100%); display: flex; flex-direction: column; max-height: 90vh; }
.wahl-dialog { display: flex; flex-direction: column; min-height: 0; padding: 18px 24px 0; }
.wahl-leiste { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; }
.wahl-leiste input[type=search] { flex: 1 1 16rem; max-width: 26rem; }
.wahl-zahlhinweis { margin: 8px 0 0; }
.wahl-koerper { overflow-y: auto; min-height: 8rem; margin: 14px -24px 0; padding: 4px 24px 10px; border-top: 1px solid var(--linie); overscroll-behavior: contain; }
.wahl-koerper h3 { margin: 16px 0 6px; }
.wahl-koerper h3:first-child { margin-top: 10px; }
/* Zeitungsspalten: die Liste liest sich von oben nach unten, dann in der nächsten Spalte weiter */
.wahl-liste { columns: 17.5rem; column-gap: 1.5rem; padding: 5px 0; }
.wahl-liste.einzeln { border-top: 1px solid var(--linie); margin-top: 8px; padding-top: 10px; }
.wahl-liste label { break-inside: avoid; display: flex; gap: 9px; align-items: baseline; padding: 6px 9px; margin: 0; color: var(--tinte); font-size: 13.5px; font-weight: 400; cursor: pointer; border-radius: var(--r-klein); }
.wahl-liste label:hover { background: var(--akzent-hell); }
.wahl-liste label:has(input:checked) { background: var(--akzent-hell); font-weight: 600; }
.wahl-liste .wahl-name { min-width: 0; overflow-wrap: anywhere; }
.wahl-liste.lang { columns: 24rem; }
.wahl-liste .wahl-name .flagge { margin-right: .4em; }
.wahl-liste .menge { margin-left: auto; padding-left: 8px; color: var(--tinte-2); font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wahl-liste label.null:not(:has(input:checked)) { color: var(--tinte-2); }
.wahl-fuss { margin: 0 -24px; padding: 14px 24px; align-items: center; background: var(--blatt-2); border-top: 1px solid var(--linie); border-radius: 0 0 var(--r-karte) var(--r-karte); }
.wahl-stand { margin-left: auto; color: var(--tinte-2); font-size: 12.5px; }

/* ---------- Anmeldung ---------- */
.tor { min-height: 100vh; display: flex; flex-direction: column; background: var(--grund); }
.tor-kopf { min-height: 72px; background: var(--nacht); display: flex; align-items: center; padding: 0 clamp(20px, 5vw, 64px); }
.tor-kopf .marke { padding: 0; border: 0; }
.tor-buehne { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: clamp(28px, 9vh, 96px) clamp(20px, 5vw, 64px) 48px; display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(28px, 6vw, 88px); align-items: start; }
.tor-bild { display: flex; flex-direction: column; gap: 22px; padding-top: 10px; }
.tor-bild h1 { font-size: clamp(30px, 3.9vw, 48px); line-height: 1.12; letter-spacing: -.035em; max-width: 13em; }
.tor-bild p { max-width: 34em; font-size: 15px; line-height: 1.65; color: var(--tinte-2); }
.tor-liste { margin-top: 14px; border-top: 1px solid var(--linie); }
.tor-liste div { display: grid; grid-template-columns: 6.5rem 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--linie); align-items: baseline; }
.tor-liste b { font: 800 24px/1.1 var(--schrift-titel); letter-spacing: -.03em; color: var(--akzent); }
.tor-liste span { color: var(--tinte-2); font-size: 13.5px; }
.tor-form { background: var(--blatt); border: 1px solid var(--linie); border-radius: var(--r-karte); box-shadow: var(--schatten); padding: 30px 32px 22px; display: flex; flex-direction: column; }
.tor-form h2 { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 20px; }
.tor-form form .knopfzeile .haupt { flex: 1 1 auto; min-height: 44px; }
.tor-version { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--linie); }

/* ---------- Suche ---------- */
.suche { display: grid; grid-template-columns: 16.5rem minmax(0, 1fr); gap: 22px; align-items: start; }
.filter { background: var(--blatt); border: 1px solid var(--linie); border-radius: var(--r-karte); box-shadow: var(--schatten); padding: 18px; position: sticky; top: calc(var(--leiste-h) + 18px); }
.filter h2 { font-size: 15px; margin-bottom: 14px; }
.filter-zu > summary { display: none; }
/* Der Filter bleibt beim Blättern stehen. Ist er höher als der Bildschirm, scrollen nur die Felder –
   „Suchen“ und „Zurücksetzen“ bleiben am unteren Rand des Filters sichtbar. */
.filter-form { display: flex; flex-direction: column; max-height: calc(100vh - 10rem); }
.filter-felder { overflow-y: auto; min-height: 0; padding: 0 10px 4px 0; margin-right: -10px; scrollbar-width: thin; overscroll-behavior: contain; }
.filter-form > .knopfzeile { flex: none; margin-top: 0; padding-top: 14px; border-top: 1px solid var(--linie); }
.filter-form > .knopfzeile .haupt { flex: 1 1 auto; }
/* Sortierung und aktive Filter über den Treffern */
.sortieren { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12.5px; font-weight: 500; color: var(--tinte-2); }
.sortieren select { width: auto; min-width: 0; min-height: 40px; }
.aktive-filter { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -8px 0 16px; }
.marke-filter { display: inline-flex; align-items: center; gap: 7px; min-height: 0; background: var(--akzent-hell); border: 1px solid var(--akzent-rand); border-radius: 999px;
  padding: 4px 11px; font-size: 12px; font-weight: 600; color: var(--akzent-dunkel); cursor: pointer; }
.marke-filter:hover { border-color: var(--akzent); }
.marke-filter .weg { font-size: 15px; line-height: 1; color: var(--akzent); }
.marke-filter .flagge { margin-right: .3em; }

.liste { background: var(--blatt); border: 1px solid var(--linie); border-radius: var(--r-karte); box-shadow: var(--schatten); overflow: hidden; }
.zeile { position: relative; display: grid; grid-template-columns: 7rem minmax(0, 1fr) auto; border-bottom: 1px solid var(--linie); }
.zeile:last-child { border-bottom: 0; }
/* Streifen am linken Rand nur, wenn die Frist drängt oder vorbei ist */
.zeile::before, .detail-kopf::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: transparent; }
.bald::before { background: var(--ocker); }
.dringend::before { background: var(--rot); }
.vorbei::before { background: var(--linie-2); }
.zeile.markt::before { display: none; }       /* im Bestand ist alles vorbei – der Streifen sagt dort nichts */
.frist { min-width: 0; overflow: hidden; padding: 16px 8px 16px 20px; display: flex; flex-direction: column; line-height: 1.15; }
.frist-tage { font: 800 30px/1 var(--schrift-titel); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.frist-tage.lang { font-size: 21px; padding: 5px 0 2px; }   /* ab 1.000 Tagen: passt sonst nicht in die Spalte */
.frist-wort { font: 800 19px/1.1 var(--schrift-titel); letter-spacing: -.02em; padding: 6px 0 2px; }
.frist-einheit { font-size: 12px; color: var(--tinte-2); margin-top: 3px; }
.frist time { font-size: 12px; margin-top: 5px; font-variant-numeric: tabular-nums; color: var(--tinte-2); }
/* Piktogramm unter der Frist: Symbol = Branche, Kachelfarbe = Auftragsart (Maße und Farben aus der Übergabe vom 25.11.2026;
   Rot kommt nicht vor, es markiert in der Liste die Frist). Bezeichnung steht immer in title und aria-label. */
.pk-kachel { display: inline-flex; align-items: center; justify-content: center; flex: none; align-self: flex-start; width: 64px; height: 64px; margin-top: 12px; border-radius: 12px; background: #e9edf0; color: #55606a; }
.pk-kachel svg { width: 34px; height: 34px; }
.pk-kachel.pk-bau { background: #fbecd0; color: #8a5600; }
.pk-kachel.pk-lieferung { background: #dde9f8; color: #1c4c8a; }
.pk-kachel.pk-dienst { background: #dbefe5; color: #1d6747; }
.pk-kachel.pk-unbekannt { background: #e9edf0; color: #55606a; }
/* aus dem Titel geschätzt (keine Angabe der Quelle): gestrichelter Rand in der Symbolfarbe */
.pk-kachel.pk-geschaetzt { border: 1.5px dashed currentColor; }
/* mit Kachel ist die Fristspalte oft höher als der Text daneben: sie reicht über alle Zeilen des Eintrags, damit darunter keine Lücke entsteht */
.zeile.mit-notiz .frist { grid-row: 1 / span 2; }
.bald .frist-tage, .bald .frist-wort { color: var(--ocker); }
.dringend .frist-tage, .dringend .frist-wort { color: var(--rot); }
.vorbei .frist-wort { color: var(--tinte-2); }
.zeile-haupt { padding: 16px 16px 17px 8px; min-width: 0; }
.zeile-haupt h3 { font-family: var(--schrift); font-weight: 600; font-size: 15px; line-height: 1.4; letter-spacing: -.005em; }
.zeile-haupt h3 a { color: var(--tinte); text-decoration: none; }
.zeile-haupt h3 a:hover { color: var(--akzent-dunkel); text-decoration: underline; }
.zeile.gemerkt .zeile-haupt h3 a { background: linear-gradient(transparent 55%, var(--marker) 55%, var(--marker) 92%, transparent 92%); }
.zeile-wer { margin-top: 3px; font-size: 13.5px; }
/* Flagge vor jedem Ländernamen */
.flagge { width: 1.25em; height: .94em; vertical-align: -.1em; margin-right: .35em; border: 1px solid rgba(0, 0, 0, .2); border-radius: 2px; object-fit: cover; }
.land { white-space: nowrap; }
.zeile-meta { display: flex; flex-wrap: wrap; gap: 2px 16px; margin-top: 6px; font-size: 12.5px; color: var(--tinte-2); }
.zeile-meta .wert { color: var(--tinte); font-weight: 600; }
.auszug { margin-top: 7px; font-size: 13px; color: var(--tinte-2); max-width: 75ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.zeile-aktion { padding: 16px 18px 16px 4px; display: flex; flex-direction: column; gap: 8px; align-items: stretch; min-width: 8.4rem; }
.zeile-aktion button, .zeile-aktion .knopf { min-height: 34px; padding: 6px 12px; font-size: 12px; }
button[aria-pressed="true"] { background: var(--marker); border-color: var(--marker-rand); color: var(--tinte); }
button[aria-pressed="true"]:hover { background: #ffdc2e; border-color: var(--marker-rand); color: var(--tinte); }
.zeile-notiz { grid-column: 2 / -1; padding: 0 18px 16px 8px; display: grid; grid-template-columns: 11rem minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.marke-neu { background: var(--akzent); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 999px; margin-right: 7px; font-weight: 600; vertical-align: 2px; }
.leer { padding: 44px 28px; }
.leer h2 { font-size: 17px; }
.leer p { max-width: 55ch; margin-top: 7px; color: var(--tinte-2); }
.blaettern { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 16px 0; }

/* ---------- Detail ---------- */
.detail { background: var(--blatt); border: 1px solid var(--linie); border-radius: var(--r-karte); box-shadow: var(--schatten); overflow: hidden; }
.detail-kopf { position: relative; display: grid; grid-template-columns: 9rem minmax(0, 1fr); border-bottom: 1px solid var(--linie); }
.detail-kopf .frist { padding: 24px 12px 24px 26px; }
.detail-kopf .frist-tage { font-size: 44px; }
.detail-kopf .frist-tage.lang { font-size: 28px; }
.detail-kopf-text { padding: 24px 26px 24px 8px; }
.detail-kopf-text h1 { font-family: var(--schrift); font-size: 22px; font-weight: 700; line-height: 1.32; letter-spacing: -.015em; max-width: 40em; }
.detail-inhalt { padding: 24px 26px; }
.angaben { display: grid; grid-template-columns: minmax(8rem, 14rem) minmax(0, 1fr); gap: 8px 22px; margin: 0; }
.angaben dt { color: var(--tinte-2); font-size: 12.5px; padding-top: 1px; }
.angaben dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; max-width: 80ch; }
.angaben-block { border-top: 1px solid var(--linie); margin-top: 20px; padding-top: 18px; }
.angaben-block > h2, .angaben-block > h3 { margin-bottom: 11px; }
.detail-inhalt > .angaben-block:first-child, .detail-inhalt > div:first-child > .angaben-block:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.lose .knopf { margin: 7px 8px 0 0; }
.angaben-block .angaben-block { margin-left: 16px; }

/* ---------- Marktrecherche ---------- */
.zeile.markt { grid-template-columns: 8.4rem minmax(0, 1fr) auto; }
.zeile.markt .frist time.frist-wort { font-size: 17px; margin-top: 0; padding-top: 2px; white-space: nowrap; color: var(--tinte); font-variant-numeric: tabular-nums; }
.zeile.markt .frist-einheit { font-size: 12.5px; }
/* Auslaufende Verträge: links die Tage bis zum Ende der Laufzeit; die Marke darunter sagt, wenn das Ende nicht von der Quelle genannt ist */
.zeile.vertrag { grid-template-columns: 8.6rem minmax(0, 1fr) auto; }
.frist .herkunft { align-self: flex-start; margin-top: 8px; padding: 2px 8px; border-radius: 8px; background: #eeecf4; color: var(--tinte-2); font-size: 11px; font-weight: 600; line-height: 1.35; cursor: help; }
.zeile.vertrag .frist time { white-space: nowrap; }
.sortieren span { white-space: nowrap; }
.zeile-los { margin-top: 2px; font-size: 13px; color: var(--tinte-2); }
.wert-klein { font-weight: 600; color: var(--tinte); }
.filter .haken { margin-bottom: 6px; }
.profilkopf { background: var(--blatt); border: 1px solid var(--linie); border-radius: var(--r-karte); box-shadow: var(--schatten); padding: 24px 26px; margin-bottom: 24px; }
.profilkopf h1 { font-family: var(--schrift); font-size: 22px; font-weight: 700; line-height: 1.32; letter-spacing: -.015em; max-width: 40em; }
.profilkopf h1 .flagge { margin-right: .5em; }
td a.land { text-decoration: none; }
td a.land:hover, td a.land:focus-visible { text-decoration: underline; }
.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 16px 26px; margin: 20px 0 0; padding-top: 18px; border-top: 1px solid var(--linie); }
.kennzahlen dt { font-size: 12px; color: var(--tinte-2); }
.kennzahlen dd { margin: 3px 0 0; font: 800 24px/1.2 var(--schrift-titel); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.abschnitt { margin-bottom: 26px; }
.abschnitt > h2 { margin-bottom: 10px; }
.abschnitt > p.klein { margin: -5px 0 10px; }
.zweispaltig { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 0 22px; }
.rangliste { list-style: none; margin: 0; padding: 8px 20px; background: var(--blatt); border: 1px solid var(--linie); border-radius: var(--r-karte); box-shadow: var(--schatten); }
.rangliste li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 16px; padding: 10px 0; border-bottom: 1px solid var(--linie); font-size: 13.5px; }
.rangliste li:last-child { border-bottom: 0; }
.rangliste .rang-zahl { font-variant-numeric: tabular-nums; font-weight: 600; }
.rangliste .balken { grid-column: 1 / -1; height: 4px; background: var(--akzent); border-radius: 2px; }
.lose { list-style: none; margin: 0; padding: 0; }
.lose > li { border-top: 1px solid var(--linie); padding: 14px 0; }
.lose > li:first-child { border-top: 0; padding-top: 0; }
.lose h3 { margin-bottom: 6px; }
.beschreibung { white-space: pre-line; max-width: 80ch; overflow-wrap: anywhere; }

/* ---------- Tabellen ---------- */
.tafel-rahmen { background: var(--blatt); border: 1px solid var(--linie); border-radius: var(--r-karte); box-shadow: var(--schatten); overflow-x: auto; margin-bottom: 22px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { text-align: left; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--tinte-2); background: var(--blatt-2); padding: 12px 16px; border-bottom: 1px solid var(--linie); white-space: nowrap; }
td { padding: 13px 16px; border-bottom: 1px solid var(--linie); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.zahl, th.zahl { text-align: right; font-variant-numeric: tabular-nums; }
td .knopfzeile { margin: 0; gap: 6px; }
td button { min-height: 32px; padding: 5px 11px; font-size: 12px; }
td select { min-height: 32px; padding: 4px 8px; width: auto; font-size: 12.5px; }
.status { display: inline-block; font-size: 11px; font-weight: 600; line-height: 1.4; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.status.gut { color: var(--gruen); background: var(--gruen-hell); }
.status.warn { color: #7a4e00; background: var(--ocker-hell); }
.status.schlecht { color: var(--rot); background: var(--rot-hell); }
.status.neutral { color: var(--tinte-2); background: #eeecf4; }

.karte { background: var(--blatt); border: 1px solid var(--linie); border-radius: var(--r-karte); box-shadow: var(--schatten); padding: 20px 22px 22px; margin-bottom: 22px; }
.karte > h2 { font-size: 16px; margin-bottom: 14px; }
.zwei { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; align-items: start; }
.linkfeld { display: flex; gap: 8px; margin-top: 8px; }
.linkfeld input { font-size: 12.5px; }
.profil { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 24px; padding: 18px 22px; border-bottom: 1px solid var(--linie); align-items: start; }
.profil:last-child { border-bottom: 0; }
.profil h3 a { color: var(--tinte); text-decoration: none; }
.profil h3 a:hover { color: var(--akzent-dunkel); text-decoration: underline; }
.profil .kriterien { color: var(--tinte-2); font-size: 13px; margin-top: 5px; max-width: 75ch; }
.profil .knopfzeile { justify-content: flex-end; margin-top: 0; }
.profil .knopfzeile button, .profil .knopfzeile .knopf { min-height: 34px; padding: 6px 12px; font-size: 12px; }
.profil.aus h3 a { color: var(--tinte-2); }

/* ---------- Benachrichtigungen und Einstellungen ---------- */
.einleitung { max-width: 75ch; margin-bottom: 18px; }
.karte > .kennzahlen { border-top: 0; padding-top: 0; margin-top: 0; }
.feld-oben { margin-top: 14px; }
.umbruch { overflow-wrap: anywhere; }
code, pre, input.geheim { font-family: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace; font-size: 12.5px; }
pre { background: var(--blatt-2); border: 1px solid var(--linie); border-radius: var(--r); padding: 12px 14px; margin: 8px 0 14px; overflow-x: auto; line-height: 1.5; }
.anleitung > summary { cursor: pointer; font: 700 15px/1.3 var(--schrift-titel); }
.anleitung[open] > summary { margin-bottom: 12px; }
.anleitung p { max-width: 80ch; }
.anleitung .tafel-rahmen { margin-bottom: 0; box-shadow: none; }
.eintragwahl .gewaehlt { margin: 0 0 8px; }
.wahl-suche { display: grid; grid-template-columns: minmax(8rem, 13rem) minmax(0, 1fr) auto; gap: 8px; }
.wahl-treffer ul { list-style: none; margin: 8px 0 0; padding: 0; border: 1px solid var(--linie); border-radius: var(--r); max-height: 14rem; overflow: auto; }
.wahl-treffer li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 12px; border-bottom: 1px solid var(--linie); font-size: 13px; }
.wahl-treffer li:last-child { border-bottom: 0; }
.wahl-treffer li > span { min-width: 0; overflow-wrap: anywhere; }
.wahl-treffer li button { min-height: 30px; padding: 4px 11px; font-size: 12px; white-space: nowrap; }
.wahl-treffer p { margin-top: 8px; }
.wahl-treffer .flagge { vertical-align: -2px; }

/* ---------- Dialog und Meldungen ---------- */
.schleier { position: fixed; inset: 0; background: rgba(28, 21, 48, .5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow: auto; z-index: 20; }
.schleier + .schleier { background: rgba(28, 21, 48, .35); }
.dialog { background: var(--blatt); width: min(40rem, 100%); border-radius: var(--r-karte); box-shadow: var(--schatten-hoch); }
.dialog > h2 { padding: 18px 24px; border-bottom: 1px solid var(--linie); font-size: 17px; }
.dialog > h2 ~ * { margin-left: 24px; margin-right: 24px; }
.dialog > h2 + * { margin-top: 20px; }
.dialog > :last-child { margin-bottom: 22px; }
.dialog.breit > h2 ~ * { margin: 0; }
#meldungen { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 30; max-width: min(26rem, calc(100vw - 40px)); }
.meldung { background: var(--tinte); color: #fff; padding: 12px 16px 12px 14px; border-radius: 10px; border-left: 4px solid var(--marker); box-shadow: var(--schatten-hoch); font-size: 13px; font-weight: 500; }
.meldung.fehler { border-left-color: #ff8a80; }

/* ---------- Seitenleiste als Schublade (Tablet, Telefon) ---------- */
@media (max-width: 1180px) {
  .gestell { grid-template-columns: minmax(0, 1fr); }
  .seite { position: fixed; left: 0; top: 0; bottom: 0; width: min(280px, 86vw); height: auto; transform: translateX(-102%); visibility: hidden; z-index: 16; box-shadow: var(--schatten-hoch); }
  .gestell.offen .seite { transform: none; visibility: visible; }
  .gestell.offen .seite-schleier { display: block; position: fixed; inset: 0; z-index: 15; background: rgba(28, 21, 48, .5); border: 0; border-radius: 0; min-height: 0; padding: 0; }
  .menue { display: inline-flex; min-height: 38px; padding: 6px 12px 6px 10px; }
  .leiste { padding: 0 16px; }
  .kontext-innen { padding: 8px 16px; }
  main { padding: 20px 16px 64px; }
}
/* ---------- Schmal ---------- */
@media (max-width: 860px) {
  input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="search"], select, textarea { font-size: 16px; }   /* sonst zoomt iOS beim Antippen */
  .firma { max-width: 44vw; }
  .pfad > span { display: none; }
  .tor-kopf { min-height: 60px; }
  .tor-buehne { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 28px; }
  .tor-bild { gap: 12px; padding-top: 0; }
  .tor-liste { display: none; }
  .tor-form { padding: 24px 20px 18px; }
  .suche { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .filter { position: static; padding: 0; }
  .filter-zu > summary { display: block; padding: 14px 18px; cursor: pointer; font-weight: 600; }
  .filter-zu > .filter-innen { padding: 0 18px 18px; }
  .filter-form { max-height: none; }
  .filter-felder { overflow: visible; padding-right: 0; margin-right: 0; }
  .filter h2 { display: none; }
  .zeile { grid-template-columns: 6.7rem minmax(0, 1fr); }
  .zeile.markt { grid-template-columns: 7.4rem minmax(0, 1fr); }
  .zeile.vertrag { grid-template-columns: 8rem minmax(0, 1fr); }
  .zeile.markt .frist time.frist-wort { font-size: 15px; }
  .frist { padding-left: 14px; padding-right: 4px; }
  .zeile-haupt { padding-right: 14px; }
  .zeile-aktion { grid-column: 2; flex-direction: row; padding: 0 14px 16px 8px; min-width: 0; flex-wrap: wrap; }
  .zeile-notiz { grid-template-columns: 1fr; padding-right: 14px; }
  .frist-tage { font-size: 25px; }
  .zeile .frist { grid-row: 1 / span 2; }
  .zeile.mit-notiz .frist { grid-row: 1 / span 3; }
  .pk-kachel { width: 48px; height: 48px; border-radius: 9px; }
  .pk-kachel svg { width: 26px; height: 26px; }
  .detail-kopf { grid-template-columns: 6.2rem minmax(0, 1fr); }
  .detail-kopf .frist { padding: 18px 8px 18px 16px; }
  .detail-kopf .frist-tage { font-size: 32px; }
  .detail-kopf-text { padding: 18px 16px 18px 6px; }
  .detail-kopf-text h1, .profilkopf h1 { font-size: 18px; }
  .detail-inhalt, .profilkopf { padding: 18px 16px; }
  .angaben { grid-template-columns: 1fr; gap: 0; }
  .angaben dd { margin-bottom: 10px; }
  .profil { grid-template-columns: 1fr; padding: 16px; }
  .profil .knopfzeile { justify-content: flex-start; }
  .wahl-suche { grid-template-columns: 1fr; }
  .karte { padding: 18px 16px; }
  .dialog.breit { max-height: 92vh; }
  .dialog > h2 { padding: 16px; }
  .dialog > h2 ~ * { margin-left: 16px; margin-right: 16px; }
  .wahl-dialog { padding: 14px 16px 0; }
  .wahl-koerper { margin: 12px -16px 0; padding: 4px 16px 10px; }
  .wahl-fuss { margin: 0 -16px; padding: 12px 16px; }
  .wahl-liste, .wahl-liste.lang { columns: auto; }
  .wahl-stand { margin-left: 0; flex-basis: 100%; }
}
@media (prefers-reduced-motion: no-preference) {
  .meldung { animation: herein .18s ease-out; }
  @keyframes herein { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
  @media (max-width: 1180px) { .seite { transition: transform .2s ease-out, visibility .2s; } }
}
@media print {
  .seite, .leiste, .kontext, .filter, .zeile-aktion, #meldungen, .blaettern, .knopfzeile { display: none !important; }
  .gestell { display: block; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .suche { grid-template-columns: 1fr; }
  .liste, .detail, .karte, .tafel-rahmen, .profilkopf { box-shadow: none; }
}
