@view-transition {
    navigation: auto;
}

::view-transition-old(root) {
    animation: none;
}

::view-transition-new(root) {
    animation: none;
}

/* Zentrale Farbpalette. Dunkles Schema ist der Standard; das helle Schema
   überschreibt die Tokens über html[data-theme="light"] (gesetzt von
   js/theme.js aus localStorage, umgeschaltet per Sonne/Mond im Header). */
:root {
    --primary-color: #007bff;
    --bg-dark: #1a1d21;      /* Seitenhintergrund, „versenkte“ Flächen        */
    --nav-bg: #2a2e35;       /* Header, Karten, Panels                        */
    --field-bg: #1f232b;     /* Eingabefelder                                 */
    --btn-bg: #3a3e45;       /* neutrale Schaltflächen                        */
    --btn-bg-hover: #4a4e55;
    --border: #444;          /* Rahmen                                        */
    --border-hi: #6a6a6a;    /* Rahmen bei Hover/Fokus                        */
    --border-soft: rgba(255, 255, 255, 0.07);
    --hover-bg: rgba(255, 255, 255, 0.05);
    /* Karten unter dem Mauszeiger (setup.php). Ein eigener Ton statt eines
       Schleiers: --hover-bg ist durchscheinend und mischt sich mit dem
       Seitenhintergrund, nicht mit dem der Karte (--nav-bg) — die Karte würde
       beim Überfahren dunkler statt heller. */
    --card-hover: #31363e;
    --card-active: #373c45;
    --card-hover-border: rgba(255, 255, 255, 0.14);
    --text-light: #f8f9fa;   /* Haupttext                                     */
    --text-soft: #d0d5de;    /* sekundärer Text                               */
    --text-muted: #a0a0a0;   /* gedämpfter Text                               */
    --text-dim: #777;        /* Beschriftungen, Zähler                        */
    /* Vermerk „Archiviert" auf den Kacheln der Übersicht. Türkis, weil die
       Statusfarben (grün/rot/grau/violett/orange) schon belegt sind und der
       Vermerk keiner davon ist — er sagt etwas über den Bestand, nicht über
       den Zustand des Geräts. */
    --archiv-fg:   #4dd0e1;
    --archiv-bg:   rgba(77, 208, 225, 0.16);
    --archiv-line: rgba(77, 208, 225, 0.55);
    --archiv-auf:  #10262b;  /* Text auf gefülltem Grund (gepackt)            */
    --chart-grid: #464646;   /* Gitterlinien in Diagrammen                    */
    --transition: all 0.3s ease;
    color-scheme: dark;      /* native Controls/Scrollbars/Dropdowns dunkel   */
}

html[data-theme="light"] {
    --bg-dark: #eef1f5;
    --nav-bg: #ffffff;
    --field-bg: #f5f7fa;
    --btn-bg: #dfe3ea;
    --btn-bg-hover: #d0d6df;
    --border: #c9ced8;
    --border-hi: #a8b0bd;
    --border-soft: rgba(0, 0, 0, 0.08);
    --hover-bg: rgba(0, 0, 0, 0.05);
    /* Hell wird die Karte beim Überfahren dunkler, nicht heller — von
       --nav-bg (#ffffff) aus gibt es nach oben keinen Weg. */
    --card-hover: #eff2f7;
    --card-active: #e4e9f0;
    --card-hover-border: rgba(0, 0, 0, 0.14);
    --text-light: #1d2129;
    --text-soft: #333a45;
    --text-muted: #5a6270;
    --text-dim: #7b8494;
    /* Hell ein dunkleres Türkis — das helle aus dem dunklen Schema verschwände
       auf Weiß. */
    --archiv-fg:   #0e7490;
    --archiv-bg:   rgba(14, 116, 144, 0.12);
    --archiv-line: rgba(14, 116, 144, 0.45);
    --archiv-auf:  #ffffff;
    --chart-grid: #d4d8e0;
    color-scheme: light;
}

html {
    background-color: var(--bg-dark);
}

body {
    background-color: var(--bg-dark);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    color: var(--text-light);
}

/* Reserve header height while header.html loads asynchronously */
#header-placeholder { min-height: 72px; }

/* Header Layout */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* space-between allein lässt keinen Abstand übrig, sobald die Navigation
       breit genug wird: „Setup“ klebte dann am Farbschema-Umschalter. Das gap
       ist der Mindestabstand, den space-between nicht unterschreiten kann. */
    gap: 1.5rem;
    padding: 1rem 2rem;
    background-color: var(--nav-bg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    /* Navigation und Logo-Block zusammen brauchen rund 1475px. Ohne Umbruch
       wird die ganze Seite so breit — auf einem Tablet steht dann alles außer
       dem Kopfbereich nur noch im linken Ausschnitt, und der Rest (z. B. das
       Diagramm) wirkt rechts abgeschnitten. Der Logo-Block rutscht deshalb
       unter die Navigation, statt die Seite zu verbreitern. */
    flex-wrap: wrap;
}

