/* 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):not(.work-nav-unread) { 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); }
 /* Revealing text must not change row heights or the icon hit coordinates.
    Labels sit outside the 88px rail until the width animation exposes them. */
 html[data-design-system][data-m3e-theme] body.single-page-root.module-sidebar-collapsed .ticket-brand { position:relative; flex:0 0 74px; height:74px; min-height:74px; justify-content:flex-start; padding:0 0 36px 11px; gap:0; }
 html[data-design-system][data-m3e-theme] body.single-page-root.module-sidebar-collapsed .ticket-sidebar-nav { flex:0 0 auto; grid-auto-rows:56px; gap:8px; }
 html[data-design-system][data-m3e-theme] body.single-page-root.module-sidebar-collapsed .ticket-nav-item { position:relative; flex-direction:row; justify-content:flex-start; box-sizing:border-box; height:56px; min-height:56px; max-height:56px; padding:0 0 0 18px; gap:16px; white-space:nowrap; }
 html[data-design-system][data-m3e-theme] body.single-page-root.module-sidebar-collapsed .ticket-nav-item>i { display:block; flex:0 0 24px; width:24px; height:24px; font-size:24px; line-height:24px; }
 html[data-design-system][data-m3e-theme] body.single-page-root.module-sidebar-collapsed .ticket-brand-copy { display:grid; position:absolute; left:60px; right:0; top:0; height:38px; align-content:center; opacity:0; visibility:hidden; pointer-events:none; }
 html[data-design-system][data-m3e-theme] body.single-page-root.module-sidebar-collapsed .ticket-nav-item span:not(.ticket-nav-badge):not(.work-nav-unread) { display:block; position:absolute; left:60px; right:8px; top:50%; transform:translateY(-50%); line-height:24px; font-size:15px; opacity:0; visibility:hidden; pointer-events:none; }
 html[data-design-system][data-m3e-theme] body.single-page-root.module-sidebar-collapsed .single-page-sidebar-date { display:grid; flex:0 0 auto; width:196px; max-width:none; opacity:0; visibility:hidden; pointer-events: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 { padding:0 0 36px 11px; gap:0; }
 html[data-design-system][data-m3e-theme] body.single-page-root.module-sidebar-collapsed.module-sidebar-hover-expanded .ticket-nav-item { padding:0 0 0 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,.ticket-nav-item span:not(.ticket-nav-badge):not(.work-nav-unread)) { opacity:1; visibility:visible; }
 html[data-design-system][data-m3e-theme] body.single-page-root.module-sidebar-collapsed.module-sidebar-hover-expanded .single-page-sidebar-date { opacity:1; visibility:visible; }
}
@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%; }
}

/* Anchor the unread marker to the bell in both rail widths. */
@media(min-width:760px){
 html[data-design-system][data-m3e-theme] body.single-page-root.module-daily-flow{height:auto;overflow-y:visible}
 html[data-design-system][data-m3e-theme] body.module-daily-flow :is(.single-page-app,.single-page-shell){height:auto;min-height:100dvh;overflow:visible}
 html[data-design-system][data-m3e-theme] body.module-daily-flow #moduleViewRemote{height:auto;overflow:visible;flex:none}
 html[data-design-system][data-m3e-theme] body.module-daily-flow #moduleRemoteContent{flex:none;overflow:visible}
 html[data-design-system][data-m3e-theme] body.module-daily-flow [data-module-frame="scheduling"]{display:block;height:var(--daily-frame-height,calc(100dvh - var(--single-page-topbar-height)))}
 /* Keep the document's reserved height while a modal uses the visible viewport. */
 html[data-design-system][data-m3e-theme][data-m3e-module-focus="true"] body.module-daily-flow{overflow-y:hidden}
 html[data-design-system][data-m3e-theme][data-m3e-module-focus="true"] body.module-daily-flow #moduleRemoteContent{min-height:var(--daily-frame-height)}
 html[data-design-system][data-m3e-theme][data-m3e-module-focus="true"] body.module-daily-flow [data-module-frame="scheduling"]{position:fixed;top:var(--single-page-topbar-height);left:var(--single-page-sidebar-width);width:calc(100% - var(--single-page-sidebar-width));height:calc(100dvh - var(--single-page-topbar-height));z-index:210}
}
@media(min-width:760px){
 html[data-design-system][data-m3e-theme] body.single-page-root .ticket-nav-item>.work-nav-unread{display:block;position:absolute;left:36px;right:auto;top:10px;bottom:auto;width:9px;height:9px;transform:none;opacity:1;visibility:visible;pointer-events:none}
}
