/* Die vom Nutzer gelieferten Originalschriften werden ausschließlich lokal vom eigenen Server geladen. */
@font-face { font-family:"Hevi Tahoma"; src:url("fonts/tahoma.ttf") format("truetype"); font-style:normal; font-weight:400; font-display:swap; }
@font-face { font-family:"W95FA"; src:url("fonts/W95F.otf") format("opentype"); font-style:normal; font-weight:400; font-display:swap; }
@font-face { font-family:"Nouveau IBM"; src:url("fonts/Nouveau_IBM.ttf") format("truetype"); font-style:normal; font-weight:400; font-display:block; }
/* Theme-Auswahl: native select/checkbox. Kein Abonnement und keine Anlagenkonfiguration
   wird beim Themewechsel geschrieben; gespeichert wird nur die Browserdarstellung. */
.appearance-choice select { min-width: 125px; max-width: 48%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); font: inherit; }
#settings-main [hidden],#original-info-toggle,#original-consumption,.original-detail-links { display: none; }
/* In historischen Themes bleiben Ansichten lesbar; Schreib- und Steuerflächen sind Modern vorbehalten. */
/* Die drei historischen Bedienoberflächen behalten Korrekturen und Entnahmesteuerung. */
html[data-appearance="original"] :is(.day-edit,.meter-correct,.edit-form,#ventctrl),
html:is([data-appearance="luna"],[data-appearance="classic"],[data-appearance="terminal"],[data-appearance="skeuomorph"]) :is(#settings-basic,#settings-meter-form,#meter-add) { display:none!important; }

/* ORIGINAL: Farben, Asap-Condensed/Arial-Narrow-Schrift, 15-vw-Seitennavigation und
   kräftig abgesetzte Linkflächen stammen aus lib/desktop.css und lib/mobile.css von vor
   der GUI-Modernisierung. Nur der Rahmen wird rekonstruiert, die aktuelle Fachlogik bleibt.
   Moderne Kachelgrößen und automatische Vollbild-Anpassungen dürfen hier nicht eingreifen. */
html:not(.embedded)[data-appearance="original"] { --bg:#e0e0e0; --surface:#e0e0e0; --ink:#000; --muted:#333; --line:#aaa; --accent:#333; --accent-soft:#ccc; color-scheme:light; }
html:not(.embedded)[data-appearance="original"] body { background:#e0e0e0; color:#000; font-family:"Asap Condensed","Arial Narrow",Arial,sans-serif; }
html:not(.embedded)[data-appearance="original"] body > #container { display:block!important; min-height:100vh; }
html:not(.embedded)[data-appearance="original"] .sidebar { position:fixed!important; top:0; left:0; bottom:0; height:100vh!important; width:15vw; padding:0!important; background:#505050; border:0; }
html:not(.embedded)[data-appearance="original"] #header { position:fixed; left:0; top:0; width:100%; height:5vw; padding:0!important; background:#606060; z-index:210; }
html:not(.embedded)[data-appearance="original"] .headertitel { position:absolute; left:5.25vw; top:.1vw; font-size:3.5vw; color:white; font-style:italic; }
html:not(.embedded)[data-appearance="original"] .headerlogo { position:absolute; left:.75vw; top:.5vw; width:4vw!important; height:4vw!important; border-radius:1vw; }
html:not(.embedded)[data-appearance="original"] .brand-sub,html:not(.embedded)[data-appearance="original"] .nav-caption,html:not(.embedded)[data-appearance="original"] .sidebar-note,html:not(.embedded)[data-appearance="original"] .nav-more,html:not(.embedded)[data-appearance="original"] #navigation .icon { display:none!important; }
html:not(.embedded)[data-appearance="original"] #navigation { display:block!important; position:static!important; width:15vw; margin-top:5vw; height:auto!important; padding:0!important; background:#505050; border:0; }
html:not(.embedded)[data-appearance="original"] .desktop-nav-group { display:contents!important; }
html:not(.embedded)[data-appearance="original"] .desktop-subnav,html:not(.embedded)[data-appearance="original"] .mobile-subnav { display:none!important; }
html:not(.embedded)[data-appearance="original"] #navigation a { display:block!important; width:13.5vw; min-height:0!important; height:auto; margin:1vw .75vw; padding:.75vw .2vw; text-align:center; font:1.5vw "Asap Condensed","Arial Narrow",Arial,sans-serif; color:white!important; background:#707070!important; border:0; border-right:.5vw solid #404040; border-bottom:.5vw solid #404040; border-radius:0!important; box-shadow:none!important; transition:none; }
html:not(.embedded)[data-appearance="original"] #navigation a:hover { background:#808080!important; }
html:not(.embedded)[data-appearance="original"] #navigation a:active { border-color:#707070; background:#606060!important; }
html:not(.embedded)[data-appearance="original"] .workspace { display:block!important; width:85vw; max-width:none; min-height:100vh!important; height:auto!important; margin:0 0 0 15vw!important; padding:calc(5vw + 10px) 10px 28px!important; }
html:not(.embedded)[data-appearance="original"] .topbar { display:block; margin:0 0 8px!important; min-height:0!important; }
html:not(.embedded)[data-appearance="original"] .topbar>div:first-child { max-width:none!important; }
html:not(.embedded)[data-appearance="original"] .topbar h1 { font-family:inherit; font-size:2vw; font-weight:bold; color:#000; letter-spacing:0; }
html:not(.embedded)[data-appearance="original"] .top-actions { position:fixed!important; top:.6vw!important; right:8px!important; z-index:250; }
html:not(.embedded)[data-appearance="original"] .top-actions .data-state,html:not(.embedded)[data-appearance="original"] .header-install { display:none!important; }
html:not(.embedded)[data-appearance="original"] #settings-button { width:32px; height:32px; border-radius:2px; background:#e0e0e0; color:#333; border:2px outset #ddd; }
html:not(.embedded)[data-appearance="original"] #original-consumption { display:flex; align-items:center; gap:18px; position:fixed; top:.5vw; right:50px; z-index:220; color:white; font:clamp(11px,1.25vw,19px) "Asap Condensed","Arial Narrow",Arial,sans-serif; }
html:not(.embedded)[data-appearance="original"] #original-consumption table { border-collapse:collapse; }
html:not(.embedded)[data-appearance="original"] #original-consumption td { padding:0 5px; white-space:nowrap; }
html:not(.embedded)[data-appearance="original"] .original-time { text-align:center; line-height:1.4; }
html:not(.embedded)[data-appearance="original"] body.overview-page .live-grid,html:not(.embedded)[data-appearance="original"] body.overview-page .overview-summary { display:none!important; }
html:not(.embedded)[data-appearance="original"] #content { display:block!important; flex:none!important; height:auto!important; overflow:visible!important; }
html:not(.embedded)[data-appearance="original"] .system-card { border:0!important; border-radius:0!important; background:transparent!important; box-shadow:none!important; height:calc(100vh - 5vw - 105px)!important; min-height:320px!important; }
html:not(.embedded)[data-appearance="original"] .system-card .card-header,html:not(.embedded)[data-appearance="original"] .system-legend { display:none!important; }
html:not(.embedded)[data-appearance="original"] .system-stage { height:100%!important; min-height:300px!important; width:100%; padding:0!important; }
html:not(.embedded)[data-appearance="original"] .system-frame { height:100%!important; width:100%!important; border:0; max-height:none!important; }
html:not(.embedded)[data-appearance="original"] .original-detail-links { display:block; text-align:right; font-size:13px; margin:6px 0; }
html:not(.embedded)[data-appearance="original"] .original-detail-links button { font:inherit; color:#000080; background:none; border:0; padding:3px 5px; text-decoration:underline; }
html:not(.embedded)[data-appearance="original"] .page-panel { border:0; border-radius:0; background:#e0e0e0; box-shadow:none; padding:8px; }
html:not(.embedded)[data-appearance="original"] #s_nav { border-radius:0; background:none; }
html:not(.embedded)[data-appearance="original"] #s_nav a { color:#000; background:#aaa; border:2px outset #ddd; border-radius:0; font:18px "Asap Condensed","Arial Narrow",Arial,sans-serif; }
html:not(.embedded)[data-appearance="original"] #s_nav a.active { background:#ccc; border-style:inset; }
html:not(.embedded)[data-appearance="original"] .chart-context { display:none; }
html:not(.embedded)[data-appearance="original"] .page-tools { justify-content:flex-end; }
html:not(.embedded)[data-appearance="original"] body.chart-page #chart_div,html:not(.embedded)[data-appearance="original"] body.chart-page #s_chart_div { min-height:350px; height:calc(100vh - 5vw - 210px)!important; }
html:not(.embedded)[data-appearance="original"] #footer { display:block!important; position:fixed; bottom:0; left:0; width:100%; background:#404040; color:#999; padding:1px 7px; font:clamp(9px,1vw,14px) "Asap Condensed","Arial Narrow",Arial,sans-serif; text-align:right; z-index:215; }
html:not(.embedded)[data-appearance="original"] .tile-dialog,html:not(.embedded)[data-appearance="original"] .settings-dialog,html:not(.embedded)[data-appearance="original"] .settings-toast { background:#e0e0e0!important; color:#000; border-radius:0; border:2px outset #ddd; box-shadow:none!important; backdrop-filter:none!important; -webkit-backdrop-filter:none!important; }
html:not(.embedded)[data-appearance="original"] .tile-dialog-header,html:not(.embedded)[data-appearance="original"] .settings-heading { background:#606060; color:#fff; padding:8px; }
html:not(.embedded)[data-appearance="original"] .tile-dialog-header h2,html:not(.embedded)[data-appearance="original"] .settings-heading h2 { color:#fff; font-family:inherit; }
html:not(.embedded)[data-appearance="original"] .settings-row,html:not(.embedded)[data-appearance="original"] .tile-detail-list>div { border-color:#aaa; border-radius:0; }
html:not(.embedded)[data-appearance="original"] .loading-spinner { display:none; }
html:not(.embedded)[data-appearance="original"] * { scroll-behavior:auto!important; }
html:not(.embedded)[data-appearance="original"] .settings-hint-pulse { animation:none; }
html:not(.embedded)[data-appearance="original"] .live-grid,html:not(.embedded)[data-appearance="original"] .overview-summary,html:not(.embedded)[data-appearance="original"] .system-stage { opacity:1!important; transform:none!important; transition:none!important; }
/* Die alte Mobilansicht besitzt unten eine breite Starttaste und darunter drei Menüfelder. */
@media(max-width:500px) {
    html:not(.embedded)[data-appearance="original"] .sidebar { height:auto!important; width:100%; background:transparent; }
    html:not(.embedded)[data-appearance="original"] #header { height:12.5vw; }
    html:not(.embedded)[data-appearance="original"] .headertitel { left:12vw; top:-1vw; font:italic bold 10vw "Noto Sans",Arial,sans-serif; }
    html:not(.embedded)[data-appearance="original"] .headerlogo { left:1vw; top:1vw; width:10vw!important; height:10vw!important; }
    html:not(.embedded)[data-appearance="original"] #navigation { position:fixed!important; left:0; bottom:0; width:100%; padding:3px!important; margin:0; background:#505050; z-index:240; display:grid!important; grid-template-columns:repeat(3,minmax(0,1fr)); gap:3px; }
    html:not(.embedded)[data-appearance="original"] #navigation>a:first-child { grid-column:1/-1; }
    html:not(.embedded)[data-appearance="original"] #navigation a { width:auto; margin:0; font-size:4.25vw; padding:7px 2px; border-width:2px; }
    html:not(.embedded)[data-appearance="original"] .workspace { width:100%; margin:0!important; padding:calc(12.5vw + 8px) 5px 108px!important; }
    html:not(.embedded)[data-appearance="original"] .topbar h1 { font-size:5vw; }
    html:not(.embedded)[data-appearance="original"] .top-actions { top:6px!important; right:6px!important; }
    html:not(.embedded)[data-appearance="original"] #original-info-toggle { display:block; position:fixed; top:6px; right:44px; z-index:260; width:30px; height:30px; background:#ddd; border:2px outset white; color:#222; font:bold 20px Georgia,serif; }
    html:not(.embedded)[data-appearance="original"] #original-consumption { display:none; top:12.5vw; right:5px; left:5px; padding:10px; background:#606060; font-size:12px; border:2px outset #888; }
    html:not(.embedded)[data-appearance="original"] #original-consumption.original-info-open { display:block; }
    html:not(.embedded)[data-appearance="original"] #original-consumption table { width:100%; margin-top:6px; }
    html:not(.embedded)[data-appearance="original"] #original-consumption td { white-space:normal; padding:2px; }
    html:not(.embedded)[data-appearance="original"] .system-card { height:62vh!important; min-height:280px!important; }
    html:not(.embedded)[data-appearance="original"] #footer { display:none!important; }
    html:not(.embedded)[data-appearance="original"] #stattab { display:table!important; }
    html:not(.embedded)[data-appearance="original"] .day-card-list { display:none!important; }
    html:not(.embedded)[data-appearance="original"] .table-scroll { overflow:auto!important; }
}
/* Embedded: bewahrt die frühere Grafik ohne Bloom und zeigt die alte Außentemperatur/Bedienung. */
html.embedded[data-appearance="original"] body { background:transparent!important; }
html.embedded[data-appearance="original"] #container { opacity:1!important; filter:none!important; transition:none!important; }
html.embedded[data-appearance="original"] #feuer,html.embedded[data-appearance="original"] #kfeuer { filter:none!important; image-rendering:auto; }
html.embedded[data-appearance="original"] #atemp,html.embedded[data-appearance="original"] #ventctrl { display:block!important; }

/* Im Originalrahmen teilt sich das Schema denselben grauen Hintergrund wie früher. */
html:not(.embedded)[data-appearance="original"] .workspace { width:calc(100% - 15vw); }
html:not(.embedded)[data-appearance="original"] .system-frame { background:#e0e0e0!important; }
html.embedded[data-appearance="original"] { background:#e0e0e0!important; }
html.embedded[data-appearance="original"] body,html.embedded[data-appearance="original"] #container { background:transparent!important; }
html.embedded[data-appearance="original"] #ventctrl input { border:2px outset #ddd; border-radius:0; background:#ddd; color:#000; font:1.5vw Arial,sans-serif; padding:.3vw .5vw; }
@media(max-width:500px){html:not(.embedded)[data-appearance="original"] .workspace{width:100%;}}

html:not(.embedded)[data-appearance="original"] #s_content .table-scroll { display:block!important; overflow:auto; }
html:not(.embedded)[data-appearance="original"] .stat-mobile { display:none!important; }
/* LUNA/KLASSIK: ein gemeinsamer einfacher Seitenaufbau, zwei historische Farbsätze.
   Kein zweiter Anwendungsstapel: dieselben Links, Formulare und Tabellen bleiben erhalten.
   Die alten Browserrahmen werden per CSS imitiert; heutige Berechtigungs-/Push-APIs bleiben sicher.
   Titelleiste und Rahmen umschließen die Anwendung bis zum Fensterrand.
   Breite Desktopansicht ist absichtlich Standard. Erst der explizite PDA-Schalter stapelt Inhalte. */
html.retro-theme { --bg:#3a6ea5; --surface:#ece9d8; --ink:#000; --muted:#555; --line:#aca899; --accent:#003399; --accent-soft:#d9e7fa; --radius:0px; font-family:"Hevi Tahoma",Tahoma,Arial,sans-serif; color-scheme:light; }
html.retro-theme body { background:var(--bg); color:#000; font:11px/1.4 "Hevi Tahoma",Tahoma,Arial,sans-serif; }
html.retro-theme:not(.embedded) body>#container { display:block!important; min-width:0; min-height:100dvh; width:100%; margin:0; border:3px solid #0054e3; border-radius:8px 8px 0 0; background:var(--surface); }
html.retro-theme:not(.embedded) .sidebar { display:block!important; position:relative!important; width:100%; height:auto!important; top:auto; bottom:auto; padding:0!important; background:var(--surface); border:0; z-index:70; }
html.retro-theme:not(.embedded) #header { position:static; display:flex; align-items:center; gap:6px; height:31px; width:100%; padding:4px 7px!important; background:linear-gradient(#3b93ff 0%,#0873ed 12%,#0054e3 82%,#0041b9 100%); border-radius:5px 5px 0 0; }
html.retro-theme:not(.embedded) .headerlogo { position:static; width:18px!important; height:18px!important; border-radius:2px; }
html.retro-theme:not(.embedded) .headertitel { font:bold 13px "Hevi Tahoma",Tahoma,Arial,sans-serif; letter-spacing:0; color:#fff; text-shadow:1px 1px #00307c; }
html.retro-theme:not(.embedded) .brand-sub,html.retro-theme:not(.embedded) .nav-caption,html.retro-theme:not(.embedded) .sidebar-note { display:none!important; }
html.retro-theme:not(.embedded) #navigation { position:static!important; display:flex!important; align-items:flex-start; flex-wrap:nowrap; gap:0; width:100%; height:auto!important; margin:0; padding:2px 4px!important; background:var(--surface); border:0; border-bottom:1px solid #aca899; }
html.retro-theme:not(.embedded) #navigation a { position:relative; display:block; min-height:25px!important; height:auto; margin:0; padding:5px 10px!important; width:auto; font:11px "Hevi Tahoma",Tahoma,Arial,sans-serif; color:#000!important; background:transparent!important; border:1px solid transparent; border-radius:0!important; box-shadow:none!important; text-decoration:none; transition:none; }
html.retro-theme:not(.embedded) #navigation>a>.icon,html.retro-theme:not(.embedded) #navigation .desktop-nav-group>a>.icon,html.retro-theme:not(.embedded) .nav-more { display:none!important; }
html.retro-theme:not(.embedded) #navigation a:hover,html.retro-theme:not(.embedded) #navigation a:focus-visible { border-color:#316ac5; background:#c1d2ee!important; }
html.retro-theme:not(.embedded) #navigation a.active { background:#d9e7fa!important; border-color:#7f9db9; }
html.retro-theme:not(.embedded) .desktop-nav-group { display:block; position:relative; }
html.retro-theme:not(.embedded) .desktop-subnav,html.retro-theme:not(.embedded) .desktop-nav-group.is-active>.desktop-subnav { display:none!important; position:absolute!important; left:0; top:100%; min-width:145px; width:max-content; margin:0; padding:2px; border:1px solid #aca899; border-radius:0; background:var(--surface)!important; box-shadow:2px 2px 2px #0005; backdrop-filter:none!important; }
html.retro-theme:not(.embedded) .desktop-nav-group:hover>.desktop-subnav,html.retro-theme:not(.embedded) .desktop-nav-group:focus-within>.desktop-subnav { display:block!important; }
html.retro-theme:not(.embedded) #navigation .desktop-subnav a { min-height:25px; color:#000!important; }
html.retro-theme:not(.embedded) .desktop-subnav::before,html.retro-theme:not(.embedded) .mobile-subnav { display:none!important; }
html.retro-theme:not(.embedded) .workspace { display:block!important; height:auto!important; min-height:0!important; width:100%; max-width:none; margin:0; padding:10px!important; background:var(--surface); }
html.retro-theme:not(.embedded) .topbar { display:flex; min-height:0!important; margin:0 0 10px!important; padding:0; }
html.retro-theme:not(.embedded) .topbar>div:first-child { max-width:none!important; }
html.retro-theme:not(.embedded) .topbar h1 { font:bold 16px "Hevi Tahoma",Tahoma,Arial,sans-serif!important; letter-spacing:0; color:#003399; margin:0; }
html.retro-theme:not(.embedded) .top-actions { position:static!important; gap:8px; }
html.retro-theme:not(.embedded) .top-actions .data-state { display:flex!important; position:static!important; font:11px "Hevi Tahoma",Tahoma,Arial,sans-serif; color:#444; }
html.retro-theme:not(.embedded) .data-state .state-dot { display:none; }
html.retro-theme:not(.embedded) .header-install { display:none!important; }
html.retro-theme:not(.embedded) #settings-button { position:fixed; top:17px; right:21px; z-index:240; width:25px; height:23px; padding:3px; border:1px solid #fff; border-radius:3px; background:linear-gradient(#7eb1f5,#1761cb); color:white; box-shadow:inset 0 0 1px #fff; }
html.retro-theme:not(.embedded) #settings-button .icon { width:15px; height:15px; }
html.retro-theme:not(.embedded) .settings-anchor { position:static; }
html.retro-theme:not(.embedded) #content { display:block!important; height:auto!important; min-height:0!important; overflow:visible!important; }
html.retro-theme:not(.embedded) .live-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr))!important; gap:8px; margin:0 0 10px!important; opacity:1!important; transform:none!important; }
html.retro-theme:not(.embedded) .live-metric { background:#f7f6ef; border:1px solid #aca899; border-radius:0; padding:9px!important; min-height:98px; }
html.retro-theme:not(.embedded) .metric-title,html.retro-theme:not(.embedded) .summary-label { font:11px "Hevi Tahoma",Tahoma,Arial,sans-serif!important; color:#003399; min-height:17px!important; letter-spacing:0; }
html.retro-theme:not(.embedded) .metric-title .icon,html.retro-theme:not(.embedded) .summary-label .icon { width:13px; height:13px; }
html.retro-theme:not(.embedded) .metric-number,html.retro-theme:not(.embedded) .summary-value { font:bold 20px "Hevi Tahoma",Tahoma,Arial,sans-serif!important; color:#000; margin-top:5px; opacity:1!important; }
html.retro-theme:not(.embedded) .stove-field-label,html.retro-theme:not(.embedded) .stove-runtime>span:first-child,html.retro-theme:not(.embedded) .storage-field-label { font:11px "Hevi Tahoma",Tahoma,Arial,sans-serif!important; min-height:14px!important; color:#555; }
html.retro-theme:not(.embedded) .metric-detail,html.retro-theme:not(.embedded) #heating-support,html.retro-theme:not(.embedded) #metric-stove-info { font:11px "Hevi Tahoma",Tahoma,Arial,sans-serif!important; margin-top:6px; }
html.retro-theme:not(.embedded) .charge-track { height:10px; border:1px solid #7f9db9; border-radius:0; background:white; margin-top:7px; }
html.retro-theme:not(.embedded) #charge-level { height:100%; border-radius:0; background:repeating-linear-gradient(90deg,#29b71b 0,#29b71b 7px,#dcebd8 7px,#dcebd8 9px); }
html.retro-theme:not(.embedded) .has-warning { background:#fff4b4!important; border-color:#c9a94f; animation:none!important; }
html.retro-theme:not(.embedded) .system-card { flex:none!important; height:auto!important; min-height:0!important; border:1px solid #7f9db9; border-radius:0; box-shadow:none; background:#fff; overflow:hidden; }
html.retro-theme:not(.embedded) .system-card .card-header { padding:5px 8px; border-bottom:1px solid #aca899; background:#f7f6ef; }
html.retro-theme:not(.embedded) .card-header h2 { font:bold 12px "Hevi Tahoma",Tahoma,Arial,sans-serif; color:#003399; }
html.retro-theme:not(.embedded) .badge { border-radius:0; padding:1px 5px; background:#ece9d8; color:#444; font:11px "Hevi Tahoma",Tahoma,Arial,sans-serif; }
html.retro-theme:not(.embedded) .system-stage { display:block; height:430px!important; min-height:0!important; width:100%; padding:0!important; opacity:1!important; }
html.retro-theme:not(.embedded) .system-frame { display:block; max-height:none!important; border:0; background:white; }
html.retro-theme:not(.embedded) .system-legend { font:11px "Hevi Tahoma",Tahoma,Arial,sans-serif; margin:0; padding:4px 8px; border-top:1px solid #aca899; background:#f7f6ef; }
html.retro-theme:not(.embedded) .system-legend>span:last-child { font-size:11px!important; }
html.retro-theme:not(.embedded) .gas-card { border:1px solid #aca899!important; border-radius:0!important; background:#f7f6ef!important; margin-top:10px!important; opacity:1!important; transform:none!important; }
html.retro-theme:not(.embedded) .gas-summary { background:transparent!important; padding:7px 0!important; }
html.retro-theme:not(.embedded) .gas-expand { width:140px; min-height:24px; margin:5px auto; padding:3px; border:1px solid #003c74; border-radius:3px; background:linear-gradient(#fff,#ece9d8); color:#000; font:11px "Hevi Tahoma",Tahoma,Arial,sans-serif; }
html.retro-theme:not(.embedded) .gas-extra dl { padding:8px; gap:8px 16px; }
html.retro-theme:not(.embedded) .gas-extra dt { font:11px "Hevi Tahoma",Tahoma,Arial,sans-serif; }
html.retro-theme:not(.embedded) .gas-extra dd { font:bold 15px "Hevi Tahoma",Tahoma,Arial,sans-serif; }
html.retro-theme:not(.embedded) .page-panel { display:block!important; min-height:0!important; border:1px solid #aca899; border-radius:0; background:#fff; box-shadow:none; padding:10px; }
html.retro-theme:not(.embedded) #s_nav { display:flex; gap:0; background:transparent; border:0; border-bottom:1px solid #919b9c; padding:0; border-radius:0; margin:0 0 8px; }
html.retro-theme:not(.embedded) #s_nav a { background:#ece9d8; border:1px solid #919b9c; border-radius:3px 3px 0 0; padding:5px 13px; margin-right:2px; color:#000; font:11px "Hevi Tahoma",Tahoma,Arial,sans-serif; }
html.retro-theme:not(.embedded) #s_nav a.active { background:#fff; border-top:3px solid #e68b2c; padding-top:3px; border-bottom-color:white; }
html.retro-theme:not(.embedded) .page-tools { margin-bottom:5px; }
html.retro-theme:not(.embedded) .chart-context { font:11px "Hevi Tahoma",Tahoma,Arial,sans-serif; color:#003399; }
html.retro-theme:not(.embedded) .chart-context small { display:none; }
html.retro-theme:not(.embedded) #chart_div,html.retro-theme:not(.embedded) #s_chart_div { height:clamp(350px,calc(100dvh - 235px),650px)!important; min-height:350px!important; border:0; border-radius:0; box-shadow:none; background:white; }
html.retro-theme:not(.embedded) #s_content .table-scroll { display:block!important; overflow:auto; border:1px inset #ccc; border-radius:0; }
html.retro-theme:not(.embedded) .stat-mobile { display:none!important; }
html.retro-theme:not(.embedded) #stattab { display:table!important; border-collapse:collapse; color:#000; }
html.retro-theme:not(.embedded) #stattab th { background:#ece9d8; border:1px outset #eee; font:bold 11px "Hevi Tahoma",Tahoma,Arial,sans-serif; color:#000; padding:5px 7px; }
html.retro-theme:not(.embedded) #stattab td { font:11px/1.4 "Hevi Tahoma",Tahoma,Arial,sans-serif; background:#fff; border:1px solid #ddd; padding:4px 7px; }
html.retro-theme:not(.embedded) #footer { display:block!important; position:static; height:auto; width:100%; border-top:1px solid #aca899; background:var(--surface); color:#444; padding:3px 8px; text-align:left; font:11px "Hevi Tahoma",Tahoma,Arial,sans-serif; }
html.retro-theme:not(.embedded) .loading-spinner { display:none; }
html.retro-theme:not(.embedded) .loading-grid { display:none; }
html.retro-theme:not(.embedded) .tile-hit:hover { box-shadow:none; }

/* Zeittypische Dialogfenster: feste Titelzeile, native Felder, keine Milchglas-/Bewegungseffekte. */
html.retro-theme .settings-dialog,html.retro-theme .tile-dialog { max-width:calc(100vw - 18px); max-height:calc(100dvh - 18px); border:3px solid #0054e3; border-radius:7px 7px 0 0; background:var(--surface)!important; background-image:none!important; color:#000; box-shadow:2px 3px 3px #0005!important; backdrop-filter:none!important; -webkit-backdrop-filter:none!important; font:11px "Hevi Tahoma",Tahoma,Arial,sans-serif; }
html.retro-theme .settings-dialog::backdrop,html.retro-theme .tile-dialog::backdrop { background:transparent; backdrop-filter:none; }
html.retro-theme .settings-heading,html.retro-theme .tile-dialog-header { padding:4px 5px; margin:0; align-items:center; background:linear-gradient(#3b93ff,#0054e3 80%,#0041b9); color:#fff; }
html.retro-theme .settings-heading h2,html.retro-theme .tile-dialog-header h2 { font:bold 13px "Hevi Tahoma",Tahoma,Arial,sans-serif; color:white; text-shadow:1px 1px #00307c; }
html.retro-theme .tile-dialog-header p { color:white; font:11px "Hevi Tahoma",Tahoma,Arial,sans-serif; margin:2px 0 0; }
html.retro-theme .settings-view { padding:6px 12px 12px; }
html.retro-theme .tile-dialog-shell { padding:0; }
html.retro-theme #tile-dialog-body,html.retro-theme .tile-dialog-controls { margin:0; padding:12px; }
html.retro-theme .settings-row,html.retro-theme .settings-choice { padding:10px 0; border-color:#aca899; font:11px "Hevi Tahoma",Tahoma,Arial,sans-serif; }
html.retro-theme .settings-row strong,html.retro-theme .settings-choice strong { font:bold 11px "Hevi Tahoma",Tahoma,Arial,sans-serif; }
html.retro-theme .settings-row small,html.retro-theme .settings-choice small,html.retro-theme .settings-status,html.retro-theme .settings-intro { font:11px/1.45 "Hevi Tahoma",Tahoma,Arial,sans-serif; color:#444; }
html.retro-theme .tile-detail-list { display:grid; gap:0 12px; }
html.retro-theme .tile-detail-list>div { border:0; border-bottom:1px solid #aca899; border-radius:0; padding:9px 0; }
html.retro-theme .tile-detail-list dt { font:11px "Hevi Tahoma",Tahoma,Arial,sans-serif; color:#444; }
html.retro-theme .tile-detail-list dd { font:bold 16px "Hevi Tahoma",Tahoma,Arial,sans-serif; color:#000; }
html.retro-theme .tile-detail-note { font:11px/1.45 "Hevi Tahoma",Tahoma,Arial,sans-serif; color:#444; }
html.retro-theme .button,html.retro-theme .settings-icon,html.retro-theme .tile-close,html.retro-theme .settings-save,html.retro-theme .settings-disable,html.retro-theme .settings-input-row button { min-height:25px; border:1px solid #003c74; border-radius:3px; padding:4px 10px; background:linear-gradient(#fff,#ece9d8); box-shadow:inset 1px 1px white; color:#000; font:11px "Hevi Tahoma",Tahoma,Arial,sans-serif; }
html.retro-theme .button:active,html.retro-theme .settings-save:active { background:#dcd9c8; box-shadow:inset 1px 1px #888; }
html.retro-theme .settings-icon,html.retro-theme .tile-close { width:23px; height:23px; min-width:23px; min-height:23px; padding:0; margin:0; font:bold 17px "Hevi Tahoma",Tahoma,Arial,sans-serif; }
html.retro-theme #settings-close,html.retro-theme .tile-close { color:white; background:linear-gradient(#f1a18a,#d54423); border-color:white; }
html.retro-theme input:not([type="checkbox"]):not([type="hidden"]),html.retro-theme select { border:1px solid #7f9db9; border-radius:0; background:white; color:#000; font:11px "Hevi Tahoma",Tahoma,Arial,sans-serif; min-height:25px; padding:3px 5px; }
html.retro-theme .settings-input-row input { min-width:0; }
html.retro-theme .settings-choice input { width:13px; height:13px; margin:2px 0 0; }
html.retro-theme .settings-toast { top:34px; right:8px; background:#ffffe1!important; background-image:none!important; color:black; border:1px solid #000; border-radius:6px; box-shadow:2px 2px 2px #0003!important; backdrop-filter:none!important; font:11px/1.45 "Hevi Tahoma",Tahoma,Arial,sans-serif; }
html.retro-theme .settings-toast::before { background:#ffffe1!important; border-color:#000; }
html.retro-theme .settings-hint-pulse { animation:none; }
html.retro-theme .metric-unit,html.retro-theme .detail-unit { font-size:11px!important; color:#555; }
html.retro-theme * { scroll-behavior:auto!important; }

/* Pocket-PC-Ansicht: explizite kleine Formulare, zweispaltige Messwertgruppen und lesbare
   Einzel-Tagesdatensätze statt der breiten Desktop-Tabelle. Kein automatischer Gerätewechsel. */
html.retro-theme[data-pda="true"]:not(.embedded) body>#container { width:100%; min-width:0; margin:0; border-width:1px; border-radius:0; min-height:100dvh; }
html.retro-theme[data-pda="true"]:not(.embedded) #header { height:25px; padding:3px 5px!important; border-radius:0; }
html.retro-theme[data-pda="true"]:not(.embedded) .headerlogo { width:14px!important; height:14px!important; }
html.retro-theme[data-pda="true"]:not(.embedded) .headertitel { font-size:12px; }
html.retro-theme[data-pda="true"]:not(.embedded) #settings-button { top:2px; right:3px; width:24px; height:21px; }
html.retro-theme[data-pda="true"]:not(.embedded) #navigation { justify-content:space-around; }
html.retro-theme[data-pda="true"]:not(.embedded) #navigation a { font-size:11px; padding:6px 4px!important; min-height:27px!important; }
html.retro-theme[data-pda="true"]:not(.embedded) .workspace { padding:6px!important; }
html.retro-theme[data-pda="true"]:not(.embedded) .topbar { flex-wrap:wrap; gap:4px; margin-bottom:6px!important; }
html.retro-theme[data-pda="true"]:not(.embedded) .topbar h1 { font-size:13px!important; }
html.retro-theme[data-pda="true"]:not(.embedded) .top-actions .data-state { font-size:10px; }
html.retro-theme[data-pda="true"]:not(.embedded) .live-grid { grid-template-columns:repeat(2,minmax(0,1fr))!important; gap:5px; }
html.retro-theme[data-pda="true"]:not(.embedded) .live-metric { min-height:95px; padding:6px!important; }
html.retro-theme[data-pda="true"]:not(.embedded) .metric-number,html.retro-theme[data-pda="true"]:not(.embedded) .summary-value { font-size:18px!important; }
html.retro-theme[data-pda="true"]:not(.embedded) .system-stage { height:215px!important; }
html.retro-theme[data-pda="true"]:not(.embedded) .system-legend { flex-wrap:wrap; font-size:10px; padding:4px; }
html.retro-theme[data-pda="true"]:not(.embedded) .system-legend>span:last-child { font-size:10px!important; }
html.retro-theme[data-pda="true"]:not(.embedded) .summary-label { font-size:11px!important; }
html.retro-theme[data-pda="true"]:not(.embedded) .gas-segment { padding:0 5px; }
html.retro-theme[data-pda="true"]:not(.embedded) .summary-label .icon { display:none; }
html.retro-theme[data-pda="true"]:not(.embedded) .gas-extra dl { grid-template-columns:repeat(2,minmax(0,1fr)); }
html.retro-theme[data-pda="true"]:not(.embedded) .page-panel { padding:6px; }
html.retro-theme[data-pda="true"]:not(.embedded) #s_nav a { padding:5px 7px; }
html.retro-theme[data-pda="true"]:not(.embedded) .page-tools { display:block; }
html.retro-theme[data-pda="true"]:not(.embedded) .chart-context { display:none; }
html.retro-theme[data-pda="true"]:not(.embedded) #tagwahl { display:flex; flex-wrap:wrap; margin:5px 0; gap:4px; }
html.retro-theme[data-pda="true"]:not(.embedded) #chart_div,html.retro-theme[data-pda="true"]:not(.embedded) #s_chart_div { height:360px!important; min-height:300px!important; }
html.retro-theme[data-pda="true"]:not(.embedded) #s_content .table-scroll { display:none!important; }
html.retro-theme[data-pda="true"]:not(.embedded) .stat-mobile { display:grid!important; gap:7px; }
html.retro-theme[data-pda="true"]:not(.embedded) .day-card { border:1px solid #aca899; border-radius:0; background:white; padding:0 7px 7px; }
html.retro-theme[data-pda="true"]:not(.embedded) .day-header { padding:5px 0; border-color:#aca899; }
html.retro-theme[data-pda="true"]:not(.embedded) .day-value dt,html.retro-theme[data-pda="true"]:not(.embedded) .day-outside { font-size:11px; }
html.retro-theme[data-pda="true"]:not(.embedded) .day-value dd { font-size:12px; }
html.retro-theme[data-pda="true"] .settings-dialog { width:calc(100vw - 12px); }
html.retro-theme[data-pda="true"] .settings-choice { gap:8px; }
html.retro-theme[data-pda="true"] .settings-toast { top:28px; right:4px; max-width:calc(100vw - 12px); }
html.retro-theme[data-pda="true"]:not(.embedded) #footer { font-size:9px; }

/* Das Schema bleibt realistisch; Retro entfernt nur die nachträgliche Licht-/Glasnachbearbeitung. */
html.retro-theme.embedded,html.retro-theme.embedded body { background:transparent!important; }
html.retro-theme.embedded #container { filter:none!important; transition:none!important; opacity:1!important; }
html.retro-theme.embedded #feuer,html.retro-theme.embedded #kfeuer { filter:none!important; }
html.retro-theme.embedded .tempd,html.retro-theme.embedded #p_pfs,html.retro-theme.embedded #p_kwh { font-family:"Hevi Tahoma",Tahoma,Arial,sans-serif; }

/* Die bestehende Größenroutine passt das feste Schema proportional in diesen Rahmen ein.
   Die iframe-Maße kommen deshalb aus JS und werden nicht mit 100%-Vorgaben überstimmt. */
html.retro-theme:not(.embedded) body.overview-page .system-stage { flex:none!important; display:flex; align-items:center; justify-content:center; height:350px!important; }
html.retro-theme[data-pda="true"]:not(.embedded) body.overview-page .system-stage { height:190px!important; }

/* Ein PDA bleibt auch im großen Browserfenster ein kompakter Arbeitsbereich.
   Die Bedienelemente liegen innerhalb seines Rahmens und bleiben bei 320 px erreichbar. */
html.retro-theme:not(.embedded) body>#container { position:relative; }
html.retro-theme:not(.embedded) #settings-button { position:absolute; top:4px; right:5px; }
html.retro-theme[data-pda="true"]:not(.embedded) body>#container { max-width:none; margin:0; }
html.retro-theme[data-pda="true"]:not(.embedded) #settings-button { top:2px; right:3px; }
/* KLASSIK / 1996: Windows 95 verwendet keine XP-Verläufe und keine runden Flächen.
   Helle Kanten oben/links, dunkle Kanten unten/rechts und eingesenkte Eingabefelder
   bilden die damaligen nativen HTML-/Systemelemente nach. Dieselbe DOM-Struktur genügt. */
html[data-appearance="classic"] { --bg:#008080; --surface:#c0c0c0; --ink:#000; --muted:#333; --line:#808080; --accent:#000080; --accent-soft:#c0c0c0; font-family:"W95FA","MS Sans Serif","Microsoft Sans Serif","Hevi Tahoma",Tahoma,sans-serif; }
html[data-appearance="classic"] body { font:12px/1.4 "W95FA","MS Sans Serif","Microsoft Sans Serif","Hevi Tahoma",Tahoma,sans-serif; }
html[data-appearance="classic"]:not(.embedded) body>#container { border:2px outset #fff; border-radius:0; background:#c0c0c0; box-shadow:none; }
html[data-appearance="classic"]:not(.embedded) #header { background:#000080; border-radius:0; height:25px; padding:3px 5px!important; }
html[data-appearance="classic"]:not(.embedded) .headertitel { font:bold 12px "W95FA","MS Sans Serif","Microsoft Sans Serif","Hevi Tahoma",Tahoma,sans-serif; text-shadow:none; }
html[data-appearance="classic"]:not(.embedded) .headerlogo { width:16px!important; height:16px!important; border-radius:0; }
html[data-appearance="classic"]:not(.embedded) #navigation { background:#c0c0c0; border-bottom:2px groove #fff; }
html[data-appearance="classic"]:not(.embedded) #navigation a { font-family:"W95FA","MS Sans Serif","Microsoft Sans Serif","Hevi Tahoma",Tahoma,sans-serif; }
html[data-appearance="classic"]:not(.embedded) #navigation a:hover { border:1px outset #fff; background:#c0c0c0!important; }
html[data-appearance="classic"]:not(.embedded) #navigation a.active { border:1px inset #eee; background:#c0c0c0!important; }
html[data-appearance="classic"]:not(.embedded) .desktop-subnav { border:2px outset #fff; background:#c0c0c0!important; box-shadow:1px 1px #000; }
html[data-appearance="classic"]:not(.embedded) #navigation .desktop-subnav a:hover { background:#000080!important; color:white!important; border-color:#000080; }
html[data-appearance="classic"]:not(.embedded) .topbar h1 { font-family:"W95FA","MS Sans Serif","Microsoft Sans Serif","Hevi Tahoma",Tahoma,sans-serif!important; color:#000; }
html[data-appearance="classic"]:not(.embedded) #settings-button { border:2px outset #eee; border-radius:0; background:#c0c0c0; box-shadow:none; color:black; width:26px; height:20px; padding:0; }
html[data-appearance="classic"]:not(.embedded) #settings-button .icon { display:none; }
html[data-appearance="classic"]:not(.embedded) #settings-button::before { content:"..."; font:bold 12px "W95FA","Microsoft Sans Serif","Hevi Tahoma",Tahoma,sans-serif; }
html[data-appearance="classic"]:not(.embedded) .live-metric { background:#c0c0c0; border:2px groove #fff; }
html[data-appearance="classic"]:not(.embedded) .metric-title,html[data-appearance="classic"]:not(.embedded) .summary-label { color:#000; font-family:"W95FA","MS Sans Serif","Microsoft Sans Serif","Hevi Tahoma",Tahoma,sans-serif!important; }
html[data-appearance="classic"]:not(.embedded) .metric-title>.icon,html[data-appearance="classic"]:not(.embedded) .summary-label>.icon { display:none; }
html[data-appearance="classic"]:not(.embedded) .metric-number { background:#fff; border:2px inset #ddd; padding:4px; font:18px "W95FA","MS Sans Serif","Microsoft Sans Serif","Hevi Tahoma",Tahoma,sans-serif!important; }
html[data-appearance="classic"]:not(.embedded) .metric-number .stove-temperature-value,html[data-appearance="classic"]:not(.embedded) #overview-stove-hours { font-weight:normal; }
html[data-appearance="classic"]:not(.embedded) .charge-track { background:#fff; border:2px inset #ddd; height:12px; }
html[data-appearance="classic"]:not(.embedded) #charge-level { background:#000080; }
html[data-appearance="classic"]:not(.embedded) .system-card,html[data-appearance="classic"]:not(.embedded) .page-panel { border:2px inset #ddd; }
html[data-appearance="classic"]:not(.embedded) .system-card .card-header,html[data-appearance="classic"]:not(.embedded) .system-legend { background:#c0c0c0; border-color:#808080; }
html[data-appearance="classic"]:not(.embedded) .card-header h2 { color:#000; font:12px "W95FA","MS Sans Serif","Microsoft Sans Serif","Hevi Tahoma",Tahoma,sans-serif; }
html[data-appearance="classic"]:not(.embedded) .gas-card { background:#c0c0c0!important; border:2px groove #fff!important; }
html[data-appearance="classic"]:not(.embedded) .summary-value { font:18px "W95FA","MS Sans Serif","Microsoft Sans Serif","Hevi Tahoma",Tahoma,sans-serif!important; }
html[data-appearance="classic"]:not(.embedded) .gas-expand { border:2px outset #ddd; border-radius:0; background:#c0c0c0; box-shadow:none; }
html[data-appearance="classic"]:not(.embedded) .gas-expand:active { border-style:inset; }
html[data-appearance="classic"]:not(.embedded) #s_nav a { background:#c0c0c0; border:2px outset #ddd; border-radius:0; padding:4px 11px; }
html[data-appearance="classic"]:not(.embedded) #s_nav a.active { border:2px inset #ddd; padding:4px 11px; background:#c0c0c0; }
html[data-appearance="classic"]:not(.embedded) #stattab th { background:#c0c0c0; border:2px outset #ddd; font-family:"W95FA","MS Sans Serif","Microsoft Sans Serif","Hevi Tahoma",Tahoma,sans-serif; }
html[data-appearance="classic"]:not(.embedded) #stattab td { font-family:"W95FA","MS Sans Serif","Microsoft Sans Serif","Hevi Tahoma",Tahoma,sans-serif; }
html[data-appearance="classic"] .settings-dialog,html[data-appearance="classic"] .tile-dialog { background:#c0c0c0!important; border:2px outset #fff; border-radius:0; box-shadow:1px 1px #000!important; font-family:"W95FA","MS Sans Serif","Microsoft Sans Serif","Hevi Tahoma",Tahoma,sans-serif; }
html[data-appearance="classic"] .settings-heading,html[data-appearance="classic"] .tile-dialog-header { background:#000080; border-radius:0; margin:1px; padding:2px 3px; }
html[data-appearance="classic"] .settings-heading h2,html[data-appearance="classic"] .tile-dialog-header h2 { font:bold 12px "W95FA","MS Sans Serif","Microsoft Sans Serif","Hevi Tahoma",Tahoma,sans-serif; text-shadow:none; }
html[data-appearance="classic"] .settings-icon,html[data-appearance="classic"] #settings-close,html[data-appearance="classic"] .tile-close { border:2px outset #ddd; border-radius:0; background:#c0c0c0; color:#000; font:bold 13px "W95FA","Microsoft Sans Serif","Hevi Tahoma",Tahoma,sans-serif; width:19px; height:19px; min-width:19px; min-height:19px; box-shadow:none; }
html[data-appearance="classic"] .button,html[data-appearance="classic"] .settings-save,html[data-appearance="classic"] .settings-disable,html[data-appearance="classic"] .settings-input-row button { border:2px outset #ddd; border-radius:0; background:#c0c0c0; box-shadow:none; color:#000; font:11px "W95FA","MS Sans Serif","Microsoft Sans Serif","Hevi Tahoma",Tahoma,sans-serif; }
html[data-appearance="classic"] .button:active,html[data-appearance="classic"] .settings-save:active,html[data-appearance="classic"] .settings-icon:active { border-style:inset; }
html[data-appearance="classic"] input:not([type="checkbox"]):not([type="hidden"]),html[data-appearance="classic"] select { border:2px inset #ddd; border-radius:0; background:#fff; color:#000; font:11px "W95FA","MS Sans Serif","Microsoft Sans Serif","Hevi Tahoma",Tahoma,sans-serif; }
html[data-appearance="classic"] input[type="checkbox"] { accent-color:#555; }
html[data-appearance="classic"] .settings-row strong,html[data-appearance="classic"] .settings-choice strong { font-weight:normal; }
html[data-appearance="classic"] .tile-detail-list { display:block; }
html[data-appearance="classic"] .tile-detail-list>div { display:flex; flex-direction:row; justify-content:space-between; align-items:baseline; gap:12px; border-bottom:1px dotted #808080; padding:6px 0; }
html[data-appearance="classic"] .tile-detail-list dt { max-width:60%; color:#000; font-family:"W95FA","MS Sans Serif","Microsoft Sans Serif","Hevi Tahoma",Tahoma,sans-serif; }
html[data-appearance="classic"] .tile-detail-list dd { text-align:right; font:13px "W95FA","MS Sans Serif","Microsoft Sans Serif","Hevi Tahoma",Tahoma,sans-serif; }
html[data-appearance="classic"] .settings-toast { border-radius:0; background:#ffffe1!important; border:1px solid black; box-shadow:1px 1px #000!important; }
html[data-appearance="classic"] .settings-toast::before { display:none; }
html[data-appearance="classic"] .settings-row:focus-within,html[data-appearance="classic"] button:focus-visible,html[data-appearance="classic"] a:focus-visible { outline:1px dotted #000; outline-offset:-4px; }
html[data-appearance="classic"]:not(.embedded) #footer { background:#c0c0c0; border-top:2px groove #fff; color:#000; }

/* Windows-CE-artige PDA-Oberfläche: flacher, kontrastreich und mit kleinen grauen Menübuttons.
   Im Unterschied zu Pocket PC/Luna gibt es hier weder blaue XP-Verläufe noch farbige Fortschrittsblöcke. */
html[data-appearance="classic"][data-pda="true"] { --bg:#c0c0c0; }
html[data-appearance="classic"][data-pda="true"]:not(.embedded) body>#container { border:1px solid #000; box-shadow:none; }
html[data-appearance="classic"][data-pda="true"]:not(.embedded) #header { background:#404040; border-bottom:1px solid #000; height:23px; }
html[data-appearance="classic"][data-pda="true"]:not(.embedded) #navigation { display:grid!important; grid-template-columns:repeat(2,minmax(0,1fr)); gap:3px; padding:3px!important; }
html[data-appearance="classic"][data-pda="true"]:not(.embedded) #navigation a { display:block; text-align:center; width:100%; border:1px outset #eee; background:#c0c0c0!important; padding:5px!important; }
html[data-appearance="classic"][data-pda="true"]:not(.embedded) #navigation a.active { border-style:inset; font-weight:bold; }
html[data-appearance="classic"][data-pda="true"]:not(.embedded) .topbar h1 { color:#000; font-weight:normal!important; }
html[data-appearance="classic"][data-pda="true"]:not(.embedded) .live-metric { min-height:100px; padding:5px!important; border:1px solid #808080; }
html[data-appearance="classic"][data-pda="true"]:not(.embedded) .metric-number { font-size:16px!important; }
html[data-appearance="classic"][data-pda="true"]:not(.embedded) .metric-title { font-size:11px!important; }
html[data-appearance="classic"][data-pda="true"] .settings-dialog { margin:0 auto; width:min(480px,100vw); max-height:100dvh; }
html[data-appearance="classic"][data-pda="true"] .settings-heading { background:#404040; }
html[data-appearance="classic"][data-pda="true"]:not(.embedded) .day-card { background:#e0e0e0; border:1px solid #808080; }
html[data-appearance="classic"][data-pda="true"]:not(.embedded) .day-header,html[data-appearance="classic"][data-pda="true"]:not(.embedded) .day-value dt { color:#000; }

/* Auf sehr schmalen PDAs bekommen alle gepaarten Werte dieselbe zweizeilige Beschriftungszone. */
@media(max-width:350px){
 html.retro-theme[data-pda="true"]:not(.embedded) .stove-field-label,
 html.retro-theme[data-pda="true"]:not(.embedded) .stove-runtime>span:first-child,
 html.retro-theme[data-pda="true"]:not(.embedded) .storage-field-label { min-height:2.4em!important; line-height:1.2!important; }
}

/* Der mobile Originalrahmen darf keine unsichtbare Vollbildfläche vor die Bedienung legen.
   Kopf und Navigation sind selbst fixiert; ihr Elternbereich benötigt deshalb keine Höhe. */
@media(max-width:500px){html:not(.embedded)[data-appearance="original"] .sidebar{height:0!important;bottom:auto!important;overflow:visible;}}

/* Klassik-Grafik und ihr verbleibender Rand verwenden dieselbe Systemfarbe. */
html:not(.embedded)[data-appearance="classic"] .system-stage,
html:not(.embedded)[data-appearance="classic"] .system-frame { background:#c0c0c0!important; }

/* Der Hilfezugang übernimmt in jedem historischen Thema die zeitgemäße Schaltfläche.
   Die Position bleibt auch im PDA-Rahmen unmittelbar links neben Einstellungen. */
html:not(.embedded)[data-appearance="original"] #help-button { width:32px; height:32px; border:2px outset #ddd; border-radius:2px; background:#e0e0e0; color:#333; font:700 20px/1 Arial,sans-serif; }
html.retro-theme:not(.embedded) #help-button { position:absolute; top:4px; right:35px; z-index:240; width:25px; height:23px; padding:0; border:1px solid #fff; border-radius:3px; background:linear-gradient(#7eb1f5,#1761cb); color:#fff; box-shadow:inset 0 0 1px #fff; font:700 16px/1 "Hevi Tahoma",Tahoma,sans-serif; }
html.retro-theme[data-pda="true"]:not(.embedded) #help-button { top:2px; right:30px; width:24px; height:21px; }
html[data-appearance="classic"]:not(.embedded) #help-button { width:26px; height:20px; right:34px; border:2px outset #eee; border-radius:0; background:#c0c0c0; box-shadow:none; color:#000; font:700 13px/1 "W95FA","Microsoft Sans Serif",sans-serif; }
html[data-appearance="classic"][data-pda="true"]:not(.embedded) #help-button { right:32px; }

/* Luna und Klassik verwenden Listenfelder mit den Farben der jeweiligen Systemfenster. */
html.retro-theme :is(.meter-current,.meter-calibration,.meter-reading) {
    background:var(--surface);
    border:1px inset #aca899;
    border-radius:0;
    box-shadow:none;
}
html.retro-theme .meter-overview { grid-template-columns:repeat(2,minmax(0,1fr)); }
html.retro-theme .meter-reading-head { flex-wrap:wrap; }
html.retro-theme .meter-reading p { overflow-wrap:anywhere; }
html.retro-theme[data-pda="true"] .meter-overview { grid-template-columns:minmax(0,1fr); }
html.retro-theme:not(.embedded) .health-anchor { position:absolute; top:4px; right:64px; z-index:240; }
html.retro-theme:not(.embedded) #health-button { width:25px; height:23px; padding:0; border:1px solid #fff; border-radius:3px; background:#1761cb; }
html[data-appearance="classic"]:not(.embedded) #health-button { border:2px outset #eee; border-radius:0; background:#c0c0c0; }
html.retro-theme .health-popover { background:var(--surface); border-radius:0; backdrop-filter:none; }
html.retro-theme[data-pda="true"]:not(.embedded) .health-anchor { top:2px; right:59px; }

/* Klassik: gut lesbare Windows-Schrift und umbrechende Felder auch im normalen Fenster. */
html[data-appearance="classic"] {
    --klassik-schrift:"W95FA","MS Sans Serif","Microsoft Sans Serif",Tahoma,sans-serif;
}
html[data-appearance="classic"] body { font:14px/1.4 var(--klassik-schrift); }
html[data-appearance="classic"] :is(.settings-dialog,.tile-dialog,.settings-toast,.settings-row,.settings-choice,.settings-status,.settings-intro),
html[data-appearance="classic"] :is(.button,input:not([type="checkbox"]),select,.settings-save,.settings-disable),
html[data-appearance="classic"] :is(.settings-row,.settings-choice) :is(strong,small) {
    font:13px/1.35 var(--klassik-schrift);
}
html[data-appearance="classic"] :is(.meter-reading p,.meter-state,.meter-calibration p,.meter-current p,.meter-label) {
    font-size:13px;
}
html[data-appearance="classic"]:not(.embedded) :is(#navigation a,#stattab th,#stattab td,.gas-expand,.system-legend,#footer,.top-actions .data-state) {
    font:13px/1.35 var(--klassik-schrift);
}
html[data-appearance="classic"]:not(.embedded) :is(.metric-title,.summary-label,.stove-field-label,.stove-runtime>span:first-child,.storage-field-label,.metric-detail,#heating-support,#metric-stove-info,.system-legend>span:last-child) {
    font:13px/1.3 var(--klassik-schrift)!important;
}
html[data-appearance="classic"]:not(.embedded) :is(#navigation,#s_nav,.topbar,.system-legend) { flex-wrap:wrap; }
@media (max-width:850px) {
    html[data-appearance="classic"][data-pda="false"]:not(.embedded) .live-grid {
        grid-template-columns:repeat(2,minmax(0,1fr))!important;
    }
    html[data-appearance="classic"][data-pda="false"]:not(.embedded) .system-stage {
        height:clamp(150px,46vw,350px)!important;
    }
}
@media (max-width:440px) {
    html[data-appearance="classic"]:not(.embedded) .workspace { padding:6px!important; }
    html[data-appearance="classic"]:not(.embedded) .meter-overview { grid-template-columns:minmax(0,1fr); }
    html[data-appearance="classic"]:not(.embedded) :is(.metric-title,.metric-detail,.summary-label) { overflow-wrap:anywhere; }
}
@media (max-width:360px) {
    html[data-appearance="classic"][data-pda="false"]:not(.embedded) .live-grid {
        grid-template-columns:minmax(0,1fr)!important;
    }
}

/* Eine feste 216-Farben-Browserpalette belegt einen Teil der verfügbaren 256
   Farben. Die Abbildung wirkt auch auf Verlauf, Diagramm und Heizschema. */
html.retro-theme:not(.embedded),
html.retro-theme:not(.embedded) body { background:var(--surface); }
html[data-appearance="classic"]:not(.embedded) :is(body>#container,.settings-dialog,.tile-dialog) {
    filter:url("#hevi-8bit-palette");
}
html.retro-theme:not(.embedded) body.chart-page>#container,
html.retro-theme:not(.embedded) body.chart-page :is(.workspace,#content,.page-panel) {
    display:flex!important;
    flex-direction:column;
}
html.retro-theme:not(.embedded) body.chart-page :is(.workspace,#content,.page-panel,.diagramm-ansicht) {
    flex:1 0 auto;
    min-height:0;
}
html.retro-theme:not(.embedded) body.chart-page .diagramm-ansicht { height:auto; }
html.retro-theme:not(.embedded) body.chart-page .diagramm-plot { flex:1 0 240px; }
html.retro-theme:not(.embedded) body.chart-page :is(.topbar,#s_nav,#footer) { flex:none; }

/* Schwache Mischfarben können bei der Palettenabbildung weiß werden.
   Die Betriebsflächen bleiben mit einer höheren Deckkraft erkennbar. */
html[data-appearance="classic"] .diagramm-betriebsflaeche { opacity:.27; }
html[data-appearance="classic"] .diagramm-schaltkante { opacity:.62; }