/* Navigation */
.nav-wrapper {
    display: flex;
    align-items: center;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;      /* mehrzeilig statt breiter als der Schirm */
}

.nav-button {
    text-decoration: none;
    color: var(--text-muted);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    border: 1px solid transparent;
    white-space: nowrap;  /* umbrochen wird zwischen den Punkten, nicht in „Live Monitor“ */
}

.nav-button:hover {
    color: var(--text-light);
    background-color: var(--hover-bg);
}

.nav-button.active {
    color: white;
    background-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.4);
}

.button {
    color: var(--text-muted);
    background-color: var(--nav-bg);
    padding: 4px 40px;
    border-radius: 4px;
    margin-left: 40px;
    transition: var(--transition);
    border: 1px solid transparent;
}
.button:hover {
    color: var(--text-light);
    background-color: var(--hover-bg);
}

.force-cursor-progress, .force-cursor-progress * {
    cursor: progress !important;
}

.logo-right {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.1));
}


label {
    text-align: left;
    margin-left: 40px;
    display: inline-block;
}

input {
    font-size: 1em;
    border: 2px solid #ccc;
    border-radius: 4px;
    text-align: center;
    margin-left: 20px;
}

select {
    font-size: 1em;
    border: 2px solid #ccc;
    border-radius: 4px;
    margin-left: 20px;
    min-width: 120px;
}

.formula-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 20px 10px 5px 10px;
}

.formula-controls label {
    width: auto !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
    display: inline-block;
    min-width: 0;
}

.formula-controls input[type="checkbox"] {
    margin-left: 0 !important;
    width: 18px;
    height: 18px;
}

#codeEditor {
    height: 30vh;
    background-color: var(--field-bg);
    color: var(--text-soft);
    border: 1px solid var(--border);
    border-radius: 4px;
    margin: 10px;
    padding: 10px;
    font-family: 'Courier New', monospace;
    overflow-y: auto;
    white-space: pre;
    box-sizing: border-box;
    outline: none;
}

#codeEditor:focus {
    border-color: #007acc;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 10px 0 10px;
}

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

.live-data-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
}

#current_value {
  font-size: 2.4rem;
  font-weight: bold;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#state_date_time {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-family: monospace;
}


/* ── Zurück-Knopf ──────────────────────────────────────────────────────────────
   Der Pfeil links neben der Überschrift, der eine Seite zu ihrer Übersicht
   zurückführt (setup.php, alarmierung.php, kalibrierung.php …). Stand früher in
   setup.css; dort fand ihn nur, wer das ganze Setup-Stylesheet lud. */
.setup-back-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 22px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    text-decoration: none;
    transition: background var(--transition), border-color var(--transition);
}
.setup-back-btn:hover { background: var(--hover-bg); border-color: var(--border-hi); }

/* ── Page headings ─────────────────────────────────────────────────────────── */
h1 { padding-left: 20px; margin-bottom: 6px; }

/* ── Shared toolbar ─────────────────────────────────────────────────────────── */
.sensor-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px 14px;
    flex-wrap: wrap;
}
.filter-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.filter-btn {
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--nav-bg);
    color: var(--text-muted);
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.filter-btn.active { color: white; border-color: transparent; }
.filter-btn:hover:not(.active) { background: var(--btn-bg); color: var(--text-soft); }
.sensor-toolbar .filter-btn.active { background: #007bff; border-color: #007bff; }
#sensor-search {
    background: var(--nav-bg);
    border: 1px solid var(--border);
    color: var(--text-light);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.88rem;
    width: 240px;
}
#sensor-search:focus { outline: none; border-color: #007bff; }
.sensor-counter { margin-left: auto; font-size: 0.82rem; color: var(--text-dim); }

