/* PH Vorarlberg – Digitaler Studierendenausweis (PWA) */
:root {
    --brand: #254287;
    --brand-2: #3b5fb3;
    --brand-dark: #182c5c;
    --bg: #eef1f6;
    --panel: #ffffff;
    --text: #1b2230;
    --muted: #5d6677;
    --line: #dde2ea;
    --ok: #127a3a;
    --bad: #b3261e;
    --warn-bg: #fff3d6;
    --warn: #7a5000;
    --card-text: #1b2230;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f131a;
        --panel: #1a202b;
        --text: #e7eaf0;
        --muted: #a0a9b8;
        --line: #2b3341;
        --warn-bg: #3a2c0c;
        --warn: #f3c056;
    }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.45;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
}
[hidden] { display: none !important; }
a { color: var(--brand); }
@media (prefers-color-scheme: dark) { a { color: #93b2ff; } }
h1, h2, h3 { line-height: 1.2; }
h2 { font-size: 1.3rem; margin: 6px 4px 14px; }
h3 { font-size: 1rem; margin: 0 0 8px; }
.small { font-size: 0.85rem; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }

.view { min-height: 100vh; min-height: 100dvh; }
.view-center { display: grid; place-items: center; }
.loading-logo { width: 180px; opacity: 0.9; animation: fade 1.2s ease-in-out infinite alternate; }
@keyframes fade { from { opacity: 0.4; } to { opacity: 1; } }

/* ---------------------------------------------------------------- Buttons & Formulare */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px; padding: 10px 18px;
    font: inherit; font-weight: 600;
    border-radius: 12px; border: 1px solid var(--line);
    background: var(--panel); color: var(--text);
    cursor: pointer; text-decoration: none;
}
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:active { background: var(--brand-dark); }
.btn.danger { color: var(--bad); border-color: currentColor; background: transparent; }
.btn.link { background: none; border: none; color: var(--brand); min-height: 36px; }
.btn.big { width: 100%; min-height: 58px; font-size: 1.08rem; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 0.85rem; }
.btn svg { width: 24px; height: 24px; fill: currentColor; }
.btn:disabled { opacity: 0.6; }

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 14px;
}
.form label { display: block; margin-bottom: 14px; font-size: 0.9rem; font-weight: 600; }
.form input {
    display: block; width: 100%; margin-top: 6px;
    min-height: 48px; padding: 10px 12px;
    font: inherit; font-size: 1.1rem;
    border: 1px solid var(--line); border-radius: 10px;
    background: var(--bg); color: var(--text);
}
.form input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.form .btn { width: 100%; }
.help { margin: 0 0 14px; color: var(--muted); font-size: 0.92rem; }
.msg { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: #fbe5e3; color: var(--bad); font-weight: 600; }
.msg.ok { background: #e3f5e9; color: var(--ok); }

/* ---------------------------------------------------------------- Login */
#view-login { max-width: 460px; margin: 0 auto; padding: calc(24px + var(--safe-top)) 16px 32px; }
.login-head { text-align: center; margin-bottom: 18px; }
.login-logo { width: 200px; max-width: 70%; }
@media (prefers-color-scheme: dark) { .login-logo { background: #fff; padding: 10px 14px; border-radius: 12px; } }
.login-head h1 { font-size: 1.25rem; margin: 14px 0 0; }
.tabs { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.tab { flex: 1; min-height: 42px; border: 0; border-radius: 9px; background: none; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.tab.active { background: var(--brand); color: #fff; }
.footnote { font-size: 0.8rem; color: var(--muted); text-align: center; margin-top: 18px; }
.lang-switch { display: flex; gap: 6px; }
.lang-switch.small { justify-content: flex-end; margin-bottom: 8px; }
.lang-switch button {
    font: inherit; font-size: 0.85rem; font-weight: 600; padding: 6px 12px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer;
}
.lang-switch button.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Zustimmung vor der ersten Anmeldung */
.consent { border-color: var(--brand); }
.consent .help { margin-bottom: 10px; }
.consent-check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: 0.95rem; cursor: pointer; }
.consent-check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--brand); }

/* ---------------------------------------------------------------- Hauptansicht */
#view-main { padding: calc(12px + var(--safe-top)) 0 calc(84px + var(--safe-bottom)); }
.page { max-width: 480px; margin: 0 auto; padding: 0 14px; }

.banner {
    max-width: 480px; margin: 0 auto 12px; padding: 12px 14px;
    display: flex; gap: 10px; align-items: center;
    background: var(--warn-bg); color: var(--warn); border-radius: 12px;
    font-size: 0.9rem; position: relative;
}
.banner > div { flex: 1; }
.banner.bad { background: #fbe5e3; color: var(--bad); }
.banner.info { background: var(--panel); color: var(--text); border: 1px solid var(--line); }
.banner-close { background: none; border: 0; font-size: 1.4rem; color: inherit; cursor: pointer; padding: 0 4px; }
@media (min-width: 509px) { .banner { margin-left: auto; margin-right: auto; } }
#install-hint, #status-banner { margin-left: 14px; margin-right: 14px; }
@media (min-width: 509px) { #install-hint, #status-banner { margin-left: auto; margin-right: auto; } }

/* ---------------------------------------------------------------- Ausweiskarte */
.idcard-stage { perspective: 900px; margin: 0 auto 16px; max-width: 460px; container-type: inline-size; }
/* Scheckkartenformat ISO 7810 ID-1 (85,6 × 54 mm); alle Maße in cqw = Prozent der Kartenbreite */
.idcard {
    position: relative; isolation: isolate;
    aspect-ratio: 1.586; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 2cqw;
    padding: 3.8cqw 5cqw 3.4cqw;
    background: #fff; color: var(--card-text);
    border-radius: 4.5cqw;
    overflow: hidden;
    /* 3D-Kippen mit dem Handy (Werte aus dem Lagesensor, siehe app.js) */
    transform: rotateY(calc(var(--tx, 0) * 15.5deg)) rotateX(calc(var(--ty, 0) * -13.3deg));
    box-shadow: calc(var(--tx, 0) * -18px) calc(var(--ty, 0) * -13px + 17px) 34px rgba(20, 35, 80, 0.26), 0 1px 3px rgba(20, 35, 80, 0.12);
    will-change: transform;
}
.idcard > * { position: relative; z-index: 2; }
.idcard > .ic-bg, .idcard > .ic-micro, .idcard > .ic-holo, .idcard > .ic-holo2, .idcard > .ic-glare { position: absolute; pointer-events: none; }
/* Guilloche-Wellen, verschieben sich beim Kippen gegeneinander */
.ic-bg {
    inset: 0; z-index: 0;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='40'%3E%3Cpath d='M0 20 Q15 2 30 20 T60 20 T90 20 T120 20' fill='none' stroke='%23254287' stroke-opacity='.13' stroke-width='.8'/%3E%3Cpath d='M0 26 Q15 8 30 26 T60 26 T90 26 T120 26' fill='none' stroke='%233b5fb3' stroke-opacity='.10' stroke-width='.8'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Ccircle cx='40' cy='40' r='30' fill='none' stroke='%23127a3a' stroke-opacity='.08' stroke-width='.7'/%3E%3Ccircle cx='40' cy='40' r='22' fill='none' stroke='%23254287' stroke-opacity='.08' stroke-width='.7'/%3E%3C/svg%3E"),
        var(--card-gradient, linear-gradient(160deg, #fdfdfb, #eef3f8));
    background-position: calc(var(--tx, 0) * 14px) calc(var(--ty, 0) * 8px), calc(var(--tx, 0) * -10px) calc(var(--ty, 0) * -10px), 0 0;
}
/* Mitarbeiterausweis: gleiche Gestaltung wie der Studierendenausweis (Farben in Admin → Erscheinungsbild änderbar); nur der Titel ist klein und nicht fett */
.idcard.staff { --card-gradient: linear-gradient(160deg, var(--staff-bg-1, #fdfdfb), var(--staff-bg-2, #eef3f8)); }
.idcard.staff .idcard-type { font-weight: 400; font-size: 1.5cqw; }
.idcard.staff .idcard-type .en { font-weight: 400; }
/* Akademische Titel im Namen: klein und nicht fett */
.fields dd.name .akad { font-size: 0.58em; font-weight: 400; letter-spacing: 0.01em; }
/* Satz unter der Mitarbeiterkarte: wofür der Ausweis steht, dazu der Link zu den Vorteilen */
.card-note { max-width: 460px; margin: -4px auto 14px; padding: 0 4px; font-size: 0.9rem; line-height: 1.4; color: var(--text); }
.card-note a { display: inline-block; margin-top: 4px; font-weight: 600; }
.idcard.staff .ic-micro { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='330' height='16'%3E%3Ctext x='0' y='6.5' font-family='Arial' font-size='6.2' font-weight='700' fill='%23182c5c' fill-opacity='.13' letter-spacing='.8'%3EDIGITAL ID · STAFF ID CARD · %3C/text%3E%3Ctext x='-165' y='14.5' font-family='Arial' font-size='6.2' font-weight='700' fill='%23182c5c' fill-opacity='.13' letter-spacing='.8'%3EDIGITAL ID · STAFF ID CARD · DIGITAL ID · STAFF ID CARD · %3C/text%3E%3C/svg%3E"); }
/* Mikroschrift: diagonal, lückenlos, steht still */
.ic-micro {
    inset: -60%; z-index: 1; transform: rotate(-28deg);
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='330' height='16'%3E%3Ctext x='0' y='6.5' font-family='Arial' font-size='6.2' font-weight='700' fill='%23254287' fill-opacity='.13' letter-spacing='.8'%3EDIGITAL ID · STUDENT ID CARD · %3C/text%3E%3Ctext x='-165' y='14.5' font-family='Arial' font-size='6.2' font-weight='700' fill='%23254287' fill-opacity='.13' letter-spacing='.8'%3EDIGITAL ID · STUDENT ID CARD · DIGITAL ID · STUDENT ID CARD · %3C/text%3E%3C/svg%3E");
}
/* Regenbogen: schmal und dezent; Winkel und Laufrichtung folgen der Neigung */
.ic-holo {
    inset: 0; z-index: 3;
    background: linear-gradient(calc(115deg + var(--tx, 0) * 50deg - var(--ty, 0) * 30deg),
        transparent 0 40%, rgba(255, 106, 213, 0.16) 44.5%, rgba(173, 140, 255, 0.17) 47%, rgba(148, 208, 255, 0.20) 49.5%,
        rgba(127, 255, 212, 0.18) 52%, rgba(198, 255, 138, 0.16) 54.5%, transparent 59%);
    background-size: 300% 300%; background-repeat: no-repeat;
    background-position: calc(50% - var(--tx, 0) * 40%) calc(50% - var(--ty, 0) * 40%);
    mix-blend-mode: multiply;
}
.ic-holo2 {
    inset: 0; z-index: 3; opacity: 0.5; mix-blend-mode: color-burn;
    background: linear-gradient(calc(25deg - var(--tx, 0) * 35deg + var(--ty, 0) * 25deg),
        transparent 0 45%, rgba(148, 208, 255, 0.14) 49%, rgba(255, 106, 213, 0.11) 52%, transparent 56%);
    background-size: 300% 300%; background-repeat: no-repeat;
    background-position: calc(50% + var(--tx, 0) * 40%) calc(50% + var(--ty, 0) * 40%);
}
/* Glanzlicht: heller Lichtfleck + feiner Glanzstreifen, beide folgen der Neigung */
.ic-glare {
    inset: 0; z-index: 3;
    background:
        radial-gradient(circle at var(--px, 50%) var(--py, 50%), rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.35) 22%, rgba(255, 255, 255, 0) 46%),
        linear-gradient(calc(120deg + var(--tx, 0) * 20deg), transparent 40%, rgba(255, 255, 255, 0.55) 49%, rgba(255, 255, 255, 0.55) 51%, transparent 60%);
    background-size: 100% 100%, 260% 260%; background-repeat: no-repeat;
    background-position: 0 0, calc(50% - var(--tx, 0) * 40%) calc(50% - var(--ty, 0) * 40%);
    mix-blend-mode: soft-light;
}
.idcard-overlay { z-index: 5 !important; }
.idcard-foot .live { text-align: right; }
.idcard .live-dot { width: 1.8cqw; height: 1.8cqw; }
.idcard-foot .live .lbl { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.idcard-foot .live > div:last-child { font-weight: 700; font-size: 3.4cqw; color: var(--brand); font-variant-numeric: tabular-nums; line-height: 1.15; }
.live-date { font-weight: 600; color: #6c7894; font-size: 2.6cqw; }
.motion-hint { display: block; margin: -6px auto 12px; font: inherit; font-size: 0.8rem; font-weight: 600; color: var(--brand); background: none; border: 0; text-decoration: underline; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .idcard { transform: none; } }
.idcard-head { display: flex; align-items: center; justify-content: space-between; gap: 3cqw; }
.idcard-logo { height: 10cqw; width: auto; }
.idcard-type { text-align: right; font-weight: 800; font-size: 3cqw; letter-spacing: 0.08em; color: var(--brand); line-height: 1.25; }
.idcard-type .en { font-weight: 600; color: #6c7894; }

.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.7); animation: live 1.5s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 7px rgba(61, 220, 132, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); } }

.idcard-body { display: grid; grid-template-columns: 23% 1fr; gap: 4.5cqw; min-height: 0; overflow: hidden; align-items: start; }
.idcard.no-photo .idcard-body { grid-template-columns: 1fr; }
.photo {
    display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
    border-radius: 2cqw; background: #e9edf4; border: 1px solid #dde2ea;
}
.photo-missing { display: grid; place-items: center; font-size: 2.4cqw; text-align: center; color: #7a8497; padding: 2cqw; }
/* Angaben auf der Karte: Name über die ganze Breite, darunter je zwei nebeneinander */
.fields { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1.3cqw 3cqw; align-content: start; }
.fields > div { min-width: 0; }
.fields .f-wide { grid-column: 1 / -1; }
/* eine einzelne Zusatzangabe bekommt die ganze Zeile */
.fields > .f-extra:nth-child(even):last-child { grid-column: 1 / -1; }
.fields dt { font-size: 2.3cqw; text-transform: uppercase; letter-spacing: 0.06em; color: #6c7894; line-height: 1.2; }
.fields dd { margin: 0.2cqw 0 0; font-size: 3.6cqw; font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fields dd.name { font-size: 4.6cqw; font-weight: 800; line-height: 1.12; white-space: normal; overflow-wrap: anywhere; }
.fields dd.name > span:first-child { text-transform: uppercase; } /* nur der Nachname, nicht die Titel */

.idcard-foot { display: flex; justify-content: space-between; align-items: end; gap: 3cqw; }
.idcard-foot .right { text-align: right; }
.idcard-foot .lbl { font-size: 2.2cqw; text-transform: uppercase; letter-spacing: 0.06em; color: #6c7894; }
.valid-date { font-size: 4.4cqw; font-weight: 800; color: var(--ok); font-variant-numeric: tabular-nums; line-height: 1.15; }
.valid-date.expired { color: var(--bad); }

/* Weitere Angaben unter der Karte */
.card-extra {
    max-width: 460px; margin: 0 auto 16px; padding: 10px 16px;
    background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
    display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: baseline;
}
.card-extra[hidden] { display: none; }
.card-extra > div { display: contents; }
.card-extra dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.card-extra dd { margin: 0; font-weight: 600; }

.idcard-overlay {
    position: absolute; inset: 0;
    display: grid; place-items: center; text-align: center;
    background: rgba(179, 38, 30, 0.12);
    font-size: 6cqw; font-weight: 900; color: var(--bad);
    letter-spacing: 0.06em;
}
.idcard-overlay span { background: #fff; border: 3px solid currentColor; padding: 8px 16px; border-radius: 10px; transform: rotate(-8deg); }

.barcode-box {
    display: block; width: 100%; margin: 14px 0 6px; padding: 12px 12px 8px;
    background: #fff; border: 1px solid var(--line); border-radius: 14px; cursor: pointer;
}
.barcode-box svg { display: block; width: 100%; height: 70px; }
.barcode-label { font-size: 0.78rem; color: #6c7894; margin-top: 4px; }
.hinweis { font-size: 0.8rem; color: var(--muted); margin: 10px 4px; }
.sync-info { color: var(--muted); margin: 4px 4px 16px; }

/* ---------------------------------------------------------------- Nachweise / Info */
.cert { display: flex; gap: 12px; align-items: flex-start; }
.cert-icon { flex: 0 0 38px; height: 38px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; }
.cert h3 { margin-bottom: 2px; }
.cert .expired { color: var(--bad); }
.links a { display: flex; justify-content: space-between; align-items: center; padding: 12px 2px; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 600; }
.links a:last-child { border-bottom: 0; }
.links a::after { content: "›"; font-size: 1.4rem; color: var(--muted); }

/* ---------------------------------------------------------------- Navigation unten */
.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    display: flex; justify-content: space-around;
    padding: 6px 6px calc(6px + var(--safe-bottom));
    background: var(--panel); border-top: 1px solid var(--line);
}
.bottom-nav button {
    flex: 1; max-width: 120px;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 0; border: 0; background: none; cursor: pointer;
    font: inherit; font-size: 0.72rem; font-weight: 600; color: var(--muted);
}
.bottom-nav svg { width: 24px; height: 24px; fill: currentColor; }
.bottom-nav button.active { color: var(--brand); }
@media (prefers-color-scheme: dark) { .bottom-nav button.active { color: #93b2ff; } }

/* ---------------------------------------------------------------- Vollbild QR / Barcode */
.fullscreen {
    position: fixed; inset: 0; z-index: 50;
    background: var(--brand); color: #fff;
    overflow-y: auto;
    padding: calc(12px + var(--safe-top)) 16px calc(16px + var(--safe-bottom));
}
.fullscreen.light { background: #fff; color: #1b2230; }
.fs-inner { max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.fs-head { width: 100%; display: flex; justify-content: space-between; align-items: center; }
.fs-logo { height: 38px; background: #fff; padding: 5px 8px; border-radius: 8px; }
.fs-close { width: 44px; height: 44px; border-radius: 50%; border: 0; font-size: 1.8rem; line-height: 1; background: rgba(255, 255, 255, 0.18); color: inherit; cursor: pointer; }
.light .fs-close { background: #eef1f6; }
.qr-person { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; }
.qr-person img { width: 54px; height: 72px; object-fit: cover; border-radius: 8px; border: 2px solid #fff; }
.qr-name { font-size: 1.2rem; font-weight: 800; }
.qr-box { width: 100%; max-width: 360px; aspect-ratio: 1; background: #fff; border-radius: 18px; padding: 14px; }
.qr-box svg { display: block; width: 100%; height: 100%; }
.qr-meta { width: 100%; max-width: 360px; }
.qr-meta .live-dot { margin-right: 6px; }
.progress { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.25); overflow: hidden; margin-bottom: 8px; }
.progress div { height: 100%; width: 100%; background: #fff; transform-origin: left; }
.fullscreen .muted { color: rgba(255, 255, 255, 0.75); }
.fullscreen.light .muted { color: #5d6677; }
.barcode-big { width: 100%; padding: 30px 8px; }
.barcode-big svg { width: 100%; height: auto; max-height: 45vh; }

.toast {
    position: fixed; left: 50%; bottom: calc(90px + var(--safe-bottom)); transform: translateX(-50%);
    z-index: 60; max-width: 90vw;
    padding: 12px 18px; border-radius: 12px;
    background: #1b2230; color: #fff; font-weight: 600; font-size: 0.9rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

@media (prefers-reduced-motion: reduce) {
}

/* ---------------------------------------------------------------- Single Sign-On */
.sso-panel .btn.big { font-size: 1.05rem; }
.sso-panel .help { margin-bottom: 12px; }
.or { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; color: var(--muted); font-size: 0.85rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------------------------------------------------------------- Onboarding */
#view-onboarding { padding: calc(20px + var(--safe-top)) 16px calc(24px + var(--safe-bottom)); }
.onb { max-width: 460px; margin: 0 auto; }
.onb h1 { font-size: 1.35rem; margin: 10px 0 10px; }
.onb p { margin: 0 0 14px; }
.onb .btn.big { margin-top: 10px; }
.onb-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 8px; }
.onb-dots span { width: 28px; height: 5px; border-radius: 3px; background: var(--line); }
.onb-dots span.active { background: var(--brand); }
.onb-list { margin: 0 0 12px; padding-left: 22px; }
.onb-list li { margin-bottom: 10px; }
.onb-list .key { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); vertical-align: middle; font-weight: 800; }
.onb-list .key svg { width: 20px; height: 20px; fill: #1a73e8; }

/* Nachbau der Berechtigungsfrage des Browsers (Firefox) */
.browser-prompt {
    position: relative;
    margin: 6px 0 18px;
    padding: 18px 18px 16px;
    background: #fff; color: #15141a;
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.06);
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    font-size: 0.93rem;
}
.browser-prompt::before { /* Pfeil zur Adressleiste */
    content: ""; position: absolute; top: -8px; left: 28px;
    width: 16px; height: 16px; background: #fff; transform: rotate(45deg);
    box-shadow: -1px -1px 0 rgba(0, 0, 0, 0.06);
}
.bp-title { font-weight: 600; line-height: 1.35; margin-bottom: 10px; }
.bp-title strong { font-weight: 700; }
.bp-link { display: inline-block; color: #0061e0; text-decoration: underline; margin-bottom: 14px; }
.bp-check { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.bp-box { width: 18px; height: 18px; border: 1.5px solid #8f8f9d; border-radius: 4px; }
.bp-buttons { display: flex; justify-content: flex-end; gap: 8px; }
.bp-buttons span { padding: 9px 16px; border-radius: 6px; font-weight: 600; }
.bp-allow { background: #0061e0; color: #fff; box-shadow: 0 0 0 3px rgba(0, 97, 224, 0.35); animation: bp-pulse 1.6s ease-in-out infinite; }
.bp-block { background: #f0f0f4; color: #15141a; }
.bp-pointer { position: absolute; right: 118px; bottom: -22px; font-size: 1.8rem; transform: rotate(-10deg); }
@keyframes bp-pulse { 50% { box-shadow: 0 0 0 7px rgba(0, 97, 224, 0.12); } }
@media (prefers-reduced-motion: reduce) { .bp-allow { animation: none; } }
.form-title { font-size: 1.05rem; margin: 0 0 6px; }
.ms-btn { width: 100%; background: #fff; color: #5e5e5e; border: 1px solid #8c8c8c; font-weight: 600; }
.ms-btn svg { width: 21px; height: 21px; }
@media (prefers-color-scheme: dark) { .ms-btn { background: #2f2f2f; color: #fff; border-color: #2f2f2f; } }
/* Glanz deutlicher: kräftigere Überlagerung + leichter Schatten auf der Gegenseite */
.ic-glare { mix-blend-mode: overlay; }
.ic-glare::after {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(circle at calc(100% - var(--px, 50%)) calc(100% - var(--py, 50%)), rgba(30, 45, 90, 0.14), rgba(30, 45, 90, 0) 55%);
    mix-blend-mode: multiply;
}
.panel.account { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
/* Ausweis wechseln (Mitarbeitende, die auch studieren) */
.card-switch { display: flex; gap: 8px; }
.card-switch button {
    flex: 1; min-height: 46px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line);
    background: var(--panel); color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
}
.card-switch button.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.panel.account .btn { flex: 0 0 auto; }
/* Bibliotheksausweis als QR-Code */
.library-btn { width: 100%; margin-top: 10px; background: var(--panel); color: var(--brand); border: 2px solid var(--brand); }
.library-btn svg { width: 22px; height: 22px; fill: currentColor; }
.library-qr { width: min(78vw, 340px); margin: 24px auto 8px; padding: 14px; background: #fff; border-radius: 16px; }
.library-qr svg { display: block; width: 100%; height: auto; }
.library-num { text-align: center; font-size: 1.25rem; font-weight: 700; letter-spacing: 0.06em; font-family: ui-monospace, Consolas, monospace; }
/* Einrichtung: Browser-Frage nur als Beispielbild – schräg, blass, gekennzeichnet, nicht anklickbar */
.bp-example { position: relative; margin: 30px 10px 22px; transform: rotate(-3deg) scale(0.94); pointer-events: none; user-select: none; }
.bp-example .browser-prompt { margin: 0; opacity: 0.85; filter: grayscale(0.4); border: 2px dashed #9aa3b5; box-shadow: 0 6px 18px rgba(20, 35, 80, 0.12); }
.bp-example .bp-allow { animation: none; box-shadow: none; }
.bp-ribbon { position: absolute; top: -15px; left: 14px; z-index: 3; padding: 3px 12px; border-radius: 999px; background: #fff3d6; color: #7a5000; border: 1px solid #d49b1a; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.04em; }
.bp-mark { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; font-size: 2.8rem; font-weight: 900; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(179, 38, 30, 0.22); transform: rotate(-14deg); }
.library-missing { margin: 60px 16px; padding: 16px; border-radius: 12px; background: #fff3d6; color: #7a5000 !important; font-size: 1.05rem !important; font-weight: 600; text-align: center; }

/* Studium (Prototyp): Studien, Prüfungen, Ergebnisse */
.st-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.st-head h3 { margin: 0; }
.pill { font-size: 0.8rem; font-weight: 700; color: var(--brand); background: var(--bg); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
@media (prefers-color-scheme: dark) { .pill { color: #93b2ff; } }
.st-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.st-row:last-child { border-bottom: 0; }
.st-row > div:first-child { min-width: 0; }
.st-title { font-weight: 600; overflow-wrap: anywhere; }
.st-row .meta { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.st-sem { margin: 14px 0 2px; font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.st-sem:first-child { margin-top: 4px; }
.grade { flex: 0 0 auto; min-width: 42px; height: 42px; padding: 0 8px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; color: #fff; background: var(--muted); }
.grade.pos { background: var(--ok); }
.grade.neg { background: var(--bad); }
.grade.open { background: transparent; color: var(--muted); border: 1px dashed var(--muted); }
.st-actions { display: flex; gap: 10px; justify-content: space-between; margin-top: 4px; }
#st-studien details { margin-top: 6px; }
#st-studien summary { cursor: pointer; padding: 6px 0; }

/* Studium: Service aktivieren, „Neu für dich“, Benachrichtigungen */
.st-points { margin: 0 0 14px; padding-left: 18px; color: var(--muted); }
.st-points li { margin-bottom: 6px; }
.bottom-nav button { position: relative; }
.nav-badge { position: absolute; top: 0; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 0.68rem; font-weight: 800; line-height: 18px; text-align: center; }
.panel.st-neu { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border: 0; box-shadow: 0 10px 28px rgba(37, 66, 135, 0.28); }
.panel.st-neu h3 { color: #fff; }
.panel.st-neu .pill { background: rgba(255, 255, 255, 0.2); color: #fff; }
.panel.st-neu .st-row { border-color: rgba(255, 255, 255, 0.25); padding: 14px 0; }
.panel.st-neu .st-title { font-size: 1.05rem; }
.panel.st-neu .meta { color: rgba(255, 255, 255, 0.85); }
.panel.st-neu .grade { min-width: 56px; height: 56px; font-size: 1.5rem; background: #fff; color: var(--brand); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); }
.panel.st-neu .grade.neg { color: var(--bad); }
.panel.st-neu .grade.neutral { color: var(--muted); }
.panel.st-neu .btn { width: 100%; margin-top: 12px; background: #fff; color: var(--brand); border: 0; }
.st-row.is-new .st-title { color: var(--brand); }
@media (prefers-color-scheme: dark) { .st-row.is-new .st-title { color: #93b2ff; } }
.new-badge { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 0.65rem; font-weight: 800; letter-spacing: 0.04em; vertical-align: middle; }

/* Kalender: Monatsraster, Tagesliste, eigene Termine */
.kal-panel { padding: 12px 10px 10px; }
.kal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.kal-head .btn.small { min-width: 42px; font-size: 1.3rem; line-height: 1; padding: 0; }
.kal-title { flex: 1; border: 0; background: none; font: inherit; font-weight: 700; font-size: 1.05rem; color: var(--text); cursor: pointer; padding: 8px 0; text-transform: capitalize; }
.kal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.kal-dow { text-align: center; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); padding: 4px 0 6px; }
.kal-day { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; border-radius: 12px; background: none; color: var(--text); font: inherit; font-size: 0.95rem; cursor: pointer; padding: 0; }
.kal-day.other { color: var(--muted); opacity: 0.45; }
.kal-day.today { font-weight: 800; color: var(--brand); }
@media (prefers-color-scheme: dark) { .kal-day.today { color: #93b2ff; } }
.kal-day.sel { background: var(--brand); color: #fff; }
.kal-day:active { background: var(--bg); }
.kal-day.sel:active { background: var(--brand-dark); }
.kal-dots { display: flex; gap: 3px; height: 6px; }
.kal-dot { display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.kal-dot.own { background: var(--ok); }
.kal-day.sel .kal-dot { background: #fff; }
.kal-day.sel .kal-dot.own { background: #c8f0d4; }
.kal-ev { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kal-ev:last-child { border-bottom: 0; }
.kal-ev .bar { flex: 0 0 4px; align-self: stretch; border-radius: 2px; background: var(--brand); min-height: 34px; }
.kal-ev.own .bar { background: var(--ok); }
.kal-ev.own { cursor: pointer; }
.kal-time { flex: 0 0 70px; font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 2px; }
.kal-body { flex: 1; min-width: 0; }
.kal-body .meta { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.kal-desc { white-space: pre-wrap; margin-top: 6px !important; }
#kal-setup details { margin-top: 4px; color: var(--muted); }
#kal-setup summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
#kal-setup .form .btn { width: 100%; }
#kal-url { font-size: 0.95rem; }
/* Dialog eigener Termin */
.fs-inner.fs-left { text-align: left; align-items: stretch; }
.te-form { width: 100%; }
.te-form textarea { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); resize: vertical; }
.te-form .check { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 14px; }
.te-form .check input { width: 22px; height: 22px; margin: 0; }
.te-times { display: flex; gap: 12px; }
.te-times label { flex: 1; }
.te-form .btn.danger { margin-top: 10px; }
