/* ============================================================
   DASHBOARD & MODULE NAVIGATION
   ============================================================ */

/* ---- Top Navigation Bar ---- */
.system-bar {
    display: none !important;
}

.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.5rem;
    background: color-mix(in srgb, var(--surface) 94%, #181311);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid color-mix(in srgb, var(--accent) 26%, var(--border));
    box-shadow: 0 10px 30px rgba(20, 15, 11, 0.16);
    position: sticky;
    /* Forskydes ned under "under opbygning"-bjælken når den vises (ellers 0). */
    top: var(--csl-cn-h, 0px);
    z-index: 500;
    gap: 1rem;
}

.top-nav-brand {
    appearance: none;
    -webkit-appearance: none;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    font-weight: 800;
    font-size: 0.84rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    cursor: pointer;
    flex-shrink: 0;
    text-decoration: none;
    transition: var(--transition);
    line-height: 1;
    opacity: 0.92;
}

.top-nav-brand:hover {
    color: var(--text-main);
    background: transparent;
}

.top-nav-logo-img {
    width: 22px;
    height: 22px;
    display: block;
    border-radius: 10px;
    flex-shrink: 0;
}

.top-nav-brand-label {
    display: inline-block;
    white-space: nowrap;
}

.top-nav-links {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-link {
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    border: 1px solid rgba(201, 106, 61, 0.12);
    background: rgba(255, 251, 244, 0.03);
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 700;
    font-family: "Public Sans", "Outfit", sans-serif;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link svg {
    flex-shrink: 0;
}

.nav-link:hover {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: #f4efe6;
    border-color: color-mix(in srgb, var(--accent) 32%, var(--border));
}

.nav-link.active {
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: #f4efe6;
    border-color: color-mix(in srgb, var(--accent) 44%, var(--border));
    box-shadow: inset 0 0 0 1px rgba(255, 251, 244, 0.04);
}

.top-nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.top-nav-user-chip {
    min-height: 38px;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.theme-btn {
    min-height: 40px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    color: var(--text-main);
    font-family: "Public Sans", "Outfit", sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.theme-btn:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--accent) 36%, var(--border));
    box-shadow: 0 10px 24px rgba(13, 11, 9, 0.12);
}

.theme-btn {
    width: 42px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

@media (max-width: 900px) {
    .top-nav-user-chip span {
        display: none;
    }
}

.theme-btn-orb {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 24%, transparent), color-mix(in srgb, var(--primary) 20%, transparent));
    border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
    overflow: hidden;
}

.theme-icon {
    position: absolute;
    transition: transform 0.25s ease, opacity 0.25s ease, color 0.25s ease;
}

.theme-icon-moon {
    color: #c96a3d;
    opacity: 0;
    transform: translateY(6px) scale(0.8);
}

.theme-icon-sun {
    color: #d7a928;
    opacity: 0;
    transform: translateY(-6px) scale(0.8);
}

[data-theme="light"] .top-nav {
    background: rgba(248, 241, 231, 0.94);
    border-bottom: 1px solid rgba(67, 54, 37, 0.12);
    box-shadow: 0 8px 24px rgba(31, 42, 36, 0.06);
}

[data-theme="light"] .top-nav-brand {
    color: #445149;
}

[data-theme="light"] .top-nav-brand:hover {
    color: #1f2a24;
}

[data-theme="light"] .nav-link {
    background: rgba(255, 251, 244, 0.78);
    border-color: rgba(201, 106, 61, 0.12);
    color: #445149;
}

[data-theme="light"] .nav-link:hover,
[data-theme="light"] .nav-link.active {
    background: rgba(201, 106, 61, 0.12);
    color: #8e4f2f;
    border-color: rgba(201, 106, 61, 0.2);
    box-shadow: none;
}

[data-theme="light"] .top-nav-user-chip,
[data-theme="light"] .theme-btn {
    background: rgba(255, 251, 244, 0.9);
    border-color: rgba(67, 54, 37, 0.12);
    color: #445149;
}

[data-theme="light"] .theme-btn:hover {
    border-color: rgba(201, 106, 61, 0.22);
    box-shadow: 0 10px 22px rgba(31, 42, 36, 0.08);
}

[data-theme="light"] .theme-btn-orb {
    background: linear-gradient(135deg, rgba(201, 106, 61, 0.14), rgba(45, 122, 120, 0.12));
    border-color: rgba(201, 106, 61, 0.18);
}

.theme-btn[data-theme-mode="dark"] .theme-icon-moon,
.theme-btn[data-theme-mode="light"] .theme-icon-sun {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.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;
}

/* ---- Dashboard View ---- */
#dashboard-view {
    padding: 2.5rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeInUp 0.5s ease-out;
}

.dashboard-hero-random .hero-random-btn {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.72rem 1rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, transparent), color-mix(in srgb, var(--primary) 10%, transparent));
    color: var(--text-main);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 14%, transparent);
    transition: var(--transition);
}

.dashboard-hero-random .hero-random-btn:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--accent) 42%, transparent);
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 20%, transparent), color-mix(in srgb, var(--primary) 16%, transparent));
    box-shadow: 0 14px 30px color-mix(in srgb, var(--accent) 20%, transparent);
}

.dashboard-hero-random .hero-random-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.dashboard-hero-random {
    margin: 0 0 2rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, transparent), color-mix(in srgb, var(--primary) 7%, transparent));
    transition: var(--transition);
}

.dashboard-hero-random:hover {
    border-color: color-mix(in srgb, var(--accent) 40%, transparent);
    box-shadow: 0 4px 24px color-mix(in srgb, var(--accent) 10%, transparent);
}

.hero-random-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-random-icon {
    flex-shrink: 0;
    font-size: 2.5rem;
    animation: heroIconSpin 4s ease-in-out infinite;
}

@keyframes heroIconSpin {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
}

.hero-random-text {
    flex: 1;
    min-width: 0;
}

.hero-random-title {
    margin-bottom: 2px;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.06em;
}

.hero-random-sub {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.archive-cat-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0.5rem;
    padding: 0.75rem 0 0.5rem;
    border-bottom: 1px solid var(--border);
}

.archive-cat-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.archive-cat-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-main);
}

.cat-icon {
    font-size: 0.9rem;
}