/* ── Calibration action buttons (shared: callist, sensor_edit) ──────────────── */
.action-btns      { display: flex; gap: 6px; flex-wrap: wrap; }
.action-link {
    display: inline-block;
    padding: 4px 12px;
    background: #007bff;
    color: white;
    border-radius: 4px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: background 0.15s;
}
.action-link:hover { background: #0069d9; }
.action-link-poly {
    display: inline-block;
    padding: 4px 12px;
    background: var(--btn-bg);
    color: #ffc080;
    border-radius: 4px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: background 0.15s;
}
.action-link-poly:hover { background: var(--btn-bg-hover); }

/* ── Table wrap ─────────────────────────────────────────────────────────────── */
.table-wrap {
    padding: 0 20px 20px;
    overflow-x: auto;
}

/* ── Sensor list table (#t01) ──────────────────────────────────────────────── */
table#t01 {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
table#t01 th {
    background: var(--nav-bg);
    padding: 8px 12px;
    text-align: center;
    color: var(--text-dim);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    white-space: nowrap;
}
table#t01 td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--nav-bg);
    white-space: nowrap;
}
table#t01 tr:hover td:not(.no-row-hl) { background: var(--nav-bg); }
table#t01 td.td-center { text-align: center; }
table#t01 td.td-right  { text-align: right; }

/* ── Shared cell styles ─────────────────────────────────────────────────────── */
.id-cell   { font-family: monospace; color: var(--text-muted); font-size: 0.82rem; }
.name-cell { font-weight: 500; }

/* ── Cal page shared elements ───────────────────────────────────────────────── */
#sensor-subtitle { margin: 0 0 10px 20px; font-size: 0.85rem; color: var(--text-dim); font-family: monospace; }
#stability-label { min-width: 60px; text-align: right; }
#status-cal      { margin-top: 8px; }

