/**
 * NotenWeb - Stylesheet
 * Design: Midnight Amber — deep navy authority meets warm amber precision
 * Schrift: Lexend lokal (CSP font-src 'self', keine Google Fonts)
 */

@font-face {
    font-family: 'Lexend';
    src: url('/fonts/lexend/Lexend.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Core palette */
    --primary: #1845c8;
    --primary-dark: #1236a0;
    --primary-light: #6a9de8;
    --secondary: #3558c4;
    --secondary-light: #8aaae6;

    /* Amber accent — the signature color */
    --accent: #f5a623;
    --accent-dark: #d88b10;
    --accent-light: #fde8b8;

    /* Semantic colors */
    --success: #1a9e6e;
    --success-light: #d1f5e8;
    --danger: #e5483a;
    --danger-light: #fde8e6;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --info: #0891b2;
    --info-light: #d0f0f9;

    /* Neutrals */
    --light: #e6eff9;
    --light-bg: #edf4fc;
    --warm-white: #ffffff;
    --dark: #080f24;
    --dark-text: #0e1829;
    --text: #0e1829;
    --text-muted: #5a6b8a;
    --text-secondary: #7d90b0;

    /* Surfaces */
    --card-bg: #ffffff;
    --nav-bg: #ffffff;
    --page-bg: #e8f0f9;
    --bg-surface: #f7fafd;

    /* Borders */
    --border: #cdd9ee;
    --border-light: #dce8f5;
    --border-dark: #1845c8;

    /* Header */
    --header-bg: #080f24;
    --header-gradient: linear-gradient(105deg, #080f24 0%, #0d1e50 55%, #162d78 100%);

    /* Formularfelder — pastellgelb (niedrige Spezifität via :where, überschreibbar) */
    --form-field-bg: #fff9e6;
    --form-field-bg-focus: #fffef8;
    --form-field-bg-disabled: #f3ead8;
}

/* Pastellgelber Standard für textähnliche Eingaben (:where = Spezifität 0) */
:where(textarea, select, input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="image"]):not([type="range"]):not([type="color"])) {
    background-color: var(--form-field-bg);
}

body {
    font-family: 'Lexend', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--page-bg);
    background-image: radial-gradient(circle, rgba(8,15,36,0.11) 1px, transparent 1px);
    background-size: 22px 22px;
    background-attachment: fixed;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* === Header === */
.main-header {
    background: var(--header-gradient);
    color: white;
    padding: 0.9rem 2rem;
    box-shadow: 0 2px 20px rgba(8,15,36,0.5);
    border-bottom: 2px solid rgba(245,166,35,0.4);
    position: relative;
}

.main-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #f5a623 0%, #1845c8 60%, transparent 100%);
    opacity: 0.6;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
    text-decoration: none;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo::before {
    content: '◆';
    color: #f5a623;
    font-size: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Zur Hauptseite — wie eule.html / anmeldung.html (roter Demo-Link) */
.btn-zur-hauptseite {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.95rem;
    border-radius: 8px;
    background: #dc2626;
    color: #fff !important;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.35);
    transition: background 0.15s ease, transform 0.1s ease;
}

.btn-zur-hauptseite:hover {
    background: #b91c1c;
    color: #fff;
}

.user-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.85);
    letter-spacing: 0.01em;
}