.card-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 4px 0 2px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.63rem;
    font-weight: 600;
}

.chip-energy {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.chip-age {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.modal-body-enhanced .content-block {
    margin-bottom: 1.25rem;
}

.sim-collapsible {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.sim-collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-size: 0.87rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.sim-collapsible-header::-webkit-details-marker {
    display: none;
}

.sim-collapsible-header:hover {
    color: var(--text-main);
}

.sim-toggle-icon {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

details.sim-collapsible[open] .sim-toggle-icon {
    transform: rotate(180deg);
}

.sim-collapsible-body {
    padding: 1rem;
}

/* ---- Module Cards Grid ---- */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.module-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.5rem;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1), box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    position: relative;
    overflow: hidden;
    text-align: left;
    font-family: inherit;
    color: inherit;
    text-decoration: none;
}

.module-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--module-accent, rgba(0,255,204,0.04));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.module-card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 16px 40px rgba(0,0,0,0.2), 0 0 0 1px var(--module-color, rgba(0,255,204,0.3));
    border-color: var(--module-color, rgba(0,255,204,0.4));
}

.module-card:hover::before { opacity: 1; }

.module-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--module-bg, rgba(0,255,204,0.12));
    border: 1px solid var(--module-color, rgba(201,106,61,0.25));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.module-icon-wrap svg {
    color: var(--module-color, #c96a3d);
}

.module-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.module-card p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

.module-card-arrow {
    position: absolute;
    bottom: 1.25rem;
    right: 1.25rem;
    color: var(--module-color, rgba(0,255,204,0.4));
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.2s, transform 0.2s;
}

.module-card:hover .module-card-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ---- Dashboard Redesign: warm editorial shell ---- */
#dashboard-view.dashboard-home {
    max-width: 1360px;
    padding: 2.5rem 1.5rem 4rem;
}

#dashboard-view.dashboard-home .dashboard-shell {
    display: grid;
    gap: 1.25rem;
}

/* ---- Teacher Hub: same warm shell layout ---- */
#teacher-view .th-shell {
    max-width: 1360px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
    display: grid;
    gap: 1.25rem;
}

/* ---- Archive: same shell layout ---- */
#archive-view .arc-shell {
    max-width: 1360px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
    display: grid;
    gap: 1.25rem;
}

/* Grid-items maa kunne krympe under deres min-content — ellers tvinger
   et enkelt barn (fx arc-filter-row) hele sporet ud over viewporten paa
   mobil, og alle soeskende klippes af overflow-x: hidden. */
#archive-view .arc-shell > *,
#teacher-view .th-shell > * {
    min-width: 0;
}

/* Archive hero: stack layout so search sits below headline */
.arc-hero {
    flex-direction: column;
    align-items: flex-start;
}

.arc-hero h1 { margin-bottom: 0.75rem; }

.arc-search-row {
    width: 100%;
    max-width: 580px;
    margin-top: 0.5rem;
}

.arc-search-input {
    width: 100%;
    padding: 0.75rem 1.25rem;
    border-radius: 14px;
    border: 1.5px solid rgba(201, 106, 61, 0.3);
    background: rgba(255,255,255,0.55);
    color: var(--text-main, #1f2a24);
    font-family: "Public Sans", "Outfit", sans-serif;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
    box-sizing: border-box;
}

.arc-search-input:focus {
    border-color: #c96a3d;
    box-shadow: 0 0 0 3px rgba(201, 106, 61, 0.12);
    background: rgba(255, 255, 255, 0.85);
}

.arc-search-input::placeholder { color: rgba(95, 107, 99, 0.55); }

.arc-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.7rem;
}

.arc-hero-stats span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 28px;
    padding: 0.34rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 250, 243, 0.62);
    border: 1px solid rgba(201, 106, 61, 0.14);
    color: #5f6b63;
    font-size: 0.8rem;
    font-weight: 700;
}

.arc-hero-stats strong {
    color: #1f2a24;
    font-variant-numeric: tabular-nums;
}

.arc-curation {
    display: grid;
    grid-template-columns: minmax(220px, 0.78fr) 1.6fr;
    gap: 1rem;
    align-items: stretch;
    padding: 1rem;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(247, 240, 230, 0.76), rgba(238, 232, 221, 0.58));
    border: 1px solid rgba(67, 54, 37, 0.1);
}

.arc-curation-head {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.35rem 0.5rem;
}

.arc-section-kicker {
    display: inline-flex;
    width: fit-content;
    margin-bottom: 0.35rem;
    color: #8e4f2f;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.arc-curation h2 {
    margin: 0 0 0.45rem;
    color: #1f2a24;
    font-family: "Public Sans", sans-serif;
    font-size: clamp(1.25rem, 2vw, 1.7rem);
    line-height: 1.05;
}

.arc-curation p {
    margin: 0;
    color: #5f6b63;
    font-size: 0.92rem;
    line-height: 1.45;
}

.arc-preset-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.arc-preset-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 142px;
    padding: 0.95rem;
    border: 1px solid rgba(67, 54, 37, 0.11);
    border-radius: 14px;
    background: rgba(255, 250, 243, 0.78);
    color: #1f2a24;
    text-align: left;
    font-family: "Public Sans", "Outfit", sans-serif;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.arc-preset-card:hover,
.arc-preset-card.active {
    transform: translateY(-1px);
    background: rgba(255, 250, 243, 0.94);
    border-color: rgba(201, 106, 61, 0.28);
    box-shadow: 0 14px 24px rgba(31, 42, 36, 0.08);
}

.arc-preset-card.active {
    box-shadow: inset 0 0 0 1px rgba(201, 106, 61, 0.26), 0 14px 24px rgba(31, 42, 36, 0.08);
}

.arc-preset-kicker {
    margin-bottom: 0.7rem;
    color: #2d7a78;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.arc-preset-card strong {
    margin-bottom: 0.45rem;
    color: inherit;
    font-size: 1rem;
    line-height: 1.18;
}

.arc-preset-card span:last-child {
    color: #5f6b63;
    font-size: 0.82rem;
    line-height: 1.38;
}

/* Quick filter bar */
.arc-filter-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    background: var(--card-bg, rgba(245, 241, 232, 0.65));
    border: 1px solid var(--border, rgba(67, 54, 37, 0.1));
    border-radius: 16px;
}

