/* Gemeinsames Styling für alle Tool-Seiten (tools/*.html)
 * Design-Foundation: Tokens (Light/Dark × Brand teal|classic), Buttons, Tabs, Panels.
 * Brand-Standard: teal (Landing). Klassisch (Violett) via html[data-brand="classic"].
 */
@import url('src/shared/tools-dark.css');
@import url('src/shared/dashboard-dark.css');

:root {
    color-scheme: light;

    /* Brand: Teal (Standard, Landing-Page) */
    --bg1: #0c6b5e;
    --bg2: #12263f;
    --brand1: #0d9f8a;
    --brand2: #12b59c;
    --ok1: #2dce89;
    --ok2: #11998e;
    --danger1: #f5365c;
    --danger2: #f56036;

    --text: #0c1222;
    --text-secondary: #5b6b82;
    --muted: #6c757d;
    --heading: #0c1222;
    --card: #ffffff;
    --card-elevated: rgba(255, 255, 255, 0.9);
    --border: rgba(12, 18, 34, 0.12);
    --border-strong: rgba(13, 159, 138, 0.32);
    --soft: #f0f7f5;
    --surface-muted: #e6f2ef;
    --input-bg: #ffffff;
    --input-border: #ced4da;
    --code-bg: #e5f5f1;
    --shadow: 0 14px 36px rgba(12, 18, 34, 0.08);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.28);
    --radius: 14px;
    --radius-lg: 20px;
    --radius-pill: 999px;

    --icon-muted: rgba(255, 255, 255, 0.92);
    --icon-dim: rgba(33, 37, 41, 0.72);

    --app-page-padding: 24px;
    --app-shell-width: min(1920px, calc(100vw - 2 * var(--app-page-padding)));
    --app-content-max: 1920px;
    --app-shell-max: 1920px;
    --app-max-width: 1920px;
}

html {
    min-height: 100%;
    overflow-x: clip;
    background: linear-gradient(135deg, var(--bg1) 0%, var(--bg2) 100%);
}


html[data-theme="dark"] {
    color-scheme: dark;

    --bg1: #07101f;
    --bg2: #0a3d36;
    --brand1: #14c4ab;
    --brand2: #0d9f8a;
    --ok1: #34d399;
    --ok2: #10b981;
    --danger1: #fb7185;
    --danger2: #f97316;

    --text: #e8eef6;
    --text-secondary: #a8b4c4;
    --muted: #8b9aab;
    --heading: #f2f6fb;
    --card: #121a28;
    --card-elevated: rgba(22, 32, 48, 0.92);
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(20, 196, 171, 0.38);
    --soft: #0c1420;
    --surface-muted: #1a2638;
    --input-bg: #1a2638;
    --input-border: rgba(255, 255, 255, 0.14);
    --code-bg: #1e2d3a;
    --shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.55);
    --icon-muted: rgba(255, 255, 255, 0.9);
    --icon-dim: rgba(232, 238, 246, 0.72);
}

html[data-theme="light"] {
    color-scheme: light;

    --bg1: #0c6b5e;
    --bg2: #12263f;
    --brand1: #0d9f8a;
    --brand2: #12b59c;
    --ok1: #2dce89;
    --ok2: #11998e;
    --danger1: #f5365c;
    --danger2: #f56036;

    --text: #0c1222;
    --text-secondary: #5b6b82;
    --muted: #6c757d;
    --heading: #0c1222;
    --card: #ffffff;
    --card-elevated: rgba(255, 255, 255, 0.9);
    --border: rgba(12, 18, 34, 0.12);
    --border-strong: rgba(13, 159, 138, 0.32);
    --soft: #f0f7f5;
    --surface-muted: #e6f2ef;
    --input-bg: #ffffff;
    --input-border: #ced4da;
    --code-bg: #e5f5f1;
    --shadow: 0 14px 36px rgba(12, 18, 34, 0.08);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.28);
    --icon-muted: rgba(255, 255, 255, 0.92);
    --icon-dim: rgba(33, 37, 41, 0.72);
}

/* Klassisch: Violett (bisheriges Design) */
html[data-brand="classic"],
html[data-brand="classic"][data-theme="light"] {
    --bg1: #667eea;
    --bg2: #764ba2;
    --brand1: #5e72e4;
    --brand2: #825ee4;
    --border-strong: rgba(94, 114, 228, 0.28);
    --soft: #f5f6fb;
    --surface-muted: #eef0f8;
    --code-bg: #eef0ff;
    --text: #1e2440;
    --heading: #1e2440;
    --text-secondary: #5c6578;
}

