/* Fixed global reference: title/identity, quiet side rail, mobile bottom navigation. */
html[data-design-system][data-m3e-theme] body.single-page-root {
  --single-page-sidebar-width:224px; --single-page-topbar-height:80px; --character-toolbar-height:80px;
  font-family:"Noto Sans SC","PingFang SC","Microsoft YaHei",system-ui,sans-serif;
  color:var(--md-on-surface); background:var(--md-surface);
}
html[data-design-system][data-m3e-theme] body.single-page-root .single-page-app { background:var(--md-surface); }
html[data-design-system][data-m3e-theme] body.single-page-root .single-page-sidebar { width:var(--single-page-sidebar-width); padding:28px 14px 20px; background:var(--md-surface-container); border:0; box-shadow:none; transition:none; }
html[data-design-system][data-m3e-theme] body.single-page-root .ticket-brand { justify-content:flex-start; padding:0 8px 36px; gap:12px; }
html[data-design-system][data-m3e-theme] body.single-page-root .ticket-brand-copy { display:grid; gap:6px; }
html[data-design-system][data-m3e-theme] body.single-page-root .ticket-brand-copy small { font-size:11px; letter-spacing:0; }
html[data-design-system][data-m3e-theme] body.single-page-root .ticket-brand-copy strong { font-size:18px; }
html[data-design-system][data-m3e-theme] body.single-page-root .ticket-sidebar-nav { gap:8px; }
html[data-design-system][data-m3e-theme] body.single-page-root .ticket-nav-item { justify-content:flex-start; gap:16px; min-height:56px; padding:12px 18px; border:0; border-radius:32px; color:var(--md-muted); font-size:15px; }
html[data-design-system][data-m3e-theme] body.single-page-root .ticket-nav-item span:not(.ticket-nav-badge) { display:inline; }
html[data-design-system][data-m3e-theme] body.single-page-root .ticket-nav-item:hover { background:var(--md-surface-high); color:var(--md-on-surface); }
html[data-design-system][data-m3e-theme] body.single-page-root .ticket-nav-item[aria-current="page"] { color:var(--md-on-primary-container); background:var(--md-primary-container); font-weight:700; }
html[data-design-system][data-m3e-theme] body.single-page-root .single-page-sidebar-date { display:grid; margin:auto 0 0; padding:16px; background:var(--md-surface-high); }
html[data-design-system][data-m3e-theme] body.single-page-root .single-page-sidebar-date>i { background:var(--md-primary-container); color:var(--md-on-primary-container); }
html[data-design-system][data-m3e-theme] body.single-page-root .single-page-sidebar-date strong { color:var(--md-on-surface); font-size:13px; }
html[data-design-system][data-m3e-theme] body.single-page-root .single-page-shell { grid-template-rows:var(--single-page-topbar-height) minmax(0,1fr); }
html[data-design-system][data-m3e-theme] body.single-page-root .single-page-topbar {
  display:grid!important; grid-template-columns:minmax(0,1fr) 48px 48px minmax(48px,180px); grid-template-rows:1fr; gap:16px;
  height:var(--single-page-topbar-height); min-height:var(--single-page-topbar-height); padding:12px clamp(20px,3vw,40px);
  position:sticky; top:0; z-index:40; background:var(--md-surface); border:0;
}
.m3e-shell-context { grid-column:1; grid-row:1; min-width:0; }
.m3e-shell-context>strong { font-size:20px; line-height:1.4; }
@media(min-width:760px) {
 body[data-current-module="workbench"]:has(#moduleViewWorkbench[data-workbench-view="overview"]) .m3e-shell-context>strong { font-size:36px; line-height:1.2; font-weight:750; letter-spacing:-1px; }
}
html[data-design-system][data-m3e-theme] body.single-page-root .single-page-topbar .ticket-freshness { display:flex; margin:3px 0 0; gap:6px; font-size:12px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
html[data-design-system][data-m3e-theme] body.single-page-root .single-page-topbar .ticket-freshness i { font-size:14px; color:var(--md-muted); }
html[data-design-system][data-m3e-theme] body.single-page-root .single-page-topbar .workspace-character { grid-column:2; grid-row:1; width:48px; max-width:none; height:48px; margin:0; transform:none; }
html[data-design-system][data-m3e-theme] body.single-page-root .single-page-topbar .character-feedback { position:absolute; top:50%; right:calc(100% + 12px); transform:translateY(-50%); z-index:2; box-sizing:border-box; width:max-content; max-width:min(280px,calc(100vw - var(--single-page-sidebar-width) - 520px)); padding:6px 12px; border-radius:18px; background:var(--md-primary-container); color:var(--md-on-primary-container); pointer-events:none; }
html[data-design-system][data-m3e-theme] body.single-page-root .single-page-topbar [data-m3e-appearance-open] { grid-column:3; grid-row:1; width:48px; height:48px; min-height:48px; }
html[data-design-system][data-m3e-theme] body.single-page-root .single-page-topbar .ticket-profile { display:flex; grid-column:4; grid-row:1; min-width:0; min-height:48px; max-width:100%; justify-self:end; padding:4px 12px 4px 4px; gap:8px; border-radius:28px; }
html[data-design-system][data-m3e-theme] body.single-page-root #accountIdentity { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; }
html[data-design-system][data-m3e-theme] body.single-page-root .management-module-nav { margin:12px 24px 0; background:var(--md-surface-container); border:0; }
html[data-design-system][data-m3e-theme] body.single-page-root .management-module-nav a[aria-current="page"] { background:var(--md-primary-container); color:var(--md-on-primary-container); box-shadow:none; }
html[data-design-system][data-m3e-theme] body.single-page-root .module-load-state { background:var(--md-surface); color:var(--md-on-surface); }
html[data-design-system][data-m3e-theme] body.single-page-root .module-load-state p { color:var(--md-muted); }
html[data-design-system][data-m3e-theme] body.single-page-root .module-load-state button { min-height:48px; padding:12px 24px; background:var(--md-primary); color:var(--md-on-primary); border:0; border-radius:28px; }
@media(min-width:760px) and (max-width:1099px) {
 html[data-design-system][data-m3e-theme] body.single-page-root { --single-page-sidebar-width:88px; }
 html[data-design-system][data-m3e-theme] body.single-page-root .ticket-brand { justify-content:center; padding-inline:0; }
 html[data-design-system][data-m3e-theme] body.single-page-root .ticket-brand-copy,
 html[data-design-system][data-m3e-theme] body.single-page-root .single-page-sidebar-date { display:none; }
 html[data-design-system][data-m3e-theme] body.single-page-root .ticket-nav-item { flex-direction:column; justify-content:center; gap:6px; padding:12px 0; border-radius:24px; font-size:12px; }
}
/* Keep the existing hover/keyboard rail behavior under the themed shell. */
@media(min-width:760px) {
 html[data-design-system][data-m3e-theme] body.single-page-root.module-sidebar-collapsed { --single-page-sidebar-width:88px; }
 html[data-design-system][data-m3e-theme] body.single-page-root.module-sidebar-collapsed .single-page-sidebar { z-index:80; transition:width 180ms var(--m3e-ease); }
 html[data-design-system][data-m3e-theme] body.single-page-root.module-sidebar-collapsed .ticket-brand { justify-content:center; padding-inline:0; gap:0; }
 html[data-design-system][data-m3e-theme] body.single-page-root.module-sidebar-collapsed .ticket-nav-item { flex-direction:row; justify-content:center; padding-inline:0; }
 html[data-design-system][data-m3e-theme] body.single-page-root.module-sidebar-collapsed :is(.ticket-brand-copy,.single-page-sidebar-date,.ticket-nav-item span:not(.ticket-nav-badge)) { display:none; }
 html[data-design-system][data-m3e-theme] body.single-page-root.module-sidebar-collapsed.module-sidebar-hover-expanded .single-page-sidebar { width:224px; }
 html[data-design-system][data-m3e-theme] body.single-page-root.module-sidebar-collapsed.module-sidebar-hover-expanded .ticket-brand { justify-content:flex-start; padding-inline:8px; gap:12px; }
 html[data-design-system][data-m3e-theme] body.single-page-root.module-sidebar-collapsed.module-sidebar-hover-expanded .ticket-nav-item { justify-content:flex-start; padding:12px 18px; gap:16px; font-size:15px; }
 html[data-design-system][data-m3e-theme] body.single-page-root.module-sidebar-collapsed.module-sidebar-hover-expanded :is(.ticket-brand-copy,.single-page-sidebar-date) { display:grid; }
 html[data-design-system][data-m3e-theme] body.single-page-root.module-sidebar-collapsed.module-sidebar-hover-expanded .ticket-nav-item span:not(.ticket-nav-badge) { display:inline; }
}
@media(max-width:759px) {
 html[data-design-system][data-m3e-theme] body.single-page-root { --single-page-topbar-height:76px; --mobile-nav-height:calc(76px + env(safe-area-inset-bottom)); }
 html[data-design-system][data-m3e-theme] body.single-page-root .single-page-sidebar { display:none; }
 html[data-design-system][data-m3e-theme] body.single-page-root .single-page-topbar { grid-template-columns:minmax(0,1fr) 48px 48px 48px; gap:8px; padding:10px 16px; }
 html[data-design-system][data-m3e-theme] body.single-page-root .single-page-topbar .workspace-character { position:static; width:48px; }
 html[data-design-system][data-m3e-theme] body.single-page-root .single-page-topbar .character-feedback { top:calc((var(--single-page-topbar-height) - 48px)/2 + 30px); left:16px; right:auto; transform:none; width:calc(100% - 200px); max-width:none; max-height:22px; overflow:hidden; padding:0; border-radius:0; background:transparent; font-size:12px; line-height:18px; }
 html[data-design-system][data-m3e-theme] body.single-page-root .single-page-topbar .character-feedback progress { height:3px; margin-top:1px; max-width:100%; }
 html[data-design-system][data-m3e-theme] body.single-page-root .single-page-topbar:has(.workspace-character[data-speaking="true"]) .ticket-freshness { visibility:hidden; }
 html[data-design-system][data-m3e-theme] body.single-page-root .single-page-topbar .ticket-profile { width:48px; min-height:48px; justify-content:center; padding:4px; background:var(--md-primary-container); }
 html[data-design-system][data-m3e-theme] body.single-page-root .single-page-topbar .ticket-profile>:not(.ticket-avatar) { display:none; }
 html[data-design-system][data-m3e-theme] body.single-page-root .single-page-topbar .ticket-freshness { font-size:11px; }
 html[data-design-system][data-m3e-theme] body.single-page-root .single-page-topbar .ticket-freshness i { display:none; }
 html[data-design-system][data-m3e-theme] body.single-page-root .mobile-module-nav { gap:4px; padding:6px 8px calc(6px + env(safe-area-inset-bottom)); border:0; border-radius:0; background:var(--md-surface); }
 html[data-design-system][data-m3e-theme] body.single-page-root .mobile-module-nav>a { min-height:64px; gap:4px; color:var(--md-muted); font-size:12px; font-weight:600; }
 html[data-design-system][data-m3e-theme] body.single-page-root .mobile-module-nav>a i { width:56px; max-width:100%; height:32px; border-radius:22px; font-size:24px; }
 html[data-design-system][data-m3e-theme] body.single-page-root .mobile-module-nav>a[aria-current="page"] { color:var(--md-primary); background:transparent; }
 html[data-design-system][data-m3e-theme] body.single-page-root .mobile-module-nav>a[aria-current="page"] i { background:var(--md-primary-container); color:var(--md-on-primary-container); }
 html[data-design-system][data-m3e-theme] body.single-page-root .management-module-nav { margin:8px 16px 0; flex-wrap:nowrap; overflow-x:auto; }
 html[data-design-system][data-m3e-theme] body.single-page-root .management-module-nav a { flex:0 0 auto; white-space:nowrap; }
}
@media(prefers-reduced-motion:reduce) {
 html[data-design-system][data-m3e-theme] body.single-page-root.module-sidebar-collapsed .single-page-sidebar,
 html[data-m3e-theme] .single-page-sidebar,
 html[data-m3e-theme] .mobile-module-nav>a { transition:none; }
}
/* Short windows retain navigation while giving the embedded page room to scroll. */
@media(max-width:759px) and (max-height:480px) {
 html[data-design-system][data-m3e-theme] body.single-page-root { --single-page-topbar-height:56px; --mobile-nav-height:calc(60px + env(safe-area-inset-bottom)); }
 html[data-design-system][data-m3e-theme] body.single-page-root .single-page-topbar { padding-block:4px; }
 html[data-design-system][data-m3e-theme] body.single-page-root .m3e-shell-context { align-self:start; }
 html[data-design-system][data-m3e-theme] body.single-page-root .single-page-topbar .ticket-freshness { display:none; }
 html[data-design-system][data-m3e-theme] body.single-page-root .management-module-nav { margin-top:0; padding-block:0; }
 html[data-design-system][data-m3e-theme] body.single-page-root .management-module-nav a { min-height:48px; padding-block:8px; }
 html[data-design-system][data-m3e-theme] body.single-page-root .mobile-module-nav { padding-block:6px calc(6px + env(safe-area-inset-bottom)); }
 html[data-design-system][data-m3e-theme] body.single-page-root .mobile-module-nav>a { min-height:48px; gap:2px; }
 html[data-design-system][data-m3e-theme] body.single-page-root .mobile-module-nav>a i { height:24px; font-size:22px; }
}
@media(max-width:759px) {
 html[data-m3e-module-focus="true"] { overflow:hidden!important; }
 html[data-m3e-module-focus="true"] body.single-page-root :is(.single-page-topbar,.single-page-sidebar,.mobile-module-nav,#managementModuleNav) { display:none!important; }
 html[data-m3e-module-focus="true"] body.single-page-root #moduleViewRemote { position:fixed; inset:0; z-index:210; width:100%; height:100dvh; margin:0; padding:0; background:var(--md-surface); }
 html[data-m3e-module-focus="true"] body.single-page-root #moduleViewRemote .module-remote-content { flex:1 1 auto; height:100%; }
}