.arc-type-tabs { display: flex; gap: 6px; }

.arc-type-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 10px;
    border: 1.5px solid var(--border, rgba(67, 54, 37, 0.14));
    background: transparent;
    color: var(--text-muted, #5f6b63);
    font-family: "Public Sans", "Outfit", sans-serif;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.arc-type-btn:hover {
    background: rgba(201, 106, 61, 0.07);
    border-color: rgba(201, 106, 61, 0.25);
    color: #c96a3d;
}

.arc-type-btn.arc-type-active {
    background: rgba(201, 106, 61, 0.1);
    border-color: rgba(201, 106, 61, 0.35);
    color: #c96a3d;
}

.arc-tag-cloud {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    overflow: hidden;
    align-items: center;
    flex: 1;
}

.arc-filter-toggle {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 10px;
    border: 1.5px solid var(--border, rgba(67, 54, 37, 0.14));
    background: transparent;
    color: var(--text-muted, #5f6b63);
    font-family: "Public Sans", "Outfit", sans-serif;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.arc-filter-toggle:hover {
    background: rgba(45, 122, 120, 0.06);
    border-color: rgba(45, 122, 120, 0.25);
    color: #2d7a78;
}

/* Advanced filter panel */
.arc-advanced-filters {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border, rgba(67, 54, 37, 0.1));
    border-radius: 14px;
}

.arc-filter-label {
    display: block;
    font-family: "Public Sans", "Outfit", sans-serif;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted, #5f6b63);
    margin-bottom: 6px;
}

.arc-filter-select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border, rgba(67, 54, 37, 0.14));
    background: var(--surface, rgba(255,255,255,0.6));
    color: var(--text-main, #1f2a24);
    font-family: "Public Sans", "Outfit", sans-serif;
    font-size: 0.88rem;
    cursor: pointer;
}

.arc-filter-select:focus {
    outline: none;
    border-color: #c96a3d;
    box-shadow: 0 0 0 2px rgba(201, 106, 61, 0.1);
}

.arc-results-toolbar {
    display: grid;
    grid-template-columns: minmax(190px, auto) 1fr auto;
    gap: 0.8rem;
    align-items: center;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(67, 54, 37, 0.1);
    border-radius: 16px;
    background: rgba(255, 250, 243, 0.5);
}

.arc-results-summary p {
    margin: 0;
    color: #1f2a24;
    font-weight: 800;
}

.arc-active-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
    min-width: 0;
}

.arc-active-filter {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0.28rem 0.58rem;
    border-radius: 999px;
    background: rgba(45, 122, 120, 0.08);
    border: 1px solid rgba(45, 122, 120, 0.15);
    color: #315f5d;
    font-size: 0.74rem;
    font-weight: 800;
}

.arc-clear-filters {
    justify-self: end;
    padding: 0.48rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(201, 106, 61, 0.18);
    background: rgba(255, 250, 243, 0.7);
    color: #8e4f2f;
    font-family: "Public Sans", "Outfit", sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
}

.arc-clear-filters:hover {
    background: rgba(201, 106, 61, 0.1);
}

@media (max-width: 980px) {
    .arc-curation {
        grid-template-columns: 1fr;
    }

    .arc-preset-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .arc-results-toolbar {
        grid-template-columns: 1fr;
    }

    .arc-clear-filters {
        justify-self: start;
    }
}

@media (max-width: 640px) {
    #archive-view .arc-shell {
        padding-inline: 1rem;
    }

    .arc-hero {
        padding: 1.5rem;
        border-radius: 20px;
    }

    .arc-hero-stats span {
        width: 100%;
        justify-content: space-between;
    }

    .arc-curation {
        padding: 0.75rem;
        border-radius: 18px;
    }

    .arc-preset-grid {
        grid-template-columns: 1fr;
    }

    .arc-preset-card {
        min-height: 0;
    }

    .arc-filter-row {
        align-items: stretch;
    }

    .arc-type-tabs,
    .arc-filter-toggle {
        width: 100%;
    }

    .arc-type-btn,
    .arc-filter-toggle {
        justify-content: center;
    }
}


.th-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
    padding: 2.25rem 2.5rem;
    border: 1px solid rgba(67, 54, 37, 0.12);
    border-radius: 28px;
    background:
        radial-gradient(circle at top right, rgba(201, 106, 61, 0.1), transparent 40%),
        linear-gradient(180deg, rgba(250, 246, 238, 0.99), rgba(241, 234, 222, 0.97));
    box-shadow: 0 14px 36px rgba(30, 24, 18, 0.11);
}

.th-hero-text { flex: 1; min-width: 220px; }

.th-hero-kicker {
    margin: 0 0 0.75rem;
    font-family: "Public Sans", "Outfit", sans-serif;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #8e4f2f;
}

.th-hero h1 {
    margin: 0 0 0.5rem;
    font-family: "Fraunces", Georgia, serif;
    font-size: clamp(1.7rem, 3vw, 2.5rem);
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1.05;
    color: #1f2a24;
}

.th-hero-sub {
    margin: 0;
    font-size: 1rem;
    color: #5f6b63;
    font-family: "Public Sans", "Outfit", sans-serif;
}

.th-hero-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* ── Hero ─────────────────────────────────────────────────────────── */
.db-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
    padding: 2.25rem 2.5rem;
    border: 1px solid rgba(67, 54, 37, 0.12);
    border-radius: 28px;
    background:
        radial-gradient(circle at top right, rgba(215, 169, 40, 0.09), transparent 40%),
        linear-gradient(180deg, rgba(250, 246, 238, 0.99), rgba(241, 234, 222, 0.97));
    box-shadow: 0 14px 36px rgba(30, 24, 18, 0.11);
}

.db-hero-text {
    flex: 1;
    min-width: 220px;
}

.db-hero-kicker {
    margin: 0 0 0.75rem;
    font-family: "Public Sans", "Outfit", sans-serif;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #8e4f2f;
}

.db-hero h1 {
    margin: 0 0 0.5rem;
    font-family: "Fraunces", Georgia, serif;
    font-size: clamp(1.9rem, 3.5vw, 2.9rem);
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1.05;
    color: #1f2a24;
}

