/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

/* Label/tag denoting the user that shared a connection */
.jdbc-share-tag {

    background: #0095ff;
    padding: 0.25em;

    -moz-border-radius:    0.25em;
    -webkit-border-radius: 0.25em;
    -khtml-border-radius:  0.25em;
    border-radius:         0.25em;

    color: white;
    font-size: 0.75em;
    font-weight: bold;

}
.totp-enroll p,.totp-details{font-size:.8em}.totp-qr-code{text-align:center}.totp-qr-code img{margin:1em;border:1px solid rgba(0,0,0,0.25);box-shadow:1px 1px 2px rgba(0,0,0,0.25);cursor:pointer}h3.totp-details-header{font-size:.8em}h3.totp-details-header::before{content:'▸ '}.totp-details-visible h3.totp-details-header::before{content:'▾ '}.totp-details,.totp-hide-details{display:none}.totp-details-visible .totp-details{display:table}.totp-details-visible .totp-hide-details{display:inline}.totp-details-visible .totp-show-details{display:none}.totp-hide-details,.totp-show-details{color:blue;text-decoration:underline;cursor:pointer;margin:0 .25em;font-weight:normal}.totp-details{margin:0 auto}.totp-details th{padding-right:.25em;text-align:left}.totp-details td{font-family:monospace}.totp-detail{display:inline-block;margin:0 .25em}/* MSA Insight – Verbindungsanalyse */

.msa-insight.view {
    padding: 20px;
}

.msa-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.msa-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.msa-button, .msa-link {
    padding: 6px 12px;
    background: #0066cc;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
}

.msa-button:hover, .msa-link:hover {
    background: #0052a3;
}

.msa-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.msa-source {
    font-size: 13px;
    color: #666;
}

.msa-source code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
}

.msa-spacer {
    flex: 1;
}

.msa-progress {
    margin-bottom: 20px;
    padding: 12px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.msa-progress-track {
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    margin-top: 8px;
    overflow: hidden;
}

.msa-progress-bar {
    height: 100%;
    background: #0066cc;
    transition: width 0.3s ease;
}

.msa-notice {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 4px;
    border: 1px solid;
    color: #212529;
}

.msa-notice.msa-denied {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.msa-notice.msa-error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.msa-notice.msa-warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.msa-notice:not(.msa-denied):not(.msa-error):not(.msa-warning) {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #495057;
}

.msa-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
    flex-wrap: wrap;
}

.msa-tabs a {
    padding: 8px 16px;
    text-decoration: none;
    color: #333;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
}

.msa-tabs a.active {
    color: #0066cc;
    border-bottom-color: #0066cc;
    font-weight: bold;
}

.msa-tabs a:hover:not(.active) {
    background: #f4f4f4;
}

.msa-kpis {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.msa-kpi {
    flex: 1;
    min-width: 140px;
    padding: 16px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.msa-kpi-alert {
    background: #fff3cd;
    border-color: #ffc107;
}

.msa-kpi-value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.msa-kpi-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.msa-period {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.msa-chart.msa-bars {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 200px;
    padding: 16px 0;
    border-bottom: 1px solid #ddd;
    margin-bottom: 12px;
}

.msa-bar-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}

.msa-bar-stack {
    width: 100%;
    max-width: 60px;
    height: 100%;
    display: flex;
    flex-direction: column-reverse;
}

.msa-bar {
    width: 100%;
    transition: height 0.3s ease;
}

.msa-bar-sessions {
    background: #0066cc;
}

.msa-bar-hours {
    background: #00a3e0;
}

.msa-bar-label {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
    text-align: center;
}

.msa-legend {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #666;
    margin-bottom: 24px;
}

.msa-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 4px;
    vertical-align: middle;
}

.msa-heatmap {
    border-collapse: collapse;
    margin-bottom: 24px;
}

.msa-heatmap th, .msa-heatmap td {
    border: 1px solid #ddd;
    padding: 4px;
    text-align: center;
    font-size: 12px;
}

.msa-heatmap th {
    background: #f9f9f9;
}

.msa-heat-cell {
    cursor: default;
    transition: opacity 0.2s ease;
}

.msa-heat-weekend {
    background: #fafafa;
}

.msa-buckets {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
}

.msa-buckets th, .msa-buckets td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.msa-buckets th {
    width: 120px;
    color: #666;
}

.msa-bucket-track {
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
}

.msa-bucket-bar {
    height: 100%;
    background: #0066cc;
}

.msa-bucket-count {
    text-align: right;
    font-weight: bold;
}

.msa-hint {
    font-size: 13px;
    color: #666;
    font-style: italic;
    margin-bottom: 16px;
}

.msa-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.msa-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.msa-table th, .msa-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e9ecef;
    text-align: left;
    color: #212529;
}

.msa-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #212529;
    cursor: pointer;
    border-bottom: 2px solid #dee2e6;
}

.msa-table th:hover {
    background: #e9ecef;
}

.msa-table.sorted th:first-child {
    padding-left: 20px;
}

.msa-name {
    font-weight: 500;
}

