/*
   ALSOFT-Statusseite — Stilblatt.

   Farben, Schrift und Masse kommen aus der Palette „ALBAU Web“ (albau-tokens.css im
   ALBAU-Repository); hier steht nur die Teilmenge, die die Seite braucht, unter dem Praefix
   --st-. Hell und dunkel folgen der Einstellung des Betriebssystems — die Seite hat keine
   Anmeldung, also auch keinen Ort, an dem eine Wahl gespeichert waere.

   Keine fremden Ressourcen: die Schrift liegt unter /fonts, es gibt kein CDN, kein Zaehlpixel.
*/

@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url('/fonts/manrope-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url('/fonts/manrope-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    color-scheme: light dark;

    --st-font: 'Manrope', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --st-text: #26303C;
    --st-text-secondary: #4C5A70;
    --st-text-muted: #4F5B68;
    --st-surface: #FFFFFF;
    --st-canvas: #F2F5F8;
    --st-surface-group: #F5F8FB;
    --st-line: #CFD8E1;
    --st-border-field: #94A1AF;
    --st-action: #1F4A80;
    --st-action-hover: #12305B;
    --st-on-action: #FFFFFF;
    --st-focus: 0 0 0 3px rgba(31, 74, 128, .35);
    --st-tip-surface: #1F3A5C;
    --st-tip-ink: #FFFFFF;

    /* Die vier Zustaende. Jeder traegt zusaetzlich ein Zeichen und einen Text (§4): die Farbe
       allein sagt nie etwas. Als Flaeche im Streifen halten alle mindestens 3:1 gegen die Seite. */
    --st-betrieb: #178A3C;
    --st-betrieb-surface: #E4F3E9;
    --st-beeintraechtigt: #9A6B00;
    --st-beeintraechtigt-fill: #B7791F;
    --st-beeintraechtigt-surface: #FFF3D6;
    --st-ausfall: #B23A3A;
    --st-ausfall-surface: #FBEDED;
    --st-wartung: #1F4A80;
    --st-wartung-surface: #EDF3F9;
    --st-keine: #5F6B78;
    --st-keine-fill: #CFD8E1;

    --st-radius: 12px;
    --st-radius-sm: 7px;
    --st-field-height: 36px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --st-text: #EDF1F7;
        --st-text-secondary: #B9C6D9;
        --st-text-muted: #9BAABF;
        --st-surface: #141C28;
        --st-canvas: #0F151F;
        --st-surface-group: #18212F;
        --st-line: #2E3B54;
        --st-border-field: #4E5F7E;
        --st-action: #3578C2;
        --st-action-hover: #4C8FD6;
        --st-on-action: #FFFFFF;
        --st-focus: 0 0 0 3px rgba(76, 143, 214, .45);
        --st-tip-surface: #24364F;
        --st-tip-ink: #EDF1F7;

        --st-betrieb: #4CC38A;
        --st-betrieb-surface: #17342A;
        --st-beeintraechtigt: #E8C77D;
        --st-beeintraechtigt-fill: #D9A514;
        --st-beeintraechtigt-surface: #3A2F14;
        --st-ausfall: #E57575;
        --st-ausfall-surface: #33191C;
        --st-wartung: #7FB2E8;
        --st-wartung-surface: #1B2A40;
        --st-keine: #9BAABF;
        --st-keine-fill: #35435E;
    }
}

* { box-sizing: border-box; }

html { font-family: var(--st-font); font-size: 15px; line-height: 1.5; color: var(--st-text); background: var(--st-canvas); }
body { margin: 0; }
a { color: var(--st-action); }
a:hover { color: var(--st-action-hover); }
:focus-visible { outline: none; box-shadow: var(--st-focus); border-radius: 4px; }

.seite { max-width: 880px; margin: 0 auto; padding: 24px 20px 48px; }