html[data-brand="classic"][data-theme="dark"] {
    --bg1: #2a2f6b;
    --bg2: #3b1f63;
    --brand1: #7b8cff;
    --brand2: #a78bfa;
    --border-strong: rgba(123, 140, 255, 0.35);
    --soft: #15182a;
    --surface-muted: #24283e;
    --code-bg: #2a2f48;
    --card: #1c1f33;
    --card-elevated: rgba(36, 40, 62, 0.88);
    --text: #e8eaf4;
    --heading: #f3f4ff;
    --text-secondary: #aeb4c8;
    --muted: #9aa3b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: transparent;
    min-height: 100vh;
    width: 100%;
    margin: 0;
    padding: var(--app-page-padding);
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Hauptinhalt: feste Shell-Breite, nie breiter als 1920px */
body > .container,
body > .page-card,
body > .container.page-card,
body > .welcome-wrap {
    box-sizing: border-box;
    width: var(--app-shell-width);
    max-width: var(--app-content-max);
    flex: 1 1 auto;
    margin-inline: auto;
}

.container {
    width: 100%;
    max-width: var(--app-content-max);
    background: var(--card);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.page-card {
    width: 100%;
    max-width: var(--app-content-max);
}

.header {
    background: linear-gradient(135deg, var(--brand1) 0%, var(--brand2) 100%);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
}

/* Brand-Logo: Teal (Standard) vs Klassisch – abhängig von html[data-brand] */
.app-brand-logo {
    margin: 2px auto 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}
.app-brand-logo__mark {
    display: block;
    width: auto;
    height: auto;
    max-width: min(96px, 28vw);
    max-height: 88px;
    border-radius: 18px;
}
.app-brand-logo__mark--classic,
.app-brand-logo__mark--classic[aria-hidden="true"],
.app-brand-logo__mark--classic[hidden] {
    display: none !important;
}
html[data-brand="classic"] .app-brand-logo__mark--teal,
html[data-brand="classic"] .app-brand-logo__mark--teal[aria-hidden="true"],
html[data-brand="classic"] .app-brand-logo__mark--teal[hidden] {
    display: none !important;
}
html[data-brand="classic"] .app-brand-logo__mark--classic {
    display: block !important;
}
html[data-brand="teal"] .app-brand-logo__mark--classic {
    display: none !important;
}
html:not([data-brand="classic"]) .app-brand-logo__mark--classic {
    display: none !important;
}
html:not([data-brand="classic"]) .app-brand-logo__mark--teal {
    display: block !important;
}

.ms365-header-nav {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 6;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ms365-header-nav .btn {
    margin: 0;
    padding: 8px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.92);
    color: #32325d;
    border: 1px solid rgba(255, 255, 255, 0.35);
    font-weight: 800;
}
.ms365-header-nav .btn:hover {
    background: #fff;
    transform: none;
}

.ms365-truncation-banner {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, #b42318 35%, var(--border, #dee2e6));
    background: color-mix(in srgb, #b42318 10%, var(--card, #fff));
    color: var(--heading, #32325d);
    font-size: 0.92em;
    line-height: 1.45;
}
.ms365-truncation-banner[hidden] {
    display: none !important;
}
.ms365-sync-trust {
    display: grid;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border, #dee2e6);
    background: color-mix(in srgb, var(--brand1, #0d6efd) 6%, var(--card, #fff));
}
.ms365-sync-trust__check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    font-size: 0.92em;
    font-weight: 600;
    color: var(--heading, #32325d);
    cursor: pointer;
}
.ms365-sync-trust__check input {
    margin-top: 3px;
}
.ms365-write-hint {
    margin: 8px 0 0;
    font-size: 0.88em;
    color: var(--muted, #6c757d);
}
.ms365-bulk-progress {
    margin: 12px 0;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border, #dee2e6);
    background: var(--card, #fff);
}
.ms365-bulk-progress__bar {
    height: 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--border, #dee2e6) 80%, transparent);
    overflow: hidden;
    margin-bottom: 8px;
}
.ms365-bulk-progress__bar > [data-fill],
.ms365-bulk-progress__bar > div {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--brand1, #0d6efd), var(--brand2, #20c997));
    transition: width 160ms ease;
}
.ms365-empty-state-banner {
    margin: 0 0 16px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px dashed color-mix(in srgb, var(--brand1, #0d6efd) 35%, var(--border, #dee2e6));
    background: color-mix(in srgb, var(--brand1, #0d6efd) 7%, var(--card, #fff));
}
.ms365-empty-state-banner p {
    margin: 0 0 10px;
    line-height: 1.45;
}
.ms365-empty-state-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.dash-playbooks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin: 8px 0 18px;
}
a.dash-playbook-card,
.dash-playbook-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border, #dee2e6);
    background: var(--card, #fff);
    text-decoration: none !important;
    color: inherit !important;
    transition: border-color 140ms ease, box-shadow 140ms ease;
    box-shadow: 0 6px 16px rgba(30, 36, 64, 0.05);
}
a.dash-playbook-card:hover,
.dash-playbook-card:hover {
    border-color: color-mix(in srgb, var(--brand1, #0d6efd) 45%, var(--border, #dee2e6));
    box-shadow: 0 8px 20px color-mix(in srgb, var(--brand1, #0d6efd) 12%, transparent);
    text-decoration: none !important;
    color: inherit !important;
}
a.dash-playbook-card:visited,
a.dash-playbook-card:active {
    text-decoration: none !important;
    color: inherit !important;
}
.dash-playbook-card h3 {
    margin: 0;
    font-size: 1.02rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--heading, #32325d);
}
.dash-playbook-card p {
    margin: 0;
    font-size: 0.9em;
    color: var(--muted, #6c757d);
    line-height: 1.4;
}
.dash-automationen-more {
    margin: 8px 0 0;
    font-size: 0.9em;
    color: var(--muted, #6c757d);
}
@media (max-width: 768px) {
    .ms365-header-tools #ms365AuthWidget {
        max-width: 100%;
    }
}

.header > #ms365AuthWidget,
.ms365-auth-widget {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: nowrap;
}
.header > #ms365AuthWidget {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 6;
    margin: 0;
    max-width: min(420px, calc(100% - 168px));
}
.ms365-auth-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0;
}
.header > #ms365AuthWidget .btn {
    margin: 0;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.92);
    color: #32325d;
    border: 1px solid rgba(255, 255, 255, 0.35);
    font-weight: 800;
}
.header > #ms365AuthWidget .btn:hover {
    background: #fff;
    transform: none;
}

.ms365-auth-widget [hidden],
.ms365-auth-menu[hidden],
.ms365-auth-menu__panel[hidden] {
    display: none !important;
}
.ms365-auth-menu {
    position: relative;
}
.ms365-auth-menu__trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: min(280px, 42vw);
    margin: 0;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.92);
    color: #32325d;
    font: inherit;
    font-weight: 800;
    font-size: 0.92em;
    cursor: pointer;
    min-width: 0;
}
.ms365-auth-menu__trigger:hover,
.ms365-auth-menu.is-open .ms365-auth-menu__trigger {
    background: #fff;
}
.ms365-auth-menu__trigger .bi {
    margin: 0;
    flex: 0 0 auto;
}
.ms365-auth-menu__trigger #ms365AuthBadgeText {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.ms365-auth-menu__chevron {
    font-size: 0.85em;
    opacity: 0.7;
    transition: transform 0.15s ease;
}
.ms365-auth-menu.is-open .ms365-auth-menu__chevron {
    transform: rotate(180deg);
}
.ms365-auth-menu__panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 40;
    min-width: 260px;
    max-width: min(340px, calc(100vw - 32px));
    padding: 8px;
    border-radius: 12px;
    background: #fff;
    color: #32325d;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.22);
    border: 1px solid rgba(50, 50, 93, 0.08);
    text-align: left;
}
.ms365-auth-menu__meta {
    padding: 8px 12px 10px;
    border-bottom: 1px solid #e9ecef;
}
.ms365-auth-menu__meta-name {
    font-weight: 800;
    line-height: 1.3;
    word-break: break-word;
}
.ms365-auth-menu__meta-mail {
    margin-top: 2px;
    font-size: 0.85em;
    font-weight: 600;
    color: #6c757d;
    word-break: break-all;
}
.ms365-auth-menu__ctx {
    padding: 8px 12px 10px;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ms365-auth-menu__ctx-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}
.ms365-auth-menu__ctx-k {
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6c757d;
    flex: 0 0 auto;
}
.ms365-auth-menu__ctx-v {
    font-weight: 800;
    font-size: 0.92em;
    text-align: right;
    word-break: break-all;
    min-width: 0;
}
.ms365-auth-menu__tenant {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
    max-width: 100%;
}
.ms365-auth-menu__tenant code {
    font-size: 0.78em;
    font-weight: 600;
    word-break: break-all;
}
.ms365-auth-menu__copy {
    border: none;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 6px;
    line-height: 1;
    flex-shrink: 0;
}
.ms365-auth-menu__copy:hover {
    color: #32325d;
    background: rgba(0, 0, 0, 0.05);
}
.ms365-auth-menu__item {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #32325d;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
}
.ms365-auth-menu__item .bi {
    margin: 0;
    flex: 0 0 auto;
}
.ms365-auth-menu__item:hover,
.ms365-auth-menu__item:focus-visible {
    background: color-mix(in srgb, var(--brand1) 10%, #fff);
    outline: none;
}
.ms365-auth-menu__item--danger:hover,
.ms365-auth-menu__item--danger:focus-visible {
    background: #fff0f3;
    color: #f5365c;
}
.ms365-auth-menu__section {
    padding: 8px 4px 6px;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 4px;
}
.ms365-auth-menu__section-label {
    padding: 0 8px 6px;
    font-size: 0.72em;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6c757d;
}
.ms365-auth-menu__brand-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 0 4px 4px;
}
.ms365-auth-menu__brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 8px 6px;
    border-radius: 8px;
    border: 1px solid rgba(12, 18, 34, 0.12);
    background: #f8fafc;
    color: #32325d;
    font: inherit;
    font-size: 0.82em;
    font-weight: 700;
    cursor: pointer;
}
.ms365-auth-menu__brand:hover {
    background: #fff;
    border-color: color-mix(in srgb, var(--brand1) 45%, transparent);
}
.ms365-auth-menu__brand.is-active,
.ms365-auth-menu__brand[aria-checked="true"] {
    border-color: var(--brand1);
    background: color-mix(in srgb, var(--brand1) 12%, #fff);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand1) 18%, transparent);
}
.ms365-auth-menu__brand-swatch {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    flex: 0 0 auto;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.ms365-auth-menu__brand-swatch--teal {
    background: linear-gradient(135deg, #0d9f8a, #12b59c);
}
.ms365-auth-menu__brand-swatch--classic {
    background: linear-gradient(135deg, #5e72e4, #825ee4);
}
html[data-theme="dark"] .ms365-auth-menu__section {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}
html[data-theme="dark"] .ms365-auth-menu__section-label {
    color: #8b9aab;
}
html[data-theme="dark"] .ms365-auth-menu__brand {
    background: #1a2638;
    border-color: rgba(255, 255, 255, 0.12);
    color: #e8eef6;
}
html[data-theme="dark"] .ms365-auth-menu__brand:hover {
    background: #243044;
}
html[data-theme="dark"] .ms365-auth-menu__brand.is-active,
html[data-theme="dark"] .ms365-auth-menu__brand[aria-checked="true"] {
    background: color-mix(in srgb, var(--brand1) 22%, #1a2638);
}
html[data-theme="dark"] .ms365-auth-menu__item:hover,
html[data-theme="dark"] .ms365-auth-menu__item:focus-visible {
    background: color-mix(in srgb, var(--brand1) 18%, transparent);
}

.header-tool-indicator {
    /* Header-Reihenfolge: Titel -> Logo -> Toolname -> Kurzbeschreibung */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 16px auto 8px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    font-size: 0.95em;
    line-height: 1.2;
    position: static;
}
.header-tool-indicator__label {
    opacity: 0.92;
    font-weight: 700;
    letter-spacing: 0.2px;
}
.header-tool-indicator__label { display: none; }
.header-tool-indicator__name {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 900;
}

.header h1 {
    font-size: 2em;
    margin: 0 auto 10px;
    max-width: min(36rem, calc(100% - 24px));
    text-align: center;
}

@media (max-width: 1099px) {
    .header {
        padding-top: 68px;
    }
    .header > #ms365AuthWidget {
        max-width: calc(100% - 32px);
    }
}
@media (max-width: 640px) {
    .ms365-auth-menu__trigger #ms365AuthBadgeText {
        display: none;
    }
    .ms365-auth-menu__trigger {
        max-width: none;
        padding: 8px 10px;
    }
}

.header p {
    opacity: 0.9;
    font-size: 1.1em;
}

/* Kurzbeschreibung unter Toolname (nicht der fixierte Hilfe-Link): max. 2 Zeilen */
.header > p:not(.header-help-row) {
    max-width: min(720px, 92vw);
    margin-left: auto;
    margin-right: auto;
    margin-top: 6px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.header > p:not(.header-help-row) code {
    font-size: 0.92em;
    font-family: Consolas, 'Segoe UI', monospace;
    background: rgba(255, 255, 255, 0.18);
    padding: 1px 6px;
    border-radius: 6px;
}

.app-fixed-footer {
    position: relative;
    width: var(--app-shell-width);
    max-width: var(--app-content-max);
    margin-top: auto;
    margin-inline: auto;
    padding-top: 12px;
    flex: 0 0 auto;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 16px;
    pointer-events: none;
}

.app-fixed-footer__left,
.app-fixed-footer__right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    pointer-events: auto;
}

.app-fixed-footer__right {
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    margin-left: auto;
}

.header-help-row {
    margin: 0;
    font-size: 0.95em;
}

.header-help-link__label {
    display: none;
}

.header-help-link:hover .header-help-link__label,
.header-help-link:focus .header-help-link__label {
    display: inline;
}

.header-help-link,
.site-credit-link,
.ms365-theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid color-mix(in srgb, var(--brand1) 25%, transparent);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
    color: #32325d;
    text-decoration: none;
    font-weight: 700;
    opacity: 0.98;
    font: inherit;
    cursor: pointer;
    line-height: 1;
}
.header-help-link:hover,
.site-credit-link:hover,
.ms365-theme-toggle:hover {
    opacity: 1;
    background: #fff;
}

.site-credit-row {
    margin: 0;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.app-published-stamp {
    margin: 0;
    padding: 0;
    font-size: 0.72em;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0.01em;
    color: #fff;
    opacity: 0.82;
    white-space: nowrap;
    text-align: right;
}

@media (max-width: 720px) {
    .app-fixed-footer {
        align-items: stretch;
        flex-direction: column;
    }
    .app-fixed-footer__left,
    .app-fixed-footer__right {
        width: 100%;
    }
    .app-fixed-footer__right {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        margin-left: 0;
    }
    .app-published-stamp {
        text-align: left;
    }
}
.site-credit-link .bi,
.ms365-theme-toggle .bi {
    margin: 0;
    color: rgba(50, 50, 93, 0.88);
    font-size: 1.1em;
    opacity: 0.95;
}

html[data-theme="dark"] .site-credit-link,
html[data-theme="dark"] .ms365-theme-toggle,
html[data-theme="dark"] .header-help-link {
    background: rgba(28, 31, 51, 0.92);
    color: #e8eaf4;
    border-color: rgba(255, 255, 255, 0.18);
}
html[data-theme="dark"] .site-credit-link:hover,
html[data-theme="dark"] .ms365-theme-toggle:hover,
html[data-theme="dark"] .header-help-link:hover {
    background: #24283e;
}
html[data-theme="dark"] .site-credit-link .bi,
html[data-theme="dark"] .ms365-theme-toggle .bi,
html[data-theme="dark"] .header-help-link .bi {
    color: rgba(232, 234, 244, 0.9);
}


.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.12);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* Seiten-eigene Aktionen im Header (keine globale Kontextleiste) */
.header .toolbar {
    border-radius: 12px;
    margin-top: 16px;
    border: 1px solid rgba(255, 255, 255, 0.16);
}
/* Dashboard wandert nach links oben – leere Kapsel nicht stehen lassen */
.header .toolbar:not(:has(a[href], button, input, select, textarea)) {
    display: none;
}

/* Toolbar unten (Zwischenstand) */
.bottom-toolbar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    background: var(--soft);
    border-top: 1px solid var(--border);
    justify-content: center;
}

.content { padding: 30px; color: var(--text); }

.btn {
    background: linear-gradient(135deg, var(--brand1) 0%, var(--brand2) 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 1em;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    margin: 10px 5px;
    display: inline-block;
    text-decoration: none;
    font-weight: 650;
}

/* Icons (Bootstrap Icons) */
.bi {
    display: inline-block;
    vertical-align: -0.125em;
    line-height: 1;
}
.btn .bi {
    margin-right: 8px;
    font-size: 1.05em;
    opacity: 0.98;
}
.toolbar .btn .bi,
.bottom-toolbar .btn .bi {
    margin-right: 6px;
}
.header .header-help-link .bi {
    margin: 0;
    color: rgba(50, 50, 93, 0.9);
}

.header-tool-indicator .bi {
    position: static;
    transform: none;
    margin: 0 0 6px;
    opacity: 0.95;
    font-size: 3.75em; /* 3× von 1.25em */
    pointer-events: none;
    display: block;
}

.header-tool-indicator__name {
    display: block;
    text-align: center;
    font-size: 1.35em;
    font-weight: 900;
}

/* Toolname + Icon: konsistente Typografie/Spacing */
.header-tool-indicator__name {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.header-tool-indicator__name > i.bi {
    margin: 0;
    font-size: 3.75em;
    line-height: 1;
    opacity: 0.95;
    pointer-events: none;
    display: block;
}

.steps .step .bi {
    margin-right: 6px;
    opacity: 0.9;
}

.copy-btn .bi {
    margin-right: 6px;
}

.toolbar .btn {
    margin: 0;
    font-size: 0.9em;
    padding: 8px 16px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px color-mix(in srgb, var(--brand1) 40%, transparent);
}
.btn:disabled {
    background: var(--muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.btn-success { background: linear-gradient(135deg, var(--ok1) 0%, var(--ok2) 100%); }
.btn-brand {
    background: linear-gradient(135deg, var(--brand1) 0%, var(--brand2) 100%);
    color: #fff;
}
.btn-brand:hover {
    box-shadow: 0 5px 15px color-mix(in srgb, var(--brand1) 45%, transparent);
}
.btn-brand:disabled {
    background: var(--muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.btn-danger { background: linear-gradient(135deg, var(--danger1) 0%, var(--danger2) 100%); }
.btn-small,
.btn-sm { padding: 5px 10px; font-size: 0.85em; }
.btn.alt,
.btn-ghost {
    background: var(--surface-muted);
    color: var(--heading);
    border: 1px solid var(--border);
    box-shadow: none;
}
.btn.alt:hover,
.btn-ghost:hover {
    background: var(--card);
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}
.small-btn {
    appearance: none;
    border: 1px solid var(--border);
    background: var(--surface-muted);
    color: var(--heading);
    border-radius: 10px;
    padding: 8px 12px;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
}
.small-btn:hover {
    border-color: var(--border-strong);
    background: var(--card);
}
.copy-btn { float: right; margin-top: -10px; }

/* Kursteams: schmale Delete-Aktionsspalte */
.kt-action-col {
    width: 38px;
    min-width: 38px;
    max-width: 38px;
    text-align: center;
}
.kt-action-col,
th.kt-action-col,
td.kt-action-col {
    padding-left: 6px !important;
    padding-right: 6px !important;
}
.kt-delete-btn {
    width: 28px;
    height: 26px;
    padding: 0;
    line-height: 26px;
    border-radius: 8px;
    font-weight: 900;
    letter-spacing: 0.5px;
}

/* Schritt-Assistent: Karte + Fortschrittsbalken (alle Tools) */
.steps {
    --step-progress-pct: 11%;
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    justify-content: center;
    align-items: stretch;
    padding: 20px 18px 18px;
    margin: 0 0 12px;
    background: linear-gradient(180deg, #ffffff 0%, var(--soft) 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 4px 22px rgba(50, 50, 93, 0.07);
}
.steps::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 22px;
    right: 22px;
    height: 6px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--brand1) 14%, transparent);
    pointer-events: none;
}
.steps::after {
    content: '';
    position: absolute;
    top: 14px;
    left: 22px;
    width: var(--step-progress-pct, 12%);
    max-width: calc(100% - 44px);
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--ok1) 0%, var(--brand1) 55%, var(--brand2) 100%);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}
.steps .step {
    position: relative;
    text-align: center;
    padding: 10px 12px 12px;
    margin-top: 24px;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s, color 0.2s;
    cursor: pointer;
    flex: 1 1 auto;
    min-width: 108px;
    max-width: 220px;
    font-size: 0.82em;
    font-weight: 500;
    line-height: 1.3;
    color: var(--text-secondary);
    background: var(--card);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.steps .step:hover {
    border-color: var(--border-strong);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}
.steps .step.active {
    background: linear-gradient(135deg, var(--brand1) 0%, var(--brand2) 100%);
    color: #fff;
    font-weight: 600;
    border-color: transparent;
    box-shadow: 0 10px 22px color-mix(in srgb, var(--brand1) 35%, transparent);
}
.steps .step.completed {
    background: color-mix(in srgb, var(--ok1) 18%, var(--card));
    color: color-mix(in srgb, var(--ok2) 80%, var(--heading));
    border-color: color-mix(in srgb, var(--ok1) 45%, var(--border));
    font-weight: 600;
}
.steps .step.step--optional {
    max-width: 260px;
    font-size: 0.78em;
    color: var(--muted);
    border-style: dashed;
    background: var(--soft);
}
.steps .step.step--optional.active {
    color: #fff;
    border-style: solid;
    background: linear-gradient(135deg, var(--brand1) 0%, var(--brand2) 100%);
}
.steps .step.step--optional.completed {
    color: #146c43;
    border-style: solid;
}

/* Kursteams: alle Schritte in einer Zeile (bei Platzmangel horizontal scrollen) */
.steps.steps--one-line {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-color: color-mix(in srgb, var(--brand1) 45%, transparent) color-mix(in srgb, var(--brand1) 8%, transparent);
    scrollbar-width: thin;
}
.steps.steps--one-line::-webkit-scrollbar {
    height: 7px;
}
.steps.steps--one-line::-webkit-scrollbar-track {
    background: color-mix(in srgb, var(--brand1) 8%, transparent);
    border-radius: 999px;
}
.steps.steps--one-line::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--brand1) 40%, transparent);
    border-radius: 999px;
}
.steps.steps--one-line .step {
    flex: 0 0 auto;
    min-width: 0;
    max-width: none;
    white-space: nowrap;
    padding: 8px 10px 10px;
    font-size: 0.72em;
}
.steps.steps--one-line .step.step--optional {
    max-width: none;
    font-size: 0.68em;
}

/* Step-Inhalte: nur aktiven Schritt anzeigen */
.step-content { display: none; }
.step-content.active { display: block; animation: fadeIn 0.3s; }
.wtg-step-content { display: none; }
.wtg-step-content.active { display: block; animation: fadeIn 0.3s; }

/* Kompatibilität: ältere/alternative Step-Container-Klassen */
.arge-step-content,
.jg-step-content,
.gp-step-content,
.ku-step-content,
.slg-step-content { display: none; }
.arge-step-content.active,
.jg-step-content.active,
.gp-step-content.active,
.ku-step-content.active,
.slg-step-content.active { display: block; animation: fadeIn 0.3s; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 15px 0;
}
.alert-warning { background: #fff3cd; border-left: 4px solid #ffc107; color: #856404; }
.alert-info { background: #d1ecf1; border-left: 4px solid #17a2b8; color: #0c5460; }
.alert-success { background: #d4edda; border-left: 4px solid #28a745; color: #155724; }

.filter-section {
    background: var(--soft);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid var(--border);
    color: var(--text);
}
.filter-group { margin: 15px 0; }
.filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--heading);
}
.filter-group input:not([type="checkbox"]):not([type="radio"]),
.filter-group select,
.filter-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    font-size: 1em;
    background: var(--input-bg);
    color: var(--text);
}

/* Zwei-Spalten-Eingabe + Vorschau (ARGE/Jahrgang) */
.arge-step1-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    align-items: start;
    margin-top: 8px;
}
@media (max-width: 768px) {
    .arge-step1-grid { grid-template-columns: 1fr; }
}

/* Kursteams: Fächer-Checkbox-Filter */
.subject-filter-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}
.subject-filter-toolbar .btn {
    margin: 0;
}
.subject-filter-search {
    flex: 1 1 260px;
    min-width: 220px;
}
.subject-filter-search input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    font-size: 1em;
    background: var(--input-bg);
    color: var(--text);
}
.subject-filter-list {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px 12px;
    max-height: 220px;
    overflow: auto;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
}
.subject-filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    background: var(--soft);
    border: 1px solid var(--border);
    color: var(--text);
}
.subject-filter-item:hover {
    border-color: var(--border-strong);
}
.subject-filter-item input {
    margin: 0;
}
.subject-filter-item code {
    font-family: Consolas, 'Segoe UI', monospace;
    font-size: 0.95em;
}
.subject-filter-summary {
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.9em;
    line-height: 1.4;
}
.subject-filter-advanced {
    margin-top: 10px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
}
.subject-filter-advanced summary {
    cursor: pointer;
    color: var(--heading);
    font-weight: 600;
}
.subject-filter-advanced .filter-group {
    margin: 12px 0 0;
}
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 10px;
}
.checkbox-label input { margin: 0; }

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.9em;
}
th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
th {
    background: var(--brand1);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
}
.kt-sortable-th { cursor: pointer; user-select: none; }
.kt-sort-indicator { opacity: 0.95; margin-left: 6px; font-weight: 900; }
.table-container {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}

/* Teamname-Baukasten (Drag & Drop) */
.name-builder {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.name-builder-dropzone {
    flex: 1 1 420px;
    min-height: 54px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px dashed color-mix(in srgb, var(--brand1) 55%, transparent);
    border-radius: 12px;
    background: #fff;
}
.name-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.08);
    background: #f8f9ff;
    color: #32325d;
    font-weight: 800;
    cursor: grab;
    user-select: none;
    white-space: nowrap;
}
.name-chip:active { cursor: grabbing; }
.name-chip code {
    font-family: Consolas, 'Segoe UI', monospace;
    font-weight: 900;
}
.name-chip .chip-x {
    appearance: none;
    border: 0;
    background: transparent;
    color: #6c757d;
    font-weight: 900;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}