.msa-number {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.msa-flag {
    color: #d9534f;
    font-weight: bold;
}

.msa-link {
    color: #0066cc;
    text-decoration: underline;
    cursor: pointer;
}

.msa-row-open {
    background: #fff8e1;
}

.msa-chip {
    display: inline-block;
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    margin-right: 4px;
    margin-bottom: 4px;
    color: #333;
    border: 1px solid #dee2e6;
}

.msa-userlist {
    font-size: 13px;
    color: #666;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msa-finding {
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.msa-severity-info {
    border-left: 4px solid #0066cc;
}

.msa-severity-warning {
    border-left: 4px solid #ffc107;
}

.msa-finding h4 {
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.msa-badge {
    display: inline-block;
    background: #0066cc;
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

.msa-finding ul {
    margin: 8px 0;
    padding-left: 20px;
}

.msa-finding li {
    margin-bottom: 4px;
    font-size: 14px;
}

/* MSA Insight Menu Item - Enterprise Design */
.msa-insight-menu-item.msa-insight {
    border-top: 1px solid #e0e0e0;
    margin-top: 4px;
    padding-top: 4px;
}

.msa-insight-menu-item.msa-insight a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.msa-insight-menu-item.msa-insight a:hover {
    background-color: #f5f7fa;
    color: #0066cc;
}

.msa-insight-menu-item.msa-insight a i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: #0066cc;
}

@media print {
    .msa-toolbar, .msa-actions, .msa-tabs, .msa-insight-menu {
        display: none !important;
    }
    .msa-insight.view {
        padding: 0;
    }
}
/* MAX Access Launcher - Startseitenkarte im CI von MAX Access (Farben wie msa-portal-branding) */
.mxl-karte {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 1.25rem;
    padding: 1rem 1.25rem;
    background: #fdfeff;
    border: 1px solid #ced8db;
    border-left: 4px solid #70c5c3;
    border-radius: 8px;
}
.mxl-karte h2 {
    margin: 0 0 .15rem;
    font: 700 1.05rem/1.3 "MSA Istok", "Segoe UI", system-ui, sans-serif;
    color: #11212c;
}
.mxl-karte .mxl-sub {
    margin: 0;
    color: #4e5d67;
    font-size: .9rem;
}
.mxl-knopf {
    flex: none;
    padding: .55rem 1rem;
    background: #003c57;
    color: #fbfdfe !important;
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none !important;
    white-space: nowrap;
}
.mxl-knopf:hover, .mxl-knopf:focus-visible { background: #195370; outline: 2px solid #70c5c3; outline-offset: 2px; }
@media (max-width: 600px) {
    .mxl-karte { flex-direction: column; align-items: stretch; }
    .mxl-knopf { text-align: center; }
}
/*! MAX Access - abgeleitet von Zer0CoolX/guacamole-customize-loginscreen-extension (GPL-3.0) */
/*
 * MAX Access - Branding fuer Apache Guacamole 1.6 (Extension msa-portal-branding)
 * Kommentare ausser dem Lizenzhinweis oben entfernt bau564.py beim Bau: /app.css ist ohne
 * Anmeldung lesbar, interne Doku steht nur in der Quelle und im CoC.
 *
 * Wird von Guacamole ueber /app.css am Kontextwurzelpfad ausgeliefert; relative URLs
 * loesen daher gegen den Kontextwurzelpfad auf (app/ext/msa-portal-branding/...).
 *
 * v7 (CoC #564, 07.11.2026): "komplettes Branding wie MAX performance, Name MAX Access".
 *   - Anmeldung 1:1 im Aufbau der MAX-performance-Anmeldung (.lg2): links die Welt
 *     (Petrol, Linienraster, CI-Doppellinie, Logo, Schaubild, Claim), rechts das Formular.
 *     Das fruehere Autohaus-Hintergrundbild entfaellt (Nutzer-Korrektur im selben Auftrag).
 *   - Oberflaeche nach der Anmeldung: Kopfleiste Petrol mit Logo + "MAX Access",
 *     Listen, Reiter, Tabellen, Schaltflaechen, Felder, Menues, Meldungen, Laden,
 *     Guacamole-Menue in der Sitzung (Strg+Alt+Umschalt).
 *   - Nur helles Schema: Guacamole liefert seine Symbole (Protokolle, Ordner, Benutzer)
 *     als dunkle SVGs; ein dunkles Schema braeuchte eigene Symbole.
 *
 * CI-Werte aus MAX performance (/opt/controlling/app/static/index.html, dort oklch):
 */
:root {
    --mxa-shell: #003c57;      /* Petrol: Kopf, Schaltflaechen */
    --mxa-shell-ink: #fbfdfe;
    --mxa-shell-mut: #afced6;
    --mxa-ci: #70c5c3;         /* Tuerkis: CI-Linie */
    --mxa-ground: #f4f7f9;
    --mxa-card: #fdfeff;
    --mxa-tool: #e9eff2;
    --mxa-ink: #11212c;
    --mxa-mut: #4e5d67;
    --mxa-line: #ced8db;
    --mxa-line2: #e3e9eb;
    --mxa-feld: #788a94;       /* Feldrand: 3,3:1 auf Grund, 3,1:1 auf Werkzeugband */
    --mxa-acc: #195370;
    --mxa-acc-t: rgba(25, 83, 112, .08);
    --mxa-acc-r: rgba(116, 197, 192, .45);
    --mxa-neg: #ba2b28;
    --mxa-r: 8px;
    --mxa-fh: "MSA Istok", "Segoe UI", system-ui, sans-serif;
    --mxa-fb: "MSA Plex", "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
}

@font-face { font-family: "MSA Istok"; src: url('app/ext/msa-portal-branding/fonts/istok-400.woff2') format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "MSA Istok"; src: url('app/ext/msa-portal-branding/fonts/istok-700.woff2') format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "MSA Plex";  src: url('app/ext/msa-portal-branding/fonts/plex-var.woff2') format("woff2"); font-weight: 100 700; font-display: swap; }

@keyframes mxa-dreh { to { transform: rotate(360deg); } }


/* ##########################################################################
   TEIL A - ANMELDUNG (Aufbau wie .login.lg2 in MAX performance)
   ##########################################################################
   Vorlage app/login/templates/login.html, ergaenzt per HTML-Patch:
     div.login-ui > p.login-error
                  + section.mxa-welt  (welt.html: Logo, Schaubild, Claim "MAX Access")
                  + .login-dialog-middle (= .lg-seite)
                       > .login-dialog > form.login-form (= .lg-karte)
                           .logo | .version | p (Hilfetext, z. B. TOTP)
                           | h2.mxa-gruss, p.mxa-hilfe (gruss.html)
                           | .login-fields | .buttons
                       > footer.mxa-fuss (fuss.html)
   Basis: div.login-ui ist display:table und absolut ueber die ganze Seite.
   Das fruehere Hintergrundbild (Autohaus-Motiv) ist auf Wunsch des Nutzers durch
   ein neues Bild im Stil von MAX performance ersetzt (images/max-access-welt.svg,
   Verbindungsnetz um den Zugangsknoten); das alte liegt in /root/hs-backup/vor_564b/.
   ?v= im Bildpfad: neuer Stand ohne Rueckgriff auf einen alten Browser-Cache. */

div.login-ui {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(400px, .88fr);
    grid-auto-rows: minmax(100%, auto);
    overflow: auto;
    background: var(--mxa-ground);
    color: var(--mxa-ink);
    font: 400 14px/1.45 var(--mxa-fb);
    -webkit-font-smoothing: antialiased;
}

div.login-ui ::selection { background: var(--mxa-acc-r); color: var(--mxa-ink); }

/* --- A1. Welt (wie .lg-welt) ------------------------------------------------------ */
.login-ui .mxa-welt {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 28px;
    box-sizing: border-box;
    min-height: 100%;
    padding: 40px 56px 44px 92px;
    overflow: hidden;
    color: var(--mxa-shell-ink);
    background-color: var(--mxa-shell);
    background-image:
        repeating-linear-gradient(to bottom, transparent 0 31px, rgba(255, 255, 255, .045) 31px 32px),
        url("app/ext/msa-portal-branding/images/max-access-welt.svg?v=76"),
        radial-gradient(90% 70% at 70% 30%, rgba(112, 197, 195, .10), transparent 70%);
    background-size: auto, cover, auto;
    background-position: 0 0, 70% 40%, 0 0;
    background-repeat: repeat, no-repeat, no-repeat;
}

/* CI-Doppellinie links und tuerkise Unterkante */
.login-ui .mxa-welt::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 56px;
    width: 5px;
    border-left: 1px solid rgba(112, 197, 195, .55);
    border-right: 1px solid rgba(112, 197, 195, .55);
}

.login-ui .mxa-welt::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background: var(--mxa-ci);
}

.login-ui .mxa-welt .mxa-logo { display: block; height: 27px; width: auto; align-self: flex-start; }

/* Schaubild (wie .lg-wf) */
.login-ui .mxa-schaubild { width: min(100%, 640px); height: auto; align-self: center; overflow: visible; }
.login-ui .mxa-schaubild .raster line { stroke: rgba(255, 255, 255, .07); stroke-width: 1; }
.login-ui .mxa-schaubild .verb path {
    fill: none;
    stroke: rgba(112, 197, 195, .55);
    stroke-width: 1;
    stroke-dasharray: 3 4;
    opacity: 0;
    animation: mxa-ein .5s ease-out .95s forwards;
}
.login-ui .mxa-schaubild rect {
    transform-box: fill-box;
    transform-origin: 50% 100%;
    animation: mxa-wachs .9s cubic-bezier(.16, 1, .3, 1) both;
    animation-delay: calc(var(--i) * 85ms + 120ms);
}
.login-ui .mxa-schaubild rect.s { fill: rgba(255, 255, 255, .16); }
.login-ui .mxa-schaubild rect.m { fill: rgba(255, 255, 255, .05); stroke: rgba(255, 255, 255, .42); stroke-width: 1; stroke-dasharray: 4 3; }
.login-ui .mxa-schaubild rect.p { fill: rgba(112, 197, 195, .55); }
.login-ui .mxa-schaubild rect.e { fill: var(--mxa-ci); filter: drop-shadow(0 6px 14px rgba(112, 197, 195, .35)); }
.login-ui .mxa-schaubild .glyphen line,
.login-ui .mxa-schaubild .glyphen path { fill: none; stroke: rgba(255, 255, 255, .55); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.login-ui .mxa-schaubild .glyphen circle { fill: rgba(255, 255, 255, .45); }
.login-ui .mxa-schaubild .glyphen,
.login-ui .mxa-schaubild .txt { opacity: 0; animation: mxa-ein .5s ease-out .8s forwards; }
.login-ui .mxa-schaubild text { fill: var(--mxa-shell-mut); font: 500 11.5px/1 var(--mxa-fh); text-anchor: middle; letter-spacing: .02em; }
.login-ui .mxa-schaubild text.ee { fill: var(--mxa-ci); font-weight: 700; }
.login-ui .mxa-schaubild text.mx { fill: var(--mxa-shell); font: 700 21px/1 var(--mxa-fh); letter-spacing: -.01em; }
.login-ui .mxa-schaubild text.ziel { fill: var(--mxa-shell-ink); font-size: 12px; letter-spacing: 0; text-anchor: start; }

@keyframes mxa-wachs { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes mxa-ein { to { opacity: 1; } }

/* Claim (wie .lg-claim) */
.login-ui .mxa-claim h1 {
    margin: 0;
    padding: 0;
    color: var(--mxa-shell-ink);
    font: 700 clamp(46px, 5.6vw, 84px)/.95 var(--mxa-fh);
    letter-spacing: -.02em;
    text-align: left;
    text-wrap: balance;
}

.login-ui .mxa-claim p {
    margin: 14px 0 0;
    max-width: 44ch;
    color: var(--mxa-shell-mut);
    font-size: 15px;
    line-height: 1.55;
}

/* --- A2. Seite (wie .lg-seite) ---------------------------------------------------- */
.login-ui .login-dialog-middle {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    box-sizing: border-box;
    width: auto;
    min-width: 0;
    min-height: 100%;
    padding: 40px 28px 24px;
    text-align: left;
}

/* Karte (wie .lg-karte): kein Kasten, nur Spalte */
.login-ui .login-dialog,
.login-ui.continuation .login-dialog {
    display: block;
    box-sizing: border-box;
    width: min(380px, 100%);
    max-width: none;
    margin: auto 0;
    padding: 0;
    overflow: visible;
    background: none;
    color: var(--mxa-ink);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    font: 400 14px/1.45 var(--mxa-fb);
}

/* Folgedialoge (TOTP-Einrichtung mit QR-Code) duerfen breiter sein. */
.login-ui.continuation .login-dialog { width: min(440px, 100%); }

.login-ui .login-dialog .login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Guacamole-Logo, Produktname und Versionsplakette der Basis entfallen: Der Name
   steht als Claim in der Welt, eine Versionsangabe hat MAX performance nicht. */
.login-ui .login-dialog .logo,
.login-ui .login-dialog .version { display: none; }

/* --- A3. Gruss, Hinweise (wie .lg-karte h2, .lg-hilfe, .lg-gruppe) --------------- */
.login-ui .login-dialog .mxa-gruss {
    margin: 0;
    padding: 0;
    color: var(--mxa-ink);
    font: 700 28px/1.15 var(--mxa-fh);
    letter-spacing: -.01em;
    text-align: left;
    text-transform: none;
}

.login-ui .login-dialog .mxa-hilfe {
    margin: -8px 0 6px;
    color: var(--mxa-mut);
    font-size: 14px;
    line-height: 1.5;
}

/* Im Folgeschritt (TOTP) fragt Guacamole nur den Code ab - der Windows-Hinweis
   passt dort nicht; der Gruss bleibt als Ueberschrift. */
.login-ui.continuation .login-dialog .mxa-hilfe { display: none; }

/* Hilfetext der Basis (z. B. TOTP) */
.login-ui .login-dialog .login-form > p.ng-binding {
    margin: 0;
    color: var(--mxa-mut);
    font-size: 14px;
    line-height: 1.5;
}

.login-ui .login-dialog h1 { color: var(--mxa-ink); }
.login-ui .login-dialog th { text-shadow: none; color: var(--mxa-ink); }
.login-ui .login-dialog a { color: var(--mxa-acc); text-underline-offset: 2px; }
.login-ui .login-dialog a:hover { color: var(--mxa-shell); }

/* --- A4. Felder: Beschriftung ueber dem Feld (wie .lg-feld) ----------------------
   Guacamole legt die Beschriftung per z-index:-1 hinter das Feld (Platzhalter).
   In MAX performance steht sie darueber - hier statisch und immer sichtbar. */
.login-ui .login-dialog .login-fields { padding: 0; }

.login-ui .login-fields .labeled-field { margin: 0 0 16px; }
.login-ui .login-fields .labeled-field:last-child { margin-bottom: 0; }

.login-ui .login-fields .labeled-field .field-header {
    position: static;
    z-index: auto;
    margin: 0 0 6px;
    opacity: 1;
    color: var(--mxa-ink);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.3;
}

.login-ui .login-dialog .login-fields input,
.login-ui .login-fields .labeled-field.empty input,
.login-ui .login-fields .labeled-field input:focus {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    height: 46px;
    margin: 0;
    padding: 0 14px;
    background: var(--mxa-card);
    color: var(--mxa-ink);
    border: 1px solid var(--mxa-feld);
    border-radius: var(--mxa-r);
    font: 400 15.5px/1 var(--mxa-fb);
    caret-color: var(--mxa-acc);
    transition: border-color .15s, box-shadow .15s;
}

.login-ui .login-dialog .login-fields input:hover { border-color: var(--mxa-mut); }

.login-ui .login-fields .labeled-field input:focus {
    outline: none;
    border-color: var(--mxa-shell);
    box-shadow: 0 0 0 1px var(--mxa-shell), 0 0 0 5px var(--mxa-acc-r);
}

.login-ui .login-dialog .login-fields input::placeholder { color: var(--mxa-mut); opacity: .8; }
.login-ui .login-dialog .login-fields input:disabled { opacity: .6; cursor: progress; }

/* Automatisch ausgefuellte Felder: Browser faerben sonst gelb/blau ein. */
.login-ui .login-dialog .login-fields input:-webkit-autofill,
.login-ui .login-dialog .login-fields input:-webkit-autofill:hover,
.login-ui .login-dialog .login-fields input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--mxa-ink);
    -webkit-box-shadow: 0 0 0 1000px var(--mxa-card) inset;
    caret-color: var(--mxa-acc);
    transition: background-color 9999s ease-in-out 0s;
}

/* --- A5. Schaltflaeche (wie .lg-karte button[type=submit]) ------------------------
   Die CI-Linie waechst in MAX performance per ::after; ein <input> hat keine
   Pseudo-Elemente, deshalb hier als innerer Schatten an der Unterkante. */
.login-ui .login-dialog .buttons { margin: 2px 0 0; padding: 0; text-align: left; }

.login-ui .login-dialog .buttons input[type=submit],
.login-ui.continuation .login-dialog .buttons input[type=submit] {
    width: 100%;
    height: 48px;
    margin: 0;
    padding: 0 16px;
    background: var(--mxa-shell);
    color: var(--mxa-shell-ink);
    border: 0;
    border-radius: var(--mxa-r);
    text-shadow: none;
    font: 700 15.5px/1 var(--mxa-fh);
    letter-spacing: .01em;
    cursor: pointer;
    box-shadow: inset 0 0 0 var(--mxa-ci), 0 8px 20px -10px rgba(2, 30, 45, .55);
    transition: transform .18s cubic-bezier(.16, 1, .3, 1), box-shadow .25s cubic-bezier(.16, 1, .3, 1);
}

.login-ui .login-dialog .buttons input[type=submit]:hover {
    transform: translateY(-1px);
    box-shadow: inset 0 -3px 0 var(--mxa-ci), 0 12px 24px -12px rgba(2, 30, 45, .6);
}

.login-ui .login-dialog .buttons input[type=submit]:focus { outline: none; }
.login-ui .login-dialog .buttons input[type=submit]:focus-visible {
    box-shadow: inset 0 -3px 0 var(--mxa-ci), 0 0 0 3px var(--mxa-ground), 0 0 0 5px var(--mxa-acc);
}

.login-ui .login-dialog .buttons input[type=submit]:active { transform: none; }
.login-ui .login-dialog .buttons input[type=submit]:disabled { cursor: progress; transform: none; opacity: .65; }

/* --- A6. Fusszeile (wie .lg-fuss2) ------------------------------------------------ */
.login-ui .mxa-fuss {
    flex: none;
    color: var(--mxa-mut);
    font-size: 11.5px;
    line-height: 1.5;
    text-align: center;
}

.login-ui .mxa-fuss b { color: var(--mxa-ink); font-weight: 600; }

/* --- A7. Fehlermeldung (wie .lg-fehler) --------------------------------------------
   Basis: fest oben ueber die ganze Breite. Hier oben in der Seitenspalte, in
   Kartenbreite; die Zelle teilt sie sich mit .login-dialog-middle. */
.login-ui.error p.login-error {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    justify-self: center;
    position: relative;
    z-index: 2;
    left: auto;
    right: auto;
    top: auto;
    box-sizing: border-box;
    width: min(380px, calc(100% - 56px));
    margin: 40px 0 0;
    padding: 9px 12px;
    background: #f7e9e8;
    color: var(--mxa-neg);
    border: 0;
    border-radius: var(--mxa-r);
    box-shadow: none;
    font: 500 13.5px/1.45 var(--mxa-fb);
    text-align: left;
}

/* --- A8. TOTP-Abfrage und -Einrichtung ---------------------------------------------
   Die TOTP-Extension wird vor dieser Extension geladen; die folgenden Regeln
   ueberschreiben deren Vorgaben (u. a. color:blue). */
.login-ui .totp-hide-details,
.login-ui .totp-show-details { color: var(--mxa-acc); }

.login-ui .totp-qr-code img {
    background: #fff;
    padding: .6em;
    border: 1px solid var(--mxa-line);
    border-radius: var(--mxa-r);
}

.login-ui .totp-details td { color: var(--mxa-ink); }

/* --- A9. Schmale Fenster (wie MAX performance <= 900 px) ---------------------------
   Eine Spalte: oben die Welt als schmales Band (Logo, Claim, Schaubild nur bei
   genug Hoehe), darunter das Formular.
   Fehler bis v7 (Knopf mobil nicht sichtbar): Die Basis legt
   div.login-ui absolut auf genau Fensterhoehe; die Formularzeile (1fr, min-height 0)
   schrumpfte auf den Rest, der Inhalt ragte unten hinaus, ohne scrollbar zu sein
   (360x640: Knopf endete bei 657 px). Jetzt waechst die Seite mit dem Inhalt
   (min-height 100dvh statt fester Hoehe) und das Dokument scrollt - so bleibt
   der Knopf auch bei offener Bildschirmtastatur erreichbar. */
@media (max-width: 900px) {
    div.login-ui {
        position: relative;
        inset: auto;
        width: auto;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: visible;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto 1fr;
        grid-auto-rows: auto;
    }
    .login-ui .mxa-welt { grid-column: 1; grid-row: 1; min-height: 0; padding: 16px 16px 16px 36px; gap: 10px; }
    .login-ui .mxa-welt::before { left: 18px; width: 4px; }
    .login-ui .mxa-welt .mxa-logo { height: 22px; }
    .login-ui .mxa-schaubild { width: 100%; max-height: 96px; }
    .login-ui .mxa-schaubild text { display: none; }
    .login-ui .mxa-claim h1 { font-size: 34px; }
    .login-ui .mxa-claim p { display: none; }
    .login-ui .login-dialog-middle { grid-column: 1; grid-row: 3; }
    .login-ui.error p.login-error { grid-column: 1; grid-row: 2; justify-self: stretch; }
    .login-ui .login-dialog-middle { justify-content: flex-start; min-height: auto; padding: 20px 16px 18px; }
    .login-ui .login-dialog { margin: 0; }
    .login-ui .login-dialog .login-form { gap: 14px; }
    .login-ui .login-dialog .mxa-gruss { font-size: 24px; }
    .login-ui .login-dialog .mxa-hilfe { margin: -6px 0 2px; font-size: 13.5px; }
    .login-ui .login-fields .labeled-field { margin-bottom: 12px; }
    .login-ui.error p.login-error { width: auto; margin: 16px 16px 0; }
}

/* Sehr niedrige Fenster (Querformat, Bildschirmtastatur): Schaubild weglassen,
   damit „Anmelden“ sichtbar bleibt; das Hintergrundbild der Welt bleibt stehen.
   (v7.1 blendete es schon ab 760 px aus - auf echten Handys mit Browserleiste
   verschwand es damit ganz.) */
@media (max-width: 900px) and (max-height: 520px) {
    .login-ui .mxa-schaubild { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .login-ui .login-dialog .buttons input[type=submit],
    .login-ui .login-dialog .login-fields input { transition: none; }
    .login-ui .login-dialog .buttons input[type=submit]:hover { transform: none; }
    div.login-ui, .login-ui.error .login-dialog { animation: none; }
    .login-ui .mxa-schaubild rect, .login-ui .mxa-schaubild .verb path,
    .login-ui .mxa-schaubild .glyphen, .login-ui .mxa-schaubild .txt { animation: none; opacity: 1; }
}


/* ##########################################################################
   TEIL B - OBERFLAECHE NACH DER ANMELDUNG
   ##########################################################################
   Ansichten (body-Klasse): home, settings, manage, client, secondaryMonitor.
   Alle Seiten ausser der Sitzung (client) liegen in #content. */

body {
    font-family: var(--mxa-fb);
    color: var(--mxa-ink);
    -webkit-font-smoothing: antialiased;
}

body:not(.client):not(.secondaryMonitor) {
    background: var(--mxa-ground);
    font-size: 14px;
    line-height: 1.45;
}

::selection { background: var(--mxa-acc-r); color: var(--mxa-ink); }

a { color: var(--mxa-acc); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible { outline: 2px solid var(--mxa-acc); outline-offset: 2px; }

input[type=checkbox],
input[type=radio] { accent-color: var(--mxa-acc); }

/* --- B1. Kopfleiste wie .top in MAX performance ----------------------------------
   Petrol, Logo der Firmengruppe, Trennstrich, "MAX Access", tuerkise Unterkante.
   Als ::before von #content, damit sie ohne Eingriff in die Vorlagen auf jeder
   Seite steht (Startseite, Einstellungen, Verwaltung, MSA Insight). */
body:not(.client):not(.secondaryMonitor) #content { position: relative; }

body:not(.client):not(.secondaryMonitor) #content::before {
    content: "MAX Access";
    display: block;
    box-sizing: border-box;
    height: 62px;
    padding: 0 24px 0 239px;
    background:
        url('app/ext/msa-portal-branding/images/msf-logo-hell.svg') no-repeat 24px center / auto 27px,
        linear-gradient(rgba(255, 255, 255, .22), rgba(255, 255, 255, .22)) no-repeat 216px center / 1px 30px,
        var(--mxa-shell);
    border-bottom: 4px solid var(--mxa-ci);
    color: var(--mxa-shell-ink);
    font: 700 17.5px/58px var(--mxa-fh);
    letter-spacing: .005em;
    white-space: nowrap;
}

/* Benutzermenue in die Kopfleiste (oben rechts). Auf der Startseite gibt es zwei
   Kopfzeilen mit Benutzermenue; die Basis blendet das zweite aus, sobald das erste
   sichtbar ist - es liegt also immer nur eines in der Kopfleiste. */
body:not(.client):not(.secondaryMonitor) #content .header .user-menu {
    position: absolute;
    top: 0;
    right: 12px;
    height: 58px;
    z-index: 5;
}

/* --- B2. Benutzermenue (Kopfleiste und Sitzungsmenue) ------------------------------ */
body:not(.client) #content .header .user-menu .menu-dropdown,
#guac-menu .header .menu-dropdown {
    height: 100%;
    color: var(--mxa-shell-ink);
    border: 0;
    border-radius: 0;
}

body:not(.client) #content .header .user-menu .menu-dropdown:hover,
#guac-menu .header .menu-dropdown:hover { background: rgba(255, 255, 255, .08); }

body:not(.client) #content .header .user-menu .menu-dropdown.open,
#guac-menu .header .menu-dropdown.open { background: rgba(255, 255, 255, .14); }

/* display:block statt flex, damit lange Namen per Auslassung (...) gekuerzt werden */
.user-menu .menu-dropdown .menu-title {
    display: block;
    padding: 0 34px 0 34px;
    font: 600 13.5px/58px var(--mxa-fb);
    background-position: 12px center;
    background-size: 16px;
}

body:not(.client) #content .header .user-menu .menu-dropdown .menu-title,
#guac-menu .header .user-menu .menu-dropdown .menu-title {
    color: var(--mxa-shell-ink);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23fbfdfe' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='10' cy='7' r='3.3'/%3E%3Cpath d='M3.6 17c.9-3.2 3.4-5 6.4-5s5.5 1.8 6.4 5'/%3E%3C/svg%3E");
}