.nav-toggle {
    display: none;
    position: relative;
    z-index: 140;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    color: white;
    cursor: pointer;
    padding: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.28rem;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.nav-toggle:hover {
    background: rgba(255,255,255,0.16);
    border-color: rgba(245,166,35,0.45);
    transform: translateY(-1px);
}

.nav-toggle.is-active {
    background: rgba(245,166,35,0.18);
    border-color: rgba(245,166,35,0.6);
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle.is-active span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle.is-active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-toggle.is-active span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}

/* === Navigation === */
.main-nav {
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 1px 8px rgba(8,15,36,0.06);
    position: relative;
}

.nav-overlay,
.nav-mobile-head {
    display: none;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 0;
    align-items: stretch;
    min-width: 0;
    overflow-x: auto;
}

.nav-link {
    padding: 0.9rem 1.4rem;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.nav-link--icon {
    min-width: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 1.1rem;
}

.nav-link-icon {
    font-size: 1.2rem;
    line-height: 1;
    font-weight: 700;
}

.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;
}

.nav-link:hover {
    background: #fff9f0;
    border-bottom-color: var(--accent-light);
    color: var(--accent-dark);
}

.nav-link.active {
    color: var(--accent-dark);
    border-bottom-color: var(--accent);
    background: #fff9f0;
    font-weight: 700;
}

/* === Container & Layout === */
.container {
    max-width: 1400px;
    margin: 1.75rem auto;
    padding: 0 2rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.page-header h1 {
    color: var(--dark);
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

/* === Cards === */
.card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 1.6rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(8,15,36,0.04), 0 4px 16px rgba(8,15,36,0.06);
}

.card h2, .card h3 {
    color: var(--dark);
    margin-bottom: 1rem;
    font-weight: 700;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.4rem;
    font-family: 'Lexend', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    position: relative;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* ── Primary: Amber capsule — the signature action button ── */
.btn-primary {
    background: linear-gradient(135deg, #f5a623 0%, #e8920c 100%);
    color: #1a0f00;
    font-weight: 700;
    border: 1px solid rgba(232,146,12,0.3);
    box-shadow: 0 2px 8px rgba(245,166,35,0.35), inset 0 1px 0 rgba(255,255,255,0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #fbb534 0%, #f5a020 100%);
    box-shadow: 0 4px 16px rgba(245,166,35,0.5), inset 0 1px 0 rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    background: linear-gradient(135deg, #e8920c 0%, #d8830a 100%);
    box-shadow: 0 1px 4px rgba(245,166,35,0.3);
}

/* ── Secondary: Royal blue solid ── */
.btn-secondary {
    background: var(--primary);
    color: #ffffff;
    border: 1px solid var(--primary-dark);
    box-shadow: 0 2px 8px rgba(24,69,200,0.25);
}

.btn-secondary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 14px rgba(24,69,200,0.4);
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(24,69,200,0.2);
}

/* ── Success: Emerald ── */
.btn-success {
    background: linear-gradient(135deg, #1db980 0%, #15976a 100%);
    color: white;
    border: 1px solid rgba(21,151,106,0.3);
    box-shadow: 0 2px 8px rgba(26,158,110,0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #22cc8e 0%, #1aaa78 100%);
    box-shadow: 0 4px 14px rgba(26,158,110,0.45);
    transform: translateY(-1px);
}

.btn-success:active {
    transform: translateY(0);
}

/* ── Danger: Bold red ── */
.btn-danger {
    background: linear-gradient(135deg, #e5483a 0%, #c73428 100%);
    color: white;
    border: 1px solid rgba(199,52,40,0.3);
    box-shadow: 0 2px 8px rgba(229,72,58,0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #f05a4b 0%, #d94035 100%);
    box-shadow: 0 4px 14px rgba(229,72,58,0.45);
    transform: translateY(-1px);
}

.btn-danger:active {
    transform: translateY(0);
}

/* ── Outline: Ghost with amber border ── */
.btn-outline {
    background: #ffffff;
    border: 1.5px solid var(--accent);
    color: var(--accent-dark);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--accent-light);
    border-color: var(--accent-dark);
    color: var(--accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(245,166,35,0.2);
}

.btn-outline:active {
    transform: translateY(0);
}

.btn-sm {
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* === Forms === */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 0.6rem;
    font-size: 1rem;
    border: 1px solid #c8d9f0;
    border-radius: 6px;
    background-color: var(--form-field-bg);
    transition: border-color 0.25s, box-shadow 0.25s, background-color 0.25s;
}

.form-control:focus {
    outline: none;
    border-color: #6aabec;
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.08);
    background-color: var(--form-field-bg-focus);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

/* === Tables === */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(8,15,36,0.04), 0 4px 16px rgba(8,15,36,0.06);
    border: 1px solid var(--border-light);
}

.data-table thead {
    background: var(--dark);
    color: white;
}

.data-table th {
    padding: 0.9rem 1.1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(200,215,240,0.9);
}

.data-table th:first-child {
    border-left: 3px solid var(--accent);
}

.data-table td {
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid #edf3fb;
    color: var(--dark-text);
    font-weight: 400;
    font-size: 0.9rem;
}

.data-table tbody tr:nth-child(even) {
    background: #f7fafd;
}

.data-table tbody tr:hover {
    background: #edf4fc;
}

.data-table .actions {
    display: flex;
    gap: 0.5rem;
}

/* === Alerts === */
.alert {
    padding: 0.9rem 1.2rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border: 1px solid;
    border-left: 4px solid;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-success {
    background: var(--success-light);
    border-color: #a7dfc9;
    border-left-color: var(--success);
    color: #0e5c3a;
}

.alert-error, .alert-danger {
    background: var(--danger-light);
    border-color: #f5c0bb;
    border-left-color: var(--danger);
    color: #7c1c14;
}

.alert-warning {
    background: var(--warning-light);
    border-color: #fcd89e;
    border-left-color: var(--warning);
    color: #7a4208;
}

.alert-info {
    background: var(--info-light);
    border-color: #a0d8ea;
    border-left-color: var(--info);
    color: #054a60;
}

/* === Text Utilities === */
.text-muted {
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

/* === Login Page Modern Redesign === */

@keyframes gradient-flow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--dark);
    color: white;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 40%, rgba(24,69,200,0.35) 0%, transparent 60%),
        radial-gradient(ellipse 60% 80% at 80% 70%, rgba(245,166,35,0.15) 0%, transparent 55%),
        radial-gradient(ellipse 100% 100% at 50% 0%, rgba(13,30,80,0.8) 0%, transparent 70%);
    pointer-events: none;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 2rem;
    z-index: 1;
    position: relative;
}

.login-box {
    background: rgba(14,24,41,0.7);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
}

.login-box h1 {
    color: white;
    margin-bottom: 0.3rem;
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.login-box h1::before {
    content: '◆ ';
    color: var(--accent);
    font-size: 1.2rem;
}

.login-box .subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 2rem;
    font-size: 0.9rem;
    font-weight: 300;
}

.login-page .form-group label {
    color: rgba(255, 255, 255, 0.75);
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.login-page .form-control {
    background-color: var(--form-field-bg);
    border: 1px solid rgba(212, 184, 120, 0.9);
    color: var(--dark);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    transition: all 0.25s ease;
    font-family: 'Lexend', sans-serif;
}

.login-page .form-control::placeholder {
    color: var(--text-muted);
}

.login-page .form-control:focus {
    background-color: var(--form-field-bg-focus);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(245,166,35,0.15);
}

.login-page .btn-primary {
    background: linear-gradient(135deg, #f5a623 0%, #e8920c 100%);
    color: #1a0f00;
    font-weight: 800;
    border: none;
    box-shadow: 0 4px 20px rgba(245,166,35,0.4);
    font-size: 1rem;
    padding: 0.85rem 1.4rem;
}

.login-page .btn-primary:hover {
    background: linear-gradient(135deg, #fbb534 0%, #f5a020 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(245,166,35,0.55);
}

/* === Dashboard Cards === */
.dashboard-card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 1.8rem 1.6rem;
    text-align: center;
    transition: all 0.25s ease;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(8,15,36,0.04), 0 4px 14px rgba(8,15,36,0.05);
    position: relative;
    overflow: hidden;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--primary) 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.dashboard-card:hover {
    border-color: var(--border);
    box-shadow: 0 4px 20px rgba(8,15,36,0.1), 0 0 0 2px rgba(245,166,35,0.15);
    transform: translateY(-3px);
}

.dashboard-card:hover::before {
    opacity: 1;
}

.dashboard-card .icon {
    font-size: 2.5rem;
    margin-bottom: 0.9rem;
    display: block;
}

.dashboard-card h3 {
    color: var(--dark);
    margin-bottom: 0.4rem;
    font-weight: 700;
    font-size: 1rem;
}

.dashboard-plusminus-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 240px));
    gap: 1.1rem;
    margin-bottom: 1.6rem;
}

.dashboard-plusminus-link {
    text-decoration: none;
}

.dashboard-plusminus-card {
    min-height: 210px;
    aspect-ratio: 1 / 1;
    padding: 1.25rem;
    border-radius: 20px;
    border: 1px solid rgba(24,69,200,0.12);
    background: linear-gradient(180deg, #ffffff 0%, #eef4ff 100%);
    box-shadow: 0 1px 3px rgba(8,15,36,0.04), 0 10px 24px rgba(8,15,36,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.45rem;
    text-align: center;
}

.dashboard-plusminus-card:hover {
    transform: translateY(-3px);
    border-color: rgba(24,69,200,0.24);
    box-shadow: 0 10px 24px rgba(8,15,36,0.1);
}

.dashboard-plusminus-card__type {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: 0.04em;
}

.dashboard-plusminus-card__class {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
}

.dashboard-plusminus-card h2 {
    margin: 0;
    color: var(--dark);
    font-size: 1.15rem;
    line-height: 1.25;
    word-break: break-word;
}

.dashboard-stats-card {
    margin-top: 1.6rem;
}

.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.2rem;
    margin-top: 1rem;
}

/* === Badges === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    font-family: 'Lexend', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 100px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--primary);
    color: white;
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-warning {
    background: var(--accent-light);
    color: var(--accent-dark);
}

/* === Grade Display === */
.grade-display {
    font-size: 1.4rem;
    font-weight: 800;
    padding: 0.4rem 1rem;
    border-radius: 8px;
    display: inline-block;
    letter-spacing: -0.02em;
}

.grade-1 { background: #d0f5e6; color: #0a5c35; border: 1px solid #9de4c0; }
.grade-2 { background: #d0edf5; color: #0a4a5c; border: 1px solid #9dd4e4; }
.grade-3 { background: #fef3c7; color: #7a4208; border: 1px solid #fcd899; }
.grade-4 { background: #fde8e6; color: #7c1c14; border: 1px solid #f5b8b2; }
.grade-5 { background: #fbd4d0; color: #7c1c14; border: 1px solid #f5a09a; }
.grade-6 { background: #e5483a; color: white; border: 1px solid #c73428; }

/* === Responsive === */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .nav-container {
        flex-direction: column;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .data-table {
        font-size: 0.9rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.6rem;
    }
}

@media (max-width: 900px) {
    body.nav-open {
        overflow: hidden;
    }

    .main-header {
        padding: 0.8rem 1rem;
    }

    .header-content {
        gap: 0.9rem;
        align-items: center;
    }

    .header-brand {
        flex: 1;
        justify-content: flex-start;
        min-width: 0;
        gap: 0.75rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .nav-toggle {
        display: inline-flex;
        flex-shrink: 0;
    }

    .user-info {
        width: auto;
        gap: 0.75rem;
        justify-content: flex-end;
        margin-left: auto;
        flex-wrap: nowrap;
    }

    .user-name {
        flex: 0 1 auto;
        font-size: 0.85rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 220px;
    }

    .main-nav {
        border-bottom: 1px solid var(--border-light);
        box-shadow: none;
        background: transparent;
    }

    .nav-overlay {
        display: none;
    }

    .nav-container {
        position: static;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0 1rem;
        background: linear-gradient(180deg, #ffffff 0%, #f7fafd 100%);
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
        border-left: none;
        border-top: 1px solid var(--border-light);
        flex-direction: column;
        align-items: stretch;
        gap: 0.35rem;
        overflow-y: hidden;
        overflow-x: hidden;
        max-height: 0;
        opacity: 0;
        visibility: hidden;
        transition: max-height 0.24s ease, opacity 0.18s ease, padding 0.18s ease;
    }

    .main-nav.is-open .nav-container {
        max-height: 80vh;
        opacity: 1;
        visibility: visible;
        padding: 0.85rem 1rem 1rem;
    }

    .nav-mobile-head {
        display: none;
    }

    .nav-mobile-title {
        font-size: 1rem;
        font-weight: 800;
        color: var(--dark);
        letter-spacing: -0.02em;
    }

    .nav-close {
        width: 40px;
        height: 40px;
        border: 1px solid var(--border-light);
        border-radius: 10px;
        background: #fff;
        color: var(--text-muted);
        font-size: 1.6rem;
        line-height: 1;
        cursor: pointer;
    }

    .nav-link {
        width: 100%;
        padding: 0.95rem 1rem;
        border: 1px solid transparent;
        border-radius: 12px;
        border-bottom-width: 1px;
        text-transform: none;
        font-size: 0.95rem;
        letter-spacing: 0;
    }

    .nav-link--icon {
        min-width: 0;
        justify-content: flex-start;
        gap: 0.75rem;
    }

    .nav-link--icon .sr-only {
        position: static;
        width: auto;
        height: auto;
        margin: 0;
        overflow: visible;
        clip: auto;
        white-space: normal;
    }

    .nav-link:hover,
    .nav-link.active {
        border-color: var(--accent-light);
    }

    .container {
        margin: 1rem auto;
        padding: 0 1rem 1rem;
    }

    .card {
        padding: 1.1rem;
        border-radius: 12px;
    }

    .page-header > div {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        width: 100%;
    }

    .page-header > div .btn,
    .page-header > div a.btn {
        flex: 1 1 150px;
    }

    .data-table,
    .perf-table,
    .student-grade-table {
        display: block;
        width: 100%;
        min-width: 640px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .grades-entry-container {
        padding: 1rem 0 5rem;
    }

    .grades-header {
        padding: 1rem;
    }

    .grades-selectors {
        width: 100%;
    }

    .grades-nav-arrows {
        width: 100%;
        flex-direction: row;
    }

    .grades-nav-arrows .btn-icon {
        flex: 1 1 0;
    }

    .grades-actions {
        width: 100%;
        justify-content: stretch;
    }

    .grades-actions .btn-icon {
        flex: 1 1 calc(50% - 0.25rem);
    }
}

@media (max-width: 640px) {
    .main-header {
        padding: 0.65rem 0.85rem;
    }

    .logo {
        font-size: 1rem;
    }

    .header-content {
        gap: 0.55rem;
    }

    .nav-toggle {
        width: 40px;
        height: 40px;
        margin-left: auto;
    }

    .nav-toggle span {
        width: 18px;
    }

    .user-info {
        gap: 0.4rem;
    }

    .user-name {
        display: none;
    }

    .user-info form {
        display: inline-flex !important;
        margin: 0;
    }

    .user-info .btn-sm {
        padding: 0.32rem 0.65rem;
        font-size: 0.74rem;
        min-height: 36px;
        border-radius: 8px;
    }

    .user-info .btn-gear {
        width: 36px;
        height: 36px;
    }

    .page-header h1 {
        font-size: 1.45rem;
    }

    .dashboard-plusminus-grid {
        grid-template-columns: 1fr;
    }
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--light-bg);
    border-radius: 8px;
    border: 1px dashed #b0c8e8;
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* === Noteneingabe-Maske === */
.grades-entry-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Kopfbereich */
.grades-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 1.2rem 1.8rem;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(26,86,219,0.06);
    margin-bottom: 1.5rem;
    gap: 1rem;
    border: 1px solid #dce8f8;
}

.grades-selectors {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.grades-select {
    min-width: 180px;
    padding: 0.7rem 1.2rem;
    font-size: 1rem;
    border: 1px solid #d8ca85;
    border-radius: 8px;
    background-color: var(--form-field-bg);
    cursor: pointer;
    transition: all 0.25s ease;
    font-weight: 500;
}

.grades-select:hover {
    border-color: #c8b660;
    box-shadow: 0 2px 6px rgba(200, 182, 96, 0.15);
}

.grades-select:focus {
    outline: none;
    border-color: #b8a040;
    box-shadow: 0 0 0 3px rgba(200, 182, 96, 0.15);
    transform: translateY(-1px);
}

.grades-nav-arrows {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.grades-nav-arrows .btn-icon {
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
    min-width: 36px;
}

.btn-icon {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    color: var(--text-muted);
    box-shadow: 0 1px 3px rgba(8,15,36,0.06);
    position: relative;
}

.btn-icon:hover {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(245,166,35,0.2);
}

.btn-icon:active {
    transform: translateY(0);
    background: #fce4b0;
}

.grades-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Hauptbereich */
.grades-main {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1.5rem;
    min-height: 600px;
}

/* Linker Bereich: Klassenarbeiten */
.grades-exams-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(26,86,219,0.06);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    border: 1px solid #dce8f8;
    font-size: 0.82rem;
}

.exams-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.exams-table thead {
    background: var(--primary);
    color: white;
}

.exams-table th {
    padding: 0.8rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

.exams-table td {
    padding: 0.8rem;
    border-bottom: 1px solid #e8f0fb;
}

.exam-row {
    transition: background 0.2s;
}

.exam-row:hover:not(.active) {
    background: var(--light-bg);
    cursor: pointer;
}

.exam-row.active {
    background: linear-gradient(90deg, var(--accent-light) 0%, #fff8ec 100%);
    box-shadow: inset 3px 0 0 var(--accent);
    transform: translateX(2px);
}

.exam-row.new-exam input {
    width: 100%;
    border: 1px solid var(--border);
    background-color: var(--form-field-bg);
    font-size: 0.9rem;
    padding: 0.35rem 0.45rem;
    border-radius: 6px;
    color: var(--dark-text);
    font-family: 'Lexend', sans-serif;
}

.exam-topic-input:focus,
.exam-date-input:focus {
    outline: 2px solid var(--accent);
    border-radius: 4px;
    background-color: var(--form-field-bg-focus);
}

.new-exam-action {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #e8f0fb;
}

/* Rechter Bereich: Schülerliste */
.grades-students-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(26,86,219,0.06);
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 800px;
    border: 1px solid #dce8f8;
}

.grades-students-panel::-webkit-scrollbar {
    width: 8px;
}

.grades-students-panel::-webkit-scrollbar-track {
    background: var(--light-bg);
    border-radius: 4px;
}

.grades-students-panel::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 4px;
}

.grades-students-panel::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.students-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.students-column {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.student-grade-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    transition: all 0.25s ease;
    border-left: 3px solid transparent;
    background: white;
    box-shadow: 0 1px 2px rgba(26,86,219,0.04);
}

.student-row-even {
    background: #e8f0fb;
}

.student-row-odd {
    background: #ffffff;
}

.student-grade-row:hover {
    background: #dce8f8 !important;
    box-shadow: 0 2px 8px rgba(26,86,219,0.1);
    transform: translateX(2px);
}

.student-icon {
    font-size: 1.2rem;
    opacity: 0.6;
    flex-shrink: 0;
}

.student-name {
    flex: 1;
    font-weight: 500;
    color: var(--dark);
    min-width: 0;
}

.student-name.highlight {
    color: var(--danger);
    font-weight: 600;
}

.grade-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    position: relative;
}

.grade-input {
    width: 80px;
    padding: 0.5rem;
    border: 2px solid var(--border);
    border-radius: 4px;
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
    background-color: var(--form-field-bg);
}

.grade-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
    background-color: var(--form-field-bg-focus);
}

/* Status-Icons für Auto-Save */
.grade-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 0.9rem;
    position: relative;
}

.grade-status-icon span {
    display: none;
    transition: all 0.3s ease;
}

.grade-status-icon[data-status="idle"] .status-idle {
    display: inline;
    color: #ccc;
    opacity: 0.5;
}

.grade-status-icon[data-status="saving"] .status-saving {
    display: inline;
    color: var(--primary);
    animation: spin 1s linear infinite;
}

.grade-status-icon[data-status="saved"] .status-saved {
    display: inline;
    color: var(--success);
    animation: checkmark 0.5s ease;
}

.grade-status-icon[data-status="error"] .status-error {
    display: inline;
    color: var(--danger);
    animation: shake 0.5s ease;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes checkmark {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Row-Status-Highlighting */
.student-grade-row.saving {
    background: rgba(24,69,200,0.07) !important;
    border-left: 3px solid var(--primary);
}

.student-grade-row.saved {
    background: rgba(26,158,110,0.08) !important;
    border-left: 3px solid var(--success);
    animation: flashGreen 0.5s ease;
}

.student-grade-row.error {
    background: rgba(229,72,58,0.08) !important;
    border-left: 3px solid var(--danger);
}

@keyframes flashGreen {
    0% { background: rgba(40, 167, 69, 0.3); }
    100% { background: rgba(40, 167, 69, 0.1); }
}

/* Verbesserte Noteneingabefelder */
.grade-input {
    width: 85px;
    padding: 0.6rem;
    border: 1px solid #c8d9f0;
    border-radius: 6px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.25s ease;
    background-color: var(--form-field-bg);
}

.grade-input:hover {
    border-color: #93c5fd;
    box-shadow: 0 1px 6px rgba(26, 86, 219, 0.1);
}

.grade-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
    transform: scale(1.04);
    background-color: var(--form-field-bg-focus);
}

.grade-input:valid {
    border-color: #7bc9a8;
}

/* Auto-Save-Indikator */
.save-status {
    margin-bottom: 1rem;
}

.auto-save-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f7fafd;
    border: 1px solid var(--border-light);
    border-radius: 100px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.25s ease;
}

.auto-save-indicator.saving {
    background: #edf4fc;
    color: var(--primary);
    border-color: #b0ccf0;
}

.auto-save-indicator.saved {
    background: var(--success-light);
    color: var(--success);
    border-color: #a7dfc9;
}

.auto-save-indicator.error {
    background: var(--danger-light);
    color: var(--danger);
    border-color: #f5b8b2;
}

.auto-save-indicator .status-icon {
    font-size: 1rem;
    animation: pulse 2s ease-in-out infinite;
}

.auto-save-indicator.saving .status-icon {
    animation: spin 1s linear infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.grades-form-actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e8f0fb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Responsive */
@media (max-width: 1200px) {
    .grades-main {
        grid-template-columns: 1fr;
    }
    
    .grades-exams-panel {
        order: 2;
    }
    
    .grades-students-panel {
        order: 1;
    }
    
    .students-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .grades-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .grades-selectors {
        flex-wrap: wrap;
    }
    
    .grades-select {
        min-width: 100%;
    }
    
    .grades-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* === Bewertungs-Punkte-Buttons === */
.interactive-grading-widget {
    background: #fff;
    border: 1px solid #dce8f8;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 4px rgba(26,86,219,0.05);
}

.criterion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.criterion-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 1rem;
}

.criterion-weight {
    color: #64748b;
    font-size: 0.875rem;
}

.grading-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between; /* Distribute items and push point-buttons to left, others to right if needed */
}

.grading-controls .point-buttons {
    flex-grow: 1; /* Allow point buttons to take available space */
}

.grading-controls .override-input-wrapper {
    margin-left: auto; /* Push input and NA button to the right */
}


.grading-controls.is-na .point-buttons,
.grading-controls.is-na .override-input-wrapper {
    pointer-events: none;
    opacity: 0.5;
}

.point-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    background: #f0f5fc;
    padding: 0.75rem;
    border-radius: 0.375rem;
    max-width: 100%;
}

.point-btn {
    border: none;
    background: transparent;
    color: #475569;
    font-weight: 600;
    padding: 0; /* Remove padding to allow fixed width/height to control size */
    width: 44px; /* Fixed width */
    height: 44px; /* Fixed height */
    flex-shrink: 0; /* Prevent shrinking */
    flex-grow: 0; /* Prevent growing */
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    display: flex; /* Use flex to center content */
    align-items: center;
    justify-content: center;
}

.point-btn:hover {
    background-color: #e2e8f0;
    transform: scale(1.05);
}

.point-btn:active {
    background-color: #cbd5e1;
    transform: scale(0.98);
}

.point-btn.selected {
    background: linear-gradient(135deg, #f5a623 0%, #e8920c 100%);
    color: #1a0f00;
    box-shadow: 0 3px 10px -2px rgba(245,166,35,0.5);
    transform: scale(1.05);
    font-weight: 800;
}

.point-btn.selected:active {
    transform: scale(1.02);
}

.override-input-wrapper {
    width: 75px;
}

.override-input {
    width: 100%;
    padding: 0.5rem 0.375rem;
    border: 1px solid #c8d9f0;
    border-radius: 0.375rem;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    background-color: var(--form-field-bg);
}

.override-input:focus {
    outline: none;
    border-color: #1a56db;
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.08);
    background-color: var(--form-field-bg-focus);
}

.na-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid #c8d9f0;
    background: #fff;
    color: #64748b;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.na-btn:hover {
    background: #f0f5fc;
    border-color: #93c5fd;
}

.na-btn.selected {
    background: #fef3c7;
    border-color: #fbbf24;
    color: #92400e;
}

.final-grade-display {
    background: linear-gradient(135deg, #0d1e50 0%, #162d78 100%);
    color: white;
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-radius: 14px;
    margin-bottom: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(8,15,36,0.35), 0 0 0 1px rgba(245,166,35,0.2);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    transition: all 0.3s ease;
    border-top: 2px solid rgba(245,166,35,0.4);
}

.final-grade-display.pinned {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.5);
    margin-bottom: 0;
    animation: slideDown 0.3s ease;
    border-radius: 0;
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Placeholder to reserve space when pinned */
.final-grade-placeholder {
    height: 0;
    transition: height 0.3s ease;
}

/* Control Buttons im blauen Feld (Ansicht + Pin) */
.grid-view-btn,
.pin-grade-btn {
    position: absolute;
    top: 0.75rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.grid-view-btn {
    left: 0.75rem;
}

.pin-grade-btn {
    right: 0.75rem;
}

.grid-view-btn:hover,
.pin-grade-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.grid-view-btn:active,
.pin-grade-btn:active {
    transform: scale(0.95);
}

.final-grade-display.pinned .pin-grade-btn {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Verstecke den separaten Button unterhalb des blauen Feldes */
.tablet-grid-toggle-container {
    display: none !important;
}

/* === Kompakte Grid-Ansicht (für alle Geräte) === */
#criteria-container.criteria-grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0.6rem;
}

#criteria-container.criteria-grid-view .interactive-grading-widget {
    padding: 0.6rem;
    margin-bottom: 0;
}

#criteria-container.criteria-grid-view .criterion-header {
    margin-bottom: 0.35rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
}

#criteria-container.criteria-grid-view .criterion-name {
    font-size: 0.9rem;
    line-height: 1.25;
}

#criteria-container.criteria-grid-view .criterion-weight {
    font-size: 0.75rem;
}

/* Grading Controls in compact view */
#criteria-container.criteria-grid-view .grading-controls {
    display: flex; /* Use flexbox for overall layout */
    flex-wrap: wrap; /* Allow items to wrap */
    gap: 0.4rem;
    align-items: center; /* Align items vertically */
}

/* Row 1: Point Buttons */
#criteria-container.criteria-grid-view .point-buttons {
    order: 1; /* Ensure point buttons come first */
    flex-basis: 100%; /* Take full width */
    max-width: 100%; /* Ensure it doesn't overflow */
    justify-content: flex-start;
}

/* Row 2: Input field and N/A button */
#criteria-container.criteria-grid-view .override-input-wrapper {
    order: 2; /* Second in order */
    flex-grow: 1; /* Allow to grow and fill space */
    min-width: 60px; /* Minimum width */
    max-width: fit-content; /* Adjust to content size */
}

#criteria-container.criteria-grid-view .na-btn {
    order: 3; /* Third in order */
    min-width: 50px;
    min-height: 40px;
    padding: 0.45rem 0.6rem;
    font-size: 0.85rem;
}

.final-grade-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 0 3rem;
}

.final-grade-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
}

.final-grade-nav-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-width: 80px;
}

.final-grade-nav-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.final-grade-nav-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.final-grade-student {
    text-align: center;
    flex: 0 0 auto;
}

.final-grade-student-label {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 0.15rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.final-grade-student-name {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.final-grade-counter {
    margin-top: 0.2rem;
    font-size: 0.85rem;
    opacity: 0.9;
}

.final-grade-main {
    text-align: center;
    flex: 0 0 auto;
}

.final-grade-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
    margin-bottom: 0.3rem;
}

.final-grade-value {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.3rem;
    color: var(--accent);
    text-shadow: 0 2px 8px rgba(245,166,35,0.3);
    letter-spacing: -0.03em;
}

.final-grade-info {
    font-size: 0.8rem;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .interactive-grading-widget {
        padding: 0.625rem 0.875rem;
        margin-bottom: 0.625rem;
    }
    .criterion-header {
        margin-bottom: 0.375rem;
    }
    .point-btn {
        padding: 0.625rem 0.75rem;
        min-height: 42px;
        min-width: 45px;
        font-size: 0.9375rem;
    }
    .point-buttons {
        gap: 0.375rem;
        padding: 0.5rem;
    }
    .grading-controls {
        gap: 0.375rem;
    }
    .final-grade-value {
        font-size: 2rem;
    }
    .final-grade-row {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
    }
    .final-grade-nav-btn {
        width: 100%;
        flex-direction: row;
        justify-content: center;
        gap: 0.5rem;
    }
}

/* === Einklappbare Bereiche für Bewertungen === */
.collapsible-section {
    margin-bottom: 1.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem 0;
    user-select: none;
}

.section-header:hover {
    opacity: 0.8;
}

.collapsible-section .section-header {
    cursor: pointer;
}

.collapse-icon {
    font-size: 0.875rem;
    color: #64748b;
    transition: transform 0.3s ease;
}

.collapsible-section.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.section-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 5000px;
    opacity: 1;
}

.collapsible-section.collapsed .section-content {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
}

/* Tablet Grid Toggle Button - Standard: versteckt, auf Tablets sichtbar */
.tablet-grid-toggle-container {
    display: none;
    margin-bottom: 1rem;
    justify-content: center;
}

#toggle-grid-view-btn {
    min-height: 50px;
    padding: 0.9rem 1.5rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* === iPad-Optimierungen === */
/* iPad Portrait & Landscape */
















/* Touch-Optimierungen für alle Tablets */
@media (hover: none) and (pointer: coarse) {
    /* Entfernen von Hover-Effekten, die auf Touch-Geräten störend sind */
    .btn:hover,
    .btn-primary:hover,
    .btn-secondary:hover,
    .nav-link:hover {
        transform: none;
    }

    /* Touch-Feedback durch active state */
    .btn:active,
    .btn-primary:active {
        transform: scale(0.98);
        opacity: 0.9;
    }

    .nav-link:active {
        background: var(--accent-light);
        opacity: 0.9;
    }

    /* Größere Clickable Areas */
    .data-table tbody tr {
        cursor: pointer;
    }

    .data-table tbody tr:active {
        background: var(--light-bg);
    }

    /* Bewertungsseite Touch-Feedback */
    .point-btn:active {
        transform: scale(0.95);
        background: var(--primary);
        color: white;
    }

    .na-btn:active {
        transform: scale(0.95);
    }

    #prev-student-btn:active,
    #next-student-btn:active {
        transform: scale(0.98);
        opacity: 0.9;
    }

    #create-assessment-btn:active {
        transform: scale(0.98);
        opacity: 0.9;
    }

    .section-header:active {
        opacity: 0.7;
    }
}