.db-hero-sub {
    margin: 0;
    font-size: 1rem;
    color: #5f6b63;
    font-family: "Public Sans", "Outfit", sans-serif;
}

.db-hero-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.db-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.4rem;
    border-radius: 999px;
    border: none;
    background: #c96a3d;
    color: #fff;
    font-family: "Public Sans", "Outfit", sans-serif;
    font-size: 0.94rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(201, 106, 61, 0.3);
}

.db-btn-primary:hover {
    background: #b55c34;
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(201, 106, 61, 0.38);
}

.db-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.4rem;
    border-radius: 999px;
    border: 1.5px solid rgba(67, 54, 37, 0.18);
    background: rgba(255, 251, 244, 0.8);
    color: #445149;
    font-family: "Public Sans", "Outfit", sans-serif;
    font-size: 0.94rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.db-btn-secondary:hover {
    background: rgba(45, 122, 120, 0.1);
    border-color: rgba(45, 122, 120, 0.3);
    color: #2d7a78;
    transform: translateY(-2px);
}

/* ── Fortsæt-zone ─────────────────────────────────────────────────── */
.db-continue-zone {
    padding: 1.25rem 1.75rem;
    border: 1px solid rgba(45, 122, 120, 0.18);
    border-radius: 22px;
    background: rgba(45, 122, 120, 0.06);
    display: grid;
    gap: 0.75rem;
}

.db-continue-label {
    margin: 0;
    font-family: "Public Sans", "Outfit", sans-serif;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #2d7a78;
}

.db-continue-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.db-continue-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(45, 122, 120, 0.22);
    background: rgba(255, 252, 248, 0.88);
    color: #1f2a24;
    font-family: "Public Sans", "Outfit", sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.db-continue-chip:hover {
    background: rgba(45, 122, 120, 0.12);
    border-color: rgba(45, 122, 120, 0.35);
    color: #2d7a78;
}

.db-continue-chip-icon {
    font-size: 1rem;
    line-height: 1;
}

/* ── Sections ─────────────────────────────────────────────────────── */
.db-section {
    padding: 2rem 2.5rem;
    border: 1px solid rgba(67, 54, 37, 0.12);
    border-radius: 28px;
    background:
        radial-gradient(circle at bottom left, rgba(45, 122, 120, 0.06), transparent 40%),
        linear-gradient(180deg, rgba(250, 246, 238, 0.98), rgba(241, 234, 222, 0.96));
    box-shadow: 0 14px 36px rgba(30, 24, 18, 0.1);
}

.db-section-head {
    display: grid;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
}

.db-section-head h2 {
    margin: 0;
    font-family: "Fraunces", Georgia, serif;
    font-size: clamp(1.5rem, 2.2vw, 2.2rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: #1f2a24;
}

.db-section-head span {
    font-family: "Public Sans", "Outfit", sans-serif;
    font-size: 0.95rem;
    color: #5f6b63;
}

/* ── Three primary tracks ─────────────────────────────────────────── */
.db-tracks {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.db-track-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.1rem;
    padding: 1.75rem 1.6rem 2.1rem;
    border: 1px solid rgba(67, 54, 37, 0.13);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 252, 247, 0.96) 0%, rgba(var(--track-bg-rgb, 255,252,247), 0.92) 100%);
    background-color: var(--track-bg, rgba(255, 252, 247, 0.96));
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: transform 0.28s cubic-bezier(0.16,1,0.3,1), box-shadow 0.28s ease, border-color 0.2s ease;
    position: relative;
    overflow: hidden;
}

.db-track-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 60%, var(--track-bg, rgba(201,106,61,0.08)));
    opacity: 0;
    transition: opacity 0.25s ease;
    border-radius: inherit;
    pointer-events: none;
}