body:not(.client) #content .header .user-menu .menu-dropdown .menu-indicator,
#guac-menu .header .menu-dropdown .menu-indicator {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5' fill='none' stroke='%23afced6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 11px;
}

/* Aufklappliste */
.menu-dropdown .menu-contents {
    margin-top: 0;
    padding: 6px;
    background: var(--mxa-card);
    color: var(--mxa-ink);
    border: 1px solid var(--mxa-line);
    border-radius: 0 0 10px 10px;
    box-shadow: 0 18px 40px -18px rgba(2, 18, 28, .45);
    font: 400 13.5px/1.4 var(--mxa-fb);
}

.menu-dropdown .menu-contents li a {
    color: var(--mxa-ink);
    border-radius: 6px;
    padding: 9px 12px;
}

.user-menu .menu-dropdown .menu-contents li a { padding-left: 36px; background-position: 12px center; }

.menu-dropdown .menu-contents li a:hover { background-color: var(--mxa-acc-t); color: var(--mxa-acc); }
.menu-dropdown .menu-contents li a.current,
.menu-dropdown .menu-contents li a.current:hover { opacity: .4; background-color: transparent; color: var(--mxa-ink); }
.menu-dropdown .menu-contents li a.danger { background-color: var(--mxa-neg); color: #fff; }
.menu-dropdown .menu-contents li a.danger:hover { background-color: #9f2421; color: #fff; }

.user-menu .menu-dropdown .menu-contents .profile {
    margin: 8px 10px 6px;
    padding: 0 0 12px;
    border-bottom: 1px solid var(--mxa-line2);
}

.user-menu .menu-dropdown .menu-contents .profile .full-name { font: 700 15px/1.3 var(--mxa-fh); }
.user-menu .menu-dropdown .menu-contents .profile .full-name a { color: var(--mxa-ink); text-decoration: none; }
.user-menu .menu-dropdown .menu-contents .profile .organization,
.user-menu .menu-dropdown .menu-contents .profile .organizational-role { color: var(--mxa-mut); font-size: 12.5px; }

/* --- B3. Abschnittskoepfe (.header) wie .bar in MAX performance -------------------- */
.header {
    min-height: 48px;
    align-items: center;
    background: var(--mxa-tool);
    border-top: 0;
    border-bottom: 1px solid var(--mxa-line);
    box-shadow: none;
}

.header:not(.ng-hide) ~ * .header,
.header:not(.ng-hide) ~ .header { border-top: 1px solid var(--mxa-line); }

.header h2 {
    margin: 0;
    padding: 12px 24px;
    color: var(--mxa-ink);
    font: 700 14px/1.2 var(--mxa-fh);
    letter-spacing: .045em;
    text-transform: uppercase;
}

.header .filter { padding: 7px 24px 7px 0; }

/* Einstellungen > Einstellungen nutzt h2.header als Abschnittskopf */
h2.header {
    display: block;
    min-height: 0;
    margin: 0;
    padding: 12px 24px;
    color: var(--mxa-ink);
    font: 700 14px/1.2 var(--mxa-fh);
    letter-spacing: .045em;
    text-transform: uppercase;
}

/* --- B4. Felder und Auswahllisten -------------------------------------------------- */
div.location,
input[type=email],
input[type=number],
input[type=password],
input[type=text],
input[type=search],
input[type=date],
input[type=time],
textarea,
select {
    box-sizing: border-box;
    padding: 6px 10px;
    background-color: var(--mxa-card);
    color: var(--mxa-ink);
    border: 1px solid var(--mxa-feld);
    border-radius: 6px;
    font-family: var(--mxa-fb);
    font-size: 13.5px;
    line-height: 1.35;
    transition: border-color .15s, box-shadow .15s;
}

select { min-height: 32px; }

div.location:hover,
input[type=email]:hover, input[type=number]:hover, input[type=password]:hover,
input[type=text]:hover, input[type=search]:hover, textarea:hover, select:hover {
    border-color: var(--mxa-mut);
}

input[type=email]:focus, input[type=number]:focus, input[type=password]:focus,
input[type=text]:focus, input[type=search]:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--mxa-shell);
    box-shadow: 0 0 0 1px var(--mxa-shell), 0 0 0 5px var(--mxa-acc-r);
}

