html[data-ui-site="admin"] { --app-footer-space: 0px; }
@media screen {
    html[data-ui-site="admin"][data-ui-theme="light"],
    html[data-ui-theme="light"] body[data-app-chrome="landing"] :is(.app-header, .app-footer) {
        --ui-bg: #f5f5f3; --ui-panel: #ffffff; --ui-raised: #eceef0;
        --ui-text: #252b33; --ui-muted: #5f6670; --ui-border: #c5c9cf;
        --ui-wash: #a8793009; --ui-info: #8e601f; --ui-teal: #8e601f;
        --ui-warning: #8e601f; --ui-soft-info: #f3eadc; --ui-soft-teal: #f3eadc;
        --ui-soft-warning: #f7eddc;
    }
    html[data-ui-site="admin"][data-ui-theme="dark"],
    html[data-ui-theme="dark"] body[data-app-chrome="landing"] :is(.app-header, .app-footer) {
        --ui-bg: #101214; --ui-panel: #1b1e22; --ui-raised: #22262b;
        --ui-text: #e9edf0; --ui-muted: #aeb5bf; --ui-border: #3e444d;
        --ui-wash: #d5a55508; --ui-info: #d5a555; --ui-teal: #d5a555;
        --ui-warning: #d5b27a; --ui-soft-info: #30291f; --ui-soft-teal: #30291f;
        --ui-soft-warning: #352c20;
    }
    html[data-ui-site="admin"] { --ice: var(--ui-teal); --amber: var(--ui-warning); }
    html[data-ui-theme] body[data-app-chrome="landing"] :is(.app-header, .app-footer) {
        --app-brand-from: #b45309; --app-brand-to: #fbbf24;
        background: var(--ui-panel); color: var(--ui-text);
    }
    html[data-ui-theme] body[data-app-chrome="landing"] .app-header { box-shadow: none; }
    html[data-ui-theme] body[data-app-chrome="landing"] .app-header .nav-dropdown-menu {
        background: var(--ui-panel);
    }
    html[data-ui-site="admin"][data-ui-theme] :is(input[type="checkbox"], input[type="radio"]) {
        accent-color: var(--ui-teal);
    }
}
/* Shared application chrome. Opt-in only: ELTventure and exported documents keep their own layout. */
html body[data-app-chrome] {
    --app-header-height: 56px;
    --app-footer-height: 58px;
    --app-brand-from: #0e7490;
    --app-brand-to: #22d3ee;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    padding: 0 0 var(--app-footer-space, 58px);
    box-sizing: border-box;
}
html:has(body[data-app-chrome]) { scroll-padding-bottom: var(--app-footer-space, 58px); }
html body[data-app-chrome] > main,
html body[data-app-chrome] > .app-page { flex: 1 0 auto; }
html body[data-app-chrome="landing"] {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: min-content min-content min-content auto min-content;
}
html body[data-app-chrome="landing"] .slider { justify-self: center; max-width: 100%; }
html[data-ui-site="score"] body[data-app-chrome] > main {
    width: calc(100% - 32px);
    box-sizing: border-box;
    margin: 24px auto;
}
html body[data-app-chrome] > :is(.me-page-wrapper, .career-shell) {
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
    min-height: 0;
}
html body[data-app-chrome] :is(.app-header, .app-footer) {
    box-sizing: border-box;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--ui-text, #edf3f8);
    background: var(--ui-panel, #182532);
    width: 100%;
    max-width: none;
    border-radius: 0;
    box-shadow: none;
    flex-shrink: 0;
}
html body[data-app-chrome] .app-header {
    position: relative;
    top: 0;
    z-index: 100;
    display: block;
    min-height: var(--app-header-height);
    padding: 0;
    margin: 0;
    overflow: visible;
    border: 0;
    border-bottom: 1px solid var(--ui-border, #334655);
}
html body[data-app-chrome] .app-header-inner {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 20px;
    width: min(1400px, calc(100% - 40px));
    max-width: none;
    min-height: var(--app-header-height);
    height: auto;
    margin: 0 auto;
    padding: 8px 0;
}
html body[data-app-chrome] .app-brand {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    gap: 10px;
    min-width: 0;
    margin: 0;
    padding: 0;
    color: var(--ui-text, #edf3f8);
    text-decoration: none;
    border: 0;
    transform: none;
    letter-spacing: normal;
    line-height: 1.15;
    font: 700 16px/1.15 system-ui, -apple-system, "Segoe UI", sans-serif;
}
html body[data-app-chrome] .app-brand-mark {
    box-sizing: border-box;
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--app-brand-from), var(--app-brand-to));
    box-shadow: inset 0 1px 0 #ffffff35, 0 3px 12px #00000020;
    color: #fff;
    font: 800 17px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
    letter-spacing: -.12em;
    transform: none;
}
html body[data-app-chrome] .app-brand-mark svg { display: block; width: 23px; height: 23px; filter: drop-shadow(0 1px 1px #0002); }
html body[data-app-chrome] .app-brand-logo { display: block; flex: 0 0 38px; width: 38px; height: 38px; object-fit: contain; }
html[data-ui-theme="dark"] body[data-app-chrome] .app-brand-logo { filter: brightness(0) invert(.84); }
html[data-ui-theme] body[data-app-chrome="landing"] .app-brand-logo { filter: none; }
/* Keep the landing navigation above carousel captions and controls. */
html body[data-app-chrome="landing"] .app-header { z-index: 2000; }
html body[data-app-chrome] .admin-header-mark {
    position: relative; display: grid; place-items: center;
    flex: 0 0 44px; width: 44px; height: 44px; border: 0; border-radius: 50%;
}
html body[data-app-chrome] .admin-header-mark::before,
html body[data-app-chrome] .admin-header-mark::after {
    content: ""; position: absolute; inset: 0; border-radius: 50%;
    border: 1px dashed var(--header-accent, #9acbc5);
    opacity: .6; pointer-events: none; animation: admin-brand-spin 48s linear infinite;
}
html body[data-app-chrome] .admin-header-mark::after {
    inset: 5px; border-style: solid;
    border-color: transparent var(--ui-warning, #edb679);
    animation-duration: 36s; animation-direction: reverse;
}
html body[data-app-chrome] .admin-header-mark .app-brand-logo {
    width: 28px; height: 28px; animation: admin-brand-spin 70s linear infinite;
}
@keyframes admin-brand-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    html body[data-app-chrome] .admin-header-mark::before,
    html body[data-app-chrome] .admin-header-mark::after,
    html body[data-app-chrome] .admin-header-mark .app-brand-logo { animation: none; }
}
html body[data-app-chrome] .app-brand-copy { display: grid; text-align: left; line-height: 1.08; }
html body[data-app-chrome] .app-brand :is(strong, .logo-text) {
    display: block;
    margin: 0;
    color: inherit;
    font: 700 16px/1.15 system-ui, -apple-system, "Segoe UI", sans-serif;
    letter-spacing: -.02em;
}
html body[data-app-chrome] .app-brand small {
    display: block;
    margin-top: 3px;
    color: var(--ui-muted, #b4c4d3);
    font: 500 10px/1.2 system-ui, sans-serif;
    letter-spacing: .03em;
}
html body[data-app-chrome] .app-header :is(.profile-btn, .login-btn, .guide-button, .nav-group-toggle, .nav-home) {
    min-height: 36px;
    padding: 7px 12px;
    font-size: 13px;
    line-height: 20px;
}
html body[data-app-chrome] .app-header .visit-header-glow { display: none; }
html body[data-app-chrome] .app-header .visit-nav { flex-wrap: wrap; }
html body[data-app-chrome] .app-header :is(.visit-nav, .main-nav, .guide-nav) { gap: 8px 16px; }
html body[data-app-chrome] .app-header :is(.career-nav-inner, .visit-nav, .guide-nav, .header-inner > nav) > a {
    color: var(--ui-text, #edf3f8);
    font-size: 13px;
}
html body[data-app-chrome] .app-footer {
    position: fixed;
    inset: auto 0 0;
    z-index: 90;
    display: block;
    margin: 0;
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px));
    border: 0;
    border-top: 1px solid var(--ui-border, #334655);
    box-shadow: 0 -4px 20px #00000014;
    font-size: 12px;
    line-height: 1.4;
}
html body[data-app-chrome] .app-footer::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: linear-gradient(90deg, var(--app-brand-from), var(--app-brand-to)); }
html body[data-app-chrome] .app-footer-inner {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 8px 16px;
    width: calc(100% - 40px);
    min-height: 36px;
    margin: 0 auto;
}
html body[data-app-chrome] .app-home {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 7px;
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid var(--ui-border, #60758a);
    border-radius: 999px;
    background: var(--ui-raised, #243647);
    color: var(--ui-text, #edf3f8);
    font: 650 12px/1.4 system-ui, sans-serif;
    text-decoration: none;
    white-space: nowrap;
}
html body[data-app-chrome] .app-home img { width: 22px; height: 22px; object-fit: contain; }
html[data-ui-theme="dark"] body[data-app-chrome] .app-home img { filter: brightness(0) invert(.85); }
html body[data-app-chrome] .app-home:hover { background: var(--ui-panel, #182532); }
html body[data-app-chrome] .app-copyright { grid-column: 2; color: var(--ui-muted, #b4c4d3); text-align: center; white-space: nowrap; }
html body[data-app-chrome] .app-footer--home .app-footer-inner { grid-template-columns: minmax(0, 1fr); }
html body[data-app-chrome] .app-footer--home .app-copyright { grid-column: 1; justify-self: center; }
html body[data-app-chrome] .app-footer-extra { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 12px; color: var(--ui-muted, #b4c4d3); font-size: 11px; text-align: right; }
html body[data-app-chrome] .app-footer-extra a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
html body[data-app-chrome] :is(.app-home, .app-brand):focus-visible { outline: 2px solid var(--ui-info, #9fc5ff); outline-offset: 3px; }

/* Admin retains its central menu and live connection status in the compact bar. */
html body[data-app-chrome] .app-header-grid {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px 16px;
    padding: 8px 20px;
}
html body[data-app-chrome] .app-header-grid .admin-header-eyebrow { display: none; }
html body[data-app-chrome] .app-header-grid .admin-header-brand strong { font-size: 17px; }
html body[data-app-chrome] .app-header-grid .admin-header-status .clock strong { font-size: 16px; }
html body[data-app-chrome] .app-header-grid .admin-hub-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; border: 0; border-radius: 0; background: transparent; }

/* Let application content fill the space between the bars without overlays. */
html body[data-app-chrome] :is(.content.doga, .content.projekt9, .game-container, .login-wrapper, .trail-auth) { min-height: 0; }
html body[data-app-chrome] > :is(.game-container, .login-wrapper, .trail-auth, .leaderboard-screen, .admin-container) { flex: 1 0 auto; }
html body[data-app-chrome].doga-web-app { height: 100dvh; min-height: 0; overflow: hidden; }
html body[data-app-chrome].doga-web-app > .app-header,
html body[data-app-chrome].doga-web-app > .app-footer { display: block; }
html body[data-app-chrome].doga-web-app > .content.doga { flex: 1 1 0; min-height: 0; height: auto; }
html body[data-app-chrome].doga-web-app .doga-web-workspace { height: 100%; }
html body[data-app-chrome].doga-web-app .doga-web-workspace:fullscreen { height: 100dvh; }

/* The idea wall already has a four-row viewport layout. Its local footer holds live controls. */
html body[data-app-chrome].wall-page { height: 100dvh; min-height: 0; }
html body[data-app-chrome].wall-page .wall-shell { flex: 1; min-height: 0; height: auto; grid-template-rows: auto minmax(0, 1fr) auto; }
html body[data-app-chrome] .masthead.app-header { z-index: 5; }
html body[data-app-chrome] .app-header .icon-button { min-height: 36px; width: 36px; height: 36px; font-size: 20px; }
html body[data-app-chrome] .masthead .app-brand { white-space: nowrap; }
html body[data-app-chrome].error-page > main { width: min(100% - 32px, 800px); margin: 40px auto; }
html body[data-app-chrome].tour-app-active :is(.app-header, .app-footer) { display: none; }
html body[data-app-chrome].tour-app-active { padding-bottom: 0; }

/* A presentation stage fits between the bars; fullscreen on the stage still fills the screen. */
html body[data-app-chrome][data-preview-class] { height: 100dvh; min-height: 0; overflow: hidden; }
html body[data-app-chrome][data-preview-class] .stage-viewport { flex: 1; min-height: 0; height: auto; }
html body[data-app-chrome][data-preview-class] .preview-controls { position: relative; inset: auto; flex-wrap: wrap; flex-shrink: 0; padding: 8px; }
html body[data-app-chrome][data-preview-class] .preview-controls button { padding: 8px 12px; }
html body[data-app-chrome][data-preview-class] .app-footer { margin-top: 0; }
html body[data-app-chrome="workbench"] { min-width: 0; }
html body[data-app-chrome="workbench"] .workbench { min-height: 0; }

/* The open-day reader keeps its sidebar below the header. Presentation mode remains full screen. */
html[data-ui-site="nyiltnap"] body[data-app-chrome] > .app-header { position: sticky; }
html[data-ui-site="nyiltnap"] body[data-app-chrome] > .sidebar { top: 57px; }
html[data-ui-site="nyiltnap"] body[data-app-chrome] > .app-footer { z-index: 90; }
html[data-ui-site="nyiltnap"] body[data-app-chrome] > .mobile-menu { top: 8px; left: auto; right: 12px; z-index: 110; }
html[data-ui-site="nyiltnap"] body[data-app-chrome].presentation > :is(.app-header, .app-footer) { display: none; }
html[data-ui-site="nyiltnap"] body[data-app-chrome].presentation > .sidebar { top: 0; }
html[data-ui-site="nyiltnap"] body[data-app-chrome].presentation { padding-bottom: 0; }

@media (max-width: 1100px) {
    html body[data-app-chrome] .app-header-grid { grid-template-columns: minmax(0, 1fr) auto; }
    html body[data-app-chrome] .app-header-grid .admin-hub-nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
}
@media (max-width: 700px) {
    html body[data-app-chrome="workbench"] .workbench { grid-template-columns: minmax(0, 1fr); }
    html body[data-app-chrome] .app-header-inner { width: calc(100% - 24px); gap: 8px 12px; }
    html body[data-app-chrome] .app-header-grid { padding-inline: 12px; }
    html body[data-app-chrome] .app-footer-inner { width: calc(100% - 24px); grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
    html body[data-app-chrome] .app-footer-extra { grid-column: 1 / -1; justify-content: flex-start; text-align: left; }
    html body[data-app-chrome] .app-footer-extra:empty { display: none; }
    html body[data-app-chrome] .app-copyright { font-size: 11px; }
    html body[data-app-chrome] .app-header .practice-desktop-nav { display: none; }
    html body[data-app-chrome] .app-header .visit-brand-copy small { max-width: 230px; }
}
@media print {
    html body[data-app-chrome] { display: block; min-height: 0; padding-bottom: 0; }
    html body[data-app-chrome] :is(.app-header, .app-footer) { display: none !important; }
}
