/* Uview Web: gleicher Aufbau wie die App – Kopf mit Linien, Plan, Statuszeile. */

:root {
    color-scheme: light dark;
    --paper: #fff;
    --ink: #000;
    --secondary: #6e6e73;
    --divider: rgba(0, 0, 0, 0.12);
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-appearance="light"]) {
        --paper: #000;
        --ink: #fff;
        --secondary: #98989d;
        --divider: rgba(255, 255, 255, 0.16);
    }
}

:root[data-appearance="light"] { color-scheme: light; }
:root[data-appearance="dark"] {
    color-scheme: dark;
    --paper: #000;
    --ink: #fff;
    --secondary: #98989d;
    --divider: rgba(255, 255, 255, 0.16);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    background: var(--paper);
    color: var(--ink);
}

body {
    display: flex;
    flex-direction: column;
    height: 100dvh;
}

header {
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 16px max(16px, env(safe-area-inset-left));
    border-bottom: 1px solid var(--divider);
}

.title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

h1 {
    margin: 0;
    font-size: 34px;
    font-weight: 700;
}

#appearance {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 18px;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    display: grid;
    place-items: center;
}
#appearance:hover { background: var(--divider); }
#appearance svg { width: 22px; height: 22px; }

#lines {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0;
    scrollbar-width: none;
}
#lines::-webkit-scrollbar { display: none; }

/* Quadratisches Linienschild im BVG-Stil. */
.badge {
    flex: none;
    width: 44px;
    height: 30px;
    margin: 4px;
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 30px;
    cursor: pointer;
    opacity: 0.55;
    outline: 2.5px solid transparent;
    outline-offset: 4px;
}
.badge[aria-pressed="true"] {
    opacity: 1;
    outline-color: var(--ink);
}
.badge:focus-visible { outline-color: var(--secondary); }

main {
    flex: 1;
    overflow: auto;
    position: relative;
}

.placeholder {
    position: absolute;
    inset: 0;
    margin: 0;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 24px;
    color: var(--secondary);
}

main svg { display: block; }

.line { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ring { fill: var(--paper); stroke: var(--ink); }
.dot { fill: #fff; }
.label { fill: var(--ink); font-weight: 500; }
.label.terminal { font-weight: 700; }

/* Züge gleiten bei jeder Aktualisierung zur neuen Position, wie in der App. */
.train {
    transition: transform 1.2s ease-in-out;
    cursor: default;
}
.train .arrow { transition: transform 1.2s ease-in-out; }
.train circle {
    stroke: #fff;
    stroke-width: 2;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

footer {
    border-top: 1px solid var(--divider);
    padding: 8px max(16px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    font-size: 13px;
    color: var(--secondary);
    min-height: 34px;
}
footer .warning { color: #ff9500; }
