/* Straßenbau-Werkzeuge – Grundstil */
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Semi Condensed"; src: url("../fonts/barlow-semi-condensed-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Semi Condensed"; src: url("../fonts/barlow-semi-condensed-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --asphalt: #262a2e;       /* Text, dunkle Flächen */
  --asphalt-2: #4a5056;     /* Nebentext */
  --fahrbahn: #e9ecea;      /* Seitengrund, kühles Grau */
  --beton: #d6dad7;         /* Linien, Ränder */
  --weiss: #ffffff;
  --gelb: #f2b705;          /* Baustellenmarkierung – einziger Akzent */
  --blau: #00578f;          /* Verkehrsblau – Links und Aktionen */
  --blau-dunkel: #003f69;
  --rot: #b3121b;           /* Warnungen */
  --gruen: #2f6b3a;

  --display: "Barlow Semi Condensed", "Barlow", "Arial Narrow", sans-serif;
  --text: "Barlow", "Segoe UI", Arial, sans-serif;

  --mass: 1rem;
  --breite: 72rem;
  --zeile: 40rem;          /* Lesebreite für Fließtext */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fahrbahn); color: var(--asphalt);
  font-family: var(--text); font-size: 1.0625rem; line-height: 1.55;
}
img, svg { max-width: 100%; }
a { color: var(--blau); text-underline-offset: 0.18em; }
a:hover { color: var(--blau-dunkel); }
:focus-visible { outline: 3px solid var(--gelb); outline-offset: 2px; }

.huelle { max-width: var(--breite); margin: 0 auto; padding: 0 1rem; }
@media (min-width: 48rem) { .huelle { padding: 0 2rem; } }

/* Kopfzeile: Wortmarke mit gestrichelter Baustellenmarkierung */
.kopf { background: var(--asphalt); color: var(--weiss); }
.kopf .huelle { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.75rem; }
.wortmarke {
  font-family: var(--display); font-weight: 700; font-size: 1.35rem; letter-spacing: 0.01em;
  color: var(--weiss); text-decoration: none; padding-bottom: 0.2rem;
  background-image: linear-gradient(90deg, var(--gelb) 0 60%, transparent 60% 100%);
  background-size: 1.1rem 3px; background-repeat: repeat-x; background-position: 0 100%;
}
.wortmarke:hover { color: var(--weiss); }
.kopf nav a { color: #c9d0d6; text-decoration: none; font-weight: 500; }
.kopf nav a:hover, .kopf nav a[aria-current] { color: var(--weiss); }

/* Typografie */
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.12; color: var(--asphalt); }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); margin: 0 0 0.75rem; letter-spacing: -0.005em; }
h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 1.9rem); margin: 2.75rem 0 0.75rem; }
h3 { font-size: 1.2rem; margin: 1.75rem 0 0.4rem; font-weight: 600; }
p, li { max-width: var(--zeile); }
.vorspann { font-size: 1.2rem; color: var(--asphalt-2); max-width: 36rem; margin: 0; }
.klein { font-size: 0.92rem; color: var(--asphalt-2); }

main { padding: 2.5rem 0 4rem; }

/* Formulare */
.feld { margin-bottom: 1.15rem; }
.feld > label, .feld > .label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.feld .hilfe { display: block; font-size: 0.9rem; color: var(--asphalt-2); margin-top: 0.3rem; }
input[type="date"], input[type="number"], select {
  font: inherit; color: var(--asphalt); background: var(--weiss);
  border: 2px solid var(--beton); border-radius: 4px; padding: 0.55rem 0.7rem; width: 100%; max-width: 20rem;
}
input:focus, select:focus { border-color: var(--blau); outline: none; box-shadow: 0 0 0 3px rgba(242, 183, 5, 0.55); }
input[type="number"] { max-width: 8rem; }

.wahl { display: grid; gap: 0.5rem; }
.wahl label {
  display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.7rem; align-items: start;
  background: var(--weiss); border: 2px solid var(--beton); border-radius: 4px; padding: 0.7rem 0.85rem; cursor: pointer;
}
.wahl label:has(input:checked) { border-color: var(--asphalt); box-shadow: inset 4px 0 0 var(--gelb); }
.wahl input { margin: 0.3rem 0 0; accent-color: var(--asphalt); }
.wahl strong { font-weight: 600; }
.wahl span.klein { grid-column: 2; }