.name-chip .chip-x:hover { color: #111; }
.name-builder-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.name-builder-palette {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.name-builder-inputs {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}
.name-builder-inputs .filter-group {
    margin: 0;
    flex: 1 1 260px;
    min-width: 220px;
}
.name-preview {
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.95em;
    line-height: 1.45;
}

.powershell-code {
    background: #012456;
    color: #f0f0f0;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    overflow-x: auto;
    margin: 20px 0;
}
.powershell-code pre { margin: 0; white-space: pre-wrap; }

/* Legacy-Toast (#toast) – bleibt kompatibel, optisch an zentrales System angeglichen */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    left: auto;
    transform: translateY(8px);
    background: var(--heading, #32325d);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius, 14px);
    z-index: 1001;
    display: none;
    max-width: min(420px, calc(100vw - 48px));
    text-align: left;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Zentrale Toasts (ms365ShowToast) – rechts unten */
.ms365-toast-host {
    position: fixed;
    inset: auto 16px 16px auto;
    z-index: 10060;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 10px;
    padding: 0;
    max-width: min(440px, calc(100vw - 32px));
    width: min(440px, calc(100vw - 32px));
    pointer-events: none;
}
.ms365-toast {
    pointer-events: auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 12px;
    width: 100%;
    padding: 14px 14px 14px 16px;
    border-radius: var(--radius, 14px);
    background: var(--card, #fff);
    color: var(--text, #1e2440);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(12px) translateX(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    overflow: hidden;
}
.ms365-toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--brand1);
}
.ms365-toast {
    position: relative;
}
.ms365-toast--show {
    opacity: 1;
    transform: translateY(0) translateX(0);
}
.ms365-toast--hide {
    opacity: 0;
    transform: translateY(8px) translateX(8px);
}
.ms365-toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: #fff;
    background: var(--brand1);
}
.ms365-toast-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}
.ms365-toast-body {
    min-width: 0;
    padding-top: 1px;
}
.ms365-toast-title {
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 2px;
    line-height: 1.2;
}
.ms365-toast-msg {
    font-size: 0.98rem;
    font-weight: 600;
    line-height: 1.45;
    color: var(--heading, var(--text));
    white-space: pre-wrap;
    word-break: break-word;
}
.ms365-toast-close {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 1.35rem;
    line-height: 1;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    cursor: pointer;
    margin: -4px -4px 0 0;
}
.ms365-toast-close:hover {
    background: var(--soft);
    color: var(--heading);
}
.ms365-toast--success::before { background: var(--ok1); }
.ms365-toast--success .ms365-toast-icon { background: linear-gradient(135deg, var(--ok1), var(--ok2)); }
.ms365-toast--error::before { background: var(--danger1); }
.ms365-toast--error .ms365-toast-icon { background: linear-gradient(135deg, var(--danger1), var(--danger2)); }
.ms365-toast--warning::before { background: #f5a623; }
.ms365-toast--warning .ms365-toast-icon { background: linear-gradient(135deg, #f5a623, #f56036); }
.ms365-toast--info::before { background: var(--brand1); }
.ms365-toast--info .ms365-toast-icon { background: linear-gradient(135deg, var(--brand1), var(--brand2)); }

/* Kursteams: Upload */
.upload-area {
    border: 3px dashed var(--brand1);
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--soft);
}
.upload-area:hover { border-color: var(--brand2); background: var(--surface-muted); }
.upload-area.dragover { border-color: var(--ok1); background: color-mix(in srgb, var(--ok1) 18%, var(--card)); }
.upload-icon { font-size: 4em; margin-bottom: 20px; }
input[type="file"] { display: none; }

/* Modal (Kursteams) */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: white;
    border-radius: 12px;
    max-width: 480px;
    width: 100%;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.modal-box h3 { margin-bottom: 16px; color: #32325d; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }

/* Phase 3: Lizenz-Gate */
.ms365-license-gate {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(5px);
}
.ms365-license-gate[hidden] {
    display: none !important;
}
/* Overlay ist UX – bei Sperr-/Login-Zustand Interaktion mit der Seite unterbinden */
html[data-ms365-license="denied"] body > *:not(.ms365-license-gate),
html[data-ms365-license="login"] body > *:not(.ms365-license-gate),
html[data-ms365-license="error"] body > *:not(.ms365-license-gate),
html[data-ms365-license="checking"] body > *:not(.ms365-license-gate) {
    pointer-events: none;
    user-select: none;
}
.ms365-license-gate__card {
    width: min(520px, 100%);
    background: var(--card-bg, #fff);
    color: var(--text, #32325d);
    border-radius: 14px;
    padding: 28px 24px 22px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
    text-align: center;
}
.ms365-license-gate__icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--brand1) 14%, transparent);
    color: var(--brand1);
    font-size: 1.4rem;
}
.ms365-license-gate__title {
    margin: 0 0 10px;
    font-size: 1.35rem;
    font-weight: 800;
}
.ms365-license-gate__text {
    margin: 0 0 14px;
    line-height: 1.5;
    color: var(--muted, #6b7280);
}
.ms365-license-gate__meta {
    text-align: left;
    background: rgba(148, 163, 184, 0.12);
    border-radius: 10px;
    padding: 12px 14px;
    margin: 0 0 16px;
    font-size: 0.95em;
    line-height: 1.45;
}
.ms365-license-gate__meta code {
    font-size: 0.85em;
    word-break: break-all;
}
.ms365-license-gate__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}
.admin-lic-table th,
.admin-lic-table td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 8px;
    vertical-align: top;
    font-size: 0.95em;
}
.admin-lic-actions {
    display: flex;
    gap: 6px;
    white-space: nowrap;
}

.admin-lic {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.admin-lic__intro {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px 18px;
}
.admin-lic__intro h2 {
    margin: 0 0 6px;
}
.admin-lic__intro p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
    max-width: 52ch;
}
.admin-lic__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.admin-lic__status {
    color: var(--muted);
    font-size: 0.95em;
    font-weight: 600;
}

.admin-lic__table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 14px);
    background: var(--card, #fff);
    box-shadow: var(--shadow, 0 8px 24px rgba(15, 23, 42, 0.06));
}
.admin-lic-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}
.admin-lic-table thead th {
    text-align: left;
    padding: 8px 10px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted, #6b7280);
    background: color-mix(in srgb, var(--brand1, #0d9f8a) 8%, transparent);
    border-bottom: 1px solid var(--border);
}
.admin-lic-sort {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: transparent;
    padding: 4px 2px;
    margin: 0;
    font: inherit;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    color: inherit;
    cursor: pointer;
}
.admin-lic-sort:hover,
.admin-lic-sort.is-active {
    color: var(--heading, #32325d);
}
.admin-lic-sort__icon {
    font-size: 0.85em;
    opacity: 0.55;
}
.admin-lic-sort.is-active .admin-lic-sort__icon {
    opacity: 1;
    color: var(--brand1, #0d9f8a);
}
.admin-lic-table tbody td {
    padding: 12px 14px;
    vertical-align: top;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
    font-size: 0.95em;
}
.admin-lic-table tbody tr:last-child td {
    border-bottom: none;
}
.admin-lic-table tbody tr:hover td {
    background: color-mix(in srgb, var(--brand1, #0d9f8a) 4%, transparent);
}
.admin-lic-row:not(.admin-lic-row--edit) {
    cursor: pointer;
}
.admin-lic-row:not(.admin-lic-row--edit) td {
    user-select: none;
}
.admin-lic-row--edit td {
    background: color-mix(in srgb, var(--brand1, #0d9f8a) 7%, transparent) !important;
    vertical-align: top;
}
.admin-lic-table__actions-col {
    width: 1%;
}
.admin-lic-school {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.admin-lic-school__name {
    font-weight: 800;
    color: var(--heading, #32325d);
}
.admin-lic-school__mail {
    font-size: 0.85em;
    color: var(--muted);
}
.admin-lic-tid {
    font-size: 0.78em;
    font-weight: 600;
    word-break: break-all;
    background: color-mix(in srgb, var(--border) 45%, transparent);
    padding: 3px 7px;
    border-radius: 6px;
}
.admin-lic-notes {
    max-width: 220px;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.9em;
    line-height: 1.4;
    color: var(--text-secondary, #495057);
}
.admin-lic-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: lowercase;
}
.admin-lic-badge--active {
    background: color-mix(in srgb, #12b886 16%, transparent);
    color: #0b7a56;
}
.admin-lic-badge--trial {
    background: color-mix(in srgb, #4c6ef5 16%, transparent);
    color: #364fc7;
}
.admin-lic-badge--expired {
    background: color-mix(in srgb, #fab005 20%, transparent);
    color: #9c6b00;
}
.admin-lic-badge--blocked,
.admin-lic-badge--unknown {
    background: color-mix(in srgb, #fa5252 16%, transparent);
    color: #c92a2a;
}
.admin-lic-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 220px;
}
.admin-lic-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--border) 55%, transparent);
    font-size: 0.78em;
    font-weight: 600;
    color: var(--text-secondary, #495057);
}
.admin-lic-muted {
    color: var(--muted);
}
.admin-lic-empty {
    text-align: center;
    padding: 28px 12px;
    color: var(--muted);
}
.admin-lic-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.admin-lic-icon-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.admin-lic-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
    font: inherit;
    background: var(--card, #fff);
    color: var(--text, #212529);
}
.admin-lic-input--sub {
    margin-top: 6px;
    font-size: 0.9em;
}
.admin-lic-input--mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.82em;
}
.admin-lic-input--area {
    resize: vertical;
    min-height: 52px;
    line-height: 1.35;
}
.admin-lic-input:focus {
    outline: 2px solid color-mix(in srgb, var(--brand1, #0d9f8a) 45%, transparent);
    border-color: var(--brand1, #0d9f8a);
}

html[data-theme='dark'] .admin-lic-badge--active {
    color: #69db7c;
}
html[data-theme='dark'] .admin-lic-badge--trial {
    color: #91a7ff;
}
html[data-theme='dark'] .admin-lic-badge--expired {
    color: #ffe066;
}
html[data-theme='dark'] .admin-lic-badge--blocked,
html[data-theme='dark'] .admin-lic-badge--unknown {
    color: #ffa8a8;
}

.admin-lic-cols {
    margin: 0 0 1rem;
    padding: 1rem 1.1rem;
}

.admin-lic-cols__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.admin-lic-cols__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 650;
}

.admin-lic-cols__hint {
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
    color: var(--muted, #667);
}

.admin-lic-cols__form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 0.75rem;
    align-items: flex-end;
    margin-bottom: 0.85rem;
}

.admin-lic-cols__field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 9rem;
    font-size: 0.85rem;
}

.admin-lic-cols__field--grow {
    flex: 1 1 14rem;
    min-width: 12rem;
}

.admin-lic-cols__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.admin-lic-cols__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface-2, #f3f4f6) 80%, transparent);
}

.admin-lic-cols__meta {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.admin-lic-cols__meta strong {
    font-weight: 600;
}

.admin-lic-cols__empty {
    color: var(--muted, #667);
    font-size: 0.9rem;
    padding: 0.35rem 0;
}

.admin-lic-check {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
    margin: 0;
    white-space: nowrap;
}

/* Zentrierte App-Dialoge (ms365AppDialog*) */
#ms365AppDialog.modal-overlay,
.ms365-app-dialog-overlay {
    z-index: 10050;
    backdrop-filter: blur(6px);
    background: rgba(20, 24, 48, 0.48);
}
#ms365AppDialog .ms365-app-dialog-box {
    max-width: 520px;
    background: var(--card, #fff);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 20px);
    box-shadow: var(--shadow-lg);
    padding: 22px 22px 18px;
    animation: ms365AppDialogIn 0.2s ease-out;
}
@keyframes ms365AppDialogIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
#ms365AppDialog .app-dialog-head {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: start;
}
#ms365AppDialog .app-dialog-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--brand1), var(--brand2));
    flex-shrink: 0;
}
#ms365AppDialog .app-dialog-icon svg {
    width: 24px;
    height: 24px;
    display: block;
}
#ms365AppDialog[data-kind="success"] .app-dialog-icon {
    background: linear-gradient(135deg, var(--ok1), var(--ok2));
}
#ms365AppDialog[data-kind="error"] .app-dialog-icon {
    background: linear-gradient(135deg, var(--danger1), var(--danger2));
}
#ms365AppDialog[data-kind="warning"] .app-dialog-icon {
    background: linear-gradient(135deg, #f5a623, #f56036);
}
#ms365AppDialog .app-dialog-title {
    margin: 0 0 6px;
    font-size: 1.18rem;
    font-weight: 900;
    color: var(--heading, #32325d);
    letter-spacing: -0.02em;
    line-height: 1.25;
}
#ms365AppDialog .app-dialog-message {
    margin: 0;
    line-height: 1.55;
    color: var(--text-secondary, #495057);
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.98rem;
}
#ms365AppDialog .app-dialog-prompt {
    margin-top: 16px;
}
#ms365AppDialog .app-dialog-input-label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-weight: 700;
    color: var(--heading, #32325d);
    font-size: 0.95rem;
}
#ms365AppDialog .app-dialog-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--input-border, var(--border));
    border-radius: 10px;
    font: inherit;
    color: var(--text);
    background: var(--input-bg, #fff);
    box-sizing: border-box;
}
#ms365AppDialog .app-dialog-input:focus {
    outline: 2px solid color-mix(in srgb, var(--brand1) 45%, transparent);
    outline-offset: 1px;
    border-color: var(--brand1);
}
#ms365AppDialog .modal-actions {
    margin-top: 18px;
}

/* Schritt-Navigation: Zurück links, Weiter rechts (eine Zeile pro Block) */
.step-nav-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 12px;
    margin-top: 18px;
    width: 100%;
    box-sizing: border-box;
}
.step-nav-row.step-nav-row--forward-only {
    justify-content: flex-end;
}
.step-nav-row.step-nav-row--back-only {
    justify-content: flex-start;
}
.step-nav-next-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    margin-left: auto;
}

/* Kursteams: sticky Schritt-Fußzeile + Weiter-Hinweise */
.step-content {
    padding-bottom: 12px;
}
.kt-step-footer {
    position: sticky;
    bottom: 0;
    z-index: 8;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 16px;
    margin-top: 22px;
    padding: 14px 16px 16px;
    background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--card) 88%, transparent) 18%, var(--card) 100%);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 24px rgba(50, 50, 93, 0.06);
    backdrop-filter: blur(10px);
}
.kt-step-footer.kt-step-footer--forward-only {
    justify-content: flex-end;
}
.kt-step-footer.kt-step-footer--back-only {
    justify-content: flex-start;
}
.kt-continue-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    margin-left: auto;
}
.kt-step-footer:not(.kt-step-footer--forward-only) .kt-continue-wrap {
    margin-left: auto;
}
.kt-continue-hint {
    margin: 0;
    max-width: 28rem;
    font-size: 0.82em;
    line-height: 1.35;
    color: var(--text-secondary);
    text-align: right;
}
.kt-continue-wrap .btn-success:disabled {
    opacity: 0.72;
}
.kt-mini-checklist {
    list-style: none;
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--soft);
    display: grid;
    gap: 8px;
}
.kt-mini-checklist__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9em;
    line-height: 1.4;
    color: var(--text-secondary);
}
.kt-mini-checklist__item.is-done {
    color: var(--heading);
}
.kt-mini-checklist__mark {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 50%;
    border: 2px solid var(--border-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75em;
    margin-top: 1px;
}
.kt-mini-checklist__item.is-done .kt-mini-checklist__mark {
    border-color: var(--ok1);
    background: linear-gradient(135deg, var(--ok1), var(--ok2));
    color: #fff;
}
.kt-mini-checklist__item.is-done .kt-mini-checklist__mark::before {
    content: '✓';
    font-weight: 700;
}
.kt-mini-checklist__item.is-pending .kt-mini-checklist__mark::before {
    content: '';
}

#browserBackupStatus:empty {
    display: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sw-lic-import {
    margin-top: 14px;
    padding: 14px 16px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand1) 7%, transparent) 0%, color-mix(in srgb, var(--brand2) 4%, transparent) 100%);
}
.sw-lic-import-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 8px;
}
.sw-lic-import-head h3 {
    margin: 0;
    flex: 1 1 auto;
}
.sw-lic-import-close {
    flex: 0 0 auto;
    padding: 6px 10px;
    line-height: 1;
    min-width: 0;
}
.sw-lic-import h3 {
    margin: 0 0 8px;
    font-size: 1.02em;
    color: #32325d;
}
.sw-lic-import-head + p,
.sw-lic-import > p {
    margin: 0 0 10px;
    line-height: 1.45;
    color: #495057;
    font-size: 0.92em;
}
.sw-lic-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: 8px 0 10px;
}
.sw-lic-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #495057;
    font-size: 0.92em;
    cursor: pointer;
    user-select: none;
}
.sw-lic-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef;
    color: #32325d;
    font-size: 0.86em;
    font-weight: 700;
    white-space: nowrap;
}
.sw-lic-status {
    font-weight: 700;
    font-size: 0.88em;
}
.sw-lic-status--new { color: #0d8050; }
.sw-lic-status--exists { color: #6c757d; }
.sw-lic-status--match { color: #0b5cab; font-weight: 600; }
.sw-lic-status--review { color: #b36b00; font-weight: 600; }
.sw-lic-diff-hints {
    display: block;
    margin-top: 2px;
    font-size: 0.82em;
    color: var(--muted, #6c757d);
    font-weight: 500;
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sw-lic-cell-diff {
    background: color-mix(in srgb, #b36b00 10%, transparent);
}
.sw-lic-row-review td {
    box-shadow: inset 3px 0 0 #b36b00;
}
.sw-lic-merge-opts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin: 8px 0 4px;
}
.sw-lic-text-filter--row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.sw-lic-text-filter--row input[type="search"] {
    flex: 1 1 14rem;
    max-width: 28rem;
}
.sw-lic-text-filter--row select {
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #ced4da;
    font: inherit;
    background: #fff;
}
.sw-lic-row-exists { background: #fafbfc; }
.sw-lic-import .teachers-table input.cell-editor {
    min-width: 4.5em;
    max-width: 7em;
    padding: 6px 8px;
}
.sw-lic-text-filter {
    margin: 8px 0 4px;
}
.sw-lic-text-filter input[type="search"] {
    width: 100%;
    max-width: 28rem;
    box-sizing: border-box;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 10px;
    font: inherit;
    font-size: 0.95em;
}
.students-list-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px 14px;
    margin: 12px 0 8px;
}
.students-list-filters__class {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 9rem;
}
.students-list-filters__class label {
    font-weight: 700;
    font-size: 0.9em;
}
.students-list-filters__class select {
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #ced4da;
    font: inherit;
    min-width: 9rem;
    background: #fff;
}
.students-list-filters__search {
    flex: 1 1 16rem;
    min-width: 12rem;
}
.students-list-filters__search input[type="search"] {
    width: 100%;
    max-width: 32rem;
    box-sizing: border-box;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 10px;
    font: inherit;
    font-size: 0.95em;
}
.students-list-filters__meta {
    margin: 0;
    flex: 1 1 100%;
    font-size: 0.9em;
    line-height: 1.4;
}
html[data-theme="dark"] .students-list-filters__class select,
html[data-theme="dark"] .students-list-filters__search input[type="search"] {
    background: var(--card, #1e2430);
    border-color: var(--border, #3a4252);
    color: inherit;
}
.sw-lic-import .teachers-table thead th.sw-lic-check-col {
    width: 2.6em;
    text-align: center;
    vertical-align: middle;
}
.sw-lic-import .teachers-table thead th.sw-lic-check-col input {
    cursor: pointer;
}

@media (max-width: 768px) {
    .header h1 { font-size: 1.35em; }
    .steps { padding: 16px 12px 14px; padding-top: 18px; }
    .steps::before,
    .steps::after { left: 14px; right: 14px; max-width: calc(100% - 28px); }
    .steps .step {
        min-width: 90px;
        max-width: none;
        font-size: 0.76em;
        padding: 8px 8px 10px;
        margin-top: 22px;
    }
    .steps.steps--one-line .step {
        min-width: 0;
        font-size: 0.66em;
        padding: 6px 8px 8px;
    }
    .content { padding: 16px; }
}

/* ========== Design-Foundation: Tabs, Theme, Surfaces ========== */

.ui-tabs,
.detail-tabs,
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 0;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-muted);
    box-shadow: none;
}

.ui-tab,
.detail-tab-btn,
.tab-btn {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 10px;
    padding: 10px 14px;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
    box-shadow: none;
    transform: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 150ms ease, background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.ui-tab:hover,
.detail-tab-btn:hover,
.tab-btn:hover {
    color: var(--heading);
    background: color-mix(in srgb, var(--brand1) 10%, transparent);
}

.ui-tab[aria-selected="true"],
.detail-tab-btn[aria-selected="true"],
.tab-btn.active,
.tab-btn[aria-selected="true"] {
    color: var(--heading);
    background: var(--card);
    border-color: var(--border-strong);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--brand1) 16%, transparent);
    transform: none;
}

.ui-tab:focus-visible,
.detail-tab-btn:focus-visible,
.tab-btn:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--brand1) 55%, transparent);
    outline-offset: 2px;
}

.detail-tabs-sticky {
    position: sticky;
    top: 0;
    z-index: 4;
    margin: 8px 0 12px;
    padding: 0;
    background: transparent;
    border-bottom: 0;
    box-shadow: none;
}

.tab-panel { display: none; margin-top: 16px; }
.tab-panel.active { display: block; }

.panel {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--card-elevated);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.panel-head {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    background:
        radial-gradient(520px 120px at 0% 0%, color-mix(in srgb, var(--brand1) 16%, transparent), transparent 60%),
        var(--soft);
}
.panel-head h2 {
    margin: 0;
    font-size: 1.08em;
    color: var(--heading);
    font-weight: 750;
}
.panel-body { padding: 16px 18px; }
.muted { color: var(--muted); }

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
select,
textarea {
    background-color: var(--input-bg);
    color: var(--text);
    border-color: var(--input-border);
    color-scheme: inherit;
}

/* Theme-Lock: verhindert Hell/Dunkel-Mischung (OS-Formularstile vs. App-Tokens) */
html[data-theme="light"] {
    color-scheme: only light;
}
html[data-theme="dark"] {
    color-scheme: only dark;
}

html[data-theme="light"] .hint,
html[data-theme="light"] .panel .hint:not(.hint-warn) {
    background: #f5f6fb;
    color: #5c6578;
    border-color: rgba(30, 36, 64, 0.12);
}
html[data-theme="dark"] .hint,
html[data-theme="dark"] .panel .hint:not(.hint-warn) {
    background: #15182a;
    color: #aeb4c8;
    border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="light"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
html[data-theme="light"] select,
html[data-theme="light"] textarea {
    background-color: #ffffff !important;
    color: #1e2440 !important;
    border-color: #ced4da !important;
    color-scheme: light;
}
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background-color: #24283e !important;
    color: #e8eaf4 !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    color-scheme: dark;
}

html[data-theme="light"] .container,
html[data-theme="light"] .panel,
html[data-theme="light"] .page-card.container {
    background-color: #ffffff;
    color: #1e2440;
}
html[data-theme="dark"] .container,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .page-card.container {
    background-color: #1c1f33;
    color: #e8eaf4;
}

html[data-theme="light"] .content,
html[data-theme="light"] .panel-body {
    color: #1e2440;
}
html[data-theme="dark"] .content,
html[data-theme="dark"] .panel-body {
    color: #e8eaf4;
}

html[data-theme="light"] table.lgr-table th,
html[data-theme="light"] table.gz-table th {
    background: #f5f6fb;
    color: #1e2440;
}
html[data-theme="dark"] table.lgr-table th,
html[data-theme="dark"] table.gz-table th {
    background: #15182a;
    color: #f3f4ff;
}

.ms365-theme-toggle {
    white-space: nowrap;
    appearance: none;
}
.ms365-header-tools {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 7;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: min(520px, calc(100% - 168px));
    justify-content: flex-end;
    flex-wrap: wrap;
}
.ms365-header-tools #ms365AuthWidget {
    position: static !important;
    top: auto !important;
    right: auto !important;
    max-width: none;
}
html[data-theme="dark"] .header > #ms365AuthWidget .btn,
html[data-theme="dark"] .ms365-header-nav .btn {
    background: rgba(28, 31, 51, 0.92);
    color: #e8eaf4;
    border-color: rgba(255, 255, 255, 0.18);
}
html[data-theme="dark"] .header > #ms365AuthWidget .btn:hover,
html[data-theme="dark"] .ms365-header-nav .btn:hover {
    background: #24283e;
}


/* ========== Stammdaten-/Einrichtungs-Tabellen (theme-aware) ========== */

.teachers-table-wrap {
    margin-top: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: auto;
    background: var(--card);
}

.teachers-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92em;
    min-width: 420px;
    color: var(--text);
}

