/* linienfunk.de - schwarz wie das App-Icon, Signalgelb wie in der App
   (Theme.swift), Rot für Kontrollen, Orange für Störungen, Lila für volle
   Bahnen. Ohne Schriften und Bibliotheken von außen. */

:root {
    color-scheme: dark;
    --bg: #000;
    --surface: #0c0c0e;
    --card: #141417;
    --card-2: #1c1c20;
    --line: rgba(255, 255, 255, 0.09);
    --text: #f5f5f7;
    --muted: rgba(255, 255, 255, 0.6);
    --faint: rgba(255, 255, 255, 0.38);
    --accent: #ffd133;
    --on-accent: #000;
    --inspection: #ff5757;
    --disruption: #ff9933;
    --crowded: #ab8fff;
    --calm: #33d699;
    --radius: 22px;
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
body {
    background: var(--bg);
    color: var(--text);
    font: 17px/1.55 var(--font);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
a { color: var(--accent); }
h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: -0.02em; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.wrap { width: min(100% - 32px, 1120px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* MARK: Kopf */

.top {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(0, 0, 0, 0.72);
    -webkit-backdrop-filter: saturate(160%) blur(18px);
    backdrop-filter: saturate(160%) blur(18px);
    border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 750; font-size: 19px; text-decoration: none; letter-spacing: -0.01em; }
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 0 0 1px var(--line); }
.top nav { display: flex; gap: 4px; margin-left: auto; }
.top nav a { padding: 8px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 550; }
.top nav a:hover { color: var(--text); background: var(--card); }
.top nav a[aria-current="page"] { color: var(--text); background: var(--card-2); }
.top .get { padding: 9px 16px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap; }

/* MARK: Knöpfe und Kleinteile */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.button:hover { background: #ffdb5c; }
.button.ghost { background: var(--card-2); color: var(--text); }
.button.ghost:hover { background: #26262b; }
.button:disabled { opacity: 0.5; cursor: default; }

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 24px;
    padding: 0 7px;
    border-radius: 7px;
    font-size: 13.5px;
    font-weight: 800;
    letter-spacing: -0.01em;
    white-space: nowrap;
}
.badge.bus { border-radius: 999px; padding: 0 9px; }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--calm); flex: none; }
.dot.live { box-shadow: 0 0 0 0 rgba(51, 214, 153, 0.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(51, 214, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(51, 214, 153, 0); } }
@media (prefers-reduced-motion: reduce) { .dot.live { animation: none; } html { scroll-behavior: auto; } }

.pill-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    padding: 9px 16px 9px 14px;
    border-radius: 999px;
    background: var(--card);
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}
.pill-link:hover { background: var(--card-2); }
.pill-link .sep { color: var(--faint); }
.pill-link .red { color: var(--inspection); }
.pill-link .orange { color: var(--disruption); }

/* MARK: Startseite */

.hero { position: relative; display: grid; grid-template-columns: 1.1fr 0.9fr; align-items: center; gap: 48px; padding: 72px 0 40px; }
.hero h1 { font-size: clamp(44px, 6.4vw, 84px); font-weight: 850; letter-spacing: -0.035em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { margin-top: 22px; max-width: 34ch; font-size: clamp(19px, 2.1vw, 22px); color: var(--muted); }
.hero .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 30px; }
.hero .pill-link { margin-top: 26px; }

.phone-stage { position: relative; display: grid; place-items: center; }
.phone-stage::before {
    content: "";
    position: absolute;
    inset: 10% -10% 0;
    background: radial-gradient(closest-side, rgba(255, 209, 51, 0.28), rgba(255, 209, 51, 0) 70%);
    filter: blur(20px);
}
.phone {
    position: relative;
    width: min(330px, 78vw);
    aspect-ratio: 600 / 1305;
    padding: 10px;
    border-radius: 54px;
    background: linear-gradient(160deg, #2a2a2f, #0e0e10 55%, #1f1f23);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 40px 80px rgba(0, 0, 0, 0.8);
}
.phone img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 44px; }
.phone.small { width: min(270px, 70vw); }

.section { padding: 80px 0 0; }
.section-head { max-width: 640px; margin-bottom: 32px; }
.section-head h2 { font-size: clamp(32px, 4.4vw, 52px); font-weight: 800; }
.section-head p { margin-top: 14px; color: var(--muted); font-size: 19px; }
.kicker { display: block; margin-bottom: 12px; color: var(--accent); font-size: 14px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.step { padding: 26px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.step .num { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 18px; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-weight: 850; }
.step h3 { font-size: 21px; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 16px; }

.split { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: center; }
.tiles { display: grid; gap: 12px; }
.tile-link { display: grid; gap: 6px; padding: 24px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.tile-link:hover { background: var(--card-2); }
.tile-link h3 { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 22px; }
.tile-link h3::after { content: "→"; color: var(--accent); }
.tile-link p { color: var(--muted); font-size: 16px; }

.promises { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.promise { padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.promise strong { display: block; margin-bottom: 6px; font-size: 17px; }
.promise span { color: var(--muted); font-size: 15px; }

.note { margin-top: 56px; color: var(--faint); font-size: 14px; }

/* MARK: Fuß */

.foot { margin-top: 96px; padding: 32px 0 44px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.foot .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 28px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot nav a { color: var(--text); text-decoration: none; }
.foot .brand { font-size: 16px; }
.foot .brand img { width: 26px; height: 26px; border-radius: 7px; }

/* MARK: Seiten mit Werkzeugen (Live, Verbindungen) */

.tool { padding: 40px 0 0; }
.tool-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: 26px; }
.tool-head h1 { font-size: clamp(36px, 5vw, 56px); font-weight: 850; }
.tool-head p { margin-top: 8px; color: var(--muted); }
.stand { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }

.panel { padding: 22px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.panel + .panel { margin-top: 14px; }
.panel h2 { font-size: 20px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.panel h2 .count { color: var(--faint); font-weight: 600; }

.stats { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.stat { padding: 22px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.stat .value { font-size: 44px; font-weight: 850; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .label { margin-top: 8px; font-weight: 650; }
.stat .sub { margin-top: 4px; color: var(--muted); font-size: 14.5px; }
.stat.inspection { background: linear-gradient(150deg, rgba(255, 87, 87, 0.2), var(--card) 60%); border-color: rgba(255, 87, 87, 0.3); }
.stat.inspection .value { color: var(--inspection); }
.stat.disruption .value { color: var(--disruption); }
.stat.crowded .value { color: var(--crowded); }
.stat .cta { display: inline-block; margin-top: 14px; color: var(--accent); font-weight: 650; font-size: 15px; text-decoration: none; }

.list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.row { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 4px; border-top: 1px solid var(--line); }
.list > .row:first-child { border-top: 0; }
.row .icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; font-weight: 800; font-size: 18px; }
.row .icon.disruption { background: rgba(255, 153, 51, 0.16); color: var(--disruption); }
.row .icon.crowded { background: rgba(171, 143, 255, 0.16); color: var(--crowded); }
.row .icon.official { background: rgba(255, 153, 51, 0.16); color: var(--disruption); }
.row .title { font-weight: 650; }
.row .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 3px; color: var(--muted); font-size: 14.5px; }
.row .side { color: var(--muted); font-size: 14px; text-align: right; white-space: nowrap; }
.row details { margin-top: 6px; color: var(--muted); font-size: 15px; }
.row details summary { cursor: pointer; color: var(--accent); font-size: 14px; font-weight: 600; }
.row details p { margin-top: 6px; }
.empty { padding: 18px 4px 6px; color: var(--muted); }
.error { padding: 14px 16px; border-radius: 14px; background: rgba(255, 87, 87, 0.12); color: #ff9f9f; }

/* MARK: Verbindungen */

.tabs { display: inline-grid; grid-auto-flow: column; gap: 4px; padding: 4px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); margin-bottom: 18px; }
.tabs button { padding: 10px 20px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 650; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }

.planner { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 18px; align-items: start; }
.form { display: grid; gap: 10px; padding: 18px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); position: sticky; top: 84px; }
.places { position: relative; display: grid; gap: 8px; }
.field { position: relative; }
.field label { position: absolute; left: 16px; top: 9px; color: var(--faint); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; pointer-events: none; }
.field input {
    width: 100%;
    height: 60px;
    padding: 22px 48px 6px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--card-2);
    outline: none;
}
.field input:focus { border-color: var(--accent); }
.field input::placeholder { color: var(--faint); }
.swap {
    position: absolute;
    right: 12px;
    top: 50%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin-top: -19px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--card);
    cursor: pointer;
    font-size: 17px;
}
.swap:hover { border-color: var(--accent); color: var(--accent); }
.suggest {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 10;
    margin: 0;
    padding: 6px;
    list-style: none;
    border-radius: 16px;
    background: #222226;
    border: 1px solid var(--line);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}
.suggest li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 11px; cursor: pointer; }
.suggest li[aria-selected="true"], .suggest li:hover { background: rgba(255, 255, 255, 0.08); }
.suggest .kind { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: rgba(255, 255, 255, 0.08); font-size: 14px; }
.suggest .name { font-weight: 600; line-height: 1.25; }
.suggest .area { display: block; color: var(--muted); font-size: 13.5px; font-weight: 400; }

.when { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.seg { display: inline-grid; grid-auto-flow: column; padding: 3px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); }
.seg button { padding: 8px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 650; cursor: pointer; }
.seg button[aria-pressed="true"] { background: #2e2e33; color: var(--text); }
.when input { min-width: 0; height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card-2); }
.when .now { height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card-2); color: var(--accent); font-size: 14px; font-weight: 650; cursor: pointer; }
.form .button { width: 100%; margin-top: 4px; }

.results { display: grid; gap: 10px; }
.results .more { justify-self: center; }
#boardMore { margin-top: 12px; }
.hint { padding: 26px; border-radius: var(--radius); border: 1px dashed var(--line); color: var(--muted); text-align: center; }
.trip { border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.trip-head { display: grid; gap: 10px; width: 100%; padding: 18px 20px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.trip-head:hover { background: rgba(255, 255, 255, 0.02); }
.trip-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; }
.trip-times { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.trip-meta { color: var(--muted); font-size: 15px; font-weight: 600; }
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chain .walk { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 13px; font-weight: 650; }
.chain .arrow { color: var(--faint); font-size: 12px; }
.trip-from { color: var(--muted); font-size: 14.5px; }
.late { color: var(--inspection); font-weight: 700; }
.ontime { color: var(--calm); }
.was { color: var(--faint); text-decoration: line-through; font-weight: 500; font-size: 0.8em; margin-left: 4px; }
.cancelled { color: var(--inspection); font-weight: 700; }

.legs { margin: 0; padding: 4px 20px 18px; list-style: none; border-top: 1px solid var(--line); }
.leg { position: relative; display: grid; grid-template-columns: 58px 1fr; gap: 0 14px; padding-top: 14px; }
.leg .time { font-weight: 750; font-variant-numeric: tabular-nums; }
.leg .stop { font-weight: 650; }
.leg .info { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 8px 0 2px; padding: 10px 12px; border-left: 4px solid var(--c, var(--faint)); border-radius: 4px 12px 12px 4px; background: rgba(255, 255, 255, 0.04); color: var(--muted); font-size: 14.5px; }
.leg .info.walking { border-left-style: dotted; }
.leg .info strong { color: var(--text); font-weight: 650; }
.leg .leg-ride { grid-column: 2; }
.leg .stops { grid-column: 2; margin: 4px 0 0; padding: 0 0 0 16px; color: var(--muted); font-size: 14px; }
.leg .stops li { padding: 2px 0; }
.leg .toggle { border: 0; background: none; color: var(--accent); font-size: 13.5px; font-weight: 650; cursor: pointer; padding: 0; }
.track { color: var(--faint); font-weight: 600; font-size: 13.5px; margin-left: 6px; }

.board { margin: 0; padding: 0; list-style: none; }
.dep { display: grid; grid-template-columns: 64px auto 1fr auto; gap: 12px; align-items: center; padding: 13px 4px; border-top: 1px solid var(--line); }
.board > .dep:first-child { border-top: 0; }
.dep .time { font-weight: 800; font-variant-numeric: tabular-nums; }
/* Verspätet: neue Zeit, darunter der Plan (die Spalte ist schmal). */
.dep .time .late, .dep .time .was, .leg .time .late, .leg .time .was { display: block; margin-left: 0; }
.dep .time .was, .leg .time .was { font-size: 12.5px; }
.dep .dest { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dep .in { color: var(--muted); font-size: 14px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* MARK: Textseiten */

.page { padding: 44px 0 0; max-width: 760px; }
.page h1 { font-size: clamp(34px, 5vw, 48px); font-weight: 850; margin-bottom: 8px; }
.page .stand { display: block; margin-bottom: 32px; }
.page h2 { font-size: 22px; margin: 38px 0 10px; }
.page h3 { font-size: 17px; margin: 22px 0 6px; }
.page p, .page li { color: rgba(255, 255, 255, 0.82); }
.page p + p { margin-top: 10px; }
.page ul { margin: 8px 0 0; padding-left: 22px; display: grid; gap: 6px; }
.page address { font-style: normal; }
.box { margin-top: 12px; padding: 20px 22px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.faq details { border-radius: 16px; background: var(--card); border: 1px solid var(--line); margin-top: 10px; }
.faq summary { cursor: pointer; padding: 17px 20px; font-weight: 650; }
.faq details p { padding: 0 20px 18px; }

/* MARK: Schmal */

@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 44px; text-align: left; }
    .split { grid-template-columns: 1fr; gap: 36px; }
    .split .phone-stage { order: 2; }
    .steps, .promises { grid-template-columns: 1fr 1fr; }
    .planner { grid-template-columns: 1fr; }
    .form { position: static; }
    .stats { grid-template-columns: 1fr 1fr; }
    .stats .stat.inspection { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
    body { font-size: 16px; }
    .top .wrap { gap: 10px; height: 58px; }
    .top .get { display: none; }
    .top nav a { padding: 7px 9px; font-size: 14px; }
    .brand span { display: none; }
    .steps, .promises { grid-template-columns: 1fr; }
    .section { padding-top: 60px; }
    /* Ab/An und Jetzt oben, das Datum darunter in voller Breite. */
    .when { grid-template-columns: 1fr auto; }
    .when .seg { justify-self: start; }
    .when input { grid-column: 1 / -1; grid-row: 2; }
    .row { grid-template-columns: auto 1fr; gap: 12px; }
    .row .side { grid-column: 2; margin-top: -6px; text-align: left; }
    .stat .value { font-size: 38px; }
    .dep { grid-template-columns: 54px auto 1fr; }
    .dep .in { grid-column: 3; text-align: left; margin-top: -8px; }
}