.knopf {
  font: inherit; font-weight: 600; cursor: pointer; border: 0; border-radius: 4px;
  background: var(--blau); color: var(--weiss); padding: 0.65rem 1.1rem;
}
.knopf:hover { background: var(--blau-dunkel); }
.knopf.leise { background: transparent; color: var(--blau); border: 2px solid currentColor; padding: 0.5rem 0.95rem; }
.knopf.leise:hover { color: var(--blau-dunkel); background: var(--weiss); }

/* Werkzeug-Layout: Eingabe links, Ergebnis rechts */
.werkzeug { display: grid; gap: 2rem; margin-top: 2rem; }
.werkzeug > * { min-width: 0; }
@media (min-width: 60rem) {
  .werkzeug { grid-template-columns: minmax(18rem, 26rem) 1fr; align-items: start; }
  .werkzeug .ergebnis { position: sticky; top: 1rem; }
}
.eingabe fieldset { min-width: 0; border: 0; padding: 0; margin: 0 0 1.25rem; }
.eingabe legend { font-family: var(--display); font-weight: 600; font-size: 1.15rem; margin-bottom: 0.6rem; padding: 0; }

.ergebnis { background: var(--weiss); border-top: 6px solid var(--asphalt); padding: 1.5rem 1.25rem 1.25rem; }
@media (min-width: 48rem) { .ergebnis { padding: 1.75rem 2rem 1.5rem; } }
.ergebnis .leer { color: var(--asphalt-2); }
.kernaussage { font-family: var(--display); font-weight: 700; font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); line-height: 1.1; margin: 0 0 0.35rem; }
.kernaussage-unter { margin: 0 0 1.25rem; color: var(--asphalt-2); }

