/* Laufband-Rechner (/laufband-rechner). Eigene Datei, stile.css bleibt unberuehrt.
   Mobil zuerst (375/390 px): flacher Kopf, darunter Richtung, Tempo, Steigung und das erste Ergebnis im
   ersten Bildschirm. Ab 1024 px Eingaben links, Ergebnis rechts (sticky), Tabelle darunter in voller Breite.
   Farben nur aus der Site-Palette (stile.css) und deren Transparenzen; Fehlerrot wie im Zone-2-Check. */

:root {
    --lb-fehler: #a4472f;                          /* wie --lc-stop im Zone-2-Check, 5,6:1 auf Weiss */
    --lb-flaeche: rgba(192, 209, 217, 0.28);       /* #c0d1d9 als Spur */
    --lb-linie: rgba(192, 209, 217, 0.85);
    --lb-tuerkis-flaeche: rgba(155, 204, 204, 0.18);
}

.lb-main {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 18px;
    color: var(--color-navy);
}

/* hidden gilt immer, auch wenn eine Klasse display setzt */
.lb-main [hidden] { display: none !important; }

.lb-main button, .lb-main a, .lb-main label, .lb-main summary, .lb-main input { touch-action: manipulation; }
.lb-seg label { -webkit-tap-highlight-color: transparent; }

.lb-sr {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}

/* ---------- Kopf ----------
   Ab 769 px Standard-.hero aus stile.css (Desktop einheitlich). Bis 768 px flach wie beim Zone-2-Check,
   damit Rechner und erstes Ergebnis im ersten Bildschirm bleiben. Bild: Laeuferin auf dem Heimlaufband
   aus dem Artikel Laufband vs. draussen, unter einem gleichmaessigen Navy-Schleier (Kennzeile >= 4,5:1). */
