/* Solar Charger - Design „Liquid Glass“. Glasflächen schweben über einem farbigen Hintergrund.
   Hell und dunkel über prefers-color-scheme. */

:root {
    /* Hintergrund: weiche Farbflecken, durch die das Glas Farbe bekommt */
    --wallpaper:
        radial-gradient(60% 45% at 8% 4%, rgba(255, 190, 92, 0.85), transparent 70%),
        radial-gradient(55% 40% at 100% 18%, rgba(255, 128, 170, 0.55), transparent 70%),
        radial-gradient(70% 50% at 85% 78%, rgba(98, 180, 255, 0.6), transparent 70%),
        radial-gradient(60% 45% at 0% 92%, rgba(140, 120, 255, 0.5), transparent 70%),
        linear-gradient(180deg, #f6efe8 0%, #eef0fa 55%, #e8f1fb 100%);
    --bg: #f1eff6;

    /* Glas */
    --glass: rgba(255, 255, 255, 0.42);
    --glass-strong: rgba(255, 255, 255, 0.62);
    --glass-border: rgba(255, 255, 255, 0.65);
    --glass-edge: rgba(255, 255, 255, 0.95);
    --glass-edge-low: rgba(255, 255, 255, 0.25);
    --glass-blur: blur(22px) saturate(185%);
    --glass-shadow: 0 1px 1px rgba(40, 30, 80, 0.04), 0 10px 32px rgba(60, 50, 110, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.85), inset 0 -1px 0 rgba(255, 255, 255, 0.25);

    /* Blasen im Energiefluss: Glasperlen */
    --orb-bg: var(--glass-strong);
    --orb-tint: 10%;
    --orb-sheen: radial-gradient(90% 70% at 30% 18%, rgba(255, 255, 255, 0.55), transparent 55%);
    --orb-hi: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    --orb-blur: blur(14px) saturate(180%);

    /* Bisherige Tokens, jetzt aus Glas abgeleitet (von den Seiten genutzt) */
    --surface: var(--glass-strong);
    --surface-2: rgba(255, 255, 255, 0.45);
    --border: rgba(60, 50, 110, 0.10);
    --shadow: var(--glass-shadow);
    --text: #14121f;
    --muted: rgba(20, 18, 31, 0.62);
    --faint: rgba(20, 18, 31, 0.42);

    --solar: #f08a0c;
    --grid: #6a5cf5;
    --battery: #0fa66e;
    --house: #0a84ff;
    --car: #e5397a;
    --danger: #ff3b30;
    --ok: #20b15a;
    --warn: #e88a00;

    --track: rgba(60, 50, 110, 0.10);
    --code-bg: rgba(18, 16, 32, 0.84);
    --code-text: #e4e2f2;
    --radius: 28px;
    --radius-sm: 16px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --wallpaper:
            radial-gradient(55% 40% at 6% 2%, rgba(255, 150, 40, 0.55), transparent 70%),
            radial-gradient(50% 38% at 100% 22%, rgba(230, 60, 140, 0.38), transparent 70%),
            radial-gradient(70% 50% at 88% 80%, rgba(40, 120, 255, 0.45), transparent 70%),
            radial-gradient(60% 45% at 0% 95%, rgba(120, 80, 255, 0.42), transparent 70%),
            linear-gradient(180deg, #0b0a14 0%, #0c0f1f 60%, #0a1222 100%);
        --bg: #0b0b16;
        --glass: rgba(255, 255, 255, 0.07);
        --glass-strong: rgba(255, 255, 255, 0.12);
        --glass-border: rgba(255, 255, 255, 0.14);
        --glass-edge: rgba(255, 255, 255, 0.45);
        --glass-edge-low: rgba(255, 255, 255, 0.06);
        --glass-shadow: 0 1px 1px rgba(0, 0, 0, 0.2), 0 14px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -1px 0 rgba(255, 255, 255, 0.04);
        --surface-2: rgba(255, 255, 255, 0.08);
        --border: rgba(255, 255, 255, 0.09);
        --text: #f4f3fa;
        --muted: rgba(244, 243, 250, 0.64);
        --faint: rgba(244, 243, 250, 0.40);
        --solar: #ffb340;
        --grid: #9d92ff;
        --battery: #32d583;
        --house: #4fb3ff;
        --car: #ff6aa6;
        --danger: #ff6b61;
        --ok: #32d583;
        --warn: #ffb340;
        --track: rgba(255, 255, 255, 0.10);
        --code-bg: rgba(0, 0, 0, 0.45);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --wallpaper:
        radial-gradient(55% 40% at 6% 2%, rgba(255, 150, 40, 0.55), transparent 70%),
        radial-gradient(50% 38% at 100% 22%, rgba(230, 60, 140, 0.38), transparent 70%),
        radial-gradient(70% 50% at 88% 80%, rgba(40, 120, 255, 0.45), transparent 70%),
        radial-gradient(60% 45% at 0% 95%, rgba(120, 80, 255, 0.42), transparent 70%),
        linear-gradient(180deg, #0b0a14 0%, #0c0f1f 60%, #0a1222 100%);
    --bg: #0b0b16;
    --glass: rgba(255, 255, 255, 0.07);
    --glass-strong: rgba(255, 255, 255, 0.12);
    --glass-border: rgba(255, 255, 255, 0.14);
    --glass-edge: rgba(255, 255, 255, 0.45);
    --glass-edge-low: rgba(255, 255, 255, 0.06);
    --glass-shadow: 0 1px 1px rgba(0, 0, 0, 0.2), 0 14px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -1px 0 rgba(255, 255, 255, 0.04);
    --surface-2: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.09);
    --text: #f4f3fa;
    --muted: rgba(244, 243, 250, 0.64);
    --faint: rgba(244, 243, 250, 0.40);
    --solar: #ffb340;
    --grid: #9d92ff;
    --battery: #32d583;
    --house: #4fb3ff;
    --car: #ff6aa6;
    --danger: #ff6b61;
    --ok: #32d583;
    --warn: #ffb340;
    --track: rgba(255, 255, 255, 0.10);
    --code-bg: rgba(0, 0, 0, 0.45);
    color-scheme: dark;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

/* Scrollbalken ausblenden (Seite, Logs, JSON), Scrollen funktioniert weiter */
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }

html { background: var(--bg); -webkit-text-size-adjust: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: transparent;
    color: var(--text);
    min-height: 100vh;
    line-height: 1.45;
    padding-bottom: calc(104px + env(safe-area-inset-bottom));
    -webkit-font-smoothing: antialiased;
    position: relative;
}

/* Hintergrund fest hinter allem; die Glasflächen scrollen darüber */
html::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background: var(--wallpaper); background-color: var(--bg);
}

/* Als Homescreen-App liegt die Statusleiste (Uhr, Akku) über der Seite. Eine Kopie des Hintergrunds,
   auf die Höhe der Statusleiste beschnitten, deckt dort scrollende Inhalte ab - ohne sichtbare Kante. */
body::before {
    content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none;
    background: var(--wallpaper); background-color: var(--bg);
    clip-path: inset(0 0 calc(100% - env(safe-area-inset-top, 0px)) 0);
}

a { color: inherit; }
button { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.icon { width: 1em; height: 1em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ---------- Glas-Material ---------- */
/* Fläche + Unschärfe + Licht an der Oberkante. Die Lichtkante (::after) ist ein Verlaufsrand,
   oben links hell, in der Mitte fast weg, unten rechts wieder etwas hell - wie Licht, das durch Glas bricht. */
.glass, .card, .stat, .pill, .icon-btn, .tabbar, .btn, .action, .log-group, .search, .field input, #toast {
    background: var(--glass);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}
.glass, .card, .stat, .tabbar, .action, .log-group { position: relative; isolation: isolate; }
.glass::after, .card::after, .stat::after, .tabbar::after, .action::after, .log-group::after, .btn::after {
    content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; z-index: 2;
    padding: 1px;
    background: linear-gradient(135deg, var(--glass-edge) 0%, var(--glass-edge-low) 32%, transparent 50%, var(--glass-edge-low) 72%, color-mix(in srgb, var(--glass-edge) 60%, transparent) 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.btn { position: relative; }

/* ---------- Kopfzeile ---------- */
.topbar {
    max-width: 680px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: calc(30px + env(safe-area-inset-top)) 16px 6px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
    width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; position: relative;
    background: radial-gradient(120% 90% at 30% 15%, rgba(255, 255, 255, 0.55), transparent 50%), linear-gradient(150deg, #ffc84d, #f07c0c);
    color: #fff; font-size: 22px;
    box-shadow: 0 8px 22px rgba(240, 124, 12, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 -2px 4px rgba(150, 60, 0, 0.25);
}
.brand-title { font-weight: 750; font-size: 17px; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
@media (max-width: 350px) { .brand-sub { display: none; } .brand { gap: 10px; } .brand-mark { width: 34px; height: 34px; font-size: 18px; border-radius: 11px; } .brand-title { font-size: 16px; } .topbar { gap: 8px; } .pill { padding-left: 9px; padding-right: 9px; } }

.pill {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
    font-size: 12px; font-weight: 650; color: var(--muted); white-space: nowrap;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.pill.live .dot { background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: pulse 2s infinite; }
.pill.live { color: var(--text); }
.pill.stale .dot { background: var(--warn); }
.pill.offline .dot { background: var(--danger); }
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); }
    70% { box-shadow: 0 0 0 6px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

.icon-btn {
    width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
    color: var(--muted); text-decoration: none; font-size: 17px;
}
.icon-btn:hover, .icon-btn.active { color: var(--text); }

/* ---------- Seite ---------- */
.page { max-width: 680px; margin: 0 auto; padding: 10px 16px 0; }
.page-title { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; margin: 8px 2px 4px; }
.page-lead { color: var(--muted); font-size: 15px; margin: 0 2px 18px; }

.section-title {
    display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
    font-size: 20px; font-weight: 750; letter-spacing: -0.02em; color: var(--text);
    margin: 28px 6px 12px;
}
.section-title .aside { font-weight: 500; font-size: 13px; letter-spacing: 0; color: var(--faint); }

.card { border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-title { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.card-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
a.card { display: block; text-decoration: none; transition: transform .2s cubic-bezier(.3, 1.4, .5, 1); }
a.card:active { transform: scale(0.98); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 420px) { .grid-3 { gap: 8px; } .grid-3 .stat { padding: 12px 10px; } .grid-3 .stat-value { font-size: clamp(15px, 5vw, 19px); } .grid-3 .stat-value small { font-size: 11px; } .grid-3 .stat-label { font-size: 11px; } .grid-3 .stat-label .icon { display: none; } }

/* Kennzahl-Kachel */
.stat { border-radius: 22px; padding: 14px 15px; min-width: 0; }
.stat-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-value { font-size: 24px; font-weight: 750; letter-spacing: -0.03em; margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-value small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 2px; letter-spacing: 0; }
.stat-foot { color: var(--faint); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Schlüssel/Wert-Liste */
.kv-list { display: grid; }
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.kv:first-child { padding-top: 0; }
.kv:last-child { border-bottom: none; padding-bottom: 0; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: 13px; }

/* Fortschrittsbalken */
.bar { height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08); }
.bar > span { display: block; height: 100%; border-radius: 99px; background: currentColor; width: 0; transition: width .6s ease; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.badge.error { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.badge.running { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.badge.neutral { background: var(--track); color: var(--muted); }
.badge.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.badge.running::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Schalter: Kapsel mit gläsernem Knopf, der beim Drücken breiter wird */
.switch { position: relative; width: 62px; height: 30px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 99px; background: var(--track); transition: background .25s ease; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08); }
.switch .track::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 38px; height: 26px; border-radius: 99px;
    background: linear-gradient(180deg, #fff, #f3f3f7);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18), 0 1px 1px rgba(0, 0, 0, 0.08), inset 0 1px 0 #fff;
    transition: transform .35s cubic-bezier(.3, 1.5, .5, 1), width .2s ease;
}
.switch input:active + .track::after { width: 44px; }
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:checked:active + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--house); outline-offset: 2px; }

/* Buttons: Glas-Kapseln */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 20px; border-radius: 999px;
    font-weight: 650; font-size: 15px; cursor: pointer; text-decoration: none;
    transition: transform .2s cubic-bezier(.3, 1.5, .5, 1), background .15s ease;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary {
    background: radial-gradient(120% 100% at 30% 0%, rgba(255, 255, 255, 0.45), transparent 55%), linear-gradient(150deg, #ffc443, #f07c0c);
    color: #1b1203; border-color: rgba(255, 220, 160, 0.7);
    box-shadow: 0 8px 22px rgba(240, 124, 12, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* Code / JSON / Logs */
details.fold { border-top: 1px solid var(--border); }
details.fold:first-of-type { border-top: none; }
details.fold > summary {
    list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 10px;
    padding: 12px 0; font-weight: 600; font-size: 15px;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "›"; color: var(--faint); font-size: 20px; line-height: 1; transition: transform .2s ease; }
details.fold[open] > summary::after { transform: rotate(90deg); }
details.fold > summary .faint { font-weight: 500; margin-left: auto; }

pre.code {
    background: var(--code-bg); color: var(--code-text); border-radius: var(--radius-sm); padding: 12px 14px;
    font: 12px/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace; overflow: auto; max-height: 340px;
    white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.log {
    background: var(--code-bg); color: var(--code-text); border-radius: 22px; padding: 6px 0;
    font: 12px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; max-height: 460px; overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.10);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.10);
}
.log-line { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 5px 14px; border-left: 3px solid transparent; }
.log-line:hover { background: rgba(255, 255, 255, 0.04); }
.log-line time { color: #8a88a6; white-space: nowrap; }
.log-line .msg { overflow-wrap: anywhere; white-space: pre-wrap; }
.log-line.ERROR { border-left-color: #ff6b61; }
.log-line.ERROR .msg { color: #ffb8b2; }
.log-line.CHARGING { border-left-color: #32d583; }
.log-empty { padding: 18px 14px; color: #8a88a6; }

/* ---------- Untere Navigation: schwebende Glas-Kapsel ---------- */
.tabbar {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom));
    width: min(420px, calc(100% - 28px)); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 5px;
    border-radius: 999px; z-index: 50;
    background: color-mix(in srgb, var(--glass-strong) 70%, transparent);
    -webkit-backdrop-filter: blur(26px) saturate(200%); backdrop-filter: blur(26px) saturate(200%);
    box-shadow: 0 16px 44px rgba(30, 20, 70, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.tabbar a {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 4px 6px; border-radius: 999px;
    text-decoration: none; color: var(--muted); font-size: 10.5px; font-weight: 650; position: relative;
    transition: color .2s ease, transform .25s cubic-bezier(.3, 1.5, .5, 1);
}
.tabbar a:active { transform: scale(0.92); }
.tabbar a .icon { font-size: 22px; }
/* Aktiver Tab: eine Linse aus hellerem Glas */
.tabbar a.active {
    color: var(--solar);
    background: radial-gradient(100% 80% at 50% 0%, rgba(255, 255, 255, 0.35), transparent 70%), var(--track);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -1px 0 rgba(255, 255, 255, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
}
.tabbar a.active span { color: var(--text); }

/* ---------- Toast ---------- */
#toast {
    position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translate(-50%, -140%);
    max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 999px; font-size: 14px; font-weight: 650;
    background: color-mix(in srgb, var(--glass-strong) 80%, transparent); color: var(--text); z-index: 100;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: transform .4s cubic-bezier(.3, 1.4, .5, 1), opacity .25s ease, visibility 0s linear .4s;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; transition: transform .4s cubic-bezier(.3, 1.4, .5, 1), opacity .2s ease; }
#toast.error { background: color-mix(in srgb, var(--danger) 85%, transparent); color: #fff; border-color: rgba(255, 255, 255, 0.35); }

/* ---------- Eingabefelder ---------- */
.search, .field input { color: var(--text); }
.search::placeholder, .field input::placeholder { color: var(--faint); }

/* ---------- Skeleton ---------- */
.skeleton { color: transparent !important; background: linear-gradient(90deg, var(--track), color-mix(in srgb, var(--track) 40%, transparent), var(--track)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Ohne Unschärfe (alte Browser, „Transparenz reduzieren“): deckendere Flächen, damit alles lesbar bleibt */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    :root { --glass: rgba(255, 255, 255, 0.82); }
    @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --glass: rgba(30, 30, 46, 0.88); } }
}
@media (prefers-reduced-transparency: reduce) {
    :root { --glass: rgba(255, 255, 255, 0.9); --glass-strong: #fff; }
    @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --glass: rgba(28, 28, 42, 0.95); --glass-strong: #24243a; } }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Kopfzeile bei wenig Platz: der Titel bleibt ganz, gekürzt wird der Status-Text.
   Die Unterzeile zählt nicht zur Breite der Marke. */
.brand { flex-shrink: 0; }
.brand-sub { width: 0; min-width: 100%; }
.topbar-right { min-width: 0; }
.pill { min-width: 0; overflow: hidden; }
#live-text { overflow: hidden; text-overflow: ellipsis; }

/* Comic-Figuren gibt es nur im Design „Comic“ */
.figure { display: none; }