.db-track-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 40px rgba(30, 24, 18, 0.1), 0 0 0 1.5px var(--track-color, #c96a3d);
    border-color: var(--track-color, #c96a3d);
}

.db-track-card:hover::after { opacity: 1; }

.db-track-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--track-bg, rgba(201, 106, 61, 0.11));
    border: 1px solid color-mix(in srgb, var(--track-color, #c96a3d) 25%, transparent);
    color: var(--track-color, #c96a3d);
    flex-shrink: 0;
}

.db-track-body {
    flex: 1;
    min-width: 0;
}

.db-track-label {
    display: block;
    margin-bottom: 0.5rem;
    font-family: "Public Sans", "Outfit", sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--track-color, #c96a3d);
}

.db-track-body h3 {
    margin: 0 0 0.4rem;
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.22rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #1f2a24;
    line-height: 1.1;
}

.db-track-body p {
    margin: 0;
    font-size: 0.88rem;
    color: #5f6b63;
    line-height: 1.55;
    font-family: "Public Sans", "Outfit", sans-serif;
}

.db-track-arrow {
    position: absolute;
    bottom: 1.1rem;
    right: 1.2rem;
    font-size: 1.1rem;
    color: var(--track-color, #c96a3d);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.2s, transform 0.2s;
}

.db-track-card:hover .db-track-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ── Rooms grid ───────────────────────────────────────────────────── */
.db-rooms {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.db-room-card {
    padding: 1.35rem 1.25rem 1.7rem !important;
    border-color: rgba(67, 54, 37, 0.12) !important;
    background: rgba(255, 252, 247, 0.92) !important;
    box-shadow: none !important;
    color: #1f2a24 !important;
    border-radius: 22px !important;
}

.db-room-card h3 {
    color: #1f2a24 !important;
    font-family: "Fraunces", Georgia, serif !important;
    font-size: 1.08rem !important;
    font-weight: 600 !important;
}

.db-room-card p {
    color: #5f6b63 !important;
    font-size: 0.85rem !important;
}

.db-room-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 16px 32px rgba(31, 42, 36, 0.09) !important;
    border-color: rgba(67, 54, 37, 0.22) !important;
}

/* ── Secondary tools ──────────────────────────────────────────────── */
.db-secondary {
    padding: 1.25rem 1.75rem;
    border: 1px solid rgba(67, 54, 37, 0.08);
    border-radius: 20px;
    background: rgba(250, 246, 238, 0.6);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.db-secondary-label {
    margin: 0;
    font-family: "Public Sans", "Outfit", sans-serif;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #a09080;
    flex-shrink: 0;
}

.db-secondary-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.db-sys-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(67, 54, 37, 0.12);
    background: rgba(255, 251, 244, 0.7);
    color: #5f6b63;
    font-family: "Public Sans", "Outfit", sans-serif;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.db-sys-btn:hover {
    background: rgba(201, 106, 61, 0.08);
    border-color: rgba(201, 106, 61, 0.22);
    color: #8e4f2f;
}

/* ── Dark mode overrides ──────────────────────────────────────────── */
[data-theme="dark"] .db-hero,
[data-theme="dark"] .db-section {
    border-color: rgba(92, 74, 53, 0.24);
    background:
        radial-gradient(circle at top right, rgba(215, 169, 40, 0.05), transparent 38%),
        linear-gradient(180deg, rgba(245, 238, 228, 0.94), rgba(233, 224, 211, 0.92));
    box-shadow: 0 18px 42px rgba(8, 7, 6, 0.22);
}

[data-theme="dark"] .db-continue-zone {
    border-color: rgba(45, 122, 120, 0.22);
    background: rgba(45, 122, 120, 0.09);
}

[data-theme="dark"] .db-secondary {
    border-color: rgba(92, 74, 53, 0.16);
    background: rgba(245, 238, 228, 0.4);
}

[data-theme="dark"] .db-track-card,
[data-theme="dark"] .db-room-card {
    border-color: rgba(92, 74, 53, 0.2) !important;
    background: rgba(244, 237, 227, 0.9) !important;
}

[data-theme="dark"] .db-track-card:hover {
    box-shadow: 0 16px 36px rgba(8, 7, 6, 0.18), 0 0 0 1.5px var(--track-color, #c96a3d) !important;
}

/* ── Light mode overrides (explicit) ─────────────────────────────── */
[data-theme="light"] .db-hero,
[data-theme="light"] .db-section {
    border-color: rgba(67, 54, 37, 0.12);
    background:
        radial-gradient(circle at top right, rgba(215, 169, 40, 0.08), transparent 40%),
        linear-gradient(180deg, rgba(250, 246, 238, 0.99), rgba(241, 234, 222, 0.97));
    box-shadow: 0 14px 36px rgba(30, 24, 18, 0.11);
}

[data-theme="light"] .db-track-card,
[data-theme="light"] .db-room-card {
    border-color: rgba(67, 54, 37, 0.12) !important;
    background: rgba(255, 252, 247, 0.94) !important;
}

/* ── Quick Generate Button on Dashboard (legacy) ────────────────── */
.dashboard-quick-gen {
    background: linear-gradient(135deg, rgba(201,106,61,0.07), rgba(45,122,120,0.06));
    border: 1px solid rgba(201,106,61,0.2);
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.dashboard-quick-gen p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.dashboard-quick-gen h3 {
    color: var(--text-main);
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.btn-generate-quick {
    background: var(--primary);
    color: #000;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-generate-quick:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(201,106,61,0.3);
}

/* ---- School Hub View ---- */
#school-hub-view {
    padding: 2rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeInUp 0.4s ease-out;
}

.hub-header {
    margin-bottom: 2rem;
}

.hub-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
}

.hub-header p {
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.school-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.1rem;
    padding: 0 1.5rem 2rem;
}

.school-hub-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 18px;
    padding: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    font-family: inherit;
    text-align: left;
}

.school-hub-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.15);
    border-color: var(--school-color, var(--primary));
}

.school-hub-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(45,122,120,0.1);
    border: 1px solid rgba(45,122,120,0.22);
    flex-shrink: 0;
}

.school-hub-card h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
    line-height: 1.2;
}

.school-hub-card p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
    flex-grow: 1;
}

.school-hub-badge {
    font-size: 0.72rem;
    padding: 3px 9px;
    border-radius: 8px;
    background: rgba(201,106,61,.08);
    border: 1px solid rgba(201,106,61,.2);
    color: var(--primary, #c96a3d);
    width: fit-content;
    font-weight: 700;
    margin-top: 0.15rem;
}

/* Back button in profile views */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.45rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
    margin-bottom: 1.5rem;
}

.back-btn:hover {
    background: var(--surface);
    color: var(--primary);
    border-color: rgba(0,255,204,0.3);
}

/* ---- Teacher Hub Redesign ---- */
.teacher-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.teacher-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    padding-left: 2px;
}

.teacher-section-block {
    margin-bottom: 2rem;
}

.teacher-tool-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    transition: var(--transition);
    font-family: inherit;
    text-align: left;
    width: 100%;
}

.teacher-tool-card:hover {
    border-color: rgba(0,255,204,0.4);
    background: rgba(0,255,204,0.05);
    transform: translateX(3px);
}

.teacher-tool-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.teacher-tool-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.teacher-tool-sub {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 1px;
}

/* ---- CSL Lab Compact Tool Grid ---- */
.csl-compact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.csl-compact-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.csl-compact-card:hover {
    border-color: rgba(0,255,204,0.3);
    box-shadow: 0 0 20px rgba(0,255,204,0.07);
}

.csl-compact-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.csl-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--primary);
    font-family: monospace;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0,255,204,0.15);
    padding-bottom: 0.4rem;
}

/* ---- General Page Layout ---- */
.page-view {
    padding: 2rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeInUp 0.4s ease-out;
    overflow-x: hidden;
}

/* Centered container helper — use this wrapper inside any view */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Prevent horizontal scroll globally */
#app-container {
    overflow-x: hidden;
    width: 100%;
}