input::placeholder,
textarea::placeholder { color: var(--mxa-mut); opacity: 1; }

/* Suchfeld (Basis: Lupe als Hintergrund, randlos im Kopf) */
.filter .search-string {
    padding: 7px 10px 7px 34px;
    background-size: 16px;
    background-position: 11px center;
}

.header .filter input,
.header .filter .search-string {
    min-width: 220px;
    border: 1px solid var(--mxa-feld);
    border-radius: 6px;
    background-color: var(--mxa-card);
}

/* --- B5. Schaltflaechen: Petrol wie die Anmeldung, CI-Kante bei Hover --------------
   Gilt fuer alle Guacamole-Schaltflaechen (Speichern, Neu, Erneut verbinden ...).
   Die weissen Guacamole-Symbole (::before) bleiben auf Petrol gut lesbar. */
a.button,
button,
input[type=submit] {
    min-height: 34px;
    padding: 0 14px;
    background-color: var(--mxa-shell);
    color: var(--mxa-shell-ink);
    border: 1px solid var(--mxa-shell);
    border-radius: 6px;
    text-shadow: none;
    box-shadow: inset 0 0 0 var(--mxa-ci);
    font: 600 13.5px/32px var(--mxa-fb);
    letter-spacing: .005em;
    cursor: pointer;
    transition: box-shadow .2s cubic-bezier(.16, 1, .3, 1), background-color .15s;
}

a.button:hover,
button:hover,
input[type=submit]:hover {
    background-color: var(--mxa-shell);
    box-shadow: inset 0 -3px 0 var(--mxa-ci);
}

a.button:active,
button:active,
input[type=submit]:active {
    background-color: #00324a;
    box-shadow: inset 0 -3px 0 var(--mxa-ci);
}

button:disabled,
button.danger:disabled,
input[type=submit]:disabled {
    background-color: var(--mxa-shell);
    color: rgba(251, 253, 254, .6);
    box-shadow: none;
    opacity: .5;
    cursor: not-allowed;
}

