/* Two independent navigation layers. All widths reserve space once; hover
   animates only the rail's paint, never the workspace or module geometry. */
body[data-workspace=true].dual-nav{--rail-width:56px;--module-width:200px;--side-width:256px;--settings-rail:56px;--settings-width:200px;--rail-open-width:208px;--rail-ease:cubic-bezier(.22,1,.36,1);--module-surface:var(--canvas)}
body[data-workspace=true].dual-nav .shell{margin-left:var(--side-width);transition:none}
body[data-workspace=true].dual-nav .sidebar{left:var(--rail-width);width:var(--module-width);height:var(--workspace-viewport-height);padding:0 8px 12px;--nav-padding-x:8px;--nav-content-gap:6px;background:var(--module-surface);border-right:1px solid var(--line);transition:none}
body[data-workspace=true].dual-nav .sidebar .crm-pipeline-heading{gap:0}
body[data-workspace=true].dual-nav .sidebar .crm-pipelines-toggle{padding-right:var(--nav-padding-x)}
/* Keep the pipeline row and its disclosure aligned with the other sections.
   The independent action sits just before the arrow. */
.dual-nav .sidebar [data-navigation-kind=crm] .crm-pipeline-heading{position:relative;min-width:0;--nav-content-gap:3px;--action-space:10px}
.dual-nav .sidebar [data-navigation-kind=crm] .crm-pipeline-heading>[data-crm-manage]{position:absolute;right:16px;width:24px;padding-inline:0}
.dual-nav .sidebar [data-navigation-kind=crm] .crm-pipeline-heading>[data-crm-manage]>.icon{width:18px;height:18px;transform:translateX(-3px)}
/* Leave room for the full Ukrainian label on the fixed 200px panel. */
.dual-nav .sidebar [data-navigation-kind=crm]:lang(uk) .crm-pipeline-heading:has(>[data-crm-manage]:not([hidden]))>.crm-pipelines-toggle{padding-inline-start:4px;gap:1px;letter-spacing:-.1px}
.dual-nav :is(.sidebar [data-navigation-kind=crm],#crm-pipelines-flyout[data-navigation-kind=crm]) [data-crm-manage]:is(:hover,:focus-visible,[aria-expanded=true]){background:transparent;box-shadow:none;opacity:1;color:var(--nav-selected)}
.dual-nav .sidebar .navigation-chevron{margin-inline-end:-4px}
.dual-nav .sidebar .crm-pipeline-branch{min-width:0}
.dual-nav .sidebar [data-navigation-kind=crm] .crm-pipeline-heading:has(>[data-crm-manage]:not([hidden]))>.crm-pipelines-toggle>span{padding-inline-end:var(--action-space)}
@media (hover:hover){
 .dual-nav .sidebar [data-navigation-kind=crm] .crm-pipeline-heading:not(:hover,:has(:focus-visible),:has(>[data-crm-manage][aria-expanded=true])){--action-space:0px}
 .dual-nav .sidebar [data-navigation-kind=crm] .crm-pipeline-heading:not(:hover,:has(:focus-visible))>[data-crm-manage]:not([aria-expanded=true]),
 .dual-nav #crm-pipelines-flyout[data-navigation-kind=crm]:not(:hover,:focus-within) [data-crm-manage]:not([aria-expanded=true]){opacity:0;pointer-events:none}
}
.dual-nav .sidebar [data-navigation-kind=crm] .crm-pipeline-heading:has(>[data-crm-manage]:hover)>.crm-pipelines-toggle{background:var(--nav-hover)}
body[data-workspace=true].dual-nav .sidebar .crm-manage-trigger{width:24px}
body[data-workspace=true].dual-nav .sidebar .nav{padding-top:12px;margin:0;min-height:0;flex:1;overflow-y:auto}
.module-sidebar-heading{flex-shrink:0;height:var(--workspace-header-height);display:flex;align-items:center;justify-content:space-between;padding:0 8px;border-bottom:1px solid var(--line);background:var(--surface)}
body[data-workspace=true].dual-nav.workspace-record-page .module-sidebar-heading{background:var(--data-canvas,var(--canvas))}
body[data-workspace=true].dual-nav :is(.module-sidebar-heading,.settings-sidebar-heading)>strong{font-family:var(--font-ui);font-size:18px;font-weight:600;line-height:24px;letter-spacing:-.35px;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.module-sidebar-close{display:none}
body[data-workspace=true].dual-nav .workspace-nav-top{margin:0 -8px;padding:0;flex-shrink:0;border:0}
body[data-workspace=true].dual-nav.settings-mode .sidebar{visibility:hidden;pointer-events:none}
body[data-workspace=true].dual-nav .settings-sidebar{left:var(--rail-width);width:var(--module-width);background:var(--module-surface);height:var(--workspace-viewport-height)}
body[data-workspace=true].dual-nav .settings-sidebar-heading{height:var(--workspace-header-height);min-height:var(--workspace-header-height);padding-inline:16px;background:var(--surface)}
.global-rail{position:fixed;z-index:42;top:var(--workspace-top-offset,0px);bottom:0;left:0;width:var(--rail-width);color:var(--ink);isolation:isolate}
.global-rail-surface{position:absolute;inset:0 auto 0 0;width:var(--rail-open-width);background:var(--side);transform:scaleX(calc(56 / 208));transform-origin:left;transition:transform 240ms var(--rail-ease),box-shadow 240ms var(--rail-ease);z-index:-1}
/* Paint the divider above the brand surface, with an unscaled 1px stroke. */
.global-rail::after{content:'';position:absolute;z-index:2;top:0;bottom:0;left:calc(var(--rail-width) - 1px);width:1px;background:var(--line);pointer-events:none;transition:transform 240ms var(--rail-ease)}
.global-rail-content{width:var(--rail-open-width);height:100%;display:flex;flex-direction:column;clip-path:inset(0 calc(var(--rail-open-width) - var(--rail-width)) 0 0);transition:clip-path 240ms var(--rail-ease)}
body[data-workspace=true] .global-rail .sidebar-brand{height:var(--workspace-header-height);min-height:var(--workspace-header-height);margin:0;display:flex;align-items:center;padding:0 21px;border-bottom:1px solid var(--line);background:var(--surface)}
.global-rail .brand{padding:0;display:flex;align-items:center;color:var(--ink)}
.global-rail .coherio-logo{font-size:17px;color:inherit}
.global-rail .coherio-symbol{transform:scale(1.25);transition:transform 240ms var(--rail-ease)}
.global-rail .coherio-word{opacity:0;transform:translateX(-5px);transition:opacity 130ms ease-out,transform 240ms var(--rail-ease)}
.global-rail-nav{display:flex;flex-direction:column;gap:5px;padding:8px 8px;overflow-y:auto;overflow-x:hidden;min-height:0;flex:1;scrollbar-width:none;overscroll-behavior:contain}
.global-rail-nav::-webkit-scrollbar{display:none}
body[data-workspace=true] .global-rail .sidebar-footer{padding:10px 8px;margin:0;border-top:1px solid var(--line);display:flex;flex-direction:column;gap:5px;flex-shrink:0}
body[data-workspace=true] .global-rail :is(.rail-link,.nav-link,.account-trigger){position:relative;display:flex;align-items:center;gap:14px;height:40px;min-height:40px;width:40px;margin:0;padding:0 10px;border:0;border-radius:9px;background:transparent;color:var(--nav-ink);text-decoration:none;font-family:inherit;font-size:var(--nav-font-size);font-weight:var(--nav-font-weight);line-height:var(--nav-line-height);text-align:left;white-space:nowrap;flex-shrink:0;box-shadow:none;transform:none;transition:color 100ms ease-in-out}
.global-rail :is(.rail-link,.nav-link,.account-trigger)::before{content:'';position:absolute;inset:0;z-index:-1;border-radius:9px;background:var(--nav-hover);opacity:0;clip-path:inset(0 calc(100% - 40px) 0 0 round 9px);transition:clip-path 240ms var(--rail-ease),opacity 100ms ease-in-out,background-color 100ms ease-in-out}
.global-rail :is(.rail-link,.nav-link,.account-trigger):is(:hover,:focus-visible,[aria-expanded=true],[aria-current=page])::before{opacity:1}
.global-rail :is(.rail-link,.nav-link,.account-trigger)[aria-current=page]::before{background:var(--nav-active)}
body[data-workspace=true] .global-rail :is(.rail-link,.nav-link,.account-trigger):is([aria-current=page],:hover,:focus-visible){color:var(--nav-selected)}
.global-rail :is(.rail-link,.nav-link,.account-trigger)>:is(.icon,.account-avatar){width:20px;height:20px;flex:0 0 20px;display:grid;place-items:center}
.global-rail .account-avatar{border-radius:50%;font-size:9px;overflow:hidden}
.global-rail :is(.rail-link,.nav-link,.account-trigger)>span:not(.account-avatar){position:absolute;left:42px;max-width:142px;opacity:0;transform:translateX(-5px);transition:opacity 130ms ease-out,transform 240ms var(--rail-ease);overflow:hidden;text-overflow:ellipsis}
.global-rail .rail-link small{display:block;font-size:10px;line-height:12px}
.global-rail .rail-link[data-coming-soon]{opacity:.4}
.global-rail .rail-link:disabled{cursor:default}
.global-rail .rail-link[data-coming-soon]:not(:focus-visible)::before{display:none}
.global-rail :focus-visible{outline:2px solid var(--side-accent);outline-offset:-2px}
.global-rail .brand:focus-visible{outline-offset:6px;border-radius:3px}
@media(min-width:701px){
 .global-rail:is([data-expanded=true],:has([aria-expanded=true])){width:var(--rail-open-width)}
 /* Keep the painted highlight stable while the clickable area follows the rail. */
 .global-rail :is(.rail-link,.nav-link,.account-trigger)::before{right:auto;width:192px}
 body[data-workspace=true] .global-rail:is([data-expanded=true],:has([aria-expanded=true])) :is(.rail-link,.nav-link,.account-trigger){width:192px}
 .global-rail:is([data-expanded=true],:has([aria-expanded=true])) .global-rail-surface{transform:scaleX(1);box-shadow:8px 0 24px rgb(0 0 0 / .13)}
 .global-rail:is([data-expanded=true],:has([aria-expanded=true]))::after{transform:translateX(calc(var(--rail-open-width) - var(--rail-width)))}
 .global-rail:is([data-expanded=true],:has([aria-expanded=true])) .global-rail-content{clip-path:inset(0)}
 .global-rail:is([data-expanded=true],:has([aria-expanded=true])) :is(.rail-link,.nav-link,.account-trigger)::before{clip-path:inset(0 round 9px)}
 .global-rail:is([data-expanded=true],:has([aria-expanded=true])) :is(.rail-link,.nav-link,.account-trigger)>span:not(.account-avatar),.global-rail:is([data-expanded=true],:has([aria-expanded=true])) .coherio-word{opacity:1;transform:none;transition-delay:40ms}
 .global-rail:is([data-expanded=true],:has([aria-expanded=true])) .coherio-symbol{transform:none}
}
@media(max-width:700px){
 body[data-workspace=true].dual-nav{--module-width:min(200px,calc(100vw - 88px))}
 body[data-workspace=true].dual-nav .shell{margin-left:0}
 .global-rail{transform:translateX(-100%);transition:transform 220ms var(--rail-ease)}
 body.dual-nav:has(.sidebar.open) .global-rail{transform:none}
 body[data-workspace=true].dual-nav .sidebar{z-index:41;transform:translateX(calc(-100% - var(--rail-width)));transition:transform 220ms var(--rail-ease)}
 body[data-workspace=true].dual-nav .sidebar.open{transform:none}
 body[data-workspace=true].dual-nav .settings-sidebar{z-index:41}
 .module-sidebar-close{display:grid}
 body.dual-nav .sidebar-backdrop{z-index:40}
 body[data-workspace=true] .global-rail :is(.rail-link,.nav-link,.account-trigger){width:44px;min-height:44px;height:44px;margin-left:-2px;padding-inline:12px}
 .global-rail :is(.rail-link,.nav-link,.account-trigger)::before{clip-path:inset(0 round 9px)}
 .global-rail-nav{gap:2px}
 body[data-workspace=true] .global-rail .sidebar-footer{gap:2px}
}
@media(prefers-reduced-motion:reduce){.global-rail,.global-rail::after,.global-rail *,.global-rail *::before,body[data-workspace=true].dual-nav .sidebar{transition:none!important}}

/* Focused work keeps the global rail and collapses the module navigation. */
@property --module-nav-offset{syntax:"<length>";inherits:false;initial-value:0px}
@media(min-width:701px){
 body[data-workspace=true].dual-nav .shell{
  margin-left:calc(var(--side-width) - var(--module-nav-offset));
  transition:--module-nav-offset 280ms var(--rail-ease);
 }
 body[data-workspace=true].dual-nav:is(.workspace-lesson-editor,.workspace-webinar-page-editor,.workspace-funnel-detail,.workspace-crm-pipeline-editor) .shell{--module-nav-offset:var(--module-width)}
 /* These destinations lay out their content at its final width immediately. */
 html[data-funnel-catalog-return] body[data-workspace=true].dual-nav .shell,
 body[data-workspace=true].dual-nav.workspace-recent-lesson-open .shell{transition:none}
 body[data-workspace=true].dual-nav .sidebar{transition:transform 280ms var(--rail-ease),visibility 0s}
 body[data-workspace=true].dual-nav:is(.workspace-lesson-editor,.workspace-webinar-page-editor,.workspace-funnel-detail,.workspace-crm-pipeline-editor) .sidebar{
  transform:translateX(-100%);
  visibility:hidden;
  transition-delay:0s,280ms;
 }
}
@media(max-width:700px){
 body[data-workspace=true].dual-nav:is(.workspace-lesson-editor,.workspace-webinar-page-editor,.workspace-funnel-detail,.workspace-crm-pipeline-editor) .sidebar{visibility:hidden}
}
@media(prefers-reduced-motion:reduce){
 body[data-workspace=true].dual-nav .shell{transition:none}
}

/* Home is a single, permanently labelled navigation surface on desktop. */
body[data-workspace=true].dual-nav.workspace-home{--side-width:208px}
body[data-workspace=true].dual-nav.workspace-home .sidebar{visibility:hidden;pointer-events:none}
body.workspace-home .global-rail .global-rail-surface{box-shadow:none}
@media(max-width:700px){
 body.workspace-home .global-rail{width:208px}
 body.workspace-home .global-rail-surface{transform:none}
 body.workspace-home .global-rail::after{transform:translateX(152px)}
 body.workspace-home .global-rail-content{clip-path:inset(0)}
 body[data-workspace=true].workspace-home .global-rail :is(.rail-link,.nav-link,.account-trigger){width:192px;margin-left:0;padding-inline:10px}
 body.workspace-home .global-rail :is(.rail-link,.nav-link,.account-trigger)>span:not(.account-avatar),body.workspace-home .global-rail .coherio-word{opacity:1;transform:none}
 body.workspace-home .global-rail .coherio-symbol{transform:none}
 body[data-workspace=true].workspace-home .rail-project-trigger{width:192px}
 body.workspace-home .rail-project-trigger::before{clip-path:inset(0 round 10px)}
 body.workspace-home :is(.rail-project-name,.rail-project-trigger>.icon){opacity:1;transform:none}
}