.panel { background: var(--nav-bg); border-radius: 8px; padding: 14px 16px; }
.panel h3 { margin: 0 0 10px 0; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.panel label { margin-left: 0; }

.live-box  { background: var(--bg-dark); border-radius: 6px; padding: 10px; text-align: center; }
.live-lbl  { font-size: 0.72rem; color: var(--text-dim); }
.live-val  { font-size: 1.3rem; font-weight: bold; margin: 3px 0; }
.live-unit { font-size: 0.72rem; color: var(--text-dim); }

.stability-row  { display: flex; align-items: center; gap: 10px; font-size: 0.8rem; color: var(--text-dim); }
.stability-track { flex: 1; height: 8px; background: var(--bg-dark); border-radius: 4px; overflow: hidden; }
.stability-fill  { height: 100%; width: 0%; border-radius: 4px; transition: width 0.5s, background 0.5s; background: #28a745; }

.config-row            { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.config-row:last-child { margin-bottom: 0; }
.config-label { flex: 1; font-size: 0.85rem; color: var(--text-soft); }
.config-val {
    background: var(--bg-dark); border: 1px solid var(--border); color: var(--text-light);
    padding: 4px 8px; border-radius: 4px; font-size: 0.85rem;
    min-width: 80px; text-align: right; cursor: pointer;
}
.config-val:hover { border-color: #007bff; }

.toggle        { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle input  { display: none; }
.toggle-slider { position: absolute; inset: 0; background: var(--border); border-radius: 24px; cursor: pointer; transition: background 0.2s; }
.toggle-slider::before {
    content: ''; position: absolute; width: 18px; height: 18px;
    left: 3px; top: 3px; background: white; border-radius: 50%; transition: transform 0.2s;
}
.toggle input:checked + .toggle-slider { background: #007bff; }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

.service-btn          { width: 100%; padding: 8px; border: none; border-radius: 4px; cursor: pointer; font-size: 0.88rem; color: var(--text-light); background: var(--btn-bg); transition: background 0.2s; }
.service-btn.active   { background: #e07b00; }
.service-btn:hover:not(:disabled) { filter: brightness(1.2); }
.service-btn:disabled { opacity: 0.35; cursor: default; }

.btn              { padding: 12px 8px; border: none; border-radius: 4px; cursor: pointer; font-size: 0.88rem; color: var(--text-light); background: var(--btn-bg); }
.btn:hover:not(:disabled) { filter: brightness(1.25); }
.btn:disabled     { opacity: 0.35; cursor: default; }

.wizard-panel         { display: none; flex-direction: column; gap: 12px; }
.wizard-panel.visible { display: flex; }
.step-header { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); margin-bottom: 8px; }
.step-title  { font-size: 1rem; font-weight: bold; margin-bottom: 8px; color: var(--text-soft); }
.step-body   { font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; white-space: pre-line; }
.step-nav    { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.btn-prev    { background: var(--btn-bg); }
.btn-next    { background: #28a745; }
.btn-finish  { background: #007bff; }
.result-box  { text-align: center; padding: 10px 0; }
.result-icon { font-size: 2.5rem; margin-bottom: 8px; }
.result-text { font-size: 0.9rem; color: var(--text-soft); margin-bottom: 10px; }

.status-msg  { font-size: 0.82rem; padding: 5px 8px; border-radius: 4px; display: none; }
.status-ok   { background: rgba(40,167,69,0.25);  color: #a8e6b5; display: block; }
.status-err  { background: rgba(220,53,69,0.25);  color: #f5c2c7; display: block; }
.status-run  { background: rgba(224,123,0,0.25);  color: #ffd090; display: block; }

.color-ok { background-color: #49b58f; }
.color-warn { background-color: orange; }
.color-alarm { background-color: #eb5d7d; }
.color-service { background-color: #4169e1; }

/* Statusbalken (leere erste Spalte): Gesamtbreite halbiert.
   Bei table-layout:auto bestimmt die breiteste Zelle die Spaltenbreite –
   daher muss auch der (leere) Spalten-<th> schmaler werden, sonst deckelt
   dessen Polsterung (zuvor ~29px = 5px Inhalt + 2×12px Padding) die Zelle. */
table#t01 th:first-child,
table#t01 td.color-ok,
table#t01 td.color-warn,
table#t01 td.color-alarm,
table#t01 td.color-service {
    box-sizing: border-box;
    width: 10px;
    padding-left: 0;
    padding-right: 0;
}

#pw-error-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.error-modal-content {
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    background-color: rgba(255, 40, 0, 0.9);
    min-width: 300px;
    color: white;
}

.error-hidden {
    display: none !important;
}

#errorIndicator {
    color: #ff5555; /* Ein helles Rot für den Fehlertext */
    font-weight: bold;
    margin-left: 15px;
}

#chart-container {
    position: relative;
    width: 100%;
    margin: 20px auto 0 auto;
    height: calc(100vh - 280px);   /* passt sich dem Viewport an */
    min-height: 250px;
}

/* Keine Größenangabe — und vor allem kein !important. Chart.js setzt am Canvas
   zwei Größen: die Attribute width/height (Pixelpuffer, = CSS-Größe × device-
   PixelRatio) und den Inline-Stil width/height (CSS-Größe). Schreibt das
   Stylesheet mit !important dagegen, gewinnt es gegen den Inline-Stil, und auf
   Geräten mit devicePixelRatio > 1 — jedes Tablet, jedes Handy — wird das
   Canvas so groß dargestellt wie sein Pixelpuffer: doppelte Größe, unten und
   rechts abgeschnitten, und die Zeigerposition passt nicht mehr zur Kurve.
   Die Höhe kommt vom Container (#chart-container, styles/export.css). */
#canvas,
#cluster-canvas {
    display: block;
    /* Auf einem Tablet gehören die Finger dem Diagramm: aufziehen zoomt,
       wischen verschiebt (Zoom-Plugin über Hammer.js). Ohne diese Zeile deutet
       der Browser die Geste zuerst selbst und zoomt die ganze Seite. */
    touch-action: none;
}

/* Layout for the logo wrapper to align items horizontally */
.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 1.5rem; /* Space between logout icon and logo */
    flex-wrap: wrap;
}

/* ── Schmale Schirme (Tablet quer und alles darunter) ────────────────────────
   Der Kopfbereich bricht dann ohnehin um; enger gesetzte Schaltflächen sparen
   die Höhe wieder ein, die der Umbruch kostet — sonst bliebe für das Diagramm
   darunter zu wenig Platz. */
@media (max-width: 1500px) {
    .header-container { padding: 0.7rem 1rem; gap: 0.8rem; }
    .nav-button       { padding: 8px 13px; font-size: 0.9rem; }
    .button-group     { gap: 6px; }
    .logo-wrapper     { gap: 1rem; }
}

@media (max-width: 700px) {
    .logo-right  { height: 30px; }
    .nav-button  { padding: 7px 11px; font-size: 0.86rem; }
}

/* Language selector in the header */
.lang-select {
    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
    /* Die aufgeklappte Liste rendert der Browser nativ; das color-scheme der
       :root-Palette sorgt dafür, dass sie zum aktiven Farbschema passt. */
}

.lang-select:hover,
.lang-select:focus {
    color: var(--text-light);
    border-color: var(--border-hi);
    outline: none;
}

.lang-select option {
    background-color: var(--nav-bg);
    color: var(--text-light);
}

/* Sonne/Mond-Umschalter für das Farbschema */
.theme-toggle {
    display: flex;
    align-items: center;
    padding: 6px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
    color: var(--text-light);
    border-color: var(--border-hi);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

/* Im dunklen Schema die Sonne anbieten, im hellen den Mond */
.theme-toggle .icon-moon { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun { display: none; }
html[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* Base styles for the logout link */
.logout-link {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease-in-out;
}

/* Styling the logout icon image */
.logout-icon {
    height: 24px; /* Standard size for nav icons */
    width: auto;
    display: block;
    filter: brightness(0) invert(1);
    opacity: 0.8;
    transition: opacity 0.2s ease, filter 0.2s ease;
}

/* Helles Schema: dunkles Icon statt Weiß (sonst weiß auf weiß unsichtbar) */
html[data-theme="light"] .logout-icon {
    filter: brightness(0) invert(0.25);
}

/* Hover effects */
.logout-link:hover .logout-icon {
    opacity: 1;
    filter: invert(34%) sepia(85%) saturate(1453%) hue-rotate(338deg) brightness(91%) contrast(96%);
}

.logout-link:active {
    transform: scale(0.9); /* Subtle click feedback */
}

/* ── Calibration History Modal ──────────────────────────────────────────────── */
#cal-history-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
}
#cal-history-modal.open { display: flex; }
.cal-history-content {
    background: var(--nav-bg);
    border-radius: 8px;
    padding: 20px;
    width: 680px;
    max-width: 95vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.cal-history-content h3 { margin: 0; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.cal-history-wrap { overflow-y: auto; flex: 1; min-height: 80px; }
.cal-history-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.cal-history-table th { background: var(--bg-dark); padding: 6px 10px; text-align: left; color: var(--text-dim); font-weight: 500; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; position: sticky; top: 0; white-space: nowrap; }
.cal-history-table td { padding: 6px 10px; border-bottom: 1px solid var(--bg-dark); vertical-align: top; }
.cal-history-table tr:hover td { background: var(--bg-dark); }
.hist-ok  { color: #a8e6b5; }
.hist-err { color: #f5c2c7; }
.cal-history-empty { display: none; text-align: center; padding: 20px; color: var(--text-dim); font-size: 0.85rem; }
.cal-history-empty.visible { display: block; }
.cal-history-btns { display: flex; justify-content: flex-end; }
.cal-history-btns button { padding: 8px 20px; border: none; border-radius: 4px; background: var(--btn-bg); color: var(--text-light); cursor: pointer; font-size: 0.88rem; }
.cal-history-btns button:hover { filter: brightness(1.2); }
.btn-history { background: var(--btn-bg) !important; grid-column: 1 / -1; }
.btn-restore { padding: 3px 10px; font-size: 0.78rem; background: #3a5a7a; border: none; border-radius: 4px; color: white; cursor: pointer; white-space: nowrap; }
.btn-restore:hover { filter: brightness(1.2); }


/* ── AMS Alarm-Button ────────────────────────────────────────────────────────── */
.alarm-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: rgba(232, 64, 90, 0.15);
    border: 1px solid rgba(232, 64, 90, 0.5);
    border-radius: 8px;
    color: #fb7185;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    margin-left: 10px;
    transition: background 0.2s, border-color 0.2s;
    animation: alarm-pulse 2s ease-in-out infinite;
}
.alarm-btn[hidden] { display: none; }
.alarm-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.alarm-btn:hover { background: rgba(232, 64, 90, 0.28); border-color: rgba(232, 64, 90, 0.75); }

@keyframes alarm-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(232, 64, 90, 0); }
    50%       { box-shadow: 0 0 0 5px rgba(232, 64, 90, 0.2); }
}

/* ── AMS Alarm-Seite (alarms.html) ───────────────────────────────────────────── */
.alarms-wrap {
    padding: 8px 28px 48px;
    max-width: 720px;
}

.alarm-page-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--nav-bg);
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    margin-bottom: 8px;
}

.alarm-page-row-ignored .alarm-page-text {
    color: var(--text-dim);
    text-decoration: line-through;
}

.alarm-page-text {
    flex: 1;
    font-size: 14px;
    color: var(--text-soft);
    word-break: break-word;
}

.alarm-page-btn {
    flex-shrink: 0;
    padding: 7px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}

.alarm-page-confirm {
    background: rgba(39, 201, 143, 0.12);
    border-color: rgba(39, 201, 143, 0.35);
    color: #27c98f;
}
.alarm-page-confirm:hover:not(:disabled) { background: rgba(39, 201, 143, 0.22); border-color: rgba(39, 201, 143, 0.6); }

.alarm-page-ignore {
    background: rgba(160, 160, 160, 0.08);
    border-color: rgba(160, 160, 160, 0.25);
    color: #8a939e;
}
.alarm-page-ignore:hover:not(:disabled) { background: rgba(160, 160, 160, 0.15); }
.alarm-page-btn:disabled { opacity: 0.4; cursor: default; }

.alarm-page-empty {
    font-size: 14px;
    color: var(--text-dim);
    font-style: italic;
    padding: 20px 0;
    margin: 0;
}