a.button.danger,
button.danger { background: var(--mxa-neg); border-color: var(--mxa-neg); }
a.button.danger:hover,
button.danger:hover { background: #a42623; box-shadow: inset 0 -3px 0 rgba(255, 255, 255, .45); }
a.button.danger:active,
button.danger:active { background: #8f211f; }

/* --- B6. Startseite: Verbindungen ------------------------------------------------- */
div.all-connections,
div.recent-connections,
div.clipboardDiv,
div.settings { margin: 18px 24px; }

.home-view div.all-connections {
    padding: 6px;
    background: var(--mxa-card);
    border: 1px solid var(--mxa-line);
    border-radius: var(--mxa-r);
}

.list-item .caption {
    padding: 7px 10px;
    border-radius: 6px;
}

.list-item .name { color: var(--mxa-ink); }
.list-item .usage { color: var(--mxa-mut); }
.list-item.selected { background: var(--mxa-acc-t); }
.list-item:not(.selected) .caption:hover { background: var(--mxa-acc-t); }
.list-item:not(.selected) .caption:hover .name { color: var(--mxa-acc); }

.home-view a.home-connection,
.home-view a.home-connection-group { color: var(--mxa-ink); text-decoration: none; }

.caption .activeUserCount { color: var(--mxa-mut); }

.expandable.expanded > .children > .list-item::before { border-left-color: var(--mxa-line); }
.expandable.expanded > .children > .list-item::after { border-bottom-color: var(--mxa-line); }

/* Zuletzt verwendet: Vorschaubilder als Karten */
.recent-connections .connection {
    margin: 0 12px 12px 0;
    background: var(--mxa-card);
    border: 1px solid var(--mxa-line);
    border-radius: var(--mxa-r);
    transition: border-color .15s, box-shadow .15s;
}

.recent-connections .connection:hover {
    background: var(--mxa-card);
    border-color: var(--mxa-acc);
    box-shadow: 0 10px 24px -14px rgba(2, 30, 45, .5);
}

.recent-connections .connection a { color: var(--mxa-ink); text-decoration: none; }

.recent-connections .connection .thumbnail > * {
    border: 1px solid var(--mxa-line);
    border-radius: 4px;
    box-shadow: none;
}

.recent-connections .connection .caption .name { font-weight: 600; }
.recent-connections .placeholder { color: var(--mxa-mut); }

/* Seitenwechsel */
.pager .set-page { padding: 3px 8px; border-radius: 6px; color: var(--mxa-acc); }

.pager .set-page.current {
    background: var(--mxa-shell);
    color: var(--mxa-shell-ink);
    border-color: var(--mxa-shell);
    border-radius: 6px;
}

/* --- B7. Reiter (Einstellungen, Verwaltung) wie .tabs in MAX performance ---------- */
.page-tabs .page-list ul,
.section-tabs ul {
    padding: 0 14px;
    background: var(--mxa-card);
    border-bottom: 1px solid var(--mxa-line);
}

.page-tabs .page-list ul + ul,
.section-tabs ul + ul { background: var(--mxa-ground); }

.page-tabs .page-list li a[href],
.section-tabs li a {
    margin: 0 4px -1px;
    padding: 13px 10px 10px;
    color: var(--mxa-mut);
    border-bottom: 3px solid transparent;
    font: 400 13.5px/1 var(--mxa-fh);
    letter-spacing: .045em;
    text-transform: uppercase;
}

.page-tabs .page-list li a[href]:visited { color: var(--mxa-mut); }

.page-tabs .page-list li a[href]:hover,
.section-tabs li a:hover {
    background: none;
    color: var(--mxa-ink);
}

.page-tabs .page-list li a[href].current,
.page-tabs .page-list li a[href].current:hover,
.section-tabs li a.current,
.section-tabs li a.current:hover {
    background: none;
    color: var(--mxa-ink);
    border-bottom-color: var(--mxa-ci);
    font-weight: 700;
}

/* --- B8. Tabellen wie in MAX performance ------------------------------------------- */
table.sorted,
.settings table.session-list,
.settings table.history-list {
    border-collapse: separate;
    border-spacing: 0;
    background: var(--mxa-card);
    border: 1px solid var(--mxa-line);
    border-radius: var(--mxa-r);
    overflow: hidden;
}

table.sorted th,
table.sorted td { border: 0; padding: 8px 12px; }

table.sorted th {
    background: var(--mxa-card);
    color: var(--mxa-mut);
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    border-bottom: 1px solid var(--mxa-line);
}

table.sorted th.sort-primary { color: var(--mxa-ink); font-weight: 700; }
table.sorted td { border-bottom: 1px solid var(--mxa-line2); font-variant-numeric: tabular-nums; }
table.sorted tr:last-child td { border-bottom: 0; }
table.sorted tbody tr:hover td,
.settings table.session-list tr.session:hover { background: var(--mxa-acc-t); }

.settings table.properties th,
.manage table.properties th { color: var(--mxa-mut); font-weight: 500; }

.settings .action-buttons,
.manage .action-buttons { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

.settings .toolbar .action-buttons { justify-content: flex-start; }

.manage-user .notice.read-only,
.manage-user-group .notice.read-only {
    background: #fbf3df;
    border: 1px solid #ecd9a6;
    color: #6b4f12;
    border-radius: var(--mxa-r);
}

/* Ueberschriften in Einstellungen/Verwaltung */
.settings h2, .manage h2,
.settings h3, .manage h3 { font-family: var(--mxa-fh); color: var(--mxa-ink); }

.settings > p, .settings p { color: var(--mxa-mut); }

/* --- B9. Meldungen und Dialoge ----------------------------------------------------- */
.notification {
    overflow: hidden;
    background: var(--mxa-card);
    color: var(--mxa-ink);
    border: 1px solid var(--mxa-line);
    border-radius: 10px;
    box-shadow: 0 24px 60px -20px rgba(2, 18, 28, .45);
    font-family: var(--mxa-fb);
}

.notification.error { background: var(--mxa-card); }

.notification .title-bar {
    margin: 0 0 4px;
    padding: 14px 18px 12px;
    background: var(--mxa-shell);
    color: var(--mxa-shell-ink);
    border-bottom: 4px solid var(--mxa-ci);
    box-shadow: none;
    font: 700 16px/1.25 var(--mxa-fh);
    letter-spacing: .005em;
    text-transform: none;
}

.notification.error .title-bar { background: var(--mxa-neg); border-bottom-color: rgba(255, 255, 255, .4); }

.notification .body { margin: 14px 18px; }
.notification .buttons { margin: 0 18px 16px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

.notification .progress {
    overflow: hidden;
    background: var(--mxa-line2);
    border-radius: 6px;
}

.notification .progress .bar { background: var(--mxa-ci); box-shadow: none; }

.global-status-modal guac-modal { background: rgba(0, 33, 50, .55); }

.logged-out-modal guac-modal,
.automatic-login-rejected-modal guac-modal,
.fatal-page-error-modal guac-modal { background: var(--mxa-ground); }

.logged-out-modal .notification,
.automatic-login-rejected-modal .notification { padding: 22px 24px; text-align: left; }

.logged-out-modal .notification p,
.automatic-login-rejected-modal .notification p { margin: 0 0 14px; }

.fatal-page-error {
    background: var(--mxa-card);
    border: 1px solid var(--mxa-line);
    border-top: 4px solid var(--mxa-neg);
    border-radius: 10px;
    padding: 20px 24px;
    box-shadow: 0 24px 60px -20px rgba(2, 18, 28, .35);
}

.fatal-page-error h1 {
    padding: 0 0 8px;
    color: var(--mxa-neg);
    font: 700 20px/1.25 var(--mxa-fh);
    text-align: left;
    text-transform: none;
}

/* --- B9b. Status in der Sitzung: Verbindungsstrecke (v7.8, Stand v7.9) ------------------------
   Statt eines Balkens quer ueber den Bildschirm eine Karte mit der Strecke
   Ihr Browser - MAX Access - Zielrechner (html/verbindung.html). Der Zustand
   (.mxa-verb--<connectionState>) zeigt, welcher Abschnitt gerade aufgebaut wird
   (laufender Impuls) und wo eine Verbindung gerissen ist (Bruchstelle):
     connecting   Browser -> MAX Access aktiv
     waiting      MAX Access -> Zielrechner aktiv
     tunnel_error Stoerung Browser - MAX Access (Netz/Browser)
     abgewiesen   MAX Access erreicht, Zugriff abgewiesen (Rechte/Sitzung) - kein Bruch
     client_error Bruch MAX Access - Zielrechner (Zielrechner/Remote-Desktop)
     disconnected Sitzung beendet, Strecke ruhig
     eingabe      Zielrechner verlangt Angaben (Kennwort o. ae.)
   Die Guacamole-Meldung (form.notification) bildet den unteren Teil derselben Karte. */
.client-status-modal {
    background:
        repeating-linear-gradient(0deg, rgba(175, 206, 214, .05) 0 1px, transparent 1px 56px),
        rgba(0, 24, 36, .74);
    -webkit-backdrop-filter: blur(9px) saturate(.55);
    backdrop-filter: blur(9px) saturate(.55);
}

.client-status-modal guac-modal {
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    box-sizing: border-box;
    overflow-y: auto;
}

.client-status-modal .modal-contents {
    width: min(540px, 100%);
    margin: auto;
    overflow: hidden;
    text-align: left;
    background: var(--mxa-card);
    border-radius: 14px;
    box-shadow: 0 34px 80px -28px rgba(0, 8, 14, .75), 0 2px 8px rgba(0, 8, 14, .22);
    animation: mxa-karte .5s cubic-bezier(.16, 1, .3, 1);
}

@keyframes mxa-karte {
    from { transform: translateY(10px) scale(.985); opacity: .35; }
}

/* Strecke (Petrol-Band mit Linienraster wie die Anmeldung) */
.mxa-strecke {
    display: grid;
    grid-template-columns: auto minmax(28px, 1fr) auto minmax(28px, 1fr) auto;
    align-items: start;
    padding: 30px 30px 22px;
    background:
        repeating-linear-gradient(0deg, rgba(175, 206, 214, .07) 0 1px, transparent 1px 22px),
        var(--mxa-shell);
    border-bottom: 4px solid var(--mxa-ci);
}

.mxa-knoten {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.mxa-punkt {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    box-sizing: border-box;
    border: 1.5px solid rgba(175, 206, 214, .32);
    border-radius: 50%;
    background: rgba(255, 255, 255, .03);
    transition: border-color .45s cubic-bezier(.16, 1, .3, 1), background-color .45s cubic-bezier(.16, 1, .3, 1), box-shadow .45s cubic-bezier(.16, 1, .3, 1);
}

.mxa-punkt svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: var(--mxa-shell-mut);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .7;
    transition: stroke .45s, opacity .45s;
}

.mxa-punkt img {
    display: block;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    opacity: .55;
    filter: saturate(.4);
    transition: opacity .45s, filter .45s;
}

.mxa-name {
    max-width: 9.5em;
    color: var(--mxa-shell-mut);
    font: 600 12px/1.3 var(--mxa-fb);
    letter-spacing: .01em;
    text-align: center;
    overflow-wrap: anywhere;
    transition: color .45s;
}

/* erreichter Knoten */
.mxa-verb--idle .mxa-k1 .mxa-punkt,
.mxa-verb--connecting .mxa-k1 .mxa-punkt,
.mxa-verb--waiting .mxa-k1 .mxa-punkt, .mxa-verb--waiting .mxa-k2 .mxa-punkt,
.mxa-verb--connected .mxa-punkt,
.mxa-verb--client_error .mxa-k1 .mxa-punkt, .mxa-verb--client_error .mxa-k2 .mxa-punkt,
.mxa-verb--tunnel_error .mxa-k1 .mxa-punkt,
.mxa-verb--abgewiesen .mxa-k1 .mxa-punkt, .mxa-verb--abgewiesen .mxa-k2 .mxa-punkt {
    border-color: var(--mxa-ci);
    background: rgba(112, 197, 195, .13);
    box-shadow: 0 8px 20px -8px rgba(112, 197, 195, .55);
}

.mxa-verb--idle .mxa-k1 svg,
.mxa-verb--connecting .mxa-k1 svg,
.mxa-verb--waiting .mxa-k1 svg,
.mxa-verb--connected svg,
.mxa-verb--client_error .mxa-k1 svg,
.mxa-verb--tunnel_error .mxa-k1 svg,
.mxa-verb--abgewiesen .mxa-k1 svg { stroke: var(--mxa-shell-ink); opacity: 1; }

.mxa-verb--waiting .mxa-k2 img,
.mxa-verb--connected .mxa-k2 img,
.mxa-verb--client_error .mxa-k2 img,
.mxa-verb--abgewiesen .mxa-k2 img { opacity: 1; filter: none; }

.mxa-verb--idle .mxa-k1 .mxa-name,
.mxa-verb--connecting .mxa-k1 .mxa-name,
.mxa-verb--waiting .mxa-k1 .mxa-name, .mxa-verb--waiting .mxa-k2 .mxa-name,
.mxa-verb--connected .mxa-name,
.mxa-verb--client_error .mxa-k1 .mxa-name, .mxa-verb--client_error .mxa-k2 .mxa-name,
.mxa-verb--tunnel_error .mxa-k1 .mxa-name,
.mxa-verb--abgewiesen .mxa-k1 .mxa-name, .mxa-verb--abgewiesen .mxa-k2 .mxa-name { color: var(--mxa-shell-ink); }

/* naechster Knoten: wartet auf den Impuls */
.mxa-verb--connecting .mxa-k2 .mxa-punkt,
.mxa-verb--waiting .mxa-k3 .mxa-punkt { border-color: rgba(112, 197, 195, .55); border-style: dashed; }

/* Abschnitte */
.mxa-weg {
    position: relative;
    height: 2px;
    margin: 24px 10px 0;
    overflow: hidden;
    border-radius: 2px;
    background: rgba(175, 206, 214, .24);
    transition: background-color .45s;
}

.mxa-weg i {
    position: absolute;
    top: 0;
    left: -45%;
    width: 45%;
    height: 100%;
    background: linear-gradient(90deg, rgba(112, 197, 195, 0), var(--mxa-ci) 70%, var(--mxa-shell-ink));
    opacity: 0;
}

/* fertiger Abschnitt */
.mxa-verb--waiting .mxa-w1,
.mxa-verb--connected .mxa-weg,
.mxa-verb--client_error .mxa-w1,
.mxa-verb--abgewiesen .mxa-w1 { background: var(--mxa-ci); }

/* laufender Abschnitt: Impuls wandert zum naechsten Knoten */
.mxa-verb--idle .mxa-w1 i,
.mxa-verb--connecting .mxa-w1 i,
.mxa-verb--waiting .mxa-w2 i {
    opacity: 1;
    animation: mxa-impuls 1.25s cubic-bezier(.45, 0, .15, 1) infinite;
}

@keyframes mxa-impuls {
    to { left: 100%; }
}

/* Bruchstelle */
.mxa-verb--tunnel_error .mxa-w1,
.mxa-verb--client_error .mxa-w2 {
    overflow: visible;
    background: linear-gradient(90deg, #ff9d92 0 calc(50% - 11px), transparent calc(50% - 11px) calc(50% + 11px), #ff9d92 calc(50% + 11px));
}

.mxa-verb--tunnel_error .mxa-w1 i,
.mxa-verb--client_error .mxa-w2 i {
    left: 50%;
    top: -5px;
    width: 12px;
    height: 12px;
    margin-left: -6px;
    background: none;
    opacity: 1;
}

.mxa-verb--tunnel_error .mxa-w1 i::before, .mxa-verb--tunnel_error .mxa-w1 i::after,
.mxa-verb--client_error .mxa-w2 i::before, .mxa-verb--client_error .mxa-w2 i::after {
    content: "";
    position: absolute;
    left: 5px;
    top: -1px;
    width: 2px;
    height: 14px;
    border-radius: 1px;
    background: #ff9d92;
    transform: rotate(45deg);
}

.mxa-verb--tunnel_error .mxa-w1 i::after,
.mxa-verb--client_error .mxa-w2 i::after { transform: rotate(-45deg); }

.mxa-verb--tunnel_error .mxa-k2 .mxa-punkt,
.mxa-verb--client_error .mxa-k3 .mxa-punkt { border-color: rgba(255, 157, 146, .55); }

/* Kopf der Karte: Verbindungsname + Zustand */
.mxa-verb-kopf { padding: 24px 30px 0; }

.mxa-verb-ziel {
    margin: 0;
    padding: 0;
    color: var(--mxa-ink);
    font: 700 22px/1.2 var(--mxa-fh);
    letter-spacing: -.005em;
    text-transform: none;
    overflow-wrap: anywhere;
    text-wrap: balance;
}

.mxa-verb-stand {
    margin: 6px 0 0;
    color: var(--mxa-acc);
    font: 600 14.5px/1.4 var(--mxa-fb);
}

.mxa-verb--client_error .mxa-verb-stand,
.mxa-verb--tunnel_error .mxa-verb-stand,
.mxa-verb--abgewiesen .mxa-verb-stand { color: var(--mxa-neg); }

.mxa-verb--disconnected .mxa-verb-stand { color: var(--mxa-mut); }

/* Guacamole-Meldung = unterer Teil der Karte */
.client-status-modal .notification,
.client-status-modal .notification.error {
    max-width: none;
    margin: 0;
    padding: 0 30px 26px;
    overflow: visible;
    text-align: left;
    color: var(--mxa-mut);
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.client-status-modal .notification .body { margin: 0; }

.client-status-modal .notification .text {
    max-width: 60ch;
    margin: 10px 0 0;
    color: var(--mxa-mut);
    font: 400 14px/1.55 var(--mxa-fb);
}

.client-status-modal .notification .countdown-text {
    margin: 12px 0 0;
    color: var(--mxa-acc);
    font: 600 13px/1.4 var(--mxa-fb);
    font-variant-numeric: tabular-nums;
}

.client-status-modal .notification .buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
    margin: 20px 0 0;
}

/* Neu verbinden / Weiter = Hauptaktion (Petrol), Start/Abmelden/Abbruch zurueckhaltend.
   Die Guacamole-Basis setzt hier .button weiss auf transparent (fuer das alte dunkle Band)
   - darum alle Zustaende ausdruecklich. */
.client-status-modal .notification .buttons button {
    min-height: 36px;
    padding: 0 16px;
    background: var(--mxa-shell);
    background-image: none;
    color: var(--mxa-shell-ink);
    border: 1px solid var(--mxa-shell);
    border-radius: 6px;
    box-shadow: inset 0 0 0 var(--mxa-ci);
    font: 600 13.5px/34px var(--mxa-fb);
    text-decoration: none;
}

.client-status-modal .notification .buttons button:hover {
    background: var(--mxa-shell);
    box-shadow: inset 0 -3px 0 var(--mxa-ci);
    text-decoration: none;
}

.client-status-modal .notification .buttons button:active { background: #00324a; }

/* Hauptaktion vorn; Guacamole-Symbol (weiss, ::before) bekommt eigenen Platz statt den Text zu ueberdecken */
.client-status-modal .notification .buttons .reconnect { order: -1; padding-left: calc(14px + 1.35em); }
.client-status-modal .notification .buttons .reconnect::before { left: 12px; width: 1.1em; background-position: center; }

/* weisse Symbole waeren auf der hellen Karte unsichtbar und laegen ueber dem Text */
.client-status-modal .notification .buttons .home::before,
.client-status-modal .notification .buttons .logout::before { display: none; }

.client-status-modal .notification .buttons .home,
.client-status-modal .notification .buttons .logout,
.mxa-verb--eingabe ~ .notification .buttons button + button {
    background: transparent;
    color: var(--mxa-acc);
    border-color: var(--mxa-line);
}

.client-status-modal .notification .buttons .home:hover,
.client-status-modal .notification .buttons .logout:hover,
.mxa-verb--eingabe ~ .notification .buttons button + button:hover {
    background: var(--mxa-acc-t);
    border-color: var(--mxa-feld);
    box-shadow: none;
}

.client-status-modal .notification .buttons .home:active,
.client-status-modal .notification .buttons .logout:active,
.mxa-verb--eingabe ~ .notification .buttons button + button:active { background: rgba(25, 83, 112, .14); }

/* Abfrage fehlender Angaben (z. B. Kennwort) im Kartenstil statt weiss auf dunkel */
.client-status-modal .notification .parameters { max-width: none; margin: 14px 0 0; }

.client-status-modal .notification .parameters input[type=email],
.client-status-modal .notification .parameters input[type=number],
.client-status-modal .notification .parameters input[type=password],
.client-status-modal .notification .parameters input[type=text],
.client-status-modal .notification .parameters textarea {
    background: var(--mxa-card);
    color: var(--mxa-ink);
    border: 1px solid var(--mxa-feld);
}

.client-status-modal .notification .parameters .field-header,
.client-status-modal .notification .parameters label { color: var(--mxa-mut); font: 600 13px/1.4 var(--mxa-fb); }

@media (max-width: 480px) {
    .mxa-strecke { padding: 24px 16px 18px; grid-template-columns: auto minmax(14px, 1fr) auto minmax(14px, 1fr) auto; }
    .mxa-punkt { width: 42px; height: 42px; }
    .mxa-punkt svg { width: 21px; height: 21px; }
    .mxa-punkt img { width: 26px; height: 26px; }
    .mxa-weg { margin: 20px 6px 0; }
    .mxa-name { font-size: 11.5px; max-width: 7.5em; }
    .mxa-verb-kopf { padding: 20px 20px 0; }
    .mxa-verb-ziel { font-size: 19px; }
    .client-status-modal .notification,
    .client-status-modal .notification.error { padding: 0 20px 22px; }
    .client-status-modal .notification .buttons button { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
    .client-status-modal .modal-contents { animation: none; }
    .mxa-verb--idle .mxa-w1 i,
    .mxa-verb--connecting .mxa-w1 i,
    .mxa-verb--waiting .mxa-w2 i { animation: none; left: 0; width: 100%; opacity: .55; }
    .mxa-punkt, .mxa-punkt svg, .mxa-punkt img, .mxa-name, .mxa-weg { transition: none; }
}

/* Warnung "Verbindung instabil" */
#connection-warning {
    background: var(--mxa-card);
    color: var(--mxa-ink);
    border-left-color: #d9a21b;
    border-radius: 0 6px 6px 0;
    font-family: var(--mxa-fb);
}

/* --- B10. Laden: CI-Kreis statt Zahnrad -------------------------------------------- */
.loading::before {
    width: 40px;
    height: 40px;
    margin-left: -20px;
    margin-top: -20px;
    box-sizing: border-box;
    background: none;
    border: 3px solid var(--mxa-line);
    border-top-color: var(--mxa-shell);
    border-right-color: var(--mxa-ci);
    border-radius: 50%;
    animation: mxa-dreh .8s linear infinite;
}

/* --- B11. Guacamole-Menue in der Sitzung (Strg+Alt+Umschalt) ----------------------- */
#guac-menu {
    background: var(--mxa-ground);
    color: var(--mxa-ink);
    box-shadow: 1px 0 0 var(--mxa-line), 12px 0 40px -18px rgba(0, 0, 0, .6);
    font: 400 14px/1.45 var(--mxa-fb);
}

#guac-menu .header {
    min-height: 58px;
    background: var(--mxa-shell);
    border-bottom: 4px solid var(--mxa-ci);
    border-top: 0;
}

#guac-menu .header h2,
#guac-menu .header h2 .menu-title {
    color: var(--mxa-shell-ink);
    font: 700 17px/1.2 var(--mxa-fh);
    letter-spacing: .005em;
    text-transform: none;
}

#guac-menu .header h2 { padding: 0 6px 0 20px; }
#guac-menu .header h2.connection-select-menu { padding: 0; }
#guac-menu .header h2.connection-select-menu .menu-title { display: block; padding: 0 34px 0 20px; line-height: 58px; }

#guac-menu .menu-body { padding: 18px 20px; }

#guac-menu .menu-section {
    padding: 14px 16px 16px;
    background: var(--mxa-card);
    border: 1px solid var(--mxa-line);
    border-radius: var(--mxa-r);
}

#guac-menu .content > * + *,
#guac-menu .menu-section ~ .menu-section { margin-top: 12px; }

.menu-section h3,
#guac-menu .menu-section h3 {
    margin: 0;
    padding: 0 0 10px;
    color: var(--mxa-mut);
    font: 700 12px/1.3 var(--mxa-fh);
    letter-spacing: .06em;
    text-transform: uppercase;
}

.menu-section ~ .menu-section h3 { padding-top: 0; }

#guac-menu #devices .device,
#guac-menu #multi-monitor .add-monitor,
#guac-menu #share-links {
    background-color: var(--mxa-card);
    border: 1px solid var(--mxa-line);
    border-radius: var(--mxa-r);
    transition: border-color .15s, background-color .15s;
}