/* Notenübersicht iPad-Optimierung */
@media only screen
  and (min-device-width: 768px)
  and (max-device-width: 1024px) {

    .overview-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .overview-table {
        min-width: 100%;
    }

    .overview-table th,
    .overview-table td {
        padding: 0.8rem;
        min-width: 80px;
    }

    .grade-edit-input {
        min-width: 70px;
        min-height: 44px;
        font-size: 1.1rem;
        padding: 0.6rem;
    }

    /* Sticky erste Spalte für horizontales Scrollen */
    .overview-table th:first-child,
    .overview-table td:first-child {
        position: sticky;
        left: 0;
        background: white;
        z-index: 10;
        box-shadow: 2px 0 8px rgba(8,15,36,0.08);
    }

    .overview-table thead th:first-child {
        z-index: 20;
    }
}

/* Verbesserte Filter-Selektoren für iPad */
@media only screen
  and (min-device-width: 768px)
  and (max-device-width: 1024px) {

    .filter-controls {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .filter-controls select,
    .filter-controls input {
        width: 100%;
        min-height: 48px;
        font-size: 1.05rem;
    }
}

/* === Password Visibility Toggle === */
.password-wrapper {
    position: relative;
}

.password-toggle-icon {
    position: absolute;
    top: 68%;
    right: 15px;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.password-toggle-icon:hover {
    color: var(--primary);
}

/* === Plus/Minus === */
.badge-neutral {
    background: #d9e1ee;
    color: #42526e;
}

.plusminus-active-card {
    overflow: hidden;
}

.plusminus-active-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.plusminus-active-heading {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.plusminus-active-meta {
    margin: 0;
    color: var(--text-muted);
}

.plusminus-active-hint {
    margin: 0.1rem 0 0;
    color: var(--primary-dark);
    font-size: 0.88rem;
    font-weight: 500;
}

.plusminus-active-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    justify-content: flex-end;
}

.plusminus-grade-editor-cell {
    text-align: center;
}

.plusminus-grade-editor {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.manual-grade-input {
    width: 72px;
    padding: 0.38rem 0.45rem;
    border: 1px solid #c8d9f0;
    border-radius: 6px;
    background-color: var(--form-field-bg);
    color: var(--dark);
    text-align: center;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.manual-grade-input:focus {
    outline: none;
    border-color: #6aabec;
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.08);
    background-color: var(--form-field-bg-focus);
}

.manual-grade-input::placeholder {
    color: var(--text-secondary);
    opacity: 1;
}

.manual-grade-input:disabled {
    background-color: var(--form-field-bg-disabled);
    color: var(--text-muted);
    cursor: default;
}

.manual-grade-input.has-error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(229, 72, 58, 0.12);
}

.manual-grade-mode {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    padding: 0.14rem 0.45rem;
    border-radius: 999px;
    background: #e8eef8;
    color: #4f6284;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.manual-grade-mode.is-manual {
    background: var(--accent-light);
    color: var(--accent-dark);
}

.plusminus-create-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(246,250,255,0.98) 100%);
}

.plusminus-class-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

.plusminus-class-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(24,69,200,0.12);
    background: rgba(255,255,255,0.86);
    color: var(--dark);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 600;
}

.plusminus-class-chip.is-active,
.plusminus-class-chip:hover {
    border-color: rgba(245,166,35,0.45);
    background: #fff7ea;
    color: var(--accent-dark);
}

.plusminus-class-chip__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.65rem;
    height: 1.65rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: rgba(24,69,200,0.08);
    color: var(--primary-dark);
    font-size: 0.76rem;
    font-weight: 700;
}

.plusminus-create-toggle {
    margin-bottom: 0.8rem;
}

.plusminus-create-form-shell {
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.plusminus-create-title {
    margin-top: 0;
    margin-bottom: 0.9rem;
}

.plusminus-create-form {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.plusminus-create-form .form-row {
    gap: 0.75rem;
}

.plusminus-create-form .form-group {
    margin-bottom: 0;
}

.plusminus-create-form .form-group label {
    margin-bottom: 0.28rem;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.plusminus-create-form .form-control {
    min-height: 38px;
    padding: 0.42rem 0.62rem;
    font-size: 0.92rem;
}

.plusminus-create-form-shell .form-row:first-of-type {
    grid-template-columns: minmax(280px, 1.5fr) minmax(180px, 0.8fr);
}

.plusminus-create-form-shell .form-row:nth-of-type(2) {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.plusminus-create-form-shell .form-row:nth-of-type(3) {
    grid-template-columns: repeat(5, minmax(96px, 1fr));
}

.plusminus-create-form-shell .form-row:nth-of-type(3) .form-control,
.plusminus-create-form-shell .form-group:last-of-type .form-control {
    text-align: center;
}

.plusminus-create-form small,
.plusminus-form-help {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.plusminus-create-info {
    margin-top: 0 !important;
    margin-bottom: 0;
    padding: 0.75rem 0.95rem;
    font-size: 0.84rem;
}

.plusminus-create-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.plusminus-active-class {
    margin: 0 0 0.25rem;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-dark);
}

.plusminus-active-panels {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-bottom: 1rem;
}

.plusminus-panel {
    border: 1px solid rgba(24,69,200,0.12);
    border-radius: 16px;
    background: #f9fbff;
    overflow: hidden;
}

.plusminus-panel summary {
    cursor: pointer;
    list-style: none;
    padding: 0.9rem 1rem;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.plusminus-panel summary::-webkit-details-marker {
    display: none;
}

.plusminus-panel summary::after {
    content: '+';
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.plusminus-panel[open] summary::after {
    content: '−';
}

.plusminus-panel__body {
    padding: 0 1rem 1rem;
    border-top: 1px solid rgba(24,69,200,0.08);
}

.plusminus-rename-form {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.75rem;
}

.plusminus-rename-form .form-group {
    flex: 1 1 260px;
    margin-bottom: 0;
}

@media (max-width: 900px) {
    .plusminus-active-header {
        flex-direction: column;
    }

    .plusminus-active-actions {
        justify-content: flex-start;
    }

    .plusminus-create-form-shell .form-row:first-of-type,
    .plusminus-create-form-shell .form-row:nth-of-type(2),
    .plusminus-create-form-shell .form-row:nth-of-type(3) {
        grid-template-columns: 1fr;
    }

    .plusminus-rename-form {
        flex-direction: column;
        align-items: stretch;
    }
}

@media only screen and (min-device-width: 768px) and (max-device-width: 1366px) {
    .plusminus-active-card {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #rating-table {
        min-width: 1180px;
    }

    #rating-table th,
    #rating-table td {
        padding-top: 0.7rem;
        padding-bottom: 0.7rem;
    }

    .rating-cell {
        width: 64px;
        height: 46px;
        font-size: 17px;
        border-radius: 8px;
    }

    .manual-grade-input {
        width: 82px;
        min-height: 42px;
        font-size: 1rem;
    }

    .finish-toggle {
        width: 54px;
        height: 54px;
    }

    .plusminus-class-shortcuts {
        gap: 0.7rem;
    }
}
/* === Question Builder UI Styles === */

/* MC Options */
.mc-option-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: var(--light-bg);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.mc-option-text {
    flex: 1;
}

.mc-option-item label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    font-weight: 500;
}

/* Keyword Items */
.keyword-item {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    align-items: center;
}

/* Match Form */
.match-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.match-column h4 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.match-item {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    align-items: center;
}

/* Blank Items */
.blank-item {
    background: var(--warning-light);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--warning);
}

.blank-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.blank-item input {
    margin-bottom: 0.5rem;
}

/* Grid Editor */
#grid_pattern_editor {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    max-width: 500px;
}

.grid-cell {
    width: 30px;
    height: 30px;
    border: 1px solid #ccc;
    cursor: pointer;
    transition: all 0.2s;
}

.grid-cell.white {
    background: white;
}

.grid-cell.black {
    background: black;
}

.grid-cell:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Table Editor */
.table-editor-grid {
    width: 100%;
    border-collapse: collapse;
}

.table-editor-grid td {
    padding: 0.5rem;
    border: 1px solid #dee2e6;
}

.table-cell-input {
    margin-bottom: 0.25rem;
}

.table-cell-input:first-child,
.table-cell-input:last-child {
    background-color: var(--form-field-bg);
}

/* Huffman Character Items */
.huffman-char-item {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    align-items: center;
}

/* Button Icons */
.btn-icon {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: all 0.2s;
    border-radius: 4px;
}

.btn-icon:hover {
    background: rgba(220, 53, 69, 0.1);
    transform: scale(1.1);
}

/* Help Text */
.help-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 1rem;
}

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Image Preview */
.image-preview-box {
    margin-top: 1rem;
    position: relative;
    display: inline-block;
}

.image-preview-box img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    border: 1px solid #c8d9f0;
}

.image-preview-box .btn-icon {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
}


/* False Statements */
.false-statement-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: var(--danger-light);
    border-radius: 8px;
    border-left: 3px solid var(--danger);
}

.false-statement-text {
    flex: 1;
}

.false-statement-item label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    font-weight: 500;
    color: var(--danger);
}

/* =========================================================
   MIDNIGHT AMBER — Global Refinements
   ========================================================= */

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--page-bg); }
::-webkit-scrollbar-thumb {
    background: #b8cce8;
    border-radius: 100px;
    border: 2px solid var(--page-bg);
}
::-webkit-scrollbar-thumb:hover { background: #8aadd4; }

/* Selection */
::selection {
    background: rgba(245,166,35,0.25);
    color: var(--dark);
}

/* Headings */
h1, h2, h3, h4 {
    letter-spacing: -0.02em;
}

/* Focus visible — keyboard navigation */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Stat boxes on dashboard */
.stat-box {
    text-align: center;
    padding: 1.2rem;
    background: linear-gradient(135deg, #f7fafd 0%, var(--light-bg) 100%);
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.stat-box .stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-box .stat-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Section dividers */
hr {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 1.5rem 0;
}

/* Table cell input styling */
.table-cell-input:first-child,
.table-cell-input:last-child {
    background-color: var(--form-field-bg);
}

/* Grades nav arrows */
.grades-nav-arrows .btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}


/* === Gear Button (Header) === */
.btn-gear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.75);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.3s;
    flex-shrink: 0;
}
.btn-gear:hover {
    background: rgba(245,166,35,0.2);
    color: var(--accent);
    transform: rotate(60deg);
}

/* === Passwort-Modal === */
.pw-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(8,15,36,0.65);
    backdrop-filter: blur(3px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.pw-modal-overlay.is-open {
    display: flex;
}
.pw-modal {
    background: var(--card-bg);
    border-radius: 14px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(8,15,36,0.35);
    overflow: hidden;
    animation: pwSlideIn 0.2s ease;
}
@keyframes pwSlideIn {
    from { opacity: 0; transform: translateY(-16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)     scale(1);    }
}
.pw-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid var(--border);
    background: var(--header-gradient);
    color: white;
}
.pw-modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}
.pw-modal-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.2rem;
    transition: color 0.15s;
}
.pw-modal-close:hover { color: white; }
.pw-modal-body {
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.pw-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    padding: 1rem 1.4rem;
    border-top: 1px solid var(--border);
    background: var(--light-bg);
}
.pw-alert {
    padding: 0.65rem 0.9rem;
    border-radius: 7px;
    font-size: 0.88rem;
}
.pw-alert-success {
    background: var(--success-light);
    color: var(--success);
}
.pw-alert-error {
    background: var(--danger-light);
    color: var(--danger);
}