.teachers-table th,
.teachers-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    color: var(--text);
}

.teachers-table th {
    position: sticky;
    top: 0;
    background: var(--brand1);
    color: #fff;
    text-align: left;
    font-weight: 700;
    z-index: 1;
}

.teachers-table th.is-sortable {
    cursor: pointer;
    user-select: none;
}

.teachers-table th.is-sortable:hover,
.teachers-table th.is-sortable:focus-visible {
    background: color-mix(in srgb, var(--brand1) 82%, #000);
    outline: none;
}

.teachers-table .teachers-sort-ind {
    opacity: 0.95;
    margin-left: 6px;
    font-weight: 900;
}

.teachers-table td code {
    font-family: Consolas, 'Segoe UI', monospace;
    background: var(--code-bg);
    color: var(--text);
    padding: 2px 6px;
    border-radius: 6px;
}

.teachers-table .students-parent-cell {
    max-width: 11rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: help;
}

.teachers-table .students-parent-more {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.85em;
}

.teachers-table .action-cell {
    width: 1%;
    white-space: nowrap;
}

.teachers-table .mini-btn {
    background: var(--danger1);
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 6px 10px;
    font-weight: 700;
    cursor: pointer;
}

.cell-editor {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 11px;
    border: 1px solid var(--input-border);
    border-radius: 10px;
    font: inherit;
    font-size: 0.98em;
    background: var(--input-bg);
    color: var(--text);
    outline: none;
    line-height: 1.35;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cell-editor:focus {
    border-color: var(--brand1);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand1) 24%, transparent);
}

