:root { --site-header-height: 80px; }
html { scroll-padding-top: calc(var(--site-header-height) + 16px); }
body.site-page { padding-top: var(--site-header-height); }
body.site-page-agenda main { padding-top: 0; }
body.site-page-member .auth-screen { min-height: calc(100vh - var(--site-header-height)); }
body.site-page-certificate { padding-top: calc(var(--site-header-height) + 24px); }
#site-header {
    --site-ink: #201714;
    --site-panel: #fff6e8;
    position: fixed; inset: 0 0 auto; z-index: 1000;
    height: var(--site-header-height);
    box-sizing: border-box;
    border-bottom: 2px solid #e65316;
    box-shadow: 0 4px 18px #2017140d;
    background: linear-gradient(105deg, #f6efe7 0%, #f1e8df 50%, #e7dad1 100%);
    color: var(--site-ink); font-family: Inter, sans-serif;
}
#site-header *, #site-header *::before, #site-header *::after { box-sizing: border-box; }
#site-header [hidden] { display: none !important; }
#site-header a { text-decoration: none; }
#site-header button, #site-header select { cursor: pointer; }
#site-header :focus-visible { outline: 2px solid #c45b2b; outline-offset: 4px; }
.site-menu { display: flex; align-items: center; justify-content: space-between; gap: 28px; height: 100%; padding: 0 28px; }
.site-mobile-menu { display: none; }
.site-menu-brand { display: block; width: 280px; aspect-ratio: 163 / 35; flex: 0 0 auto; }
.site-menu-brand img { display: block; width: 100%; height: auto; }
.site-menu-links { display: flex; align-items: center; justify-content: center; gap: 40px; flex: 1; margin: 0; padding: 0; list-style: none; }
.site-menu-item { position: relative; }
.site-menu-link { position: relative; display: inline-flex; align-items: center; min-height: 44px; color: var(--site-ink); font: italic 700 18px/1.2 'Roboto Condensed', 'Arial Narrow', sans-serif; text-transform: uppercase; white-space: nowrap; letter-spacing: 0; }
.site-menu-link:hover { color: #c45b2b; }
.site-menu-link::after { content: ''; position: absolute; left: 0; bottom: 2px; width: 24px; height: 3px; background: #e65316; transform: skewX(-25deg) scaleX(0); transform-origin: left; transition: transform 160ms ease; }
.site-menu-link:hover::after, .site-menu-link:focus-visible::after, .site-menu-item:focus-within > .site-menu-link::after { transform: skewX(-25deg) scaleX(1); }
.site-menu-dropdown { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); width: 300px; padding: 16px; border: 1px solid #c97e5555; border-radius: 8px; background: var(--site-panel); box-shadow: 0 18px 48px #402a1c26; visibility: hidden; opacity: 0; }
.site-menu-item:hover .site-menu-dropdown, .site-menu-item:focus-within .site-menu-dropdown { visibility: visible; opacity: 1; }
.site-menu-dropdown a { display: block; padding: 12px; color: var(--site-ink); font-size: 13px; line-height: 1.4; border-radius: 4px; }
.site-menu-dropdown a:hover, .site-menu-dropdown a:focus-visible { background: #d47e4e1a; }
.site-menu-tools { display: flex; align-items: center; gap: 18px; flex: 0 0 auto; }
.site-language-wrap { position: relative; flex: 0 0 auto; }
.site-language-wrap::after { content: ''; position: absolute; right: 9px; top: 50%; border: 4px solid transparent; border-top: 5px solid currentColor; transform: translateY(-25%); pointer-events: none; }
#site-header .site-language { appearance: none; min-width: 58px; height: 40px; margin: 0; padding: 0 24px 0 9px; border: 1px solid transparent; border-radius: 2px; background: transparent; color: var(--site-ink); font: 700 17px/1 'Roboto Condensed', 'Arial Narrow', sans-serif; letter-spacing: 0; }
.site-language option { background: var(--site-panel); color: var(--site-ink); }
.site-professional { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border: 1px solid #c6430d; border-radius: 2px; background: #c6430d; color: #fff; font: italic 700 17px/1.2 'Roboto Condensed', 'Arial Narrow', sans-serif; letter-spacing: 0; text-transform: uppercase; white-space: nowrap; }
.site-professional:hover { border-color: #a93408; background: #a93408; }
.site-account-link:not([hidden]) ~ .site-professional, #site-header.has-member-controls .site-professional { display: none; }
#site-header .site-account-link { max-width: 230px; }
.site-accessibility { position: relative; flex: 0 0 auto; }
.site-accessibility-toggle { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 2px solid #ffffffcc; border-radius: 50%; background: #211f1b; color: #fff; box-shadow: 0 0 0 1px #211f1b26; }
.site-accessibility-toggle svg { width: 30px; height: 30px; }
.site-accessibility-panel { position: absolute; top: calc(100% + 18px); right: 0; width: 280px; max-width: calc(100vw - 28px); padding: 10px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; border: 1px solid #c97e5555; border-radius: 8px; background: var(--site-panel); box-shadow: 0 24px 70px #43271d38; }
.site-accessibility-label { grid-column: 1 / -1; padding: 4px; font-size: 10px; font-weight: 800; line-height: 1.5; text-transform: uppercase; letter-spacing: 0; }
.site-accessibility-panel button, .site-accessibility-panel a { display: flex; align-items: center; justify-content: center; min-height: 44px; margin: 0; padding: 8px; border: 1px solid #a85d3252; border-radius: 4px; background: transparent; color: var(--site-ink); font: 700 11px/1.4 Inter, sans-serif; text-align: center; letter-spacing: 0; }
.site-accessibility-panel svg { width: 18px; height: 18px; }
.site-accessibility-panel [aria-pressed='true'] { background: #d47e4e33; }
#site-header .topbar { position: static; inset: auto; display: flex; min-height: 0; gap: 8px; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; backdrop-filter: none; }
#site-header .topbar-actions { gap: 0; }
#site-header .user-chip { max-width: 230px; }
.site-page-member .sidebar { top: calc(var(--site-header-height) + 24px); }
html[data-theme='dark'] #site-header { --site-ink: #f7efe5; --site-panel: #171310; background: #050505; }
html[data-theme='dark'] .site-professional { color: #fff; }
html[data-theme='dark'] .site-page-certificate, html[data-theme='dark'] .site-page-member { --bg: #101010; --bg-soft: #181818; --surface: #211d19; --ink: #f7efe5; --ink-soft: #e0d3c7; --muted: #cbb8a5; --text: #f7efe5; --text-muted: #cbb8a5; --line: #ffffff33; --border: #ffffff33; background: #101010; }
html[data-theme='dark'] .site-page-member :is(.login-panel,.access-panel,.panel,.sidebar,.lesson-card,.course-card,.event-card,.modal-card) { background: var(--surface); }
html.site-high-contrast body.site-page { --bg: #000; --surface: #000; --text: #fff; --text-muted: #fff; --ink: #fff; --ink-soft: #fff; --muted: #fff; --border: #fff; --line: #fff; color: #fff; background: #000; }
html.site-high-contrast .site-page :is(main,section,aside,article,.panel,.card,.modal-card) { background: #000 !important; color: #fff !important; border-color: #fff !important; }
html.site-high-contrast #site-header { --site-ink: #fff; --site-panel: #000; background: #000; }
html.site-high-contrast .site-professional { background: #000; border-color: #fff; }
html.site-high-contrast .site-page :is(p,h1,h2,h3,h4,a,label,button,input,select,textarea) { color: #fff !important; }
html.site-high-contrast .site-page :is(button,input,select,textarea) { background: #000 !important; border-color: #fff !important; }
html.site-reduce-motion *, html.site-reduce-motion *::before, html.site-reduce-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html[data-font-scale='large'] .site-page :is(main,.content) p { font-size: 19px; }
html[data-font-scale='larger'] .site-page :is(main,.content) p { font-size: 21px; }
@media (min-width: 981px) and (max-width: 1200px) {
    :root { --site-header-height: 76px; }
    .site-menu { gap: 20px; padding: 0 24px; }
    .site-menu-brand { width: 250px; }
    .site-menu-links { gap: 20px; }
    .site-menu-link, #site-header .site-language { font-size: 17px; }
    .site-menu-tools { gap: 14px; }
    .site-professional { min-height: 44px; padding: 0 14px; font-size: 16px; }
    .site-accessibility-toggle { width: 44px; height: 44px; }
}
@media (max-width: 980px) {
    :root { --site-header-height: 64px; }
    body.site-page { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
    body.site-page-member:has(#site-header.has-member-controls) { padding-bottom: 0; }
    .site-mobile-menu { position: fixed; inset: auto 0 0; display: flex; min-height: 64px; padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid #c97e5533; background: var(--site-panel); }
    .site-mobile-menu a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; flex: 1; min-width: 0; color: var(--site-ink); }
    .site-mobile-menu span { font-size: 20px; line-height: 1; }
    .site-mobile-menu small { font-size: 8px; font-weight: 600; line-height: 1.4; text-transform: uppercase; letter-spacing: 0; }
    #site-header.has-member-controls .site-mobile-menu { display: none; }
    .site-menu { gap: 10px; padding: 0 12px; }
    .site-menu-brand { width: 240px; }
    .site-menu-links, .site-professional { display: none; }
    .site-menu-tools { gap: 8px; }
    #site-header .site-language { min-width: 54px; }
    .site-accessibility-toggle { width: 44px; height: 44px; }
    .site-accessibility-toggle svg { width: 30px; height: 30px; }
    .site-page-member .sidebar { top: calc(var(--site-header-height) + 8px); }
    .site-page-member .mobile-menu-backdrop { top: var(--site-header-height); }
    #site-header .account-dropdown { top: calc(var(--site-header-height) + 8px); }
}
@media (max-width: 640px) {
    .site-menu-brand { width: 220px; }
    #site-header.has-member-controls .site-menu-brand, #site-header:has(.site-account-link:not([hidden])) .site-menu-brand { width: 160px; }
    #site-header .user-meta, #site-header .nav-user-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    #site-header .account-chevron { display: none; }
    #site-header .user-chip, #site-header .site-account-link { width: 40px; height: 40px; min-height: 40px; padding: 3px; gap: 0; }
    #site-header .avatar, #site-header .nav-user-avatar { width: 30px; height: 30px; }
}
@media (max-width: 420px) {
    .site-menu { gap: 8px; padding: 0 10px; }
    .site-menu-brand { width: 170px; }
    #site-header.has-member-controls .site-menu-brand { width: 100px; }
    #site-header:has(.site-account-link:not([hidden])) .site-menu-brand { width: 120px; }
    .site-menu-tools { gap: 6px; }
    #site-header .site-language { min-width: 50px; font-size: 17px; }
    .site-accessibility-toggle { width: 40px; height: 40px; }
    #site-header .topbar { gap: 4px; }
    #site-header .mobile-menu-toggle { width: 34px; height: 36px; min-width: 34px; }
    #site-header .user-chip { width: 36px; height: 36px; }
}
