html{--platform-header-height:72px}
.platform-shared-header-frame{position:sticky;top:0;z-index:30;min-height:var(--platform-header-height)}
.platform-shared-header-frame>the-bot-shared-header{display:block;min-height:var(--platform-header-height)}
.platform-header-fallback{box-sizing:border-box;position:absolute;inset:0;display:flex;align-items:center;gap:38px;height:var(--platform-header-height);padding:0 34px;background:var(--bot-surface,#fff);color:var(--bot-text,#393044);border-bottom:1px solid var(--bot-border,#e9e4ed);pointer-events:none}
.platform-header-brand{box-sizing:border-box;display:flex;align-items:center;flex-shrink:0;gap:10px;min-height:44px;color:inherit;text-decoration:none}
.platform-header-mark{display:block;position:relative;flex-shrink:0;width:40px;height:40px}
.platform-header-mark img{display:block;width:100%;height:100%;object-fit:contain}
.platform-header-wordmark{font-family:var(--font-oswald),Arial,sans-serif;font-size:27px;font-weight:700;letter-spacing:.025em;line-height:1.45}
.platform-header-controls{display:flex;gap:12px;margin-left:auto;align-items:center}
.platform-header-controls>span{width:44px;height:44px;display:block}
.platform-header-controls>.platform-header-avatar{width:34px;height:34px;margin:5px;border-radius:11px;background:var(--bot-accent-soft,#e9ddf8)}
.platform-shared-header-frame>the-bot-shared-header[data-shared-header-ready]+.platform-header-fallback{display:none}
@media(min-width:901px){.platform-shared-header-frame:has(>the-bot-shared-header[data-core-sidebar]) .platform-header-fallback{padding-left:0;gap:0}.platform-shared-header-frame:has(>the-bot-shared-header[data-core-sidebar]) .platform-header-brand{width:248px;padding:0 58px 0 20px;align-self:stretch;border-right:1px solid var(--bot-border,#e9e4ed)}.platform-shared-header-frame:has(>the-bot-shared-header[data-core-sidebar]) .platform-header-mark{height:48px}.platform-shared-header-frame:has(>the-bot-shared-header[data-core-sidebar]) .platform-header-mark img{position:absolute;width:64px;height:64px;max-width:none;left:50%;top:50%;transform:translate(-50%,-50%)}.platform-shared-header-frame:has(>the-bot-shared-header[data-core-sidebar="collapsed"]) .platform-header-brand{width:76px;padding:0 18px;gap:0}.platform-shared-header-frame:has(>the-bot-shared-header[data-core-sidebar="collapsed"]) .platform-header-wordmark{display:none}}
@media(max-width:900px){html{--platform-header-height:52px}.platform-header-fallback{padding:0 12px;gap:8px}.platform-header-brand{gap:6px}.platform-header-mark{width:28px;height:28px}.platform-header-wordmark{font-size:14px}.platform-shared-header-frame:has(>the-bot-shared-header[data-current-product]) .platform-header-brand{display:none}.platform-header-controls{gap:0}}
html[data-the-bot-theme="light"]{color-scheme:light;--bg:#f5f3f8;--surface:#fff;--surface-2:#f0edf4;--surface-3:#e7e3ec;--text:#17151a;--muted:#77717e;--line:#ddd8e3;--shadow:0 22px 60px #271f311a}
html[data-the-bot-theme="dark"]{color-scheme:dark;--bot-canvas:#141219;--bot-surface:#201c27;--bot-surface-soft:#282231;--bot-text:#eee8f5;--bot-text-muted:#b6aabd;--bot-border:#42364c;--bot-accent:#a783e3;--bot-accent-strong:#c4a4f4;--bot-accent-soft:#392b4b;--bot-neutral-soft:#302936;--bot-success:#78ce9d;--bot-success-soft:#1d382b;--bot-warning:#edb276;--bot-warning-soft:#41301d;--bot-danger:#f08b98;--bot-danger-soft:#46262e;--bg:#141219;--surface:#201c27;--surface-2:#282231;--surface-3:#362d40;--text:#eee8f5;--muted:#b6aabd;--line:#42364c;--shadow:0 24px 70px #0005;background:var(--bot-canvas);color:var(--bot-text)}
html[data-the-bot-theme="dark"] body{background:var(--bot-canvas);color:var(--bot-text)}
/* ADMIN has a compact standalone stylesheet; scope its hardcoded surfaces. */
html[data-the-bot-theme="dark"] body:has(the-bot-shared-header[data-current-product="admin"]) :is(main,.directory-card,input,select){background:var(--bot-surface);color:var(--bot-text);border-color:var(--bot-border)}
html[data-the-bot-theme="dark"] body:has(the-bot-shared-header[data-current-product="admin"]) :is(.eyebrow,.muted){color:var(--bot-text-muted)}
html[data-the-bot-theme="dark"] body:has(the-bot-shared-header[data-current-product="admin"]) :is(button.secondary,.account-state,.section-heading span){background:var(--bot-surface-soft);color:var(--bot-text)}
html[data-the-bot-theme="dark"] body:has(the-bot-shared-header[data-current-product="admin"]) a{color:var(--bot-accent-strong)}
html[data-the-bot-theme="dark"] .time-grid-event{background:color-mix(in srgb,var(--status-color,var(--bot-accent)) 20%,var(--bot-surface))}
html[data-the-bot-theme="dark"] .time-grid-event:hover{background:color-mix(in srgb,var(--status-color,var(--bot-accent)) 30%,var(--bot-surface))}
/* CORE sidebar uses a white translucent surface outside its color tokens. */
html[data-the-bot-theme="dark"] .app-shell.has-shared-header .sidebar{background:var(--bot-surface);border-color:var(--bot-border)}
html:has(the-bot-shared-header[data-telegram-offer-open]){overflow:hidden}

/* One surface-motion convention across the common CORE / ADMIN document. */
:root{--bot-motion-surface:280ms;--bot-motion-ease:cubic-bezier(.2,.7,.2,1)}
@keyframes bot-surface-in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
@keyframes bot-content-in{from{opacity:.65}to{opacity:1}}
.overview-page,.profile-page,.invoice-finance,.class-directory,.settings-section,.entity-detail:not([hidden]),.admin-workspace>div:not([hidden]){animation:bot-content-in var(--bot-motion-surface) var(--bot-motion-ease)}
.tb-dialog[open]>.tb-dialog-panel,.tb-disclosure[open]>:not(summary),.tb-popover,.tb-tab-panel:not([hidden]){animation:bot-surface-in var(--bot-motion-surface) var(--bot-motion-ease)}
.tb-tooltip-content{transition:opacity var(--bot-motion-surface) var(--bot-motion-ease),visibility var(--bot-motion-surface) var(--bot-motion-ease)}
/* Keep native close/focus semantics; no timer or delayed submission. */
@supports (transition-behavior:allow-discrete) and (interactivity:inert){
 .tb-dialog{opacity:0;transform:translateY(8px) scale(.98);transition:opacity var(--bot-motion-surface) var(--bot-motion-ease),transform var(--bot-motion-surface) var(--bot-motion-ease),display var(--bot-motion-surface) allow-discrete,overlay var(--bot-motion-surface) allow-discrete}
 .tb-dialog[open]{opacity:1;transform:none}
 .tb-dialog:not([open]){interactivity:inert;pointer-events:none}
 .tb-dialog[open]>.tb-dialog-panel{animation:none}
 .tb-dialog::backdrop{opacity:0;transition:opacity var(--bot-motion-surface) var(--bot-motion-ease),display var(--bot-motion-surface) allow-discrete,overlay var(--bot-motion-surface) allow-discrete}
 .tb-dialog[open]::backdrop{opacity:1}
 .tb-dialog:not([open])::backdrop{pointer-events:none}
 @starting-style{.tb-dialog[open]{opacity:0;transform:translateY(8px) scale(.98)}.tb-dialog[open]::backdrop{opacity:0}}
}
@supports selector(details::details-content) and (transition-behavior:allow-discrete) and (interactivity:inert){
 .tb-disclosure::details-content{opacity:0;transition:opacity var(--bot-motion-surface) var(--bot-motion-ease),content-visibility var(--bot-motion-surface) allow-discrete}
 .tb-disclosure[open]::details-content{opacity:1}
 .tb-disclosure:not([open])::details-content{interactivity:inert;pointer-events:none}
 .tb-disclosure[open]>:not(summary){animation:none}
}
@media(prefers-reduced-motion:reduce){:root{--bot-motion-surface:0ms}.tb-dialog,.tb-dialog::backdrop,.tb-disclosure::details-content,.tb-tooltip-content{transition:none}.tb-dialog[open]>.tb-dialog-panel,.tb-disclosure[open]>:not(summary),.tb-popover,.tb-tab-panel:not([hidden]),.overview-page,.profile-page,.invoice-finance,.class-directory,.settings-section,.entity-detail:not([hidden]),.admin-workspace>div:not([hidden]){animation:none}}
/* Common controlled menus retain their existing DOM through a visual-only close. */
.tb-popover[data-menu-surface]{animation:none;opacity:1;transform:none;transition:opacity var(--bot-motion-surface) var(--bot-motion-ease),transform var(--bot-motion-surface) var(--bot-motion-ease)}
.tb-popover[data-menu-closing]{opacity:0;transform:translateY(4px);pointer-events:none}
@starting-style{.tb-popover[data-menu-surface]{opacity:0;transform:translateY(4px)}}
@supports not (transition-behavior:allow-discrete){.tb-popover[data-menu-surface]:not([data-menu-closing]){animation:bot-surface-in var(--bot-motion-surface) var(--bot-motion-ease)}}
@media(prefers-reduced-motion:reduce){.tb-popover[data-menu-surface],.tb-popover[data-menu-surface]:not([data-menu-closing]){animation:none;transition:none}}

/* A mounted sidebar owns this frame's space; standalone header pages retain their layout. */
.platform-shared-header-frame.is-sidebar,.platform-shared-header-frame.is-sidebar>the-bot-shared-header{display:contents;position:static;min-height:0}
.platform-shared-header-frame.is-sidebar .platform-header-fallback{display:contents;position:static;height:auto;padding:0;border:0}
.platform-shared-header-frame.is-sidebar .platform-header-brand{grid-row:1;grid-column:1;align-self:center;width:auto;min-width:0;padding:0 38px 0 4px;border:0;gap:8px}
.platform-shared-header-frame.is-sidebar .platform-header-mark{width:36px;height:36px}
.platform-shared-header-frame.is-sidebar .platform-header-wordmark{font:650 17px/1.4 var(--bot-font-body);letter-spacing:0}
.platform-shared-header-frame.is-sidebar .platform-header-controls{grid-row:var(--sidebar-utilities-row,4);grid-column:1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin:0;justify-items:center;gap:4px}
.platform-shared-header-frame.is-sidebar>the-bot-shared-header[data-shared-header-ready]+.platform-header-fallback{display:none}
@media(min-width:901px){.has-sidebar-utilities.is-collapsed .platform-header-brand{padding:0;justify-self:center}.has-sidebar-utilities.is-collapsed .platform-header-wordmark{display:none}}