.cell-editor::placeholder {
    color: var(--muted);
}

/* Einrichtung Schritt 3: Verwaltungstabelle mit Inline-Inputs */
#swStep3 .teachers-table input[data-sw-admin-name],
#swStep3 .teachers-table input[data-sw-admin-email],
#swStep3 .teachers-table input[data-sw-admin-role] {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 11px;
    font: inherit;
    font-size: 0.98em;
    line-height: 1.4;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#swStep3 .teachers-table input[data-sw-admin-name]::placeholder,
#swStep3 .teachers-table input[data-sw-admin-email]::placeholder,
#swStep3 .teachers-table input[data-sw-admin-role]::placeholder {
    color: var(--muted);
}

#swStep3 .teachers-table input[data-sw-admin-name]:hover,
#swStep3 .teachers-table input[data-sw-admin-email]:hover,
#swStep3 .teachers-table input[data-sw-admin-role]:hover {
    border-color: var(--border-strong);
}

#swStep3 .teachers-table input[data-sw-admin-name]:focus,
#swStep3 .teachers-table input[data-sw-admin-email]:focus,
#swStep3 .teachers-table input[data-sw-admin-role]:focus {
    outline: none;
    background: var(--input-bg);
    border-color: var(--brand1);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand1) 24%, transparent);
}