#guac-menu #devices .device:hover,
#guac-menu #multi-monitor .add-monitor:hover { border-color: var(--mxa-acc); background-color: var(--mxa-acc-t); }

.clipboard,
.clipboard-service-target { background: var(--mxa-card); }

.clipboard {
    border: 1px solid var(--mxa-line);
    border-radius: 6px;
    font-family: var(--mxa-fb);
    padding: 8px 10px;
}

.client-zoom .client-zoom-in,
.client-zoom .client-zoom-out {
    background: var(--mxa-card);
    border: 1px solid var(--mxa-line);
}

.client-zoom .client-zoom-in:hover,
.client-zoom .client-zoom-out:hover { background: var(--mxa-acc-t); border-color: var(--mxa-acc); }

#filesystem-menu .header.breadcrumbs .breadcrumb:hover { background-color: var(--mxa-acc-t); }
.file-browser .list-item.focused .caption { border-color: var(--mxa-acc); background: var(--mxa-acc-t); }

/* --- B12. MSA Insight (Extension msa-insight): Blau -> CI ------------------------- */
.msa-button, .msa-link { background: var(--mxa-shell); border-radius: 6px; font-family: var(--mxa-fb); font-weight: 600; }
.msa-button:hover, .msa-link:hover { background: var(--mxa-shell); box-shadow: inset 0 -3px 0 var(--mxa-ci); }
.msa-progress-bar { background: var(--mxa-ci); }
.msa-tabs { border-bottom-color: var(--mxa-line); }
.msa-tabs a { color: var(--mxa-mut); font-family: var(--mxa-fh); letter-spacing: .045em; text-transform: uppercase; font-size: 13.5px; }
.msa-tabs a.active { color: var(--mxa-ink); border-bottom-color: var(--mxa-ci); }
.msa-tabs a:hover:not(.active) { background: none; color: var(--mxa-ink); }
.msa-kpi { background: var(--mxa-card); border-color: var(--mxa-line); border-radius: var(--mxa-r); box-shadow: none; }
.msa-kpi-value { color: var(--mxa-ink); }
.msa-kpi-label, .msa-period, .msa-source { color: var(--mxa-mut); }