/* ---------------------------------------------------------------- Kopf */
.kopf { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.marke { display: flex; align-items: center; gap: 12px; }
.marke svg { width: 34px; height: 34px; flex: none; }
.kopf h1 { font-size: 21px; font-weight: 750; margin: 0; letter-spacing: -.01em; }
.sprachen { display: flex; gap: 4px; }
.sprachen a, .sprachen button {
    font: inherit; font-size: 13px; font-weight: 650; min-width: 38px; height: 32px; padding: 0 8px;
    border: 1px solid var(--st-line); border-radius: var(--st-radius-sm); background: var(--st-surface);
    color: var(--st-text-secondary); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.sprachen [aria-current="true"], .sprachen [aria-pressed="true"] { background: var(--st-action); border-color: var(--st-action); color: var(--st-on-action); }

/* ---------------------------------------------------------------- Abschnitte */
main > section, main > div > section, .karte {
    background: var(--st-surface); border: 1px solid var(--st-line); border-radius: var(--st-radius);
    padding: 18px 20px; margin-bottom: 16px;
}
main h2 { font-size: 16px; font-weight: 750; margin: 0 0 10px; }
main h3 { font-size: 15px; font-weight: 700; margin: 0; }
.leer, .hinweis { color: var(--st-text-muted); margin: 0; }
.hinweis { font-size: 13px; }

/* Gesamtaussage: eine Zeile, gross, mit Zeichen. */
.gesamt { display: flex; gap: 14px; align-items: center; }
.gesamt .zeichen { font-size: 30px; line-height: 1; }
.gesamt h2 { font-size: 19px; margin: 0; }
.gesamt .stand { margin: 2px 0 0; font-size: 13px; color: var(--st-text-muted); }
.gesamt.z-betrieb { background: var(--st-betrieb-surface); border-color: var(--st-betrieb); }
.gesamt.z-beeintraechtigt { background: var(--st-beeintraechtigt-surface); border-color: var(--st-beeintraechtigt-fill); }
.gesamt.z-ausfall { background: var(--st-ausfall-surface); border-color: var(--st-ausfall); }
.gesamt.z-wartung { background: var(--st-wartung-surface); border-color: var(--st-wartung); }

.veraltet { background: var(--st-beeintraechtigt-surface); border: 1px solid var(--st-beeintraechtigt-fill); border-radius: var(--st-radius); padding: 12px 16px; margin-bottom: 16px; }
.veraltet[hidden] { display: none; }

/* Farbe und Zeichen der Zustaende */
.z-betrieb .zeichen, .z-betrieb > .dienstkopf .zustand { color: var(--st-betrieb); }
.z-beeintraechtigt .zeichen, .z-beeintraechtigt > .dienstkopf .zustand { color: var(--st-beeintraechtigt); }
.z-ausfall .zeichen, .z-ausfall > .dienstkopf .zustand { color: var(--st-ausfall); }
.z-wartung .zeichen, .z-wartung > .dienstkopf .zustand { color: var(--st-wartung); }
.z-keine .zeichen, .z-keine > .dienstkopf .zustand { color: var(--st-keine); }

/* Wartung und Meldungen */
.wartung { border-left: 4px solid var(--st-wartung); }
.wartung h2 .zeichen { color: var(--st-wartung); margin-right: 8px; }
.wartung article + article, .meldung + .meldung { border-top: 1px solid var(--st-line); margin-top: 12px; padding-top: 12px; }
.wartung p, .meldung p { margin: 4px 0; }
.zeitraum { font-weight: 650; }
.betroffen, .kopfzeile { font-size: 13px; color: var(--st-text-secondary); }
.meldungen.aktiv { border-left: 4px solid var(--st-ausfall); }
.meldung .stufe { font-weight: 700; }
.stufe-beobachtung .stufe, .stufe-behoben .stufe { color: var(--st-betrieb); }
.stufe-untersuchung .stufe, .stufe-ursacheerkannt .stufe { color: var(--st-ausfall); }
.eintrag { margin-top: 8px; }
.eintragskopf { font-size: 13px; color: var(--st-text-secondary); }
details { margin-top: 8px; }
summary { cursor: pointer; font-size: 13px; font-weight: 650; color: var(--st-action); }
.nachbetrachtung { background: var(--st-surface-group); border-radius: var(--st-radius-sm); padding: 8px 12px; margin-top: 8px; }
.nachbetrachtung h4 { margin: 0 0 4px; font-size: 13px; }

/* ---------------------------------------------------------------- Dienstliste */
.dienstliste { list-style: none; margin: 0; padding: 0; }
.dienst { padding: 14px 0; border-top: 1px solid var(--st-line); }
.dienst:first-child { border-top: none; padding-top: 4px; }
.dienstkopf { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.zustand { font-size: 14px; font-weight: 700; white-space: nowrap; }
.zustand .zeichen { margin-right: 6px; }

/* Der 90-Tage-Streifen: ein Feld je Tag, eingefaerbt nach dem schlechtesten Zustand. */
.streifen { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(90, 1fr); gap: 2px; height: 30px; }
.tag { position: relative; border-radius: 2px; background: var(--st-keine-fill); cursor: default; }
.tag.z-betrieb { background: var(--st-betrieb); }
.tag.z-beeintraechtigt { background: var(--st-beeintraechtigt-fill); }
.tag.z-ausfall { background: var(--st-ausfall); }
.tag.z-wartung { background: var(--st-wartung); }
.tag:hover, .tag:focus-visible { transform: scaleY(1.15); }

/* Beim Beruehren oder mit der Tastatur zeigt ein Tag seine Minuten und Meldungen (§4). */
.tag:hover::after, .tag:focus-visible::after {
    content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
    background: var(--st-tip-surface); color: var(--st-tip-ink); font-size: 12px; font-weight: 600; line-height: 1.4;
    padding: 6px 10px; border-radius: 6px; width: max-content; max-width: 260px; white-space: normal; z-index: 5; pointer-events: none;
}
.tag:nth-child(-n+15):hover::after, .tag:nth-child(-n+15):focus-visible::after { left: 0; transform: none; }
.tag:nth-last-child(-n+15):hover::after, .tag:nth-last-child(-n+15):focus-visible::after { left: auto; right: 0; transform: none; }
.streifenachse { display: flex; justify-content: space-between; margin: 4px 0 0; font-size: 12px; color: var(--st-text-muted); }

/* ---------------------------------------------------------------- Ihre Anlage, Abonnement */
.anlage dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 10px 0; }
.anlage dt { color: var(--st-text-secondary); font-size: 13px; }
.anlage dd { margin: 0; font-weight: 650; }
.warnung { background: var(--st-beeintraechtigt-surface); border: 1px solid var(--st-beeintraechtigt-fill); border-radius: var(--st-radius-sm); padding: 10px 12px; margin: 8px 0; }
.fehler { background: var(--st-ausfall-surface); border: 1px solid var(--st-ausfall); border-radius: var(--st-radius-sm); padding: 10px 12px; margin: 8px 0; }
.erfolg { background: var(--st-betrieb-surface); border: 1px solid var(--st-betrieb); border-radius: var(--st-radius-sm); padding: 10px 12px; margin: 8px 0; }

.zeile { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
label { font-size: 13px; font-weight: 650; color: var(--st-text-secondary); }
input[type="text"], input[type="email"], input[type="url"], input[type="datetime-local"], select, textarea {
    font: inherit; font-size: 14px; color: var(--st-text); background: var(--st-surface);
    border: 1px solid var(--st-border-field); border-radius: 9px; height: var(--st-field-height); padding: 0 10px; min-width: 0;
}
textarea { height: auto; min-height: 64px; padding: 8px 10px; width: 100%; resize: vertical; }
input.merkmal { font-variant-numeric: tabular-nums; letter-spacing: .08em; text-transform: uppercase; width: 190px; }
input[type="email"] { width: 280px; max-width: 100%; }
.wahl { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; padding: 0; border: none; }
.wahl legend { font-size: 13px; font-weight: 650; color: var(--st-text-secondary); margin-bottom: 4px; padding: 0; }
.wahl label { font-weight: 500; color: var(--st-text); display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }

/* Schaltflaechen tragen immer ein gezeichnetes Zeichen neben dem Text. */
.knopf {
    font: inherit; font-size: 14px; font-weight: 650; height: var(--st-field-height); padding: 0 14px 0 11px;
    display: inline-flex; align-items: center; gap: 7px; border-radius: 9px; cursor: pointer;
    border: 1px solid var(--st-action); background: var(--st-action); color: var(--st-on-action);
}
.knopf:hover { background: var(--st-action-hover); border-color: var(--st-action-hover); }
.knopf.zweit { background: var(--st-surface); color: var(--st-action); border-color: var(--st-border-field); }
.knopf.zweit:hover { background: var(--st-surface-group); }
.knopf svg { width: 16px; height: 16px; flex: none; }
.knopf[disabled] { opacity: .55; cursor: not-allowed; }
.linkknopf { font: inherit; font-size: 13px; background: none; border: none; color: var(--st-action); text-decoration: underline; cursor: pointer; padding: 0; }

footer { text-align: center; font-size: 12px; color: var(--st-text-muted); margin-top: 24px; }

@media (max-width: 640px) {
    .seite { padding: 16px 12px 32px; }
    .streifen { height: 24px; gap: 1px; }
    .anlage dl { grid-template-columns: 1fr; gap: 0 0; }
    .anlage dd { margin-bottom: 6px; }
}

@media (prefers-reduced-motion: reduce) {
    .tag:hover, .tag:focus-visible { transform: none; }
}