#swStep3 .teachers-table td {
    vertical-align: middle;
}

.settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
}
.settings-actions .btn {
    margin: 0;
    padding: 10px 14px;
    border-radius: 10px;
}
.settings-actions input[type="file"] {
    display: none;
}

/* Theme-aware Surfaces (Stammdaten, Einrichtung, Werkzeuge) */
.tile,
.settings-module,
.ts-step,
.ts-step-body,
.ts-year-strip,
.sw-panel {
    background: var(--card);
    color: var(--text);
}

.tile-title,
.settings h2,
.settings-module h3,
.sw-panel h2,
.ts-step-label,
.ts-step-n,
.ts-step-chevron,
.ts-status-title,
.ts-hub-tools h3,
.ts-year-strip__select {
    color: var(--heading);
}

.tile-subtitle,
.settings p,
.sw-panel p.intro,
.ts-step-desc,
.field label,
.sw-field label {
    color: var(--text-secondary);
}

.ts-step > summary {
    background: color-mix(in srgb, var(--card) 65%, transparent);
}

.ts-year-strip__select {
    background: var(--input-bg);
    border-color: var(--input-border);
}

/* Status-Chips & Zusammenfassungen */
html[data-theme="dark"] .ts-status-chip--ok {
    background: color-mix(in srgb, #34d399 18%, transparent);
    color: #6ee7b7;
}
html[data-theme="dark"] .ts-status-chip--warn {
    background: color-mix(in srgb, #fbbf24 18%, transparent);
    color: #fcd34d;
}
html[data-theme="dark"] .ts-status-chip--error {
    background: color-mix(in srgb, #fb7185 18%, transparent);
    color: #fda4af;
}
html[data-theme="dark"] .ts-status-chip--muted {
    background: color-mix(in srgb, var(--muted) 18%, transparent);
    color: var(--muted);
}

html[data-theme="dark"] .summary {
    color: #7dd3fc;
    background: color-mix(in srgb, #0ea5e9 14%, var(--card));
    border-color: color-mix(in srgb, #0ea5e9 30%, transparent);
}
html[data-theme="dark"] .summary[data-kind="ok"] {
    color: #6ee7b7;
    background: color-mix(in srgb, #34d399 14%, var(--card));
    border-color: color-mix(in srgb, #34d399 30%, transparent);
}
html[data-theme="dark"] .summary[data-kind="warn"] {
    color: #fcd34d;
    background: color-mix(in srgb, #fbbf24 14%, var(--card));
    border-color: color-mix(in srgb, #fbbf24 30%, transparent);
}

/* Sync-Log / Konsolen-Ausgabe */
[id^="swSyncLog"],
[id$="OnlineLog"] {
    background: var(--input-bg) !important;
    color: var(--text) !important;
    border-color: var(--input-border) !important;
}

/* Einrichtung: Navigation & Tabs */
.sw-nav button {
    background: var(--surface-muted);
    color: var(--heading);
    border-color: var(--border-strong);
}
.sw-nav button.active {
    color: #fff;
}
.sw-grp-tabs .tab-btn {
    background: var(--card);
    color: var(--heading);
    border-color: var(--border-strong);
}
.sw-grp-tabs .tab-btn[aria-selected="true"] {
    color: #fff;
}

/* Tabellen: explizite Dark-Mode-Sperre gegen weiße Inline-Styles */
html[data-theme="dark"] .teachers-table-wrap,
html[data-theme="dark"] .teachers-table tbody tr,
html[data-theme="dark"] .teachers-table td {
    background-color: var(--card) !important;
    color: var(--text) !important;
}

html[data-theme="dark"] .teachers-table th {
    background: var(--brand1) !important;
    color: #fff !important;
}

html[data-theme="dark"] .tile,
html[data-theme="dark"] .settings-module,
html[data-theme="dark"] .ts-step,
html[data-theme="dark"] .ts-step-body,
html[data-theme="dark"] .ts-year-strip,
html[data-theme="dark"] .sw-panel {
    background: var(--card) !important;
    color: var(--text) !important;
    box-shadow: var(--shadow);
}

html[data-theme="dark"] .sw-lic-row-exists {
    background: color-mix(in srgb, var(--brand1) 6%, var(--card)) !important;
}

html[data-theme="dark"] .sw-lic-pill {
    background: var(--code-bg);
    color: var(--text);
}

html[data-theme="dark"] .sw-lic-chip {
    color: var(--text-secondary);
}


/* Inline-Stile mit festen Hellmodus-Farben im Dunkelmodus korrigieren */
html[data-theme="dark"] [style*="color:#6c757d"],
html[data-theme="dark"] [style*="color: #6c757d"],
html[data-theme="dark"] [style*="color:#32325d"],
html[data-theme="dark"] [style*="color: #32325d"],
html[data-theme="dark"] [style*="color:#495057"],
html[data-theme="dark"] [style*="color: #495057"] {
    color: var(--muted) !important;
}

html[data-theme="dark"] [style*="background:#fff"],
html[data-theme="dark"] [style*="background: #fff"],
html[data-theme="dark"] [style*="background:#ffffff"],
html[data-theme="dark"] [style*="background: #ffffff"] {
    background: var(--input-bg) !important;
    color: var(--text) !important;
}


/* ========== Admin App Shell ========== */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body.admin-app-page {
    padding: 14px;
    align-items: stretch;
    min-height: 100vh;
}

body.admin-app-page > .admin-app {
    width: var(--app-shell-width);
    max-width: var(--app-content-max);
    margin-inline: auto;
    flex: 1 1 auto;
    min-height: calc(100vh - 28px);
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    border-radius: 22px;
    overflow: hidden;
    background: var(--card);
    box-shadow: var(--shadow-lg);
    border: 1px solid color-mix(in srgb, #fff 18%, transparent);
    animation: adminAppIn 0.35s ease-out;
}

@keyframes adminAppIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.admin-app__rail {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 22px 16px 18px;
    background:
        radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--brand2) 55%, transparent), transparent 55%),
        linear-gradient(180deg, color-mix(in srgb, var(--brand1) 92%, #1a1f4a) 0%, color-mix(in srgb, var(--brand2) 88%, #2a1648) 100%);
    color: #fff;
}

.admin-app__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px 8px;
}

.admin-app__brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    font-size: 1.15rem;
}

.admin-app__brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.15;
}

.admin-app__brand-text strong {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.admin-app__brand-text span {
    font-size: 0.78rem;
    opacity: 0.78;
    font-weight: 600;
}

.admin-app__nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
}

.admin-app__nav-btn {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(255, 255, 255, 0.82);
    border-radius: 12px;
    padding: 11px 12px;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.admin-app__nav-btn > i {
    width: 1.25rem;
    font-size: 1.05rem;
    opacity: 0.9;
}

.admin-app__nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.admin-app__nav-btn[aria-selected="true"] {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.22);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.admin-app__nav-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.7);
    outline-offset: 2px;
}

.admin-app__rail-foot {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.admin-app__rail-link {
    appearance: none;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-align: left;
}

.admin-app__rail-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.admin-app__rail-link--danger:hover {
    background: color-mix(in srgb, var(--danger1) 35%, transparent);
}

.admin-app__main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--soft) 70%, var(--card)) 0%, var(--card) 140px);
}

.admin-app__top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px 20px;
    padding: 26px 28px 18px;
    border-bottom: 1px solid var(--border);
}

.admin-app__top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex: 0 0 auto;
    min-height: 40px;
}

.admin-app__top-actions[hidden] {
    display: none !important;
}

.admin-app__top-actions .ms365-auth-widget {
    position: static;
}

.admin-app__eyebrow {
    margin: 0 0 4px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand1);
}

.admin-app__title {
    margin: 0;
    font-size: clamp(1.35rem, 1.1rem + 0.8vw, 1.75rem);
    font-weight: 850;
    letter-spacing: -0.02em;
    color: var(--heading);
    line-height: 1.15;
}

.admin-app__subtitle {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.45;
    max-width: 56ch;
}

.admin-app__body {
    flex: 1 1 auto;
    padding: 20px 28px 28px;
    min-height: 0;
}

.admin-app__panel {
    display: none;
    animation: adminPanelIn 0.28s ease;
}

.admin-app__panel.active {
    display: block;
}