/* --- B13. Schmale Fenster ---------------------------------------------------------- */
@media (max-width: 640px) {
    /* Auf dem Telefon reicht der Platz nicht fuer Logo, Name und Benutzermenue -
       der Produktname bleibt, das Logo entfaellt. */
    body:not(.client):not(.secondaryMonitor) #content::before {
        height: 54px;
        padding-left: 16px;
        background: var(--mxa-shell);
        font-size: 16.5px;
        line-height: 50px;
    }
    body:not(.client):not(.secondaryMonitor) #content .header .user-menu { height: 50px; right: 4px; }
    .user-menu .menu-dropdown .menu-title { max-width: 46vw; line-height: 50px; }
    #guac-menu .header .user-menu .menu-dropdown .menu-title { line-height: 58px; }
    .header { flex-wrap: wrap; }
    .header h2 { padding: 12px 16px; }
    .header .filter { padding: 0 16px 10px; width: 100%; box-sizing: border-box; }
    .header .filter input, .header .filter .search-string { min-width: 0; width: 100%; max-width: none; }
    div.all-connections, div.recent-connections, div.settings { margin: 14px 16px; }
    /* Breite Tabellen (Sitzungen, Verlauf, Benutzer) seitlich innerhalb der Karte rollen */
    table.sorted { display: block; max-width: 100%; overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .loading::before { animation-duration: 2.4s; }
    a.button, button, input[type=submit], .recent-connections .connection { transition: none; }
}

/* =====================================================================================
   TEIL C - TABLET UND WEB-APP (iPad, Android-Tablet, „Zum Home-Bildschirm“)
   Mit viewport-fit=cover (js/max-access.js) und Statusleiste black-translucent
   reicht die Seite bis unter Statusleiste, Notch und Home-Leiste. Die Abstaende
   env(safe-area-inset-*) halten Bedienelemente dort heraus; ohne diese Bereiche
   (Desktop, normaler Browser) sind alle Werte 0 und nichts aendert sich.
   ===================================================================================== */

/* Petrol-Streifen unter der Statusleiste (weisse Schrift bleibt lesbar). */
body:not(.client):not(.secondaryMonitor)::after {
    content: "";
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    right: 0;
    height: env(safe-area-inset-top, 0px);
    background: var(--mxa-shell);
    pointer-events: none;
}

body:not(.client):not(.secondaryMonitor) {
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}

/* Anmeldung, zweispaltig (absolut ueber die Seite) */
div.login-ui {
    top: env(safe-area-inset-top, 0px);
    right: env(safe-area-inset-right, 0px);
    bottom: env(safe-area-inset-bottom, 0px);
    left: env(safe-area-inset-left, 0px);
    width: auto;
    height: auto;
}

@media (max-width: 900px) {
    /* einspaltig im Fluss (position: relative): Abstaende kommen vom body, die
       Versaetze oben wuerden sonst ein zweites Mal verschieben */
    div.login-ui {
        top: auto;
        right: auto;
        bottom: auto;
        left: auto;
        min-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    }
}

