/* TutorMe focus surfaces: presentation tokens, not modal/consent/interaction policy.
   Header shade starts below the utility row; true modal backdrops cover the page.
   Apply only to explicit transient surfaces, never hover, field focus or lessons.
   Saturation affects only pixels behind these painted layers, not their active UI.
   Unsupported backdrop filters retain the lavender wash without modifying media. */
.tm-site{--tm-focus-tint:rgb(103 85 164 / .07);--tm-focus-fallback:rgb(103 85 164 / .10);--tm-focus-duration:220ms;--tm-focus-ease:cubic-bezier(.2,.75,.25,1);--tm-focus-shadow:0 12px 36px rgb(24 54 76 / .12);--tm-menu-width-compact:240px;--tm-menu-width-rich:360px;--tm-menu-width-filter:100%;--tm-menu-width-mobile:calc(100vw - 24px);--tm-menu-clearance:12px}
.tm-site.tm-focus-surfaces :is(.tm-dialog,.tm-photo-dialog,.tm-event-dialog,.tm-calendar-dialog,.tm-save-dialog,.tm-watch-save-dialog,.tm-watch-item-dialog,.tm-watch-script-dialog,.tm-watch-share-dialog)::backdrop,.tm-site .tm-header-focus-layer{background:var(--tm-focus-tint,rgb(103 85 164 / .07));-webkit-backdrop-filter:saturate(.8);backdrop-filter:saturate(.8)}
.tm-site .tm-header-focus-layer[popover]{position:fixed;inset:auto;margin:0;padding:0;border:0;border-radius:0;max-width:none;max-height:none;box-sizing:border-box;cursor:default}
.tm-site .tm-header-focus-layer[popover]::backdrop,.tm-site .tm-header-menu-panel[popover]::backdrop{background:transparent;pointer-events:none;backdrop-filter:none;-webkit-backdrop-filter:none}
.tm-site .tm-header .tm-header-menu-panel[popover]{position:fixed;inset:auto;right:auto;bottom:auto;margin:0;box-sizing:border-box;width:var(--tm-menu-width-compact,240px);padding:16px 20px;border:1px solid var(--tm-line,#d9d8d3);border-radius:10px;background:var(--tm-paper,#fffdf9);color:var(--tm-ink,#18364c);box-shadow:var(--tm-focus-shadow);overflow:auto;overscroll-behavior:contain;line-height:1.5}
.tm-site .tm-header .tm-header-menu-language[popover]{width:var(--tm-menu-width-compact,240px);padding:6px;flex-direction:column;gap:4px}
.tm-site .tm-header .tm-header-menu-notifications[popover]{width:var(--tm-menu-width-rich,360px);padding:16px 20px;overflow:hidden}
.tm-site .tm-header .tm-header-menu-notifications:popover-open{display:flex;flex-direction:column}
.tm-site .tm-header-notice-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none}
.tm-site .tm-header-notice-heading h2{margin:0;font-size:24px;line-height:1.25;letter-spacing:-.035em}
.tm-site .tm-header-menu-notifications:focus-visible{outline:3px solid var(--tm-purple,#6755a4);outline-offset:-3px}
.tm-site .tm-header-notice-body{min-height:0;overflow:auto;overscroll-behavior:contain;overflow-wrap:anywhere;padding:4px 0}
.tm-site .tm-header-notice-body p{font-size:14px;line-height:1.6;margin:12px 0}
.tm-site .tm-header-notice-body small{font-size:12px;line-height:1.5;color:var(--tm-muted)}
.tm-site .tm-header-menu-panel a,.tm-site .tm-header-menu-panel button{min-height:44px;box-sizing:border-box}
.tm-site .tm-header-menu-profile a{display:flex;align-items:center}
.tm-site .tm-header .tm-bell,.tm-site .tm-header .tm-profile>summary,.tm-site .tm-header .tm-language-trigger{display:inline-flex;align-items:center;justify-content:center;width:44px;min-width:44px;height:44px;min-height:44px;box-sizing:border-box;padding:9px;border-radius:50%;color:var(--tm-purple,#6755a4)}
.tm-site .tm-header .tm-language-trigger{padding:6px}
.tm-site .tm-header .tm-profile>summary{padding:4px}
.tm-site .tm-header .tm-bell svg{width:24px;height:24px;flex:none}
/* Touch must never retain a hover fill after a disclosure closes. */
.tm-site .tm-header :is(.tm-bell,.tm-language-trigger,.tm-profile>summary){background:transparent}
@media(hover:hover) and (pointer:fine){.tm-site .tm-header :is(.tm-bell,.tm-language-trigger,.tm-profile>summary):hover{background:var(--tm-control-hover-bg,#f1eee7)}}
.tm-site .tm-header .tm-bell:focus-visible,.tm-site .tm-header .tm-language-trigger:focus-visible,.tm-site .tm-header .tm-profile>summary:focus-visible,.tm-site .tm-header-menu-panel :focus-visible{outline:3px solid var(--tm-purple,#6755a4);outline-offset:2px}
/* Wrapped headers share one panel width and the same 12px viewport gutters.
   Desktop notifications retain space for readable message content. */
@media(max-width:850px){.tm-site .tm-header .tm-header-menu-panel[popover]{width:var(--tm-menu-width-mobile,calc(100vw - 24px))}}
/* A restrained entrance only; closing is immediate, with no deferred top layer.
   Translation does not change layout or scale text, and stays below the divider. */
.tm-site .tm-header .tm-header-menu-panel:popover-open{animation:tm-header-menu-in var(--tm-focus-duration,220ms) var(--tm-focus-ease,cubic-bezier(.2,.75,.25,1)) both}
.tm-site .tm-header-focus-layer:popover-open{animation:tm-header-wash-in var(--tm-focus-duration,220ms) var(--tm-focus-ease,cubic-bezier(.2,.75,.25,1)) both}
@keyframes tm-header-menu-in{from{transform:translateY(-4px);opacity:0}to{transform:translateY(0);opacity:1}}
@keyframes tm-header-wash-in{from{opacity:0}to{opacity:1}}
@media(prefers-reduced-motion:reduce){.tm-site .tm-header .tm-header-menu-panel:popover-open,.tm-site .tm-header-focus-layer:popover-open{animation:none;transition:none;scroll-behavior:auto}}
@media print{.tm-site .tm-header-focus-layer,.tm-site .tm-header-menu-panel[popover]{display:none!important}}

@media(prefers-reduced-transparency:reduce){.tm-site.tm-focus-surfaces :is(.tm-dialog,.tm-photo-dialog,.tm-event-dialog,.tm-calendar-dialog,.tm-save-dialog,.tm-watch-save-dialog,.tm-watch-item-dialog,.tm-watch-script-dialog,.tm-watch-share-dialog)::backdrop,.tm-site .tm-header-focus-layer,.tm-site .tm-header-focus-layer:popover-open{background:var(--tm-focus-fallback,rgb(103 85 164 / .10));-webkit-backdrop-filter:none;backdrop-filter:none;animation:none}}
/* Preserve system contrast rather than filtering or covering forced colours. */
@media(forced-colors:active){.tm-site.tm-focus-surfaces :is(.tm-dialog,.tm-photo-dialog,.tm-event-dialog,.tm-calendar-dialog,.tm-save-dialog,.tm-watch-save-dialog,.tm-watch-item-dialog,.tm-watch-script-dialog,.tm-watch-share-dialog)::backdrop,.tm-site .tm-header-focus-layer,.tm-site .tm-header-focus-layer:popover-open{background:transparent;-webkit-backdrop-filter:none;backdrop-filter:none;animation:none}}

/* Current navigation is subdued gold; disclosure state is neutral, not selection. */
.tm-site{--tm-pink:#EF4B79}
.tm-site .tm-nav a[aria-current]{color:var(--tm-ink);border-bottom-color:var(--tm-selected-border,#a58a45)}
.tm-site .tm-header :is(.tm-bell[aria-expanded=true],.tm-language-trigger[aria-expanded=true],.tm-profile[open]>summary){background:var(--tm-control-open-bg,#efede7);box-shadow:0 0 0 1px var(--tm-control-open-border,#b5b1a7);color:var(--tm-ink)}
.tm-site .tm-menu-pointer{position:fixed;display:block;width:12px;height:12px;box-sizing:border-box;margin:0;padding:0;background:var(--tm-paper,#fffdf9);border:solid var(--tm-line,#d9d8d3);border-width:1px 0 0 1px;transform:rotate(45deg);pointer-events:none;z-index:1}
.tm-site .tm-menu-pointer.is-above{border-width:0 1px 1px 0}
/* Pointer stays outside scrolling panels; no translated panel to detach it. */
@keyframes tm-header-menu-in{from{opacity:0}to{opacity:1}}
@keyframes tm-filter-popup-in{from{opacity:0}to{opacity:1}}
@keyframes tm-watch-filter-in{from{opacity:0}to{opacity:1}}

/* Draft filter panels share one scroll region and a persistent action footer. */
.tm-site .tm-menu-scroll{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y pinch-zoom;padding:16px 18px;scrollbar-gutter:stable}
.tm-site .tm-menu-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;flex:0 0 auto;padding:10px 16px;border-top:1px solid var(--tm-line,#d9d8d3);background:var(--tm-paper,#fffdf9)}
.tm-site .tm-menu-footer button{min-height:44px;margin:0;box-sizing:border-box}
.tm-site .tm-menu-footer .tm-text-link{padding:8px 4px;color:var(--tm-ink,#18364c);text-decoration:underline;text-underline-offset:3px}
.tm-site .tm-menu-footer .tm-button{margin-left:auto;padding:10px 16px;background:var(--tm-action-bg,#6755a4);border:1px solid var(--tm-action-bg,#6755a4);color:var(--tm-action-ink,#faf8f3);border-radius:8px;font-size:14px;line-height:1.4}
.tm-site .tm-menu-hint{font-size:12px!important;line-height:1.5;margin:0 0 14px!important;color:var(--tm-ink,#18364c)}
@media(max-width:400px){.tm-site .tm-menu-scroll{padding:14px}.tm-site .tm-menu-footer{padding:8px 14px}}
@media(forced-colors:active){.tm-site .tm-nav a[aria-current]{border-bottom-color:Highlight}.tm-site .tm-header :is(.tm-bell[aria-expanded=true],.tm-language-trigger[aria-expanded=true],.tm-profile[open]>summary){outline:1px solid CanvasText;outline-offset:1px}.tm-site .tm-header :is(.tm-bell,.tm-language-trigger,.tm-profile>summary):focus-visible{outline:3px solid Highlight;outline-offset:3px}}

/* C3: owner-bound top status, never a routine body toast. */
.tm-header-notice-toolbar,.tm-owner-save-toolbar{display:flex;align-items:center;flex:0 0 44px;min-height:44px}
.tm-site .tm-header-notice-heading>h2,.tm-owner-save-heading>h2{flex:1 1 auto;min-width:0;margin:0}
.tm-owner-save-heading{display:flex;align-items:center;gap:12px;padding-right:44px;min-height:44px}
.tm-site .tm-header-notice-heading .tm-surface-status,.tm-site .tm-header-notice-heading .tm-surface-close,.tm-owner-save-toolbar .tm-surface-status{flex:0 0 44px;width:44px;min-width:44px;height:44px;min-height:44px;padding:8px;border:0;background:transparent;border-radius:6px;opacity:1}
.tm-header-notice-details,.tm-owner-save-details{padding:12px;border:1px solid #a02e38;border-radius:8px;color:#a02e38;overflow-wrap:anywhere}
.tm-header-notice-details[hidden],.tm-owner-save-details[hidden]{display:none!important}