/* Kursteam-Katalog (Admin → Vorlagen) */
.admin-catalog-head {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 18px;
}
.admin-catalog-head__status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
}
.admin-catalog__lib {
    font-size: 0.88rem;
    font-weight: 650;
    color: var(--brand1);
    text-underline-offset: 3px;
}
.admin-catalog__lib:hover {
    color: var(--heading);
}
.admin-catalog__subtabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 6px;
    max-width: 440px;
    border-radius: 14px;
    background: var(--soft);
    border: 1px solid var(--border);
}
.admin-catalog__subtabs button {
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 700;
    font-size: 0.92rem;
    padding: 11px 14px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.admin-catalog__subtabs button i {
    font-size: 1.05rem;
    opacity: 0.85;
}
.admin-catalog__subtabs button:hover {
    color: var(--heading);
    background: color-mix(in srgb, var(--card) 55%, transparent);
}
.admin-catalog__subtabs button.is-active {
    background: var(--card);
    color: var(--heading);
    box-shadow:
        0 1px 2px color-mix(in srgb, #000 12%, transparent),
        0 0 0 1px color-mix(in srgb, var(--brand1) 28%, transparent);
}
.admin-catalog__subtabs button.is-active i {
    color: var(--brand1);
    opacity: 1;
}
.admin-catalog-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 12px;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--soft) 65%, var(--card));
}
.admin-catalog-toolbar[hidden],
[data-admin-cat-panel][hidden] {
    display: none !important;
}
.admin-catalog-toolbar__left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.admin-catalog-toolbar .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.admin-catalog__lead {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
    max-width: 62ch;
}
.admin-catalog__lead code {
    font-size: 0.86em;
    padding: 1px 6px;
    border-radius: 6px;
    background: var(--soft);
    border: 1px solid var(--border);
}
.admin-catalog__banner {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: color-mix(in srgb, #b45309 12%, var(--card));
    color: var(--heading);
    line-height: 1.45;
    white-space: pre-wrap;
}
.admin-catalog {
    display: grid;
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
}
.admin-catalog__side,
.admin-catalog__main {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
    min-height: 420px;
}
.admin-catalog__side-head {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 10px;
}
.admin-catalog__side-head .admin-catalog__search {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
}
.admin-catalog__side-head .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}
.admin-catalog__search input,
.admin-catalog__meta input,
.admin-catalog__meta select,
.admin-catalog__meta textarea,
.admin-catalog__add input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 9px 11px;
    background: var(--soft);
    color: inherit;
    font: inherit;
}
.admin-catalog__search input:focus,
.admin-catalog__meta input:focus,
.admin-catalog__meta select:focus,
.admin-catalog__meta textarea:focus,
.admin-catalog__add input:focus {
    outline: 2px solid color-mix(in srgb, var(--brand1) 45%, transparent);
    outline-offset: 1px;
    border-color: color-mix(in srgb, var(--brand1) 40%, var(--border));
}
.admin-catalog__search { display: block; }
.admin-catalog__list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: calc(60vh - 24px);
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.admin-catalog__list > li {
    list-style: none;
    margin: 0;
    padding: 0;
    min-width: 0;
}
.admin-catalog__list .admin-catalog__item {
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    border: 1px solid var(--border);
    background: var(--soft);
    color: inherit;
    border-radius: 10px;
    padding: 9px 11px;
    cursor: pointer;
    font: inherit;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
    min-width: 0;
    transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.admin-catalog__list .admin-catalog__item:hover {
    border-color: color-mix(in srgb, var(--brand1) 45%, var(--border));
    background: color-mix(in srgb, var(--brand1) 6%, var(--card));
}
.admin-catalog__list .admin-catalog__item.is-active {
    border-color: color-mix(in srgb, var(--brand1) 55%, var(--border));
    background: color-mix(in srgb, var(--brand1) 12%, var(--card));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand1) 14%, transparent);
}
.admin-catalog__list .admin-catalog__item strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--heading);
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.admin-catalog__list .admin-catalog__meta-line {
    display: block;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.admin-catalog__meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 14px;
}
.admin-catalog__meta label,
.admin-catalog__hint {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
}
.admin-catalog__meta-wide { grid-column: 1 / -1; }
.admin-catalog__channels-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.admin-catalog__channels-head h2 {
    margin: 0;
    font-size: 1rem;
    color: var(--heading);
}
.admin-catalog__channel-actions { display: flex; gap: 6px; }
.admin-catalog__hint { font-weight: 500; margin: 8px 0 10px; }
.admin-catalog__add { display: flex; gap: 8px; margin-bottom: 10px; }
.admin-catalog__channels { list-style: none; margin: 0; padding: 0; }
.admin-catalog__ch {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}
.admin-catalog__ch span { color: var(--muted); font-size: 0.8rem; }
.admin-catalog__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 280px;
    text-align: center;
    color: var(--muted);
    line-height: 1.5;
    padding: 24px 16px;
}
.admin-catalog__empty i {
    font-size: 2rem;
    color: var(--brand1);
    opacity: 0.7;
}
.admin-catalog__empty p { margin: 0; max-width: 32ch; }
.admin-catalog__path-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.admin-catalog__path-row input { flex: 1 1 auto; min-width: 0; }
.admin-mat {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
    min-height: 360px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.admin-mat__bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--soft);
    border: 1px solid var(--border);
    flex-wrap: wrap;
}
.admin-mat__path {
    font-size: 0.85rem;
    word-break: break-all;
    color: var(--heading);
}
.admin-mat__explorer {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(0, 2fr);
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    min-height: 420px;
    flex: 1 1 auto;
}
.admin-mat__tree {
    border-right: 1px solid var(--border);
    background: color-mix(in srgb, var(--soft) 80%, var(--card));
    padding: 8px 6px;
    overflow: auto;
    max-height: 58vh;
}
.admin-mat-tree__row {
    display: flex;
    align-items: center;
    gap: 2px;
    padding-left: calc(6px + var(--depth, 0) * 14px);
    border-radius: 8px;
    min-height: 32px;
}
.admin-mat-tree__row.is-selected {
    background: color-mix(in srgb, var(--brand1) 14%, var(--card));
}
.admin-mat-tree__toggle,
.admin-mat-tree__spacer {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 0;
    cursor: pointer;
    border-radius: 4px;
}
.admin-mat-tree__toggle:hover {
    color: var(--heading);
    background: color-mix(in srgb, var(--brand1) 10%, transparent);
}
.admin-mat-tree__label {
    flex: 1 1 auto;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: left;
    padding: 5px 8px 5px 4px;
    cursor: pointer;
    border-radius: 6px;
}
.admin-mat-tree__label span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-mat-tree__label i {
    color: #c9a227;
    flex: 0 0 auto;
}
.admin-mat-tree__row.is-selected .admin-mat-tree__label {
    color: var(--heading);
}
.admin-mat-tree__label:hover {
    background: color-mix(in srgb, var(--brand1) 8%, transparent);
}
.admin-mat-tree__loading {
    padding: 4px 8px 8px calc(28px + var(--depth, 0) * 14px);
    font-size: 0.8rem;
    color: var(--muted);
}
.admin-mat__pane {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--card);
}
.admin-mat__pane-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
.admin-mat__pane-title {
    font-weight: 750;
    color: var(--heading);
}
.admin-mat__pane-meta {
    font-size: 0.8rem;
    color: var(--muted);
}
.admin-mat__list {
    list-style: none;
    margin: 0;
    padding: 6px;
    max-height: calc(58vh - 44px);
    overflow: auto;
    flex: 1 1 auto;
    border: 0;
    border-radius: 0;
}
.admin-mat__empty {
    padding: 28px 16px;
    text-align: center;
    color: var(--muted);
    line-height: 1.45;
}
.admin-mat__list li,
.admin-mat__item {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
    padding: 2px 4px;
}
.admin-mat__list li:last-child { border-bottom: 0; }
.admin-mat__open,
.admin-mat__file {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    border-radius: 8px;
}
.admin-mat__file {
    cursor: default;
}
.admin-mat__open:hover {
    background: color-mix(in srgb, var(--brand1) 8%, transparent);
}
.admin-mat__open i,
.admin-mat__file i {
    margin-right: 4px;
}
.admin-mat__item--folder .admin-mat__open i {
    color: #c9a227;
}
.admin-mat__list .muted { font-size: 0.8rem; color: var(--muted); flex: 0 0 auto; }
.admin-mat__progress { margin-top: 0; }
.admin-mat .ktpl-apply-progress,
.admin-mat__progress {
    margin-top: 0;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--soft);
}
.admin-mat__progress[data-state="ok"] {
    border-color: color-mix(in srgb, #0f766e 35%, var(--border));
    background: color-mix(in srgb, #0f766e 10%, var(--card));
}
.admin-mat__progress[data-state="error"] {
    border-color: color-mix(in srgb, #b91c1c 35%, var(--border));
    background: color-mix(in srgb, #b91c1c 10%, var(--card));
}
.admin-mat__progress .ktpl-apply-progress__track {
    height: 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--border) 70%, transparent);
    overflow: hidden;
    margin-bottom: 8px;
}
.admin-mat__progress .ktpl-apply-progress__fill {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand1), var(--brand2));
    transition: width 0.2s ease;
}
.admin-mat__progress[data-state="ok"] .ktpl-apply-progress__fill {
    background: #0f766e;
    width: 100% !important;
}
.admin-mat__progress[data-state="error"] .ktpl-apply-progress__fill { background: #b91c1c; }
.admin-mat__progress .ktpl-apply-progress__text {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--heading);
}
@media (max-width: 900px) {
    .admin-catalog { grid-template-columns: 1fr; }
    .admin-catalog__side,
    .admin-catalog__main { min-height: 0; }
    .admin-catalog__subtabs { max-width: none; }
    .admin-mat__explorer {
        grid-template-columns: 1fr;
        min-height: 0;
    }
    .admin-mat__tree {
        border-right: 0;
        border-bottom: 1px solid var(--border);
        max-height: 220px;
    }
    .admin-mat__list { max-height: 40vh; }
}

@keyframes adminPanelIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.admin-app__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    margin-bottom: 14px;
}

.admin-app__toolbar-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
}

.admin-app__toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-app__pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--brand1) 12%, transparent);
    color: var(--heading);
    font-size: 0.85rem;
    font-weight: 750;
}

.admin-app__hint {
    color: var(--muted);
    font-size: 0.9rem;
}

.admin-app__hint code {
    font-size: 0.85em;
}

.admin-app__surface {
    background: var(--card);
}

.admin-app__grid {
    display: grid;
    gap: 16px;
}

.admin-app__grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 16px;
}

.admin-app__grid--notes {
    grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.2fr);
    align-items: start;
}

.admin-app__card {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--card);
    padding: 18px 18px 16px;
    box-shadow: 0 10px 28px color-mix(in srgb, var(--brand1) 6%, transparent);
}

.admin-app__card--wide {
    margin-top: 0;
}

.admin-app__card-head {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.admin-app__card-head h2 {
    margin: 0 0 4px;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--heading);
}

.admin-app__card-head p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
    font-size: 0.92rem;
}

.admin-app__card-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--brand1) 14%, transparent);
    color: var(--brand1);
    font-size: 1.1rem;
}

.admin-app__btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.admin-app__textarea {
    width: 100%;
    min-height: 160px;
    resize: vertical;
    border: 1px solid var(--input-border);
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    line-height: 1.45;
    background: var(--input-bg);
    color: var(--text);
}