/* All views: vertical scroll only */
main[id$="-view"],
main.page-view,
main.archive-layout {
    overflow-x: hidden;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   INLINE VIZ-ENGINE EMBED WIDGET
   Used by archive cards and game modal to show live animation.
   Sprint 1: Atelier Kommune palette — terracotta/teal, no sci-fi neon.
================================================================ */
.viz-embed {
    position: relative;
    width: 100%;
    border-radius: var(--radius-md, 14px);
    overflow: hidden;
    background: linear-gradient(160deg, #1a2e2e 0%, #0f1c1c 100%);
    border: 1.5px solid rgba(45,122,120,0.28);
    min-height: 220px;
}

.viz-embed iframe {
    width: 100%;
    height: var(--viz-embed-height, 360px);
    border: none;
    display: block;
    position: relative;
    z-index: 1;
}

.viz-embed-status {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    align-content: end;
    gap: 0.35rem;
    padding: 1.1rem;
    background: linear-gradient(180deg, transparent 30%, rgba(10,22,22,0.88) 100%);
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.viz-embed.is-ready .viz-embed-status {
    opacity: 0;
}

.viz-embed.is-error .viz-embed-status {
    opacity: 1;
}

.viz-embed-status-kicker {
    display: inline-flex;
    width: fit-content;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(45,122,120,0.4);
    background: rgba(45,122,120,0.15);
    color: rgba(167,220,218,0.9);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.viz-embed-status-title {
    color: #f0faf9;
    font-size: 0.95rem;
    font-weight: 800;
}

.viz-embed-status-text {
    margin: 0;
    max-width: 36ch;
    color: rgba(214,237,236,0.72);
    font-size: 0.8rem;
    line-height: 1.55;
}

.viz-embed-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10,20,20,0.65);
    cursor: pointer;
    transition: opacity 0.3s;
}

.viz-embed-overlay:hover { opacity: 0.82; }

.viz-play-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(201,106,61,0.14);
    border: 2px solid rgba(201,106,61,0.5);
    color: #e07a4a;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    transition: transform 0.2s, background 0.2s;
    font-family: inherit;
    cursor: pointer;
}

.viz-play-btn:hover { transform: scale(1.1); background: rgba(201,106,61,0.24); }

.viz-embed-label {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 4;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: rgba(167,220,218,0.6);
    font-family: monospace;
}

.viz-embed.is-modal {
    border-radius: 16px;
    border-color: rgba(45,122,120,0.36);
    box-shadow: 0 12px 32px rgba(0,0,0,0.22);
}

/* Unavailable state — when visual_profile is set but not supported in current sprint */
/* Visual Engine radar in the archive */
.archive-visual-radar {
    display: grid;
    gap: 1rem;
    margin: 1rem 0 1.15rem;
    padding: 1rem;
    border: 1px solid rgba(45,122,120,0.22);
    border-radius: 12px;
    background:
        linear-gradient(135deg, rgba(45,122,120,0.12), rgba(201,106,61,0.08)),
        rgba(12,22,22,0.72);
}

.archive-visual-radar-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.archive-visual-radar-head h2 {
    margin: 0.15rem 0 0;
    font-size: 1.25rem;
    letter-spacing: 0;
}

.archive-visual-action,
.archive-visual-chip,
.archive-visual-candidate {
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
    font-family: inherit;
    cursor: pointer;
}

.archive-visual-action {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    font-weight: 800;
    color: #f2c85d;
    border-color: rgba(242,200,93,0.28);
    background: rgba(242,200,93,0.1);
}

.archive-visual-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
}

.archive-visual-stat {
    min-width: 0;
    padding: 0.85rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.055);
}

.archive-visual-stat span,
.archive-visual-panel h3 {
    display: block;
    margin: 0 0 0.3rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.archive-visual-stat strong {
    display: block;
    font-size: 1.35rem;
    line-height: 1.1;
    color: var(--text-primary);
}

.archive-visual-stat p {
    margin: 0.35rem 0 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.45;
}

.archive-visual-radar-body {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 0.8rem;
}

.archive-visual-panel {
    min-width: 0;
}

.archive-visual-chip-row,
.archive-visual-candidate-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.archive-visual-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 34px;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    font-weight: 800;
}

.archive-visual-chip.is-supported {
    border-color: rgba(45,122,120,0.34);
    background: rgba(45,122,120,0.18);
}

.archive-visual-chip strong {
    color: #f2c85d;
}

.archive-visual-candidate-list {
    flex-direction: column;
}

.archive-visual-candidate {
    width: 100%;
    display: grid;
    gap: 0.2rem;
    text-align: left;
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
}

.archive-visual-candidate:hover,
.archive-visual-chip:hover,
.archive-visual-action:hover {
    border-color: rgba(201,106,61,0.42);
    background: rgba(201,106,61,0.12);
}

.archive-visual-candidate-title {
    color: var(--text-primary);
    font-weight: 850;
}

.archive-visual-candidate span:last-child,
.archive-visual-empty {
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.4;
}