/* Sitzung: Remote-Bild und Bildschirmtastatur ausserhalb von Statusleiste/Home-Leiste,
   der Rand bleibt schwarz (body.client).
   position: fixed: Beim Wechsel Startseite -> Sitzung haengt die Sitzungsflaeche kurz unter #content,
   bevor body die Klasse "client" bekommt. Dort ist #content (Kopfleiste, position: relative) der Bezugsrahmen
   und nur 62px hoch - Guacamole meldete diese Hoehe beim Verbindungsaufbau an den Zielrechner (2304x93). */
.client-view {
    position: fixed;
    top: env(safe-area-inset-top, 0px);
    right: env(safe-area-inset-right, 0px);
    bottom: env(safe-area-inset-bottom, 0px);
    left: env(safe-area-inset-left, 0px);
    width: auto;
    height: auto;
}

#guac-menu {
    box-sizing: border-box;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px);
}

/* Hinweis-Link unter dem Anmeldeformular */
.login-ui .login-dialog .mxa-hilfelink {
    margin: 4px 0 0;
    font-size: 12.5px;
    line-height: 1.5;
    text-align: left;
}

.login-ui .login-dialog .mxa-hilfelink a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    color: var(--mxa-acc);
    text-decoration: underline;
    text-decoration-color: rgba(25, 83, 112, .35);
    text-underline-offset: 3px;
}

.login-ui .login-dialog .mxa-hilfelink a::before {
    content: "";
    flex: none;
    width: 13px;
    height: 17px;
    border: 1.5px solid currentColor;
    border-radius: 3px;
    box-sizing: border-box;
    background: radial-gradient(circle at 50% calc(100% - 3px), currentColor 1.2px, transparent 1.6px);
}

.login-ui .login-dialog .mxa-hilfelink a:hover { color: var(--mxa-shell); text-decoration-color: currentColor; }
.login-ui.continuation .login-dialog .mxa-hilfelink { display: none; }

/* v8.0: Guacamole-Hilfsfeld fuer die Zwischenablage (textarea.clipboard-service-target, direkt im body) muss unsichtbar bleiben.
 * Die allgemeine Feldregel oben (Innenabstand, Rahmen, weisser Hintergrund, border-box) liess es 8 px links oben ins Bild ragen,
 * mit Ziehgriff - Nutzer konnten es ueber jede Sitzung grossziehen. Fokus/Auswahl per Skript bleiben moeglich. */
textarea.clipboard-service-target {
    left: -100px !important;
    top: 0 !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    color: transparent !important;
    opacity: 0 !important;
    resize: none !important;
    pointer-events: none !important;
}
/*
 * MAX Access Verlauf (CoC #575) – Spalte "Gerät & Herkunft", Detailzeilen, Abschnitt "Portal-Anmeldungen".
 * Farben/Schriften aus dem Branding (msa-portal-branding, :root --mxa-*), mit Rückfallwerten.
 */
.msa-vl-kopf { min-width: 15em; }
.msa-vl-zelle { vertical-align: middle; }

.msa-vl-knopf {
    display: inline-flex; align-items: center; gap: 10px;
    margin: 0; padding: 4px 8px 4px 4px; min-height: 40px;
    background: transparent; border: 1px solid transparent; border-radius: var(--mxa-r, 8px);
    color: var(--mxa-ink, #11212c); font: inherit; text-align: left; cursor: pointer; box-shadow: none;
    transition: background-color .16s ease-out, border-color .16s ease-out;
}
.msa-vl-knopf:hover { background: var(--mxa-acc-t, rgba(25, 83, 112, .08)); border-color: var(--mxa-line, #ced8db); }
.msa-vl-knopf:focus-visible { outline: 2px solid var(--mxa-acc, #195370); outline-offset: 2px; }
.msa-vl-knopf[aria-expanded="true"] { background: var(--mxa-acc-t, rgba(25, 83, 112, .08)); border-color: var(--mxa-acc-r, rgba(116, 197, 192, .45)); }

.msa-vl-symbol { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 6px;
    background: var(--mxa-tool, #e9eff2); color: var(--mxa-acc, #195370); }
.msa-vl-symbol svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.msa-vl-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.msa-vl-z1 { font-weight: 600; white-space: nowrap; }
.msa-vl-z2 { font-size: 12px; color: var(--mxa-mut, #4e5d67); white-space: nowrap; font-variant-numeric: tabular-nums; }

.msa-vl-pfeil { flex: none; width: 8px; height: 8px; margin-left: 2px; border-right: 1.5px solid var(--mxa-mut, #4e5d67);
    border-bottom: 1.5px solid var(--mxa-mut, #4e5d67); transform: rotate(45deg) translate(-2px, -2px); transition: transform .18s ease-out; }
.msa-vl-knopf[aria-expanded="true"] .msa-vl-pfeil { transform: rotate(-135deg) translate(-2px, -2px); }

.msa-vl-leer { font-size: 12px; color: var(--mxa-mut, #4e5d67); }
.msa-vl-laedt { display: inline-block; width: 120px; height: 10px; border-radius: 5px;
    background: linear-gradient(90deg, var(--mxa-tool, #e9eff2) 0%, var(--mxa-line2, #e3e9eb) 50%, var(--mxa-tool, #e9eff2) 100%);
    background-size: 200% 100%; animation: msa-vl-schimmer 1.2s ease-in-out infinite; }
@keyframes msa-vl-schimmer { to { background-position: -200% 0; } }

/* --- Detailzeile ------------------------------------------------------------------------------------------- */
table.sorted tr.msa-vl-detail > td,
table.sorted tbody tr.msa-vl-detail:hover > td { background: var(--mxa-ground, #f4f7f9); padding: 14px 16px 16px; }

.msa-vl-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 28px; }
.msa-vl-gruppe h3 { margin: 0 0 6px; font-family: var(--mxa-fh, inherit); font-size: 13px; font-weight: 700; color: var(--mxa-acc, #195370);
    letter-spacing: 0; text-transform: none; }
.msa-vl-gruppe dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; font-size: 13px; }
.msa-vl-gruppe dl > div { display: contents; }
.msa-vl-gruppe dt { color: var(--mxa-mut, #4e5d67); font-weight: 400; }
.msa-vl-gruppe dd { margin: 0; color: var(--mxa-ink, #11212c); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.msa-vl-ua { margin: 12px 0 0; display: flex; gap: 10px; align-items: baseline; font-size: 12px; color: var(--mxa-mut, #4e5d67); }
.msa-vl-ua code { font-size: 12px; color: var(--mxa-ink, #11212c); background: var(--mxa-card, #fdfeff); border: 1px solid var(--mxa-line2, #e3e9eb);
    border-radius: 4px; padding: 2px 6px; overflow-wrap: anywhere; white-space: normal; }

/* --- Portal-Anmeldungen ------------------------------------------------------------------------------------ */
.msa-vl-anm { margin: 40px 0 8px; }
.msa-vl-anm h2 { margin: 0 0 4px; font-family: var(--mxa-fh, inherit); font-size: 18px; font-weight: 700; color: var(--mxa-ink, #11212c);
    background: none; border: 0; padding: 0; text-transform: none; letter-spacing: 0; }
.msa-vl-anm-hilfe { margin: 0 0 14px; color: var(--mxa-mut, #4e5d67); max-width: 72ch; }
.msa-vl-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.msa-vl-filter select { min-height: 36px; padding: 0 10px; border: 1px solid var(--mxa-feld, #788a94); border-radius: 6px;
    background: var(--mxa-card, #fdfeff); color: var(--mxa-ink, #11212c); font: inherit; }
.msa-vl-filter select:focus-visible { outline: 2px solid var(--mxa-acc, #195370); outline-offset: 1px; }
/* Schmale Bildschirme: Tabelle wischt seitlich statt Spalten abzuschneiden */
.msa-vl-rollbar { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.sorted.msa-vl-anm-tabelle { width: 100%; }
@media (max-width: 720px) { table.sorted.msa-vl-anm-tabelle { min-width: 640px; } }
.msa-vl-anm-zeile { cursor: pointer; }
.msa-vl-anm-zeile:focus-visible { outline: 2px solid var(--mxa-acc, #195370); outline-offset: -2px; }
.msa-vl-anm-zeile.offen > td { background: var(--mxa-acc-t, rgba(25, 83, 112, .08)); }
.msa-vl-zeit { white-space: nowrap; font-variant-numeric: tabular-nums; }
.msa-vl-fein { display: block; font-size: 12px; color: var(--mxa-mut, #4e5d67); }
.msa-vl-leerzeile { color: var(--mxa-mut, #4e5d67); text-align: center; padding: 18px 12px !important; }
.msa-vl-mehr { margin: 12px 0 0; }

.msa-vl-marke { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.5;
    white-space: nowrap; background: var(--mxa-tool, #e9eff2); color: var(--mxa-ink, #11212c); }
.msa-vl-marke.msa-vl-erfolg { background: #e3f3ef; color: #145a46; }
.msa-vl-marke.msa-vl-abgelehnt { background: #fbe7e6; color: var(--mxa-neg, #ba2b28); }
.msa-vl-marke.msa-vl-code_falsch { background: #fbe7e6; color: var(--mxa-neg, #ba2b28); }
.msa-vl-anzahl { margin-left: 6px; font-size: 12px; font-weight: 600; color: var(--mxa-neg, #ba2b28); font-variant-numeric: tabular-nums; white-space: nowrap; }
.msa-vl-marke.msa-vl-weitere_angabe { background: #fbf3df; color: #6b4f12; }
.msa-vl-marke.msa-vl-fehler { background: #fbe7e6; color: #8a1f1d; }

@media (max-width: 720px) {
    .msa-vl-z2 { display: none; }
    .msa-vl-raster { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .msa-vl-laedt { animation: none; }
    .msa-vl-knopf, .msa-vl-pfeil { transition: none; }
}