.admin-app__textarea:focus {
    outline: 2px solid color-mix(in srgb, var(--brand1) 45%, transparent);
    border-color: var(--brand1);
}

.admin-app__footnote {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.admin-app__switch {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    cursor: pointer;
    user-select: none;
}

.admin-app__switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.admin-app__switch-ui {
    width: 48px;
    height: 28px;
    flex: 0 0 auto;
    margin-top: 2px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--muted) 35%, var(--surface-muted));
    position: relative;
    transition: background 160ms ease;
}

.admin-app__switch-ui::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    transition: transform 160ms ease;
}

.admin-app__switch input:checked + .admin-app__switch-ui {
    background: linear-gradient(135deg, var(--brand1), var(--brand2));
}

.admin-app__switch input:checked + .admin-app__switch-ui::after {
    transform: translateX(20px);
}

.admin-app__switch input:focus-visible + .admin-app__switch-ui {
    outline: 2px solid color-mix(in srgb, var(--brand1) 55%, transparent);
    outline-offset: 2px;
}

.admin-app__switch-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.admin-app__switch-label strong {
    color: var(--heading);
    font-weight: 750;
}

.admin-app__switch-label small {
    color: var(--muted);
    font-size: 0.88rem;
}

.admin-app__link-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--card);
    text-decoration: none;
    color: inherit;
    box-shadow: 0 10px 28px color-mix(in srgb, var(--brand1) 6%, transparent);
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.admin-app__link-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: 0 14px 32px color-mix(in srgb, var(--brand1) 14%, transparent);
}

.admin-app__link-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 auto;
    min-width: 0;
}

.admin-app__link-card-body strong {
    color: var(--heading);
    font-weight: 800;
}

.admin-app__link-card-body span {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.4;
}

.admin-app__link-card-chevron {
    color: var(--muted);
    font-size: 1.1rem;
}

.admin-app__notes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: min(62vh, 640px);
    overflow: auto;
    padding-right: 2px;
}

.admin-app__note {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    background: color-mix(in srgb, var(--soft) 55%, var(--card));
}

.admin-app__note-title {
    margin: 0 0 4px;
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--heading);
}

.admin-app__note-meta {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.82rem;
}

.admin-app__note-body {
    margin: 0;
    white-space: pre-wrap;
    font-family: Consolas, 'Segoe UI', monospace;
    font-size: 0.9em;
    line-height: 1.45;
    color: var(--text);
}

.admin-app__empty {
    margin: 0;
    color: var(--muted);
    padding: 18px 4px;
}

@media (max-width: 980px) {
    body.admin-app-page > .admin-app {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .admin-app__rail {
        gap: 14px;
        padding: 16px;
    }

    .admin-app__nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .admin-app__nav-btn {
        flex: 1 1 calc(50% - 8px);
    }

    .admin-app__rail-foot {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .admin-app__grid--2,
    .admin-app__grid--notes {
        grid-template-columns: 1fr;
    }

    .admin-app__top,
    .admin-app__body {
        padding-left: 18px;
        padding-right: 18px;
    }
}

@media (max-width: 560px) {
    body.admin-app-page {
        padding: 8px;
    }

    body.admin-app-page > .admin-app {
        border-radius: 16px;
        min-height: calc(100vh - 16px);
    }

    .admin-app__nav-btn {
        flex: 1 1 100%;
    }
}

/* ========== Admin Setup Checklist / Diagnose ========== */

.admin-setup-checklist {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.admin-setup-check {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--card);
    box-shadow: 0 8px 22px color-mix(in srgb, var(--brand1) 5%, transparent);
}

.admin-setup-check__icon {
    font-size: 1.25rem;
    line-height: 1;
}

.admin-setup-check__title {
    margin: 0;
    font-weight: 800;
    color: var(--heading);
    font-size: 0.95rem;
}

.admin-setup-check__detail {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.4;
}

.admin-setup-check--ok {
    border-color: color-mix(in srgb, var(--ok1) 35%, var(--border));
    background: color-mix(in srgb, var(--ok1) 8%, var(--card));
}
.admin-setup-check--ok .admin-setup-check__icon {
    color: var(--ok1);
}

.admin-setup-check--warn {
    border-color: color-mix(in srgb, #fab005 40%, var(--border));
    background: color-mix(in srgb, #fab005 10%, var(--card));
}
.admin-setup-check--warn .admin-setup-check__icon {
    color: #e67700;
}

.admin-setup-check--off {
    border-color: var(--border);
    background: color-mix(in srgb, var(--soft) 70%, var(--card));
}
.admin-setup-check--off .admin-setup-check__icon {
    color: var(--muted);
}

.admin-setup-check--pending .admin-setup-check__icon {
    color: var(--brand1);
}

.admin-app__pill--ok {
    background: color-mix(in srgb, var(--ok1) 16%, transparent);
    color: color-mix(in srgb, var(--ok2) 70%, var(--heading));
}

.admin-app__pill--warn {
    background: color-mix(in srgb, #fab005 18%, transparent);
    color: #9c6b00;
}

html[data-theme='dark'] .admin-app__pill--warn,
html[data-theme='dark'] .admin-setup-check--warn .admin-setup-check__icon {
    color: #ffe066;
}

.admin-setup-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    margin-bottom: 4px;
}

.admin-setup-meta__url {
    font-size: 0.78rem;
    word-break: break-all;
    color: var(--text-secondary);
    background: color-mix(in srgb, var(--border) 40%, transparent);
    padding: 4px 8px;
    border-radius: 8px;
}

.admin-setup-log {
    margin-top: 14px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
}

.admin-setup-log > summary {
    cursor: pointer;
    font-weight: 750;
    color: var(--heading);
    user-select: none;
}

.admin-setup-log__pre {
    margin: 10px 0 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--soft) 80%, var(--card));
    border: 1px solid var(--border);
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.82rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 220px;
    overflow: auto;
}

.admin-setup-log__pre--tall {
    max-height: 280px;
    min-height: 120px;
}

.admin-app__card .field {
    margin-bottom: 12px;
}

.admin-app__card .field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    color: var(--heading);
    font-size: 0.9rem;
}

@media (max-width: 980px) {
    .admin-setup-checklist {
        grid-template-columns: 1fr;
    }

    .admin-setup-check {
        grid-template-columns: auto 1fr;
    }

    .admin-setup-check .btn {
        grid-column: 2;
        justify-self: start;
    }
}

/* ========== Release Notes Editor / Cards ========== */

.admin-rn-kind-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}

.admin-rn-kind-opt {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-muted);
    cursor: pointer;
    font-weight: 650;
    color: var(--text-secondary);
}

.admin-rn-kind-opt input {
    accent-color: var(--brand1);
}

.admin-rn-kind-opt:has(input:checked) {
    border-color: var(--border-strong);
    background: color-mix(in srgb, var(--brand1) 12%, var(--card));
    color: var(--heading);
}

.admin-rn-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    color: var(--heading);
    font-size: 0.9rem;
}

.admin-rn-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.admin-rn-editor {
    min-height: 140px;
    padding: 12px 14px;
    border: 1px solid var(--input-border);
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--text);
    line-height: 1.5;
    outline: none;
}

.admin-rn-editor:empty:before {
    content: attr(data-placeholder);
    color: var(--muted);
}

.admin-rn-editor:focus {
    outline: 2px solid color-mix(in srgb, var(--brand1) 45%, transparent);
    border-color: var(--brand1);
}

.admin-rn-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px;
    border: 1.5px dashed var(--border-strong);
    border-radius: 14px;
    background: color-mix(in srgb, var(--soft) 70%, var(--card));
    color: var(--muted);
    text-align: center;
    font-size: 0.92rem;
}

.admin-rn-dropzone.is-dragover {
    border-color: var(--brand1);
    background: color-mix(in srgb, var(--brand1) 10%, var(--card));
}

.admin-rn-dropzone > .bi {
    font-size: 1.4rem;
    color: var(--brand1);
}

.admin-rn-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.admin-rn-thumb {
    position: relative;
    margin: 0;
    width: 104px;
    height: 78px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.admin-rn-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.admin-rn-thumb__remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.rn-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    background: color-mix(in srgb, var(--soft) 45%, var(--card));
}

.rn-card + .rn-card {
    margin-top: 12px;
}

.rn-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
}

.rn-card__title {
    margin: 0;
    flex: 1 1 auto;
    font-size: 1rem;
    font-weight: 800;
    color: var(--heading);
}

.rn-card__actions {
    display: flex;
    gap: 6px;
}

.rn-card__meta {
    margin: 6px 0 10px;
    color: var(--muted);
    font-size: 0.82rem;
}

.rn-card__body {
    color: var(--text);
    line-height: 1.5;
    font-size: 0.95rem;
}

.rn-card__body p {
    margin: 0 0 0.65em;
}

.rn-card__body p:last-child {
    margin-bottom: 0;
}

.rn-card__body ul,
.rn-card__body ol {
    margin: 0 0 0.65em;
    padding-left: 1.2rem;
}

.rn-card__pre {
    margin: 0;
    white-space: pre-wrap;
    font-family: inherit;
}

.rn-card__gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.rn-card__figure {
    margin: 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: zoom-in;
}

.rn-card__figure img {
    display: block;
    width: 100%;
    height: 110px;
    object-fit: cover;
}

.rn-kind {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rn-kind--feature {
    background: color-mix(in srgb, var(--brand1) 16%, transparent);
    color: var(--brand1);
}

.rn-kind--fix {
    background: color-mix(in srgb, var(--ok1) 18%, transparent);
    color: var(--ok2);
}

.rn-kind--other {
    background: color-mix(in srgb, var(--muted) 18%, transparent);
    color: var(--text-secondary);
}

.rn-lightbox {
    position: fixed;
    inset: 0;
    z-index: 12000;
    background: rgba(10, 12, 24, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.rn-lightbox[hidden] {
    display: none !important;
}

.rn-lightbox__img {
    max-width: min(96vw, 1100px);
    max-height: 88vh;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.rn-lightbox__close {
    position: absolute;
    top: 16px;
    right: 18px;
    border: 0;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    font-size: 1.5rem;
    cursor: pointer;
}

.welcome-release-notes .rn-card {
    background: var(--card);
}

/* Admin: nur Betreiber-MS365 */
.ms365-admin-op-block {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(16, 18, 35, 0.55);
    backdrop-filter: blur(6px);
    pointer-events: auto;
}

.ms365-admin-op-block__card {
    width: min(440px, 100%);
    padding: 28px 24px 22px;
    border-radius: 18px;
    background: var(--card);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.ms365-admin-op-block__icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--brand1) 14%, transparent);
    color: var(--brand1);
    font-size: 1.35rem;
}

.ms365-admin-op-block__title {
    margin: 0 0 8px;
    font-size: 1.2rem;
    color: var(--heading);
}

.ms365-admin-op-block__text {
    margin: 0 0 16px;
    color: var(--muted);
    line-height: 1.45;
}

.ms365-admin-op-block__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

html[data-ms365-admin-boot='1'] body.admin-app-page > .admin-app {
    /* Kein pointer-events:none – sonst sind Anmelden/Buttons tot, wenn der Overlay fehlt. */
    filter: none;
}