.viz-embed.is-unavailable {
    background: linear-gradient(160deg, #1a1a1a 0%, #111 100%);
    border-color: rgba(255,255,255,0.06);
    min-height: 160px;
}

.viz-embed-unavailable {
    display: grid;
    gap: 0.4rem;
    padding: 1.5rem;
    align-content: start;
}

.viz-embed-unavailable-kicker {
    display: block;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(156,163,175,0.5);
    margin-bottom: 0.1rem;
}

.viz-embed-unavailable-title {
    color: rgba(240,240,240,0.7);
    font-size: 0.88rem;
    font-weight: 700;
}

.viz-embed-unavailable-text {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.5;
    color: rgba(156,163,175,0.55);
}

.viz-embed-unavailable-text em {
    font-style: normal;
    color: rgba(215,169,40,0.7);
}

/* ================================================================
   GAME MODAL — Visual Panel (Sprint 1)
   Always-visible section with clear product states.
================================================================ */
.game-modal-visual-panel {
    padding: 0;
    border: 1.5px solid var(--border-color, rgba(255,255,255,0.08));
    border-radius: 16px;
    overflow: hidden;
}

.game-modal-visual-panel.is-preview-ready {
    border-color: rgba(45,122,120,0.3);
}

.game-modal-visual-panel.is-unavailable {
    border-color: rgba(255,255,255,0.07);
}

.game-modal-visual-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.2rem 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.game-modal-visual-panel-kicker {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary, #c96a3d);
    margin-bottom: 0.25rem;
}

.game-modal-visual-panel-title {
    font-size: 1rem;
    font-weight: 800;
    margin: 0 0 0.35rem;
    color: var(--text-primary, #f0f0f0);
}

.game-modal-visual-panel-intro {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-secondary, #9ca3af);
}

.game-modal-visual-stage-badge {
    flex-shrink: 0;
    display: inline-block;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1.5px solid rgba(255,255,255,0.12);
    color: var(--text-secondary, #9ca3af);
    white-space: nowrap;
    align-self: flex-start;
    margin-top: 0.2rem;
}

.game-modal-visual-stage-badge.is-ready {
    border-color: rgba(45,122,120,0.4);
    color: #5dc8c4;
    background: rgba(45,122,120,0.1);
}

.game-modal-visual-stage-badge.is-progress {
    border-color: rgba(215,169,40,0.4);
    color: #d7a928;
    background: rgba(215,169,40,0.08);
}

.game-modal-visual-slot-wrap {
    position: relative;
}

.game-modal-visual-slot-wrap.is-empty {
    padding: 0;
}

.game-modal-visual-slot {
    width: 100%;
}

.game-modal-animation-brief {
    display: grid;
    gap: 0.7rem;
    margin: 0.85rem 1rem 0;
    padding: 0.85rem;
    border-radius: 10px;
    border: 1px solid rgba(242,200,93,0.16);
    background: rgba(242,200,93,0.07);
}

.game-modal-animation-brief-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.game-modal-animation-brief-head span,
.game-modal-animation-brief-stat span {
    color: var(--text-muted, #9ca3af);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.game-modal-animation-brief-head strong {
    color: #f2c85d;
    font-size: 0.86rem;
}

.game-modal-animation-brief-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
}

.game-modal-animation-brief-stat {
    min-width: 0;
    padding: 0.55rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
}

.game-modal-animation-brief-stat strong {
    display: block;
    margin-top: 0.18rem;
    color: var(--text-primary, #f0f0f0);
    font-size: 0.85rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.game-modal-animation-flow {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.game-modal-animation-flow span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0.2rem 0.48rem;
    border-radius: 999px;
    border: 1px solid rgba(45,122,120,0.2);
    background: rgba(45,122,120,0.12);
    color: var(--text-secondary, #9ca3af);
    font-size: 0.72rem;
    line-height: 1.25;
}

/* Scene Preview SVG */
.scene-preview-svg {
    display: block;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    border-radius: 12px;
}

.game-modal-visual-slot .scene-preview-svg {
    padding: 0.5rem;
}

/* Scene-preview animations */
.scene-preview-svg .sp-zone {
    animation: sp-zone-draw 1.2s ease-out both;
}
.scene-preview-svg .sp-role-circle {
    animation: sp-role-in 0.6s ease-out both;
    transform-origin: center;
}
.scene-preview-svg .sp-role-circle:hover {
    filter: brightness(1.2);
    cursor: default;
}
.scene-preview-svg .sp-pos-dot {
    animation: sp-dot-in 0.4s ease-out both;
}
.scene-preview-svg .sp-leader-badge {
    animation: sp-leader-pulse 2.5s ease-in-out infinite;
}
.scene-preview-svg .sp-mat-icon {
    animation: sp-mat-in 0.5s ease-out both;
}

@keyframes sp-zone-draw {
    from { stroke-dashoffset: 600; opacity: 0.3; }
    to   { stroke-dashoffset: 0;   opacity: 1; }
}
@keyframes sp-role-in {
    from { r: 0; opacity: 0; }
    to   { r: 16; opacity: 1; }
}
@keyframes sp-dot-in {
    from { opacity: 0; transform: scale(0); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes sp-leader-pulse {
    0%, 100% { opacity: 0.85; }
    50%      { opacity: 1; }
}
@keyframes sp-mat-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Stagger delays for roles */
.scene-preview-svg .sp-role-circle:nth-child(1) { animation-delay: 0.3s; }
.scene-preview-svg .sp-role-circle:nth-child(2) { animation-delay: 0.45s; }
.scene-preview-svg .sp-role-circle:nth-child(3) { animation-delay: 0.6s; }
.scene-preview-svg .sp-role-circle:nth-child(4) { animation-delay: 0.75s; }

/* Stagger delays for position dots */
.scene-preview-svg .sp-pos-dot:nth-child(1) { animation-delay: 0.5s; }
.scene-preview-svg .sp-pos-dot:nth-child(2) { animation-delay: 0.6s; }
.scene-preview-svg .sp-pos-dot:nth-child(3) { animation-delay: 0.7s; }
.scene-preview-svg .sp-pos-dot:nth-child(4) { animation-delay: 0.8s; }
.scene-preview-svg .sp-pos-dot:nth-child(5) { animation-delay: 0.9s; }
.scene-preview-svg .sp-pos-dot:nth-child(6) { animation-delay: 1.0s; }

/* Light theme adjustments */
[data-theme="light"] .scene-preview-svg .sp-zone {
    animation-name: sp-zone-draw-light;
}
@keyframes sp-zone-draw-light {
    from { stroke-dashoffset: 600; opacity: 0.4; }
    to   { stroke-dashoffset: 0;   opacity: 1; }
}

/* Print: disable animations */
@media print {
    .scene-preview-svg .sp-zone,
    .scene-preview-svg .sp-role-circle,
    .scene-preview-svg .sp-pos-dot,
    .scene-preview-svg .sp-leader-badge,
    .scene-preview-svg .sp-mat-icon {
        animation: none !important;
    }
}

/* Visual trin collapsible */
.game-modal-visual-sequence-collapsible {
    border-top: 1px solid rgba(255,255,255,0.06);
}

.game-modal-visual-sequence-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.2rem;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-secondary, #9ca3af);
    user-select: none;
    list-style: none;
}

.game-modal-visual-sequence-summary::-webkit-details-marker { display: none; }
.game-modal-visual-sequence-summary::marker { display: none; }

.game-modal-visual-sequence-count {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    background: rgba(45,122,120,0.12);
    color: #5dc8c4;
    border: 1px solid rgba(45,122,120,0.24);
}

.game-modal-visual-sequence-panel {
    padding: 0.75rem 1.2rem 1rem;
}

/* Visual guide — roles, area, start, stop overview */
.game-modal-visual-guide {
    margin: 0.75rem 0 0;
    padding: 0.75rem 1rem;
    background: rgba(26,46,46,0.35);
    border-radius: 8px;
    border: 1px solid rgba(45,122,120,0.18);
}
.game-modal-visual-guide-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--primary, #2d7a78);
    margin: 0 0 0.6rem;
    font-weight: 700;
}
.game-modal-visual-guide-item {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.game-modal-visual-guide-item:last-child {
    border-bottom: none;
}
.game-modal-visual-guide-label {
    flex-shrink: 0;
    width: 7rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary, #9ca3af);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-top: 0.15rem;
}
.game-modal-visual-guide-value {
    flex: 1;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-primary, #e5e7eb);
    margin: 0;
}
.game-modal-visual-guide-chip {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    margin: 0.1rem 0.25rem 0.1rem 0;
    background: rgba(0,255,204,0.1);
    border: 1px solid rgba(0,255,204,0.2);
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--accent, #0fc);
    white-space: nowrap;
}

/* ================================================================
   GAME CARDS in archive — must open modal, not page
================================================================ */
.game-card {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    min-width: 0;
    overflow: hidden;
}
.game-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    border-color: rgba(0,255,204,0.3);
}
.game-card-header {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: flex-start;
    min-width: 0;
}
.game-card-title-stack {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
    flex: 1;
}
.game-card-header h3 {
    margin: 0;
    overflow-wrap: anywhere;
}
.game-card-subject {
    font-size: 0.62rem;
    color: var(--primary);
    font-family: monospace;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.game-card-pitch {
    margin: 0.55rem 0 0;
    color: var(--text-secondary, #9ca3af);
    line-height: 1.55;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
}
.game-card-age {
    background: rgba(255,255,255,0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    #dashboard-view.dashboard-home {
        padding: 1.25rem 0.9rem 2.5rem;
    }
    #dashboard-view.dashboard-home .dashboard-hero-panel,
    #dashboard-view.dashboard-home .dashboard-section {
        border-radius: 22px;
    }
    #dashboard-view.dashboard-home .dashboard-hero-panel,
    #dashboard-view.dashboard-home .dashboard-section {
        padding: 1.2rem;
    }
    #dashboard-view.dashboard-home .dashboard-header h1 {
        font-size: 2.45rem;
        max-width: 9ch;
    }
    #dashboard-view.dashboard-home .dashboard-primary-grid,
    #dashboard-view.dashboard-home .dashboard-value-grid,
    #dashboard-view.dashboard-home .module-grid {
        grid-template-columns: 1fr;
    }
    #dashboard-view.dashboard-home .dashboard-hero-side {
        padding: 1rem;
    }
    .module-grid {
        grid-template-columns: 1fr 1fr;
    }
    .top-nav-links {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-shrink: 1;
        min-width: 0;
    }
    .top-nav-links::-webkit-scrollbar { display: none; }
    .module-card {
        min-height: 64px;
        padding: 1rem;
    }
    .dashboard-header h1 {
        font-size: 1.8rem;
    }
    .viz-embed iframe {
        height: 200px;
    }
    .archive-visual-radar {
        padding: 0.85rem;
    }
    .archive-visual-radar-head,
    .archive-visual-radar-body,
    .archive-visual-stat-grid {
        display: grid;
        grid-template-columns: 1fr;
    }
    .archive-visual-action {
        width: 100%;
    }
    .game-modal-animation-brief-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .game-modal-animation-brief-head {
        align-items: flex-start;
        flex-direction: column;
    }
    /* Item 13 — all card grids stack vertically on mobile */
    .games-grid,
    .archive-grid,
    .school-cards-grid,
    .teacher-hub-grid,
    .csl-compact-grid {
        grid-template-columns: 1fr !important;
    }
    .module-grid {
        grid-template-columns: 1fr 1fr;
    }
    /* No horizontal scroll on small screens */
    * {
        max-width: 100%;
        box-sizing: border-box;
    }
}

@media (min-width: 641px) and (max-width: 980px) {
    #dashboard-view.dashboard-home .dashboard-hero-panel,
    #dashboard-view.dashboard-home .dashboard-primary-grid,
    #dashboard-view.dashboard-home .dashboard-value-grid,
    #dashboard-view.dashboard-home .module-grid {
        grid-template-columns: 1fr;
    }

    #dashboard-view.dashboard-home .dashboard-hero-panel {
        padding: 1.6rem;
    }
}

/* ================================================================
   ITEM 4 — GENERATED GAME CARD
   Generated results must NOT be full-width text blocks.
   They render in a centered card with max-width 720px.
================================================================ */
.generated-game-card {
    max-width: 720px;
    margin: 2rem auto;
    padding: 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    animation: fadeInUp 0.4s ease-out;
    overflow-x: hidden;
}

.generated-game-card .result-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.generated-game-card .result-pitch {
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
}

/* result-container wraps the generated card */
#result-container {
    max-width: 720px;
    margin: 0 auto;
}