/* Fristenstrahl: die gezählten Tage als Fahrbahn */
.strahl {
  --zelle: 2.6rem;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--zelle), 1fr)); gap: 0;
  background: var(--asphalt); padding: 0.9rem 0.6rem 0.75rem; border-radius: 3px; margin: 0 0 0.5rem;
  position: relative;
}
.strahl .tag {
  position: relative; text-align: center; color: var(--weiss); padding: 0.3rem 0 0.95rem;
  font-variant-numeric: tabular-nums;
}
.strahl .tag::after { /* gelbe Baustellenmarkierung unter gezählten Tagen */
  content: ""; position: absolute; left: 12%; right: 12%; bottom: 0.35rem; height: 4px; background: var(--gelb);
}
.strahl .tag .nr { display: block; font-family: var(--display); font-weight: 700; font-size: 1.25rem; line-height: 1; }
.strahl .tag .dt { display: block; font-size: 0.72rem; color: #c3cad0; margin-top: 0.2rem; }
.strahl .tag.frei { color: #7d868e; }
.strahl .tag.frei::after { background: transparent; border-top: 2px dashed #5d666e; height: 0; }
.strahl .tag.frei .nr { font-size: 0.85rem; font-family: var(--text); font-weight: 500; padding-top: 0.22rem; }
.strahl .tag.ende { background: var(--gelb); color: var(--asphalt); border-radius: 2px; }
.strahl .tag.ende .dt { color: var(--asphalt); }
.strahl .tag.ende::after { background: var(--asphalt); }
.strahl-legende { font-size: 0.88rem; color: var(--asphalt-2); margin: 0 0 1.5rem; }

/* Ergebnis-Liste */
.folgen { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--beton); }
.folgen li { display: grid; grid-template-columns: 1fr; gap: 0.15rem; padding: 0.8rem 0; border-bottom: 1px solid var(--beton); max-width: none; }
@media (min-width: 40rem) { .folgen li { grid-template-columns: 13rem 1fr; gap: 1rem; } }
.folgen .was { font-weight: 600; }
.folgen .wert { font-variant-numeric: tabular-nums; }
.folgen .wert small { display: block; color: var(--asphalt-2); font-size: 0.9rem; margin-top: 0.15rem; }

.hinweis { border-left: 4px solid var(--gelb); background: #fbf6e3; padding: 0.75rem 1rem; margin: 1.25rem 0 0; font-size: 0.95rem; }
.hinweis.warnung { border-left-color: var(--rot); background: #fbeceb; }
.hinweis p { margin: 0.3rem 0; }

.aktionen { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }

/* Erklärtext */
.text { margin-top: 3.5rem; }
.text table { border-collapse: collapse; width: 100%; max-width: 46rem; background: var(--weiss); font-size: 0.97rem; }
.text th, .text td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--beton); vertical-align: top; }
.text th { font-family: var(--display); font-weight: 600; background: var(--asphalt); color: var(--weiss); }
.tabelle-scroll { overflow-x: auto; }
details { background: var(--weiss); border-bottom: 1px solid var(--beton); max-width: 46rem; }
details summary { cursor: pointer; padding: 0.85rem 1rem; font-weight: 600; }
details > div { padding: 0 1rem 0.9rem; }

/* Startseite: Werkzeugliste wie eine Beschilderung */
.einstieg { padding: 1rem 0 2rem; }
.einstieg h1 { max-width: 20ch; }
.werkzeuge { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 0; border-top: 3px solid var(--asphalt); }
.werkzeuge li { max-width: none; border-bottom: 1px solid var(--beton); }
.werkzeuge a, .werkzeuge .bald {
  display: grid; grid-template-columns: 1fr; gap: 0.2rem 1.5rem; padding: 1.1rem 0.25rem; text-decoration: none; color: var(--asphalt);
}
@media (min-width: 48rem) { .werkzeuge a, .werkzeuge .bald { grid-template-columns: 16rem 1fr 7rem; align-items: baseline; } }
.werkzeuge a:hover { background: var(--weiss); }
.werkzeuge .name { font-family: var(--display); font-weight: 700; font-size: 1.3rem; }
.werkzeuge a .name { color: var(--blau); }
.werkzeuge .status { font-size: 0.9rem; color: var(--asphalt-2); }
.werkzeuge .bald .name { color: var(--asphalt-2); }
.werkzeuge a .status { color: var(--gruen); font-weight: 600; }

.grundsatz { display: grid; gap: 1.5rem; margin-top: 3.5rem; }
@media (min-width: 48rem) { .grundsatz { grid-template-columns: repeat(3, 1fr); } }
.grundsatz h2 { font-size: 1.25rem; margin: 0 0 0.35rem; }
.grundsatz p { margin: 0; color: var(--asphalt-2); }

/* Fuß */
.fuss { background: var(--asphalt); color: #c3cad0; padding: 2rem 0; font-size: 0.92rem; }
.fuss a { color: #8e979f; text-decoration-color: rgba(142, 151, 159, 0.4); }
.fuss a:hover { color: #c3cad0; }
.fuss .huelle { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; justify-content: space-between; }
.fuss p { margin: 0; max-width: 36rem; }
.fuss nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }

/* Werbung: nur sichtbar, wenn werbung.js eine Publisher-ID hat und der Platz einen Block bekommt */
.werbung { display: none; }
.mit-werbung .werbung.aktiv { display: block; margin: 2.5rem 0; padding-top: 0.5rem; border-top: 1px solid rgba(38, 42, 46, 0.12); min-height: 120px; }
.werbung.aktiv::before { content: "Anzeige"; display: block; margin-bottom: 0.4rem; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: #6b747c; }
.werbung ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }

.brotkrumen { font-size: 0.92rem; margin-bottom: 1.25rem; color: var(--asphalt-2); }
.brotkrumen a { color: var(--asphalt-2); }

/* Druck: nur das Ergebnis */
@media print {
  .kopf, .fuss, .eingabe, .aktionen, .text, .brotkrumen, .vorspann, .werbung { display: none !important; }
  body { background: #fff; }
  .werkzeug { display: block; margin: 0; }
  .ergebnis { border-top: 3px solid #000; padding: 0; }
  .strahl { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .druckkopf { display: block !important; }
}
.druckkopf { display: none; margin-bottom: 1rem; }

@media (prefers-reduced-motion: no-preference) {
  .strahl.neu .tag { animation: auftauchen 0.35s ease-out both; animation-delay: calc(var(--i) * 28ms); }
  @keyframes auftauchen { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}

/* Ergänzungen für weitere Werkzeuge */
input[type="text"], textarea {
  font: inherit; color: var(--asphalt); background: var(--weiss);
  border: 2px solid var(--beton); border-radius: 4px; padding: 0.55rem 0.7rem; width: 100%;
}
textarea { min-height: 5.5rem; resize: vertical; line-height: 1.45; }
input[type="text"]:focus, textarea:focus { border-color: var(--blau); outline: none; box-shadow: 0 0 0 3px rgba(242, 183, 5, 0.55); }
.feld-reihe { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.feld-reihe .feld { min-width: 0; }
.feld-reihe label { hyphens: auto; overflow-wrap: break-word; }
.feld-reihe .feld input { max-width: none; }

/* Eingabelisten (Mängel, Laststufen) */
.liste-eingabe { margin: 0 0 1rem; }
.liste-eingabe .eintrag { background: var(--weiss); border: 2px solid var(--beton); border-radius: 4px; padding: 0.75rem; margin-bottom: 0.6rem; }
.liste-eingabe .eintrag-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; margin-bottom: 0.5rem; font-weight: 600; }
.liste-eingabe .eintrag .feld { margin-bottom: 0.6rem; }
.liste-eingabe .eintrag .feld:last-child { margin-bottom: 0; }
.knopf.klein { padding: 0.3rem 0.65rem; font-size: 0.92rem; }
.knopf.link { background: none; color: var(--blau); padding: 0.2rem 0; text-decoration: underline; text-underline-offset: 0.18em; }
.knopf.link:hover { color: var(--blau-dunkel); background: none; }

table.messwerte { border-collapse: collapse; width: 100%; background: var(--weiss); font-variant-numeric: tabular-nums; }
table.messwerte th, table.messwerte td { padding: 0.3rem 0.4rem; border-bottom: 1px solid var(--beton); text-align: left; }
table.messwerte th { font-weight: 600; font-size: 0.9rem; }
table.messwerte input { max-width: none; padding: 0.35rem 0.5rem; border-width: 1px; }
table.messwerte td:last-child { width: 2.5rem; text-align: right; }

/* Ergebnis-Tabellen */
.ergebnis-tabelle { width: 100%; border-collapse: collapse; margin: 0.5rem 0 0; font-variant-numeric: tabular-nums; }
.ergebnis-tabelle th, .ergebnis-tabelle td { text-align: left; padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--beton); vertical-align: top; }
.ergebnis-tabelle th { font-family: var(--display); font-weight: 600; border-bottom: 2px solid var(--asphalt); }
.ergebnis-tabelle td small { display: block; color: var(--asphalt-2); }
.ergebnis-tabelle td + td { white-space: nowrap; }

/* Bewertung: Text plus Farbe, nie Farbe allein */
.bewertung { display: inline-block; font-weight: 600; padding: 0.1rem 0.5rem; border-radius: 3px; }
.bewertung.ok { background: #e3f0e5; color: var(--gruen); }
.bewertung.nein { background: #fbeceb; color: var(--rot); }
.bewertung.offen { background: var(--fahrbahn); color: var(--asphalt-2); }

/* Checkliste */
.checkliste { list-style: none; padding: 0; margin: 0; }
.checkliste li { max-width: none; border-bottom: 1px solid var(--beton); }
.checkliste label { display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.7rem; padding: 0.65rem 0.2rem; cursor: pointer; }
.checkliste input { margin-top: 0.3rem; accent-color: var(--asphalt); width: 1.05rem; height: 1.05rem; }
.checkliste span.klein { grid-column: 2; }
.fortschritt { font-weight: 600; margin: 0 0 0.75rem; }

/* Erzeugter Brieftext */
.brief { white-space: pre-wrap; background: var(--fahrbahn); border-left: 4px solid var(--asphalt); padding: 1rem 1.1rem; font-size: 0.97rem; line-height: 1.55; margin: 0.5rem 0 0; max-width: none; }

/* Mess-Diagramm */
.diagramm { width: 100%; height: auto; background: var(--weiss); border: 1px solid var(--beton); margin: 0.75rem 0 0.25rem; }
.diagramm text { font-family: var(--text); font-size: 11px; fill: var(--asphalt-2); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
table.messwerte td { vertical-align: middle; }
table.messwerte input { display: block; }
table.messwerte .knopf.link { line-height: 1; padding: 0.3rem 0.4rem; font-size: 1.1rem; text-decoration: none; }