.hero.lb-hero {
    background-color: var(--color-navy);
    background-image: url('../../bilder/STR_inline-1_laufband-vs-strasse-laufen.jpg');
    background-image: -webkit-image-set(url('../../bilder/STR_inline-1_laufband-vs-strasse-laufen.webp') type('image/webp'), url('../../bilder/STR_inline-1_laufband-vs-strasse-laufen.jpg') type('image/jpeg'));
    background-image: image-set(url('../../bilder/STR_inline-1_laufband-vs-strasse-laufen.webp') type('image/webp'), url('../../bilder/STR_inline-1_laufband-vs-strasse-laufen.jpg') type('image/jpeg'));
    background-position: center 0%;
}
.hero.lb-hero::before { background: rgba(31, 46, 62, 0.8); }
.lb-hero-inhalt { width: 100%; max-width: 604px; }      /* Text beginnt auf der Kante des Rechners */
.lb-hero .lb-h1 { color: #fff; text-transform: none; }

@media (max-width: 768px) {
    .hero.lb-hero { display: block; min-height: 0; padding: 14px 18px 12px; background-position: center 0%; }
    .lb-hero-inhalt { max-width: 604px; }
    .lb-hero .lb-label { display: none; }      /* mobil nur Titel und eine Zeile */
    .lb-hero .lb-h1 {
        font-size: clamp(1.55rem, 6.6vw, 2.4rem);
        line-height: 1.12; margin: 0 0 4px; letter-spacing: -0.01em;
    }
    .lb-hero .lb-sub { font-size: 0.92rem; line-height: 1.4; color: rgba(255, 255, 255, 0.92); opacity: 1; margin: 0; }
}

/* ---------- Rechner ---------- */
.lb-tool {
    display: grid; gap: 14px;
    padding: 14px 0 22px;
    scroll-margin-top: 8px;
    font-variant-numeric: tabular-nums;
}
.lb-form { margin: 0; display: grid; gap: 12px; }

.lb-seg {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    background: var(--lb-flaeche); border: 0; border-radius: 12px;
    padding: 4px; margin: 0; min-width: 0;
}
.lb-seg label { position: relative; display: block; cursor: pointer; min-width: 0; }
.lb-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.lb-seg span {
    display: flex; align-items: center; justify-content: center; text-align: center;
    min-height: 44px; border-radius: 9px; padding: 0 4px;
    font-size: 0.9rem; font-weight: 600; color: var(--color-blue-gray-text);
    transition: background 0.2s ease, color 0.2s ease;
}
.lb-seg input:checked + span { background: #fff; color: var(--color-navy); box-shadow: 0 0 0 1.5px var(--color-navy), 0 1px 3px rgba(31, 46, 62, 0.15); }
.lb-seg input:focus-visible + span { outline: 3px solid var(--color-link); outline-offset: 1px; }
.lb-richtung span { font-weight: 700; font-size: 0.95rem; }
.lb-einheiten { margin-top: 8px; }
.lb-einheiten span { font-size: 0.82rem; min-height: 44px; }

.lb-feld { min-width: 0; }
.lb-feld-label { display: block; font-size: 0.86rem; font-weight: 700; margin: 0 0 6px; }

.lb-tempo-wrap, .lb-steigung-wrap, .lb-klein-wrap {
    display: flex; align-items: center; border: 2px solid var(--color-blue-gray);
    border-radius: 12px; background: #fff; padding: 0 14px; transition: border-color 0.2s ease;
}
.lb-tempo-wrap { height: 54px; }
.lb-tempo-wrap:focus-within, .lb-steigung-wrap:focus-within, .lb-klein-wrap:focus-within {
    border-color: var(--color-navy); box-shadow: 0 0 0 3px rgba(47, 107, 107, 0.25);
}
.lb-tempo-wrap input, .lb-steigung-wrap input, .lb-klein-wrap input {
    flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; padding: 0;
    font-family: var(--font-display); font-weight: 700; color: var(--color-navy); font-variant-numeric: tabular-nums;
}
.lb-tempo-wrap input { font-size: 1.5rem; }
.lb-tempo-wrap input::placeholder, .lb-steigung-wrap input::placeholder, .lb-klein-wrap input::placeholder { color: #637580; font-weight: 500; opacity: 1; }
.lb-einheit { font-size: 0.85rem; font-weight: 700; color: var(--color-blue-gray-text); white-space: nowrap; }
.lb-main [aria-invalid="true"] { color: var(--lb-fehler); }
.lb-fehler { color: var(--lb-fehler); font-size: 0.85rem; font-weight: 600; margin: 6px 0 0; line-height: 1.4; }

/* Steigung: Minus, Feld, Plus. Knoepfe 48 px */
.lb-stepper { display: grid; grid-template-columns: 52px minmax(0, 1fr) 52px; gap: 8px; }
.lb-stepper button {
    height: 52px; border-radius: 12px; border: 0; cursor: pointer;
    background: var(--color-navy); color: #fff;
    font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; line-height: 1;
}
.lb-stepper button:hover { background: #2a3d52; }
.lb-stepper button:focus-visible { outline: 3px solid var(--color-link); outline-offset: 2px; }
.lb-stepper button:disabled { background: var(--color-gray-blue-light); color: var(--color-navy); cursor: default; }
.lb-steigung-wrap { height: 52px; justify-content: center; }
.lb-steigung-wrap input { font-size: 1.4rem; text-align: right; flex: 0 1 5ch; }
.lb-steigung-wrap .lb-einheit { margin-left: 4px; font-size: 1.1rem; color: var(--color-navy); }

/* ---------- Ergebnis ---------- */
.lb-ergebnis {
    border: 1.5px solid var(--color-gray-blue-light); border-radius: 16px;
    padding: 14px 16px 12px; background: #fff; min-width: 0;
}
.lb-erg-label { font-size: 0.86rem; font-weight: 700; color: var(--color-blue-gray-text); margin: 0; }
.lb-erg-gross {
    font-family: var(--font-display); font-size: clamp(2.2rem, 10.5vw, 3.1rem); font-weight: 700;
    line-height: 1.05; margin: 2px 0 2px; color: var(--color-navy); letter-spacing: -0.01em;
}
.lb-erg-gross small { font-size: 1rem; font-weight: 700; color: var(--color-blue-gray-text); }
.lb-erg-neben { font-size: 0.9rem; font-weight: 600; margin: 0; }
.lb-tag {
    display: inline-block; font-size: 0.74rem; font-weight: 700; color: var(--color-navy);
    border: 1.5px solid var(--color-navy); border-radius: 999px; padding: 0 8px; margin-left: 4px; vertical-align: 1px;
}
.lb-ergebnis.lb-veraltet .lb-erg-gross, .lb-ergebnis.lb-veraltet .lb-bahnen { opacity: 0.4; }

/* Zwei Bahnen: oben das Band (tuerkis, feine Lamellen), unten die Strasse (Asphalt, weisse Mittellinie) */
.lb-bahnen { margin: 14px 0 2px; }
.lb-bahn-kopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 8px; margin: 0 0 4px; font-size: 0.82rem; }
.lb-bahn-name { font-weight: 700; }
.lb-bahn-wert { font-weight: 700; margin-left: auto; text-align: right; }
.lb-bahn {
    position: relative; height: 28px; border-radius: 7px; overflow: hidden; margin: 0 0 12px;
}
.lb-bahn-strasse { margin-bottom: 6px; }
.lb-bahn-band {
    background-color: var(--color-turquoise-light);
    background-image: repeating-linear-gradient(90deg, rgba(31, 46, 62, 0.16) 0 1px, rgba(31, 46, 62, 0) 1px 7px);
    box-shadow: inset 0 0 0 1px rgba(31, 46, 62, 0.28);
}
/* Rollen an beiden Enden */
.lb-bahn-band::before, .lb-bahn-band::after {
    content: ''; position: absolute; top: 0; bottom: 0; width: 7px; background: rgba(31, 46, 62, 0.4);
}
.lb-bahn-band::before { left: 0; border-radius: 7px 0 0 7px; }
.lb-bahn-band::after { right: 0; border-radius: 0 7px 7px 0; }
.lb-bahn-strasse {
    background-color: var(--color-blue-gray);
    background-image: linear-gradient(90deg, #fff 0 14px, rgba(255, 255, 255, 0) 14px 26px);
    background-size: 26px 2px; background-repeat: repeat-x; background-position: 4px 50%;
}

/* Marke: Ebene in Bahnbreite, per translateX verschoben (Prozent = Bahnbreite). Nur auf Eingabe, 200 ms. */
.lb-marker {
    position: absolute; inset: 0; z-index: 1; pointer-events: none;
    transform: translateX(var(--lb-pos, 50%));
}
.lb-bereit .lb-marker { transition: transform 200ms ease-out; }
.lb-marker::before {
    content: ''; position: absolute; top: 3px; bottom: 3px; left: -3px; width: 6px; border-radius: 3px; z-index: 2;
    background: var(--color-navy); box-shadow: 0 0 0 2px #fff;
}
.lb-bahn-strasse .lb-marker::before { background: #fff; box-shadow: 0 0 0 2px var(--color-navy); }
.lb-bereich {
    position: absolute; top: 0; bottom: 0;
    left: calc(-1 * var(--lb-halb, 0%)); width: calc(2 * var(--lb-halb, 0%));
}
.lb-bahn-strasse .lb-bereich { background: rgba(155, 204, 204, 0.5); border-left: 2px solid var(--color-turquoise-light); border-right: 2px solid var(--color-turquoise-light); }
.lb-bahn-band .lb-bereich { background: rgba(31, 46, 62, 0.2); border-left: 2px solid var(--color-navy); border-right: 2px solid var(--color-navy); }
.lb-skala { display: flex; justify-content: space-between; font-size: 0.74rem; color: var(--color-blue-gray-text); margin: 2px 0 0; }

.lb-hinweise { list-style: none; padding: 0; margin: 10px 0 0; }
.lb-hinweise:empty { display: none; }
.lb-hinweise li {
    font-size: 0.84rem; line-height: 1.45; margin: 0 0 6px; padding: 8px 10px;
    background: var(--lb-tuerkis-flaeche); border-left: 3px solid var(--color-blue-gray); border-radius: 0 8px 8px 0;
}
.lb-vorschlag, .lb-kal-info { font-size: 0.86rem; line-height: 1.45; margin: 10px 0 0; }
.lb-vorschlag { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.lb-btn-rand {
    display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px;
    border-radius: 12px; cursor: pointer; background: #fff; color: var(--color-navy);
    border: 1.5px solid var(--color-navy); font-family: var(--font-display); font-weight: 700; font-size: 0.88rem;
}
.lb-btn-rand:hover { background: var(--lb-flaeche); }
.lb-btn-rand:focus-visible { outline: 3px solid var(--color-link); outline-offset: 2px; }
.lb-privacy { font-size: 0.76rem; color: var(--color-blue-gray-text); margin: 10px 0 0; }

/* ---------- Aufklappbereiche ---------- */
.lb-extras { min-width: 0; }
.lb-acc { border-top: 1px solid var(--lb-linie); }
.lb-acc:last-child { border-bottom: 1px solid var(--lb-linie); }
.lb-acc summary {
    cursor: pointer; list-style: none; padding: 12px 2px; min-height: 48px;
    font-weight: 700; font-size: 0.95rem; display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.lb-acc summary::-webkit-details-marker { display: none; }
.lb-acc summary::after { content: "\25BE"; font-size: 0.8rem; color: var(--color-blue-gray); transition: transform 0.2s ease; }
.lb-acc[open] summary::after { transform: rotate(180deg); }
.lb-acc summary:focus-visible { outline: 3px solid var(--color-link); outline-offset: 2px; border-radius: 4px; }
.lb-acc-inhalt { padding: 0 0 16px; }
.lb-acc-inhalt > p { font-size: 0.88rem; line-height: 1.55; margin: 0 0 10px; }
.lb-felder { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 10px; }
.lb-felder-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Felder unten buendig, auch wenn eine Beschriftung umbricht */
.lb-felder label { display: flex; flex-direction: column; justify-content: space-between; gap: 4px; font-size: 0.8rem; font-weight: 700; min-width: 0; }
.lb-klein-wrap { height: 46px; padding: 0 10px; }
.lb-klein-wrap input { font-size: 1.05rem; }
.lb-klein-wrap .lb-einheit { font-size: 0.78rem; }
.lb-ausgabe { font-size: 0.9rem; line-height: 1.5; margin: 6px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--lb-tuerkis-flaeche); }
.lb-ausgabe:empty { display: none; }
.lb-ausgabe strong { font-weight: 700; }
.lb-ausgabe-klein { font-size: 0.82rem; color: var(--color-blue-gray-text); margin: 6px 0 0; }
.lb-iv-seg { margin: 0 0 4px; }
.lb-iv-hinweis { font-size: 0.8rem; color: var(--color-blue-gray-text); margin: 0 0 10px; }

/* ---------- Tempotabelle ---------- */
.lb-tabelle-teil { padding: 8px 0 28px; }
.lb-h2 {
    font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; line-height: 1.25;
    margin: 0 0 6px; color: var(--color-navy); text-transform: none; letter-spacing: 0;
}
.lb-tabelle-teil > p { font-size: 0.9rem; line-height: 1.5; margin: 0 0 12px; color: var(--color-blue-gray-text); }
.lb-tabelle-wrap {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    border: 1px solid var(--color-gray-blue-light); border-radius: 12px; max-width: 100%;
}
.lb-tabelle-wrap:focus-visible { outline: 3px solid var(--color-link); outline-offset: 2px; }
/* Passt ab 360 px ohne Scrollen, damit die Spalte "Draussen" sichtbar bleibt; darunter scrollt der Rahmen */
.lb-tabelle {
    width: 100%; min-width: 320px; border-collapse: collapse;
    font-size: 0.84rem; font-variant-numeric: tabular-nums;
}
.lb-tabelle th, .lb-tabelle td { padding: 7px 7px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--lb-linie); }
.lb-tabelle thead th { font-size: 0.74rem; font-weight: 700; color: var(--color-blue-gray-text); background: #fff; vertical-align: bottom; white-space: normal; line-height: 1.25; }
.lb-tabelle th:first-child, .lb-tabelle td:first-child { padding-left: 10px; }
.lb-tabelle th:last-child, .lb-tabelle td:last-child { padding-right: 10px; }
.lb-tabelle tbody th { font-weight: 700; color: var(--color-navy); }
.lb-tabelle tbody tr:nth-child(even) { background: rgba(192, 209, 217, 0.16); }
.lb-tabelle tbody tr:last-child th, .lb-tabelle tbody tr:last-child td { border-bottom: 0; }
.lb-tabelle td:last-child, .lb-tabelle thead th:last-child { font-weight: 700; color: var(--color-navy); }
.lb-tabelle tr.lb-aktiv { background: rgba(155, 204, 204, 0.42); box-shadow: inset 3px 0 0 var(--color-navy); }

/* ---------- Wissensteil ---------- */
.lb-newsletter { margin: 0 0 8px; }
.lb-wissen { max-width: 760px; margin: 0 auto 3rem; padding: 24px 0 0; }
.lb-wissen h2 { text-wrap: balance; }
.lb-antwort { font-size: 1.15rem !important; color: var(--color-navy) !important; }
.lb-note { margin: 20px 0; }
.lb-glossar {
    background: linear-gradient(135deg, rgba(155, 204, 204, 0.08) 0%, rgba(94, 122, 138, 0.05) 100%);
    border-left: 4px solid var(--color-turquoise-light); border-radius: 8px; padding: 1.1rem 1.3rem; margin: 1.6rem 0;
}
.lb-glossar p { margin: 0; line-height: 1.7; }
.lb-glossar .lb-glossar-titel { font-family: var(--font-display); font-weight: 700; margin: 0 0 0.4rem; }

/* ---------- Groessere Bildschirme ---------- */
@media (min-width: 700px) {
    .lb-tool { padding-top: 24px; }
    .lb-einheiten span { font-size: 0.86rem; }
}

@media (min-width: 1024px) {
    .lb-main { max-width: 1080px; padding: 0 32px; }
    .lb-hero-inhalt { max-width: 1016px; }      /* 1080 px Spalte minus Innenabstand */
    .lb-tool {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas: "eingabe ergebnis" "extras ergebnis";
        column-gap: 40px; row-gap: 16px; align-items: start; padding-top: 36px;
    }
    .lb-form { grid-area: eingabe; }
    .lb-ergebnis { grid-area: ergebnis; position: sticky; top: 104px; padding: 20px 22px 16px; }
    .lb-extras { grid-area: extras; }
    .lb-bahn { height: 32px; }
    .lb-bahn-kopf { font-size: 0.88rem; }
    .lb-tabelle { font-size: 0.9rem; }
}

/* Rueckmeldung beim Ueberfahren, nur mit Maus */
@media (hover: hover) {
    .lb-seg label:hover input:not(:checked) + span { color: var(--color-navy); background: rgba(255, 255, 255, 0.6); }
}

@media (prefers-reduced-motion: reduce) {
    .lb-marker, .lb-bereit .lb-marker, .lb-seg span, .lb-acc summary::after { transition: none; }
}