/* ================================================================
   ITEM 7 — UGEPLAN SIDEBAR SLIDE ANIMATION
================================================================ */
.ugeplan-sidebar {
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Panel must not cover top nav (z-index < nav) */
.ugeplan-sidebar {
    z-index: 450;   /* nav is z-index 500 */
}

/* ================================================================
   ITEM 6 — WEEK PLAN FAB: only show when weekPlan.length > 0
   (JS handles display:none/flex — CSS just sets the base state)
================================================================ */
#toggle-ugeplan-btn {
    display: none; /* hidden by default; JS shows it when ugeplan.length > 0 */
}

/* ================================================================
   ITEM 10 — PRINT STYLESHEET
   Hides nav; shows only week plan on A4.
================================================================ */
@media print {
    /* Hide everything except the week plan */
    .top-nav,
    #app-container > *:not(#ugeplan-sidebar):not(.ugeplan-sidebar),
    .blob-bg,
    .particles,
    #toggle-ugeplan-btn,
    .floating-action-btn,
    #system-status-meme,
    #game-modal,
    #schools-modal,
    .btn-primary,
    .btn-secondary,
    .ugeplan-footer,
    .ugeplan-header button {
        display: none !important;
    }

    /* Force sidebar open for print */
    .ugeplan-sidebar {
        position: static !important;
        right: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        border: none !important;
        box-shadow: none !important;
        background: #fff !important;
        color: #000 !important;
        display: block !important;
    }

    .ugeplan-item {
        border: 1px solid #ddd;
        border-radius: 4px;
        padding: 8px 12px;
        margin-bottom: 6px;
        break-inside: avoid;
        color: #000;
    }

    body {
        background: #fff !important;
        color: #000 !important;
    }

    /* A4 friendly */
    @page {
        size: A4 portrait;
        margin: 20mm;
    }
}