/* TOOLS */
.tools-page{padding:2rem;max-width:1300px;margin:0 auto}
.tools-page-header{margin-bottom:2rem}
.tools-page-title{font-size:1.8rem;font-weight:800;color:var(--text)}
.tools-page-sub{color:var(--text-muted);margin-top:.25rem}
.tools-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:1.25rem}
.tool-card{background:var(--card-bg);border:2px solid var(--border);border-radius:18px;padding:2.2rem 1rem 1.8rem;display:flex;flex-direction:column;align-items:center;gap:.6rem;cursor:pointer;font-family:inherit;transition:border-color .2s,box-shadow .2s,transform .15s;text-align:center}
.tool-card:hover{border-color:var(--primary);box-shadow:0 6px 24px rgba(24,69,200,.13);transform:translateY(-4px)}
.tool-icon{font-size:3rem;line-height:1}
.tool-label{font-size:1rem;font-weight:700;color:var(--text)}
.tool-desc{font-size:.78rem;color:var(--text-muted);line-height:1.3}
.tool-fs{display:none;position:fixed;inset:0;z-index:800;background:var(--page-bg);flex-direction:column;overflow-y:auto}
.tool-fs.is-active{display:flex}
.tool-fs-bar{position:sticky;top:0;z-index:10;display:flex;align-items:center;gap:1rem;padding:.85rem 1.5rem;background:var(--header-gradient);box-shadow:0 2px 12px rgba(8,15,36,.25);flex-shrink:0}
.tool-back{background:rgba(255,255,255,.12);border:none;color:#fff;padding:.35rem 1rem;border-radius:7px;cursor:pointer;font-family:inherit;font-size:.9rem;font-weight:600;transition:background .15s;white-space:nowrap}
.tool-back:hover{background:rgba(255,255,255,.22)}
.tool-fs-title{color:#fff;font-size:1.1rem;font-weight:700}
.tool-fs-body{flex:1;padding:2rem;max-width:1100px;margin:0 auto;width:100%}
.tool-fs-centered{display:flex;flex-direction:column;align-items:center;gap:1.75rem;padding-top:3rem}
.tl{display:block;font-size:.82rem;font-weight:600;color:var(--text-muted);text-transform:uppercase;margin-bottom:.35rem}
.t-muted{color:var(--text-muted);font-size:.88rem}
.row-gap{display:flex;gap:1.25rem;flex-wrap:wrap}
.btn-row{display:flex;gap:.75rem;flex-wrap:wrap;align-items:center}
.settings-bar{display:flex;gap:1.5rem;align-items:flex-end;flex-wrap:wrap;margin-bottom:1.75rem}
.btn-xl{padding:.75rem 2.2rem;font-size:1.05rem}
.color-input{height:42px;padding:.25rem;cursor:pointer;width:70px}
/* QR-Generator */
.tool-fs-body--qr{padding-top:1.25rem}
.qr-tool{max-width:1100px;margin:0 auto}
.qr-tool-header{margin-bottom:1.75rem}
.qr-tool-lead{margin:0;font-size:0.95rem;font-weight:500;color:var(--text-muted);line-height:1.55;max-width:52rem}
.qr-tool-grid{display:grid;grid-template-columns:minmax(280px,1fr) minmax(300px,1.1fr);gap:1.75rem;align-items:stretch}
.qr-panel,.qr-preview{background:var(--card-bg);border:1px solid var(--border-light);border-radius:14px;padding:1.5rem 1.6rem;box-shadow:0 1px 3px rgba(8,15,36,0.04),0 4px 16px rgba(8,15,36,0.06);display:flex;flex-direction:column;gap:1rem}
.qr-panel{position:relative;border-top:3px solid var(--accent)}
.qr-preview{border-top:3px solid var(--primary)}
.qr-panel-title{display:flex;align-items:center;gap:0.5rem;margin:0 0 0.15rem;font-size:1rem;font-weight:700;color:var(--dark)}
.qr-panel-title-icon{display:flex;color:var(--accent-dark);opacity:0.95}
.qr-textarea{min-height:7.5rem;resize:vertical;font-size:0.95rem;line-height:1.45}
.qr-options{display:grid;grid-template-columns:1fr 1fr;gap:1rem}
@media(max-width:640px){.qr-options{grid-template-columns:1fr}}
.qr-option .tl{margin-bottom:0.35rem}
.qr-color-row{display:flex;flex-direction:column;gap:0.45rem}
.qr-color-input{width:100%;max-width:88px;height:44px;padding:4px;cursor:pointer;border-radius:8px}
.qr-color-hint{font-size:0.75rem;color:var(--text-secondary);line-height:1.35}
.qr-panel-footer{margin-top:auto;padding-top:0.25rem}
.qr-generate-btn{width:100%;justify-content:center}
/* Kein flex:1/min-height:0 — sonst kann die Vorschau im Flex-Layout auf Hoehe 0 kollabieren */
.qr-output-wrap{display:flex;flex-direction:column;align-items:center;gap:1rem;width:100%}
.qr-output-wrap[hidden]{display:none!important}
.qr-link-display{width:100%;max-width:100%;padding:0.65rem 0.9rem;background:var(--light-bg);border:1px solid var(--border);border-radius:8px;font-size:0.82rem;color:var(--text-muted);word-break:break-all;line-height:1.45;text-align:center}
.qr-canvas-shell{display:flex;justify-content:center;width:100%;padding:0.5rem 0}
.qr-canvas-frame{padding:1rem;background:linear-gradient(145deg,#ffffff 0%,var(--light-bg) 100%);border:1px solid var(--border-light);border-radius:14px;box-shadow:inset 0 1px 0 rgba(255,255,255,0.9),0 8px 28px rgba(8,15,36,0.08)}
.qr-canvas{display:block;border-radius:10px;box-shadow:0 2px 12px rgba(8,15,36,0.1);background:#fff}
.qr-actions{display:flex;flex-wrap:wrap;gap:0.65rem;justify-content:center;width:100%;margin-top:0.25rem}
.qr-actions .btn{min-width:7.5rem}
.qr-placeholder{flex:1;display:flex;align-items:center;justify-content:center;min-height:280px;border:2px dashed var(--border);border-radius:14px;background:linear-gradient(180deg,rgba(237,244,252,0.65) 0%,rgba(255,255,255,0.9) 100%);color:var(--text-muted)}
.qr-placeholder[hidden]{display:none!important}
.qr-placeholder-inner{text-align:center;padding:1.75rem 1.25rem;max-width:18rem}
.qr-placeholder-graphic{margin:0 auto 1rem;display:flex;justify-content:center;color:var(--primary)}
.qr-placeholder-svg{width:120px;height:120px;opacity:0.55}
.qr-placeholder-title{margin:0 0 0.4rem;font-size:1.05rem;font-weight:700;color:var(--text)}
.qr-placeholder-text{margin:0;font-size:0.86rem;line-height:1.45;color:var(--text-muted)}
.qr-placeholder-text strong{color:var(--accent-dark);font-weight:600}
.qr-fs-overlay{display:none;position:fixed;inset:0;z-index:2000;background:rgba(8,15,36,0.92);backdrop-filter:blur(8px);flex-direction:column;align-items:center;justify-content:center;cursor:zoom-out;padding:1.5rem}
.qr-fs-overlay.is-open{display:flex}
.qr-fs-canvas{max-width:90vmin;max-height:90vmin;border-radius:16px;box-shadow:0 12px 48px rgba(0,0,0,0.45)}
.qr-fs-hint{margin:1.5rem 0 0;color:rgba(255,255,255,0.55);font-size:0.88rem;font-weight:500}
@media(max-width:900px){.qr-tool-grid{grid-template-columns:1fr}}
.timer-presets{display:flex;gap:.5rem;flex-wrap:wrap;justify-content:center;max-width:520px}
.timer-inputs{display:flex;align-items:center;gap:.75rem}
.timer-input-group{display:flex;flex-direction:column;align-items:center;gap:.25rem}
.timer-digit-input{width:100px;text-align:center;font-size:2.2rem;font-weight:700;border:2px solid var(--border);border-radius:10px;padding:.4rem;color:var(--text);background-color:var(--form-field-bg)}
.timer-unit{font-size:.75rem;color:var(--text-muted);text-transform:uppercase}
.timer-colon{font-size:2.8rem;font-weight:800;color:var(--text);padding-bottom:.8rem}
.timer-display{font-size:5.5rem;font-weight:800;letter-spacing:.05em;color:var(--primary);font-variant-numeric:tabular-nums;transition:color .3s}
.timer-display.timer-urgent{color:var(--danger);animation:blink .6s infinite alternate}
@keyframes blink{from{opacity:1}to{opacity:.4}}
.timer-bar-wrap{width:100%;max-width:520px;height:12px;background:var(--border);border-radius:99px;overflow:hidden}
.timer-bar{height:100%;width:100%;background:var(--primary);border-radius:99px;transition:width .9s linear,background .3s}
.timer-bar.timer-bar-urgent{background:var(--danger)}

/* Tool Timer — klarere Hierarchie, Midnight-Amber-Akzente */
#tool-timer .tool-timer-wrap{width:100%;max-width:28rem;display:flex;flex-direction:column;align-items:stretch;gap:1.35rem}
#tool-timer .timer-section{display:flex;flex-direction:column;align-items:center;gap:.55rem;width:100%}
#tool-timer .timer-section-label{font-size:.68rem;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--text-secondary)}
#tool-timer .timer-presets{gap:.45rem;max-width:100%}
#tool-timer .timer-preset-chip{
    border-radius:999px;
    padding:.42rem .85rem;
    font-weight:700;
    color:var(--dark-text);
    border:1px solid var(--border);
    background:linear-gradient(180deg,#fff 0%,var(--light-bg) 100%);
    box-shadow:0 1px 2px rgba(8,15,36,.06);
    transition:border-color .2s,box-shadow .2s,transform .12s,color .15s,background .15s;
}
#tool-timer .timer-preset-chip:hover{
    border-color:rgba(245,166,35,.65);
    box-shadow:0 3px 12px rgba(24,69,200,.12),0 0 0 1px rgba(245,166,35,.25);
    color:var(--primary-dark);
    background:linear-gradient(180deg,#fff 0%,#f0f5fc 100%);
}
#tool-timer .timer-preset-chip:active{transform:scale(.97)}
#tool-timer .timer-settings-panel{
    background:var(--card-bg);
    border:1px solid var(--border-light);
    border-radius:16px;
    padding:1rem 1.15rem 1.15rem;
    box-shadow:0 4px 20px rgba(8,15,36,.06);
}
#tool-timer .timer-settings-panel .timer-inputs{margin:0 auto}
#tool-timer .timer-digit-input{
    width:5.25rem;
    font-size:2rem;
    border-radius:12px;
    border:2px solid var(--border);
    background-color:var(--form-field-bg);
    box-shadow:inset 0 1px 2px rgba(8,15,36,.04);
    transition:border-color .2s,box-shadow .2s,background-color .2s;
}
#tool-timer .timer-digit-input:hover{border-color:var(--secondary-light)}
#tool-timer .timer-digit-input:focus{
    outline:none;
    border-color:var(--accent);
    box-shadow:0 0 0 3px rgba(245,166,35,.22),inset 0 1px 2px rgba(8,15,36,.04);
    background-color:var(--form-field-bg-focus);
}
#tool-timer .timer-colon{
    font-size:2.4rem;
    padding-bottom:.65rem;
    color:var(--text-secondary);
    opacity:.85;
}
#tool-timer .timer-focus-card{
    position:relative;
    width:100%;
    padding:1.75rem 1.35rem 1.5rem;
    border-radius:22px;
    background:linear-gradient(155deg,#fff 0%,var(--light-bg) 48%,rgba(237,244,252,.98) 100%);
    border:1px solid var(--border-light);
    box-shadow:
        0 8px 32px rgba(8,15,36,.08),
        0 0 0 1px rgba(255,255,255,.6) inset;
    overflow:hidden;
}
#tool-timer .timer-focus-card::before{
    content:'';
    position:absolute;
    top:-40%;
    right:-25%;
    width:55%;
    height:90%;
    background:radial-gradient(circle,rgba(245,166,35,.14) 0%,transparent 68%);
    pointer-events:none;
}
#tool-timer .timer-focus-card::after{
    content:'';
    position:absolute;
    bottom:-30%;
    left:-15%;
    width:50%;
    height:70%;
    background:radial-gradient(circle,rgba(24,69,200,.08) 0%,transparent 65%);
    pointer-events:none;
}
#tool-timer .timer-display-stack{position:relative;display:flex;justify-content:center;align-items:center;min-height:6.5rem;margin-bottom:.35rem}
#tool-timer .timer-display-ring{
    position:absolute;
    width:min(19rem,88vw);
    height:min(19rem,88vw);
    max-width:280px;
    max-height:280px;
    border-radius:50%;
    background:conic-gradient(from 210deg,rgba(24,69,200,.12),rgba(245,166,35,.18),rgba(24,69,200,.1),rgba(245,166,35,.12),rgba(24,69,200,.12));
    opacity:.55;
    filter:blur(1px);
    pointer-events:none;
}
#tool-timer .timer-display{
    position:relative;
    z-index:1;
    font-size:clamp(3.2rem,12vw,5.25rem);
    font-weight:800;
    letter-spacing:.04em;
    line-height:1;
    font-variant-numeric:tabular-nums;
    background:linear-gradient(115deg,var(--primary-dark) 0%,var(--primary) 45%,var(--primary-light) 100%);
    -webkit-background-clip:text;
    background-clip:text;
    color:transparent;
    text-shadow:none;
    filter:drop-shadow(0 2px 14px rgba(24,69,200,.2));
}
#tool-timer .timer-display.timer-urgent{
    background:none;
    -webkit-background-clip:unset;
    background-clip:unset;
    color:var(--danger);
    filter:none;
}
#tool-timer .timer-bar-wrap--tool{
    position:relative;
    z-index:1;
    max-width:100%;
    height:14px;
    background:rgba(8,15,36,.08);
    border-radius:999px;
    box-shadow:inset 0 1px 3px rgba(8,15,36,.12);
}
#tool-timer .timer-bar-wrap--tool .timer-bar{
    background:linear-gradient(90deg,var(--primary-dark) 0%,var(--primary) 40%,var(--accent) 100%);
    box-shadow:0 0 12px rgba(24,69,200,.35);
}
#tool-timer .timer-bar-wrap--tool .timer-bar.timer-bar-urgent{
    background:linear-gradient(90deg,#b83228 0%,var(--danger) 50%,#ff8a80 100%);
    box-shadow:0 0 14px rgba(229,72,58,.45);
}
#tool-timer .timer-actions{gap:.85rem;margin-top:.15rem}

.wheel-layout{display:flex;gap:2.5rem;align-items:flex-start;flex-wrap:wrap}
.wheel-sidebar{width:250px;flex-shrink:0;display:flex;flex-direction:column;gap:1rem}
.wheel-absent-label{font-size:.78rem;font-weight:600;color:var(--text-muted);text-transform:uppercase}
.wheel-student-list{display:flex;flex-direction:column;gap:.25rem;max-height:360px;overflow-y:auto}
.wheel-check{display:flex;align-items:center;gap:.5rem;font-size:.88rem;cursor:pointer;padding:.3rem .4rem;border-radius:6px;transition:background .15s}
.wheel-check:hover{background:var(--light-bg)}
.wheel-check input{width:15px;height:15px;accent-color:var(--danger);cursor:pointer}
.wheel-stage{position:relative;display:flex;flex-direction:column;align-items:center;flex:1}
.wheel-canvas-wrap{position:relative;display:inline-block}
.wheel-pointer-right{position:absolute;right:-28px;top:50%;transform:translateY(-50%);font-size:2.5rem;color:var(--accent);line-height:1;filter:drop-shadow(0 2px 5px rgba(0,0,0,.4));z-index:1;pointer-events:none}
#wheelCanvas{border-radius:50%;box-shadow:0 6px 30px rgba(8,15,36,.2)}
.winner-overlay{position:fixed;inset:0;background:rgba(8,15,36,.75);backdrop-filter:blur(5px);z-index:2000;display:flex;align-items:center;justify-content:center}
.winner-box{background:#fff;border-radius:22px;padding:3.5rem 5rem;text-align:center;box-shadow:0 24px 70px rgba(8,15,36,.45);animation:pwSlideIn .3s ease}
.winner-name{font-size:2.5rem;font-weight:800;color:var(--primary);margin-top:.75rem}
.dice-count-row{display:flex;align-items:center;gap:1rem;flex-wrap:wrap;justify-content:center}
.dice-count-btns{display:flex;gap:.4rem}
.dice-result{display:flex;gap:1rem;flex-wrap:wrap;justify-content:center;min-height:90px;align-items:center}
.dice-face{font-size:5.5rem;line-height:1;display:inline-block}
.dice-anim{animation:diceRoll .35s ease}
@keyframes diceRoll{0%{transform:rotate(-25deg) scale(.55);opacity:0}65%{transform:rotate(8deg) scale(1.15)}100%{transform:rotate(0) scale(1);opacity:1}}
.dice-sum{font-size:1.6rem;font-weight:700;color:var(--text-muted)}
.groups-result{display:flex;gap:1rem;flex-wrap:wrap}
.group-card{background:var(--light-bg);border:1px solid var(--border);border-radius:14px;padding:1.1rem 1.3rem;min-width:160px}
.group-card-title{font-weight:700;color:var(--primary);margin-bottom:.6rem}
.group-card ul{list-style:none;padding:0;margin:0;font-size:.9rem}
.group-card li{padding:.2rem 0;border-bottom:1px solid var(--border-light)}
.group-card li:last-child{border-bottom:none}
.order-list{list-style:none;padding:0;columns:3;gap:2rem}
.order-list li{display:flex;align-items:center;gap:.6rem;padding:.5rem .75rem;border-bottom:1px solid var(--border-light);break-inside:avoid;font-size:.95rem}
.order-num{width:28px;height:28px;background:var(--primary);color:#fff;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:.78rem;font-weight:700;flex-shrink:0}

/* Zufallsreihenfolge — geheime Warteschlange */
.tool-fs-body--order{max-width:40rem}
.order-lead{margin:0 0 1.25rem;font-size:.95rem;line-height:1.55;color:var(--text-muted)}
.order-lead strong{color:var(--text);font-weight:600}
.order-settings-bar{margin-bottom:1rem}
.order-hint{margin:0 0 1rem;padding:.85rem 1.1rem;background:var(--accent-light);border:1px solid rgba(245,166,35,.35);border-radius:12px;font-size:.9rem;font-weight:500;color:var(--accent-dark);line-height:1.45}
.order-panel{display:flex;flex-direction:column;align-items:stretch;gap:1.25rem;margin-top:.25rem}
.order-meta{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:.5rem .85rem;padding:.65rem 1rem;background:var(--card-bg);border:1px solid var(--border-light);border-radius:14px;font-size:.88rem;color:var(--text-muted);box-shadow:0 2px 12px rgba(8,15,36,.05)}
.order-meta-stat strong{color:var(--primary);font-weight:800;font-variant-numeric:tabular-nums}
.order-meta-sep{width:4px;height:4px;border-radius:50%;background:var(--border-dark);opacity:.45;flex-shrink:0}
.order-current-block{display:flex;flex-direction:column;align-items:center;gap:.5rem;width:100%}
.order-current-label{font-size:.72rem;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--text-secondary)}
.order-current-card{
    width:100%;
    min-height:11rem;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:1.75rem 1.25rem;
    border-radius:22px;
    background:linear-gradient(155deg,#fff 0%,var(--light-bg) 52%,rgba(237,244,252,.98) 100%);
    border:1px solid var(--border-light);
    box-shadow:0 10px 36px rgba(8,15,36,.09),0 0 0 1px rgba(255,255,255,.55) inset;
    position:relative;
    overflow:hidden;
}
.order-current-card::before{
    content:'';
    position:absolute;
    inset:-20%;
    background:radial-gradient(circle at 30% 20%,rgba(245,166,35,.12) 0%,transparent 45%),radial-gradient(circle at 80% 80%,rgba(24,69,200,.1) 0%,transparent 42%);
    pointer-events:none;
}
.order-current-name{
    position:relative;
    z-index:1;
    font-size:clamp(1.35rem,4.2vw,2rem);
    font-weight:800;
    text-align:center;
    line-height:1.25;
    color:var(--primary-dark);
    max-width:100%;
    word-break:break-word;
}
.order-current-placeholder{position:relative;z-index:1;text-align:center;max-width:22rem;margin:0 auto}
.order-placeholder-icon{display:block;font-size:2rem;line-height:1;margin-bottom:.65rem;color:var(--accent-dark);opacity:.85}
.order-placeholder-text{margin:0;font-size:.95rem;line-height:1.5;color:var(--text-muted);font-weight:500}
.order-placeholder-text strong{color:var(--text);font-weight:700}
.order-done-msg{position:relative;z-index:1;text-align:center;font-size:1.05rem;font-weight:600;color:var(--success);line-height:1.45;padding:.5rem}
.order-actions{display:flex;justify-content:center;flex-wrap:wrap;gap:.75rem}
.order-past-details{
    border:1px solid var(--border);
    border-radius:14px;
    background:var(--bg-surface);
    padding:0 .25rem;
    font-size:.9rem;
}
.order-past-details summary{
    cursor:pointer;
    list-style:none;
    padding:.75rem 1rem;
    font-weight:700;
    color:var(--text-muted);
    display:flex;
    align-items:center;
    gap:.5rem;
    user-select:none;
}
.order-past-details summary::-webkit-details-marker{display:none}
.order-past-details summary::before{content:'\25B6';font-size:.65rem;opacity:.55;transition:transform .2s}
.order-past-details[open] summary::before{transform:rotate(90deg)}
.order-past-badge{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:1.5rem;
    height:1.5rem;
    padding:0 .4rem;
    border-radius:999px;
    background:var(--primary);
    color:#fff;
    font-size:.75rem;
    font-weight:800;
    font-variant-numeric:tabular-nums;
}
.order-past-list{list-style:none;padding:0 .85rem .85rem;margin:0;display:flex;flex-direction:column;gap:.35rem;max-height:min(38vh,260px);overflow-y:auto;-webkit-overflow-scrolling:touch}
.order-past-list li{display:flex;align-items:center;gap:.65rem;padding:.5rem .65rem;border-radius:10px;background:var(--card-bg);border:1px solid var(--border-light);font-size:.92rem}
.order-past-num{
    flex-shrink:0;
    width:26px;height:26px;
    display:flex;align-items:center;justify-content:center;
    border-radius:50%;
    background:var(--light-bg);
    color:var(--primary);
    font-size:.72rem;
    font-weight:800;
}

.sw-laps{width:100%;max-width:420px;max-height:220px;overflow-y:auto;border-radius:10px;border:1px solid var(--border)}
.sw-lap{display:flex;justify-content:space-between;padding:.45rem .9rem;border-bottom:1px solid var(--border-light);font-size:.92rem;font-variant-numeric:tabular-nums}
.sw-lap-n{font-weight:600;color:var(--text-muted)}
.random-range{display:flex;align-items:center;gap:1rem}
.random-result{font-size:8rem;font-weight:900;color:var(--primary);line-height:1;font-variant-numeric:tabular-nums}
.random-history{display:flex;gap:.5rem;flex-wrap:wrap;justify-content:center;max-width:400px}
.rn-hist{background:var(--light-bg);border:1px solid var(--border);border-radius:8px;padding:.25rem .7rem;font-size:1.1rem;font-weight:600;color:var(--text-muted)}
.score-add-row{display:flex;gap:.75rem;align-items:center;margin-bottom:1.75rem;flex-wrap:wrap}
.score-board{display:flex;flex-direction:column;gap:.75rem;max-width:600px}
.score-card{display:flex;align-items:center;gap:1rem;background:var(--card-bg);border:2px solid var(--border);border-radius:14px;padding:1rem 1.25rem;transition:border-color .2s}
.score-card.score-first{border-color:var(--accent);background:#fff9f0}
.score-rank{font-size:1.6rem;width:42px;text-align:center;flex-shrink:0}
.score-name{flex:1;font-size:1.2rem;font-weight:700}
.score-controls{display:flex;align-items:center;gap:.6rem;margin-left:auto}
.score-val{font-size:2rem;font-weight:900;color:var(--primary);min-width:3rem;text-align:center;font-variant-numeric:tabular-nums}
.score-btn{width:38px;height:38px;border-radius:8px;border:none;cursor:pointer;font-size:1.2rem;font-weight:700;font-family:inherit;transition:background .15s,transform .1s}
.score-btn:active{transform:scale(.9)}
.score-plus{background:var(--success-light);color:var(--success)}
.score-plus:hover{background:var(--success);color:#fff}
.score-minus{background:var(--danger-light);color:var(--danger)}
.score-minus:hover{background:var(--danger);color:#fff}
.score-del{background:var(--light-bg);color:var(--text-muted);font-size:.9rem}
.score-del:hover{background:var(--danger-light)}
.noise-ampel{display:flex;flex-direction:column;gap:1rem;padding:1.5rem;background:#1a1a1a;border-radius:20px;box-shadow:0 4px 20px rgba(0,0,0,.4)}
.ampel-light{width:90px;height:90px;border-radius:50%;background:rgba(255,255,255,.08);transition:background .15s,box-shadow .15s}
.ampel-light.red.active{background:#f44336;box-shadow:0 0 30px 10px rgba(244,67,54,.6)}
.ampel-light.yellow.active{background:#ffeb3b;box-shadow:0 0 30px 10px rgba(255,235,59,.6)}
.ampel-light.green.active{background:#4caf50;box-shadow:0 0 30px 10px rgba(76,175,80,.6)}
.noise-bar-wrap{width:320px;height:18px;background:var(--border);border-radius:99px;overflow:hidden}
.noise-bar{height:100%;width:0%;background:var(--success);border-radius:99px;transition:width .1s,background .15s}
.noise-label{font-size:1.4rem;font-weight:700}
.noise-thresholds{display:flex;flex-direction:column;gap:.5rem;font-size:.88rem}
.noise-thresholds label{display:flex;align-items:center;gap:.5rem;color:var(--text-muted)}
.question-layout{display:flex;gap:2.5rem;flex-wrap:wrap;align-items:flex-start}
.question-left{flex:1;min-width:280px}
.question-right{flex:1;min-width:280px;display:flex;align-items:center;justify-content:center}
.question-card{width:100%;min-height:220px;background:var(--header-gradient);border-radius:18px;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:2rem;text-align:center;box-shadow:0 6px 28px rgba(8,15,36,.2)}
.question-card-hint{color:rgba(255,255,255,.4);font-size:1rem}
.question-card-text{color:#fff;font-size:1.35rem;font-weight:600;line-height:1.5}
.question-card-meta{color:rgba(255,255,255,.45);font-size:.85rem;margin-top:1.25rem}
.pom-mode-tabs{display:flex;gap:0;border:2px solid var(--border);border-radius:10px;overflow:hidden}
.pom-tab{padding:.55rem 1.5rem;background:none;border:none;font-family:inherit;font-size:.9rem;font-weight:600;color:var(--text-muted);cursor:pointer;transition:background .15s,color .15s}
.pom-tab.active{background:var(--primary);color:#fff}
.pom-rounds{font-size:1.1rem;font-weight:700;color:var(--text-muted)}
.pom-settings{display:flex;gap:2rem;flex-wrap:wrap;justify-content:center;margin-top:.5rem}
.pom-settings label{display:flex;align-items:center;gap:.6rem;font-size:.9rem;color:var(--text-muted);font-weight:600}
@media(max-width:900px){.tools-grid{grid-template-columns:repeat(2,1fr)}.wheel-layout{flex-direction:column}.wheel-sidebar{width:100%}.order-list{columns:1}.question-layout{flex-direction:column}.score-board{max-width:100%}}
@media(max-width:500px){.timer-display{font-size:4rem}.random-result{font-size:5rem}}

/* Tablet & iPad (600–1200px): Touch-Ziele, Lesbarkeit, Layout — Desktop >1200px unverändert */
@media (min-width:600px) and (max-width:1200px){
    .tools-page{
        padding:1.35rem max(1rem,env(safe-area-inset-right)) 1.75rem max(1rem,env(safe-area-inset-left));
        max-width:100%
    }
    .tools-page-header{margin-bottom:1.5rem}
    .tools-page-title{font-size:1.65rem}
    .tools-grid{
        grid-template-columns:repeat(3,1fr);
        gap:1rem
    }
    .tool-card{
        padding:1.65rem 0.85rem 1.45rem;
        min-height:132px;
        border-radius:16px;
        -webkit-tap-highlight-color:rgba(24,69,200,.12)
    }
    .tool-card:active{transform:scale(.98)}
    .tool-icon{font-size:3.15rem}
    .tool-label{font-size:1.02rem}
    .tool-desc{font-size:0.8rem;line-height:1.35}

    .tool-fs-bar{
        padding:0.55rem max(1rem,env(safe-area-inset-right)) 0.55rem max(1rem,env(safe-area-inset-left));
        padding-top:max(0.55rem,env(safe-area-inset-top));
        min-height:52px;
        align-items:center
    }
    .tool-back{
        min-height:44px;
        padding:0.5rem 1.2rem;
        font-size:0.95rem;
        border-radius:10px
    }
    .tool-fs-title{font-size:1.12rem}
    .tool-fs-body{
        padding:1.35rem max(1rem,env(safe-area-inset-right)) max(1.25rem,env(safe-area-inset-bottom)) max(1rem,env(safe-area-inset-left))
    }
    .tool-fs-centered{padding-top:2rem;gap:1.5rem}
    .tool-fs-body--qr{padding-top:1rem}

    .qr-tool-grid{gap:1.35rem}
    .qr-panel,.qr-preview{padding:1.35rem 1.4rem}
    .qr-textarea{font-size:16px;min-height:8rem}
    .qr-actions .btn{min-height:48px;min-width:9rem;font-size:0.95rem}

    .timer-display{font-size:5.25rem}
    .timer-digit-input{width:108px;min-height:52px;font-size:2.35rem;padding:0.45rem}
    .timer-colon{font-size:2.65rem}
    .timer-presets{gap:0.55rem;max-width:100%}
    .timer-presets .btn{min-height:48px;min-width:52px;padding:0.5rem 0.85rem;font-size:0.88rem}
    .timer-bar-wrap{max-width:100%;height:14px}

    .wheel-layout{gap:1.75rem;align-items:flex-start}
    .wheel-sidebar{width:min(300px,36vw)}
    .wheel-student-list{max-height:min(42vh,420px)}
    .wheel-check{
        min-height:48px;
        padding:0.45rem 0.65rem;
        font-size:0.92rem;
        border-radius:8px
    }
    .wheel-check input{width:22px;height:22px;min-width:22px;min-height:22px}
    #tool-wheel #wheelCanvas{
        width:100%!important;
        max-width:min(500px,78vw);
        height:auto!important
    }

    .dice-count-row{gap:1.1rem}
    .dice-count-btns .btn{min-width:48px;min-height:48px;font-size:1rem;padding:0.5rem 0.65rem}
    .dice-face{font-size:5rem}
    .dice-result{min-height:100px;gap:1.1rem}

    .order-list{columns:2;gap:1.5rem}
    .order-list li{padding:0.55rem 0.65rem;font-size:0.98rem;min-height:44px}
    .order-num{width:32px;height:32px;font-size:0.82rem}

    .sw-laps{max-height:min(38vh,280px)}
    .sw-lap{padding:0.55rem 1rem;font-size:0.95rem}

    .random-result{font-size:7rem}
    .random-range{flex-wrap:wrap;justify-content:center}
    .random-range .form-control{font-size:16px;min-height:48px}

    .score-add-row{gap:0.85rem}
    .score-add-row .form-control{font-size:16px;min-height:48px}
    .score-add-row .btn{min-height:48px;padding:0.55rem 1.15rem}
    .score-card{padding:1.1rem 1.15rem;gap:0.85rem}
    .score-btn{width:48px;height:48px;font-size:1.25rem;border-radius:10px}
    .score-name{font-size:1.15rem}

    .noise-ampel{padding:1.65rem;gap:1.15rem}
    .ampel-light{width:100px;height:100px}
    .noise-bar-wrap{width:min(360px,85vw);height:20px}
    .noise-label{font-size:1.5rem}
    .noise-thresholds input,.noise-thresholds select{font-size:16px;min-height:44px}

    .question-layout{gap:1.75rem}
    .question-card{min-height:240px;padding:1.75rem}
    .question-card-text{font-size:1.28rem}
    .question-left textarea{font-size:16px;min-height:10rem}

    .pom-tab{min-height:48px;padding:0.6rem 1.35rem;font-size:0.95rem}
    .pom-settings{gap:1.5rem}
    .pom-settings .timer-digit-input{min-height:48px;font-size:16px!important;width:76px!important}

    .btn-xl{min-height:52px;padding:0.8rem 1.85rem;font-size:1.05rem}
    .btn:not(.btn-sm){min-height:44px}
    .tool-fs .form-control,.tool-fs select{font-size:16px;min-height:48px}

    .grp-result--cols-3{grid-template-columns:repeat(3,minmax(0,1fr));gap:0.4rem}
    .grp-pane-left{width:min(380px,42vw);padding:1.1rem 1.15rem}
    .grp-layout--results-focus .grp-pane-left{width:min(220px,30vw);padding:0.65rem 0.75rem;gap:0.65rem}
    .grp-layout--results-focus .grp-intro-text{display:none}
    .grp-layout--results-focus .grp-intro-title{font-size:0.88rem;margin-bottom:0.25rem}
    .grp-layout--results-focus .grp-card-panel{padding:0.65rem 0.75rem}
    #tool-groups:has(#grpResultsPanel.is-visible)>.tool-fs-body.grp-layout,
    #tool-partner:has(#ptnResultsPanel.is-visible)>.tool-fs-body.grp-layout{padding:0.45rem 0.75rem 0.55rem}
    #tool-groups .grp-results-panel.is-visible .grp-results-grid-wrap,
    #tool-partner .grp-results-panel.is-visible .grp-results-grid-wrap{overflow:hidden;align-items:flex-start}
    #tool-groups .grp-results-panel .grp-result-toolbar,
    #tool-partner .grp-results-panel .grp-result-toolbar{padding:0.4rem 0.55rem;gap:0.45rem}
    #tool-groups .grp-result-title,
    #tool-partner .grp-result-title{font-size:0.74rem;line-height:1.2}
    #tool-groups .grp-result--cols-3 .grp-card-head,
    #tool-partner .grp-result--cols-3 .grp-card-head{padding:0.28rem 0.38rem 0.22rem}
    #tool-groups .grp-result--cols-3 .grp-card-label,
    #tool-partner .grp-result--cols-3 .grp-card-label{font-size:0.66rem}
    #tool-groups .grp-result--cols-3 .grp-card-size,
    #tool-partner .grp-result--cols-3 .grp-card-size{font-size:0.56rem}
    #tool-groups .grp-result--cols-3 .grp-card-num,
    #tool-partner .grp-result--cols-3 .grp-card-num{min-width:1.4rem;height:1.4rem;font-size:0.6rem;border-radius:7px}
    #tool-groups .grp-result--cols-3 .grp-card-members,
    #tool-partner .grp-result--cols-3 .grp-card-members{padding:0 0.38rem 0.38rem;gap:0.15rem;max-height:none;overflow:visible}
    #tool-groups .grp-result--cols-3 .grp-member-chip,
    #tool-partner .grp-result--cols-3 .grp-member-chip{font-size:0.6rem;padding:0.2rem 0.3rem;border-radius:7px}
    #tool-groups .grp-result--cols-3 .grp-member-initial,
    #tool-partner .grp-result--cols-3 .grp-member-initial{width:1.15rem;height:1.15rem;font-size:0.52rem}
    #tool-groups .grp-result--cols-3 .grp-warn-banner,
    #tool-partner .grp-result--cols-3 .grp-warn-banner{padding:0.35rem 0.5rem;font-size:0.64rem;gap:0.35rem;line-height:1.3}
    #tool-groups .grp-result--cols-3 .grp-warn-icon,
    #tool-partner .grp-result--cols-3 .grp-warn-icon{width:1.05rem;height:1.05rem;font-size:0.68rem}
    #tool-groups .grp-result--cols-3 .grp-card,
    #tool-partner .grp-result--cols-3 .grp-card{border-top-width:2px;border-radius:9px}
    #tool-groups .grp-result--cols-3 .ptn-card,
    #tool-partner .grp-result--cols-3 .ptn-card{padding:0.38rem 0.48rem;gap:0.22rem;border-radius:8px;border-width:1.5px}
    #tool-groups .grp-result--cols-3 .ptn-card-badge,
    #tool-partner .grp-result--cols-3 .ptn-card-badge{width:18px;height:18px;font-size:0.55rem;border-radius:6px}
    #tool-groups .grp-result--cols-3 .ptn-member,
    #tool-partner .grp-result--cols-3 .ptn-member{font-size:0.6rem;gap:0.22rem}
    #tool-groups .grp-result--cols-3 .grp-initial,
    #tool-partner .grp-result--cols-3 .grp-initial{width:15px;height:15px;font-size:0.52rem}
    #tool-groups .grp-result--cols-3 .ptn-special-tag,
    #tool-partner .grp-result--cols-3 .ptn-special-tag{font-size:0.52rem;padding:0.08rem 0.35rem}
    #tool-groups .grp-pane-right-inner,
    #tool-partner .grp-pane-right-inner{gap:0.45rem}
    #tool-groups .grp-pane-right,
    #tool-partner .grp-pane-right{padding:0.5rem 0.6rem}
    #tool-groups .grp-result-toolbar .btn,
    #tool-partner .grp-result-toolbar .btn{min-height:40px;padding:0.32rem 0.65rem;font-size:0.72rem}
    .grp-count-btn{width:48px;height:48px;border-radius:11px;font-size:1.3rem}
    .grp-absent-btn{min-height:44px;padding:0.35rem 0.75rem;font-size:0.8rem}
    .grp-student-row{min-height:48px;padding:0.5rem 0.7rem}
    .grp-mode-tab{min-height:48px;padding:0.55rem 0.85rem;font-size:0.88rem}
    .grp-settings-btn{min-height:48px;padding:0.75rem 1.2rem;font-size:0.95rem}
    .grp-result-toolbar .btn{min-height:44px;padding:0.45rem 1rem;font-size:0.88rem}

    .excl-modal-pick{min-height:48px;padding:0.6rem 0.85rem;font-size:0.92rem}
    .excl-modal-x{width:48px;height:48px;border-radius:10px}
    .excl-cb{width:22px;height:22px;min-width:22px;min-height:22px}
}

/* ── Zufallsgruppen & Partnertool ────────────────────────────────────────── */

/* Layout */
.grp-layout{display:flex;gap:0;height:100%;min-height:calc(100vh - 56px)}
.grp-pane-left{width:min(400px,100%);flex-shrink:0;border-right:1px solid var(--border-light);padding:1.25rem 1.35rem;display:flex;flex-direction:column;gap:1.1rem;overflow-y:auto;background:linear-gradient(180deg,var(--bg-surface) 0%,var(--light-bg) 100%)}
.grp-pane-right{flex:1;padding:1rem 1.25rem;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.grp-pane-right-inner{display:flex;flex-direction:column;flex:1;min-height:0;gap:1rem}
.grp-results-panel{display:none;flex:1;flex-direction:column;min-height:0;gap:.85rem;overflow:hidden}
.grp-results-panel.is-visible{display:flex}
.grp-results-grid-wrap{flex:1;min-height:0;overflow:auto;padding-right:.2rem}

#tool-groups.tool-fs.is-active,
#tool-partner.tool-fs.is-active{overflow:hidden;max-height:100dvh}
#tool-groups.is-active>.tool-fs-body.grp-layout,
#tool-partner.is-active>.tool-fs-body.grp-layout{flex:1;min-height:0;overflow:hidden;max-width:100%;width:100%;margin:0 auto;padding:1rem 1.25rem 1.25rem}

/* Nach Gruppen/Partner-Ziehung: schmales Einstellpanel + größere Ergebnis-Typo (nur Desktop, nicht iPad/Tablet ≤1200px) */
@media(min-width:1201px){
    .grp-layout--results-focus .grp-pane-left{width:min(260px,28vw);padding:.85rem .95rem;gap:.75rem}
    .grp-layout--results-focus .grp-intro-text{display:none}
    .grp-layout--results-focus .grp-intro-title{font-size:.98rem;margin-bottom:.35rem}
    .grp-layout--results-focus .grp-card-panel{padding:.85rem .95rem}
    .grp-layout--results-focus .grp-pane-right{padding:1rem 1.35rem}
    .grp-layout--results-focus .grp-result{gap:.9rem}
    .grp-layout--results-focus .grp-result--cols-3 .grp-card-label{font-size:1.05rem}
    .grp-layout--results-focus .grp-result--cols-3 .grp-card-size{font-size:.8rem}
    .grp-layout--results-focus .grp-result--cols-3 .grp-member-chip{font-size:.9rem;padding:.5rem .7rem}
    .grp-layout--results-focus .grp-result--cols-3 .grp-member-initial{width:1.75rem;height:1.75rem;font-size:.72rem}
    .grp-layout--results-focus .grp-result--cols-3 .grp-card-members{max-height:none}
    .grp-layout--results-focus .grp-result--cols-3 .ptn-member{font-size:.95rem}
    .grp-layout--results-focus .grp-result--cols-3 .ptn-card{padding:.75rem .9rem}
    .grp-layout--results-focus .grp-result-title{font-size:1rem}
}
.grp-pane-right:fullscreen,
.grp-pane-right:-webkit-full-screen{background:var(--page-bg,#f4f6fa);padding:clamp(1rem,2.5vw,2rem);box-sizing:border-box;width:100%;height:100%;min-height:100%;overflow:auto;display:flex;flex-direction:column}
.grp-pane-right:fullscreen .grp-pane-right-inner,
.grp-pane-right:-webkit-full-screen .grp-pane-right-inner{flex:1;min-height:0;display:flex;flex-direction:column}
.grp-pane-right:fullscreen .grp-results-panel,
.grp-pane-right:-webkit-full-screen .grp-results-panel{flex:1;min-height:0}
.grp-pane-right:fullscreen .grp-results-grid-wrap,
.grp-pane-right:-webkit-full-screen .grp-results-grid-wrap{max-height:none;flex:1}

.grp-intro{margin:0 0 .25rem}
.grp-intro-title{margin:0 0 .45rem;font-size:1.15rem;font-weight:800;color:var(--dark);letter-spacing:-.02em}
.grp-intro-text{margin:0;font-size:.86rem;line-height:1.55;color:var(--text-muted);font-weight:500}

.grp-card-panel{background:var(--card-bg);border:1px solid var(--border-light);border-radius:14px;padding:1.2rem 1.25rem;box-shadow:0 1px 3px rgba(8,15,36,.04),0 4px 16px rgba(8,15,36,.06);display:flex;flex-direction:column;gap:.85rem}
.grp-card-panel--students{gap:.65rem}
.grp-card-panel--excl{padding:0;overflow:hidden;border-radius:14px}
.grp-card-panel--excl .grp-collapsible-head{border-radius:14px;border:1px solid var(--border-light);background:var(--card-bg)}
.grp-card-panel--excl .grp-collapsible-head[aria-expanded="true"]{border-radius:14px 14px 0 0;border-bottom-color:transparent}
.grp-card-panel--excl .grp-excl-panel{border-radius:0 0 14px 14px;border:1px solid var(--border-light);border-top:none}

.grp-search{font-size:.9rem}
.grp-count-block .grp-count-row{justify-content:flex-start}
.grp-count-line{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem 1rem}
.grp-split-preview{font-size:.78rem;font-weight:700;color:var(--primary);letter-spacing:.02em;white-space:normal;line-height:1.35;max-width:100%}
.grp-count-row{display:flex;align-items:center;gap:.5rem}
.grp-count-btn{width:40px;height:40px;border:2px solid var(--border);background:var(--card-bg);color:var(--text);border-radius:10px;font-size:1.25rem;font-weight:700;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .15s;flex-shrink:0;line-height:1}
.grp-count-btn:hover{border-color:var(--primary);background:var(--accent-light);color:var(--primary)}
.grp-count-input{width:72px;text-align:center;font-size:1.15rem;font-weight:800;border-radius:10px;background-color:var(--form-field-bg)}

/* Mode tabs (partner) */
.grp-mode-tabs{display:flex;gap:.4rem}
.grp-mode-tab{flex:1;padding:.5rem .75rem;border:2px solid var(--border);background:var(--card-bg);color:var(--text-muted);border-radius:8px;font-family:inherit;font-size:.85rem;font-weight:600;cursor:pointer;transition:all .15s;text-align:center}
.grp-mode-tab.is-active{border-color:var(--primary);background:var(--primary);color:#fff}

/* Section */
.grp-section{display:flex;flex-direction:column;gap:.6rem}
.grp-section-head{display:flex;align-items:center;justify-content:space-between;gap:.75rem;flex-wrap:wrap}
.grp-section-title{font-size:.72rem;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--text-muted)}
.grp-section-sub{font-size:.78rem;color:var(--text-muted);font-weight:600;text-align:right}

/* Collapsible Nicht-zusammen header */
.grp-collapsible-head{width:100%;display:flex;align-items:center;gap:.5rem;padding:.75rem 1rem;cursor:pointer;font-family:inherit;transition:background .15s,box-shadow .15s;text-align:left}
.grp-collapsible-head:hover{background:var(--light-bg)}
.grp-collapse-arrow{margin-left:auto;width:1.25rem;height:1.25rem;border-radius:6px;background:var(--light-bg);display:flex;align-items:center;justify-content:center;color:var(--primary);font-size:.65rem;line-height:1}
.grp-collapse-arrow::before{content:'\25B8';display:block;transition:transform .2s}
.grp-collapsible-head[aria-expanded="true"] .grp-collapse-arrow::before{content:'\25BE'}
.grp-excl-panel{padding:1rem 1.1rem 1.15rem;background:var(--card-bg);display:flex;flex-direction:column;gap:.75rem}
.grp-excl-hint{font-size:.82rem;color:var(--text-muted);line-height:1.5;margin:0}
.grp-action-hint{font-size:.82rem;font-weight:600;color:var(--warning);background:var(--warning-light);border:1px solid rgba(217,119,6,.35);border-radius:10px;padding:.55rem .75rem;margin:0;line-height:1.4}

/* Student list */
.grp-student-list{display:flex;flex-direction:column;gap:.3rem;max-height:280px;overflow-y:auto;padding-right:.15rem}
.grp-student-row{display:flex;align-items:center;gap:.6rem;padding:.45rem .65rem;border-radius:9px;background:var(--card-bg);border:1px solid var(--border-light);transition:opacity .2s,background .15s}
.grp-student-row.is-absent{opacity:.45;background:var(--bg-surface);text-decoration:line-through}
.grp-student-initial{width:26px;height:26px;border-radius:7px;background:var(--primary-light);color:#fff;font-size:.72rem;font-weight:700;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.grp-student-name{flex:1;font-size:.88rem;font-weight:500}
.grp-absent-btn{border:1.5px solid var(--border);background:var(--success-light);color:var(--success);border-radius:7px;padding:.2rem .55rem;font-size:.76rem;font-weight:700;cursor:pointer;font-family:inherit;transition:all .15s;white-space:nowrap;flex-shrink:0}
.grp-absent-btn:hover{border-color:var(--danger);background:var(--danger-light);color:var(--danger)}
.grp-absent-btn.is-krank{background:var(--danger-light);color:var(--danger);border-color:var(--danger)}
.grp-absent-btn.is-krank:hover{background:var(--success-light);color:var(--success);border-color:var(--success)}

/* Exclusion checkboxes */
.excl-checkbox-list{display:flex;flex-direction:column;gap:.35rem;max-height:260px;overflow-y:auto}
.excl-cb-row{display:flex;align-items:center;gap:.65rem;padding:.5rem .7rem;border-radius:9px;border:1.5px solid var(--border-light);background:var(--card-bg);cursor:pointer;transition:all .18s;user-select:none}
.excl-cb-row:hover{border-color:var(--primary-light);background:#f0f5ff}
.excl-cb-row.is-excluded{border-color:var(--danger);background:var(--danger-light)}
.excl-cb-row.is-saving{opacity:.6}
.excl-cb{width:17px;height:17px;cursor:pointer;accent-color:var(--danger);flex-shrink:0}
.excl-cb-label{display:flex;align-items:center;gap:.5rem;flex:1;font-size:.88rem;font-weight:500}
.excl-cb-initial{width:22px;height:22px;border-radius:6px;background:var(--text-muted);color:#fff;font-size:.7rem;font-weight:700;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}
.excl-cb-tag{font-size:.72rem;font-weight:700;color:var(--danger);background:rgba(229,72,58,.1);padding:.1rem .45rem;border-radius:999px;margin-left:auto;flex-shrink:0}
.excl-count-badge{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;background:var(--danger);color:#fff;border-radius:999px;font-size:.73rem;font-weight:700;padding:0 .4rem}

/* Actions */
.grp-actions{display:flex;flex-direction:column;gap:.6rem;flex-shrink:0;padding-top:.25rem}
.btn-block{width:100%;justify-content:center}

/* Top bar info pills */
.grp-bar-info{display:flex;align-items:center;gap:.5rem;margin-left:auto}
.grp-bar-pill{font-size:.78rem;font-weight:700;padding:.2rem .65rem;border-radius:999px}
.grp-bar-pill--green{background:rgba(26,158,110,.2);color:#1a9e6e}
.grp-bar-pill--red{background:rgba(229,72,58,.2);color:#e5483a}

/* Placeholder */
.grp-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;gap:.85rem;color:var(--text-muted);min-height:min(52vh,420px);text-align:center;padding:2rem 1.25rem;border:2px dashed var(--border);border-radius:16px;background:linear-gradient(165deg,rgba(255,255,255,.95) 0%,var(--light-bg) 100%)}
.grp-placeholder-visual{color:var(--primary);opacity:.35}
.grp-placeholder-svg{width:100px;height:100px;display:block}
.grp-placeholder-title{margin:0;font-size:1.1rem;font-weight:800;color:var(--dark)}
.grp-placeholder-text{margin:0;font-size:.88rem;line-height:1.45;max-width:22rem}
.grp-placeholder-text strong{color:var(--accent-dark);font-weight:700}
.grp-placeholder-tips{margin:.5rem 0 0;padding:0 0 0 1.1rem;max-width:24rem;text-align:left;font-size:.8rem;line-height:1.5;color:var(--text-secondary)}
.grp-placeholder-tips li{margin:.35rem 0}

.grp-result-toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.75rem;padding:.85rem 1.1rem;background:var(--card-bg);border:1px solid var(--border-light);border-radius:12px;box-shadow:0 1px 3px rgba(8,15,36,.04)}
.grp-result-toolbar-text{min-width:0}
.grp-result-title{font-size:.92rem;font-weight:700;color:var(--dark)}
.grp-result-toolbar-actions{display:flex;flex-wrap:wrap;gap:.5rem}

/* Group result cards */
.grp-result{display:grid;gap:.75rem;align-content:start}
.grp-result--cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.grp-result--cols-3 .grp-warn-banner{margin-bottom:.25rem}
.grp-result--cols-3 .grp-card-head{padding:.55rem .65rem .45rem}
.grp-result--cols-3 .grp-card-label{font-size:.88rem}
.grp-result--cols-3 .grp-card-size{font-size:.68rem}
.grp-result--cols-3 .grp-card-members{padding:0 .65rem .65rem;max-height:min(34vh,320px);overflow-y:auto;gap:.32rem}
.grp-result--cols-3 .grp-member-chip{font-size:.75rem;padding:.4rem .55rem}
.grp-result--cols-3 .grp-member-initial{width:1.5rem;height:1.5rem;font-size:.64rem;flex-shrink:0}
.grp-result--cols-3 .grp-member-name{line-height:1.3}
.grp-result--cols-3 .ptn-card{flex-direction:column;align-items:stretch;gap:.45rem;padding:.65rem .75rem;border-radius:12px}
.grp-result--cols-3 .ptn-card-badge{width:26px;height:26px;font-size:.72rem}
.grp-result--cols-3 .ptn-members{flex-direction:column;align-items:stretch;gap:.2rem}
.grp-result--cols-3 .ptn-link{display:none}
.grp-result--cols-3 .ptn-member{font-size:.78rem;gap:.35rem}
.grp-result--cols-3 .ptn-special-tag{font-size:.65rem;align-self:flex-start}
@media(max-width:900px){
    .grp-result--cols-3{grid-template-columns:1fr}
}
.grp-warn-banner{grid-column:1/-1;display:flex;align-items:flex-start;gap:.65rem;padding:.85rem 1rem;background:var(--warning-light);border:1px solid var(--warning);border-radius:12px;color:var(--warning);font-size:.88rem;font-weight:600;line-height:1.45}
.grp-warn-icon{flex-shrink:0;width:1.5rem;height:1.5rem;border-radius:50%;background:rgba(217,119,6,.25);display:flex;align-items:center;justify-content:center;font-weight:800;font-size:1rem;line-height:1}
.grp-card{background:var(--card-bg);border:1px solid var(--border-light);border-radius:14px;padding:0;overflow:hidden;display:flex;flex-direction:column;gap:0;box-shadow:0 1px 3px rgba(8,15,36,.04),0 6px 20px rgba(8,15,36,.06);border-top:4px solid var(--grp-accent,var(--primary));transition:transform .15s,box-shadow .15s}
.grp-card:hover{transform:translateY(-2px);box-shadow:0 4px 18px rgba(8,15,36,.1)}
.grp-card-head{display:flex;align-items:center;gap:.65rem;padding:1rem 1.1rem .65rem;background:linear-gradient(180deg,rgba(237,244,252,.85) 0%,var(--card-bg) 100%)}
.grp-card-num{display:inline-flex;align-items:center;justify-content:center;min-width:2rem;height:2rem;padding:0 .35rem;border-radius:10px;color:#fff;font-size:.85rem;font-weight:800;flex-shrink:0}
.grp-card-head-text{display:flex;flex-direction:column;gap:.1rem;min-width:0}
.grp-card-label{font-weight:800;font-size:1rem;color:var(--dark);letter-spacing:-.02em}
.grp-card-size{font-size:.75rem;font-weight:600;color:var(--text-muted)}
.grp-card-members{display:flex;flex-direction:column;align-items:stretch;gap:.35rem;padding:0 1.05rem 1.1rem}
.grp-member-chip{display:flex;align-items:center;gap:.5rem;width:100%;box-sizing:border-box;padding:.45rem .65rem;background:var(--light-bg);border:1px solid var(--border-light);border-radius:10px;font-size:.84rem;font-weight:600;color:var(--text)}
.grp-member-initial{width:1.65rem;height:1.65rem;border-radius:50%;color:#fff;font-size:.68rem;font-weight:800;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}
.grp-member-name{flex:1;min-width:0;line-height:1.35;word-break:break-word}

.grp-initial{width:22px;height:22px;border-radius:50%;color:#fff;font-size:.7rem;font-weight:700;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}

/* Partner result cards */
.ptn-card{background:var(--card-bg);border:2px solid var(--border);border-radius:16px;padding:1.1rem 1.3rem;display:flex;align-items:center;gap:1rem;position:relative;transition:border-color .2s;border-color:var(--ptn-col,var(--border))}
.ptn-card--special{background:var(--accent-light)}
.ptn-card-badge{width:28px;height:28px;border-radius:8px;color:#fff;font-size:.8rem;font-weight:800;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.ptn-members{display:flex;align-items:center;gap:.75rem;flex:1;flex-wrap:wrap}
.ptn-member{display:flex;align-items:center;gap:.4rem;font-size:.9rem;font-weight:600}
.ptn-link{font-size:1.1rem;font-weight:800;color:var(--accent-dark);flex-shrink:0;opacity:.85}
.ptn-special-tag{font-size:.72rem;font-weight:700;background:var(--accent);color:#1a2035;padding:.15rem .5rem;border-radius:999px;flex-shrink:0}

.grp-excl-launch{padding:.85rem 1rem!important}
.grp-excl-launch-row{display:flex;align-items:center;gap:.65rem;flex-wrap:wrap}
.grp-excl-launch-row .btn{flex:1;min-width:0;justify-content:center}
.grp-excl-badge{flex-shrink:0}
.grp-excl-launch-icon{margin-right:.35rem;opacity:.9}

.grp-settings-btn{
    display:flex;align-items:center;justify-content:center;gap:.55rem;width:100%;
    padding:.7rem 1.15rem;border-radius:12px;border:1.5px solid rgba(24,69,200,.35);
    background:linear-gradient(180deg,#f4f7ff 0%,#e8effc 100%);
    color:#143a9e;font-size:.9rem;font-weight:700;letter-spacing:.02em;
    box-shadow:0 1px 2px rgba(8,15,36,.06),inset 0 1px 0 rgba(255,255,255,.85);
    transition:border-color .18s,background .18s,box-shadow .18s,transform .12s,color .18s
}
.grp-settings-btn:hover{
    border-color:rgba(24,69,200,.55);
    background:linear-gradient(180deg,#fff 0%,#eef3fc 100%);
    box-shadow:0 4px 14px rgba(24,69,200,.12),inset 0 1px 0 #fff;
    color:#0d2d7a;
    transform:translateY(-1px)
}
.grp-settings-btn:active{transform:translateY(0);box-shadow:0 1px 4px rgba(8,15,36,.08)}
.grp-settings-btn__icon{flex-shrink:0;opacity:.92}
.grp-settings-btn:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

.excl-modal-backdrop{display:none;position:fixed;inset:0;z-index:10000;background:rgba(8,15,36,.55);backdrop-filter:blur(5px);align-items:center;justify-content:center;padding:1rem;overflow-y:auto}
.excl-modal-backdrop.is-open{display:flex}
.excl-modal{max-width:920px;width:100%;max-height:min(92vh,880px);background:var(--card-bg);border-radius:16px;border:1px solid var(--border-light);box-shadow:0 24px 64px rgba(8,15,36,.28);display:flex;flex-direction:column;overflow:hidden;margin:auto}
.excl-modal-header{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;padding:1rem 1.25rem;background:var(--header-gradient);border-bottom:2px solid rgba(245,166,35,.35)}
.excl-modal-header-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:.2rem}
.excl-modal-title{margin:0;font-size:1.15rem;font-weight:800;color:#fff;letter-spacing:-.02em}
.excl-modal-rule-summary{margin:0;font-size:.8rem;font-weight:600;color:rgba(255,255,255,.9);line-height:1.35}
.excl-modal-x{flex-shrink:0;align-self:flex-start;width:2.25rem;height:2.25rem;border:none;border-radius:8px;background:rgba(255,255,255,.14);color:#fff;font-size:1.35rem;line-height:1;cursor:pointer;font-family:inherit;transition:background .15s}
.excl-modal-x:hover{background:rgba(255,255,255,.26)}
.excl-modal-lead{margin:0;padding:.9rem 1.25rem;background:var(--light-bg);font-size:.86rem;line-height:1.55;color:var(--text);border-bottom:1px solid var(--border-light)}
.excl-modal-lead strong{font-weight:700;color:var(--dark)}
.excl-modal-columns{display:grid;grid-template-columns:1fr 1fr;gap:0;min-height:260px;flex:1;max-height:calc(92vh - 240px)}
.excl-modal-col{display:flex;flex-direction:column;min-height:0;border-right:1px solid var(--border-light)}
.excl-modal-col--right{border-right:none}
.excl-modal-col-head{padding:.55rem .9rem;font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--text-muted);background:var(--page-bg);border-bottom:1px solid var(--border-light)}
.excl-modal-left-list,.excl-modal-right-list{flex:1;overflow-y:auto;padding:.55rem .65rem;display:flex;flex-direction:column;gap:.35rem;min-height:180px;max-height:min(48vh,420px)}
.excl-modal-pick{display:flex;align-items:center;gap:.55rem;width:100%;text-align:left;padding:.5rem .65rem;border-radius:10px;border:1.5px solid var(--border-light);background:var(--card-bg);cursor:pointer;font-family:inherit;font-size:.86rem;transition:background .15s,border-color .15s,opacity .2s,box-shadow .15s}
.excl-modal-pick:hover:not(.is-dim){border-color:var(--primary-light);background:#f0f5ff}
.excl-modal-pick.is-selected{border-color:var(--accent);background:#fff9f0;box-shadow:0 0 0 1px rgba(245,166,35,.35)}
.excl-modal-pick.is-dim{opacity:.38}
.excl-modal-pick-initial{width:2rem;height:2rem;border-radius:9px;background:var(--primary);color:#fff;font-size:.68rem;font-weight:800;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.excl-modal-pick-name{font-weight:600;color:var(--text);text-align:left}
.excl-modal-empty{margin:0;padding:1.75rem 1rem;text-align:center;color:var(--text-muted);font-size:.86rem;line-height:1.45}
.excl-modal-footer{padding:.8rem 1.25rem;border-top:1px solid var(--border-light);display:flex;justify-content:flex-end;background:var(--page-bg)}
@media(max-width:720px){
    .excl-modal-columns{grid-template-columns:1fr;max-height:none}
    .excl-modal-col{border-right:none;border-bottom:1px solid var(--border-light)}
    .excl-modal-col--right{border-bottom:none}
}

@media(max-width:900px){
    .grp-layout{flex-direction:column}
    .grp-pane-left{width:100%;border-right:none;border-bottom:1px solid var(--border)}
    .grp-student-list{max-height:200px}
}

/* ── Klassen-Archiv ───────────────────────────────────────────────────────── */
.archiv-section{margin-top:.5rem}
.archiv-intro{display:flex;gap:1.25rem;align-items:center;background:var(--card-bg);border:1px solid var(--border);border-radius:16px;padding:1.5rem;margin-bottom:1.75rem}
.archiv-intro-icon{font-size:3rem;line-height:1;flex-shrink:0}
.archiv-year-group{margin-bottom:2rem}
.archiv-year-heading{font-size:1rem;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:.06em;margin-bottom:1rem;padding-bottom:.5rem;border-bottom:1px solid var(--border)}
.archiv-cards{display:flex;flex-wrap:wrap;gap:1rem}
.archiv-card{background:var(--card-bg);border:1px solid var(--border);border-radius:14px;padding:1.2rem 1.4rem;min-width:220px;flex:1;max-width:320px;display:flex;flex-direction:column;gap:.75rem;opacity:.95}
.archiv-card-head{display:flex;align-items:center;justify-content:space-between;gap:.75rem}
.archiv-card-name{font-size:1.1rem;font-weight:700;color:var(--text)}
.archiv-badge-pill{display:inline-flex;align-items:center;background:var(--accent-light);color:var(--accent-dark);font-size:.72rem;font-weight:700;padding:.2rem .6rem;border-radius:999px;border:1px solid var(--accent)}
.archiv-card-meta{display:flex;flex-direction:column;gap:.25rem;font-size:.83rem;color:var(--text-muted)}
.archiv-card-actions{margin-top:.25rem}
.archiv-detail-header{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:1.5rem;flex-wrap:wrap;gap:1rem}
.archiv-class-title{font-size:1.4rem;font-weight:800;display:flex;align-items:center;gap:.75rem;margin:0}
.archiv-tabs{display:flex;gap:.5rem;flex-wrap:wrap;margin-bottom:1rem;border-bottom:2px solid var(--border);padding-bottom:.5rem}
.archiv-tab{background:none;border:none;padding:.5rem 1rem;border-radius:8px 8px 0 0;font-family:inherit;font-size:.9rem;font-weight:600;color:var(--text-muted);cursor:pointer;transition:background .15s,color .15s}
.archiv-tab:hover{background:var(--bg-surface);color:var(--text)}
.archiv-tab.is-active{background:var(--primary);color:#fff}
.archiv-tab-panel{display:none}
.archiv-tab-panel.is-active{display:block}
.grade-badge{display:inline-flex;align-items:center;justify-content:center;min-width:36px;height:28px;background:var(--primary-light);color:#fff;border-radius:7px;font-size:.9rem;font-weight:700;padding:0 .4rem}

/* ── Klasse versetzen Modal ───────────────────────────────────────────────── */
.versetz-modal-backdrop{position:fixed;inset:0;z-index:1200;background:rgba(8,15,36,.6);display:flex;align-items:center;justify-content:center;padding:1rem}
.versetz-modal{background:var(--card-bg);border:1px solid var(--border);border-radius:20px;width:100%;max-width:520px;box-shadow:0 20px 60px rgba(0,0,0,.3)}
.versetz-modal-header{display:flex;align-items:center;gap:.75rem;padding:1.5rem 1.5rem 1rem;border-bottom:1px solid var(--border)}
.versetz-modal-icon{font-size:2rem;line-height:1}
.versetz-modal-header h3{margin:0;font-size:1.1rem;font-weight:700}
.versetz-modal-body{padding:1.25rem 1.5rem}
.versetz-info-box{background:var(--accent-light);border:1px solid var(--accent);border-radius:10px;padding:1rem 1.1rem;font-size:.9rem;color:var(--accent-dark)}
.versetz-modal-footer{padding:1rem 1.5rem;border-top:1px solid var(--border);display:flex;justify-content:flex-end;gap:.75rem}
.btn-warning{background:var(--warning);color:#fff;font-weight:700}
.btn-warning:hover{background:var(--accent-dark)}

/* ── Listen-Hub ───────────────────────────────────────────────────────────── */
.listen-hub__header{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;flex-wrap:wrap}
.listen-hub__subtitle{margin:.35rem 0 0;color:var(--text-muted);max-width:760px}
.listen-hub__tabs{display:flex;gap:.75rem;flex-wrap:wrap}
.listen-hub__tab{display:inline-flex;align-items:center;justify-content:center;padding:.8rem 1.05rem;border-radius:999px;text-decoration:none;font-weight:700;color:var(--primary);background:var(--bg-surface);border:1px solid var(--border);box-shadow:0 2px 8px rgba(0,0,0,.06)}
.listen-hub__tab.is-active{background:var(--accent);color:#1a2035;border-color:var(--accent);box-shadow:0 4px 14px rgba(245,166,35,.35)}
@media(max-width:720px){.listen-hub__header{flex-direction:column}}
/*
  Wird mit assets/style.css zu demo-notenweb.css zusammengefügt:
  copy /b assets\style.css+demo-notenweb-extras.css demo-notenweb.css
*/
/* Alles unterhalb ergänzt/überschreibt die Basis-Styles nur für die Demo. */

body.demo-page { padding-bottom: 5.5rem; }
.demo-stats-footer-hidden .dashboard-stats-footer { display: none !important; }
.klassen-substudents-hidden { display: none !important; }
.demo-class-row { cursor: pointer; }
.demo-class-row:hover { background: #edf4fc !important; }

/* Footer stats bar */
.dashboard-stats-footer {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--header-gradient);
    border-top: 2px solid rgba(245,166,35,0.45);
    box-shadow: 0 -4px 24px rgba(8,15,36,0.22);
    z-index: 50; padding: 0.7rem 2rem;
}
.dashboard-stats-footer__inner {
    display: flex; align-items: center; gap: 0;
    max-width: 600px; margin: 0 auto; justify-content: center;
}
.dsf-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.2rem 1.5rem; }
.dsf-number {
    font-size: 1.55rem; font-weight: 800;
    background: linear-gradient(135deg, #f5a623 0%, #fde68a 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1;
}
.dsf-label { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: rgba(200,215,240,0.75); }
.dsf-divider { width: 1px; height: 28px; background: rgba(245,166,35,0.25); flex-shrink: 0; }
@media (max-width: 900px) {
    .dashboard-stats-footer { padding: 0.75rem 1rem; }
    .dashboard-stats-footer__inner { max-width: none; justify-content: space-between; flex-wrap: wrap; row-gap: 0.65rem; }
    .dsf-item { flex: 1 1 calc(50% - 0.4rem); justify-content: center; padding: 0.15rem 0.25rem; }
    .dsf-divider { display: none; }
}

/* Layout helpers */
.demo-page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.demo-page-header h1 { margin: 0; flex: 1 1 auto; min-width: 0; }
.demo-subnav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.demo-toolbar-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem 1rem; }
.demo-toolbar-row .form-group { margin-bottom: 0; }
.demo-vorlage-criteria .form-row { align-items: flex-end; }

/* Tools fullscreen */
#demoToolsHome { max-width: 1300px; margin: 0 auto; padding: 2rem; }
.demo-tool-fs {
    display: none; position: fixed; inset: 0; z-index: 800;
    background: var(--page-bg); flex-direction: column; overflow-y: auto;
}
.demo-tool-fs.is-active { display: flex; }
.demo-tool-fs .tool-fs-bar {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; gap: 1rem; padding: 0.85rem 1.5rem;
    background: var(--header-gradient); box-shadow: 0 2px 12px rgba(8,15,36,.25); flex-shrink: 0;
}
.demo-tool-fs .tool-fs-body { flex: 1; padding: 2rem; max-width: 1100px; margin: 0 auto; width: 100%; }

/* Plus/Minus rating buttons */
.pm-cell { display: flex; gap: 2px; justify-content: center; flex-wrap: nowrap; }
.pm-rb {
    padding: 2px 6px; font-size: 0.7rem; font-weight: 800;
    border: 1.5px solid #d1d5db; background: #f9fafb;
    border-radius: 5px; cursor: pointer;
    transition: opacity 0.12s, transform 0.1s;
    white-space: nowrap; line-height: 1.6;
}
.pm-rb.rb-pp { background: #bbf7d0; color: #14532d; border-color: #4ade80; }
.pm-rb.rb-p  { background: #dcfce7; color: #166534; border-color: #86efac; }
.pm-rb.rb-n  { background: #fef9c3; color: #713f12; border-color: #fde047; }
.pm-rb.rb-m  { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.pm-rb.rb-mm { background: #fca5a5; color: #7f1d1d; border-color: #ef4444; }
.pm-rb.is-active { opacity: 1; box-shadow: 0 0 0 2px rgba(0,0,0,0.22); }
.pm-rb:not(.is-active) { opacity: 0.32; }
.pm-rb:hover:not(:disabled) { opacity: 0.85; transform: scale(1.1); }
.pm-rb:disabled { cursor: not-allowed; }

/* PM overview */
.pm-badge { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: .72rem; font-weight: 700; }
.pm-badge-open   { background: #dcfce7; color: #166534; }
.pm-badge-closed { background: #fee2e2; color: #991b1b; }

/* Bewertung score grid */
.bew-score-inp {
    width: 56px; text-align: center; padding: 3px 4px;
    border: 1px solid #d1d5db; border-radius: 5px; font-size: 0.86rem;
}
.bew-score-inp:focus { border-color: var(--primary, #1a56db); outline: none; box-shadow: 0 0 0 2px rgba(26,86,219,0.12); }
.bew-total-cell { font-weight: 700; color: var(--primary, #1a56db); text-align: center; }
.bew-grade-cell { font-weight: 700; text-align: center; }

/* Tabellen / JS-generierte Zellen */
.demo-td-center { text-align: center; }
.demo-th-center { text-align: center; }
.demo-th-pm-round { text-align: center; min-width: 120px; }
.demo-td-pm-round { text-align: center; padding: 4px 2px; }
.demo-name-cell { white-space: nowrap; }
.demo-vtpl-desc { color: #666; font-size: 0.88rem; }
.demo-vtpl-crit-list { font-size: 0.88rem; }
.demo-vtpl-sum { font-weight: 700; }
.bew-th-crit-sub { font-weight: 400; color: #888; }

.pm-pts-cell { text-align: center; font-weight: 700; }
.pm-grade-cell { text-align: center; font-weight: 700; color: var(--primary, #1a56db); }

/* Vorlagen-Kriterien-Zeilen (dynamisch) */
.demo-vtpl-crit-row { margin-bottom: 0.5rem; }
.demo-fg-crit-text { flex: 2; min-width: 12rem; }
.demo-fg-crit-pts { flex: 0 0 8rem; }
.demo-fg-crit-rm { flex: 0 0 3rem; align-self: flex-end; }

/* Sichtbarkeit per Klasse (statt inline display) */
.demo-js-hidden { display: none !important; }
.demo-body-tool-open { overflow: hidden !important; }

/* Demo-spezifische Layout-Hilfen (ehemals inline) */
.demo-alert-mb { margin-bottom: 1rem; }
.demo-spacer-5 { height: 5rem; }
.demo-mb-1-muted { margin-bottom: 1rem; }
.demo-alert-flexbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.demo-students-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.demo-h2-plain { margin: 0; }
.demo-class-select-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.demo-label-class {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}
.demo-select-class { width: auto; min-width: 12rem; }
.demo-noten-hint { margin-top: 1rem; font-size: 0.88rem; }
.demo-select-listen { min-width: 14rem; }
.demo-btn-row-mt-sm { margin-top: 0.75rem; }
.demo-btn-row-mt-lg { margin-top: 1.25rem; }
.demo-toolbar-mb-1 { margin-bottom: 1rem; }
.demo-toolbar-mb-09 { margin-bottom: 0.9rem; }
.demo-toolbar-mb-125 { margin-bottom: 1.25rem; }
.demo-fg-flex-tpl { flex: 1 1 12rem; }
.demo-fg-flex-title { flex: 2 1 18rem; }
.demo-fg-align-end { align-self: flex-end; }
.demo-fg-pm-name { flex: 2 1 16rem; }
.demo-fg-pm-class { flex: 1 1 12rem; }
.demo-fg-pm-subj { flex: 1 1 11rem; }
.demo-fg-pm-cat { flex: 1 1 11rem; }
.demo-inp-w-rounds { width: 75px; }
.demo-inp-w-pts { width: 65px; }
.demo-select-bew-class { min-width: 13rem; }
.demo-select-bew-subj { min-width: 11rem; }
.demo-select-bew-cat { min-width: 11rem; }
.demo-flex-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.demo-pm-detail-info { font-size: 0.9rem; }
.demo-card-scroll-x { overflow-x: auto; }
.demo-tools-grid-cols { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.demo-grp-card-panel { max-width: 32rem; width: 100%; }
.demo-grp-result-grid {
    display: grid;
    width: 100%;
    max-width: 56rem;
    margin-top: 1.5rem;
}
.demo-tool-fs-body-timer-pad { padding-top: 3rem; }
.demo-timer-wrap { width: 100%; max-width: 28rem; }
.demo-timer-section { display: flex; flex-direction: column; align-items: center; gap: 0.55rem; margin-bottom: 1rem; }
.demo-timer-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-secondary); }
.demo-timer-presets { display: flex; flex-wrap: wrap; gap: 0.45rem; justify-content: center; }
.demo-timer-face {
    position: relative;
    padding: 1.75rem 1.35rem;
    border-radius: 22px;
    background: linear-gradient(155deg, #fff 0%, var(--light-bg) 100%);
    border: 1px solid var(--border-light);
    box-shadow: 0 8px 32px rgba(8, 15, 36, 0.08);
}
.demo-timer-disp {
    text-align: center;
    font-size: 3.2rem;
    font-weight: 800;
    color: var(--primary);
}
.demo-timer-bar-wrap {
    height: 12px;
    background: var(--border);
    border-radius: 99px;
    margin-top: 1rem;
    overflow: hidden;
}
.demo-timer-bar-fill {
    height: 100%;
    width: 100%;
    background: var(--primary);
    border-radius: 99px;
}
.demo-timer-actions { justify-content: center; gap: 0.75rem; margin-top: 1.25rem; }

/* Zufallsgruppen: Akzentfarbe über --grp-accent am Eltern-Element */
.grp-card { --grp-accent: #1845c8; }
.grp-card-num { background: var(--grp-accent); }

.demo-schueler-link {
    color: var(--primary);
    font-weight: 600;
}

@media print {
    .main-header, .main-nav, .dashboard-stats-footer,
    .no-print, .grades-actions, .grades-nav-arrows, .btn { display: none !important; }
    body.demo-page { padding-bottom: 0; }
    .demo-tool-fs { display: none !important; }
}
