/* The workspace control occupies one header-height slot. Its avatar stays on
   the icon axis while the label reveals with the rail, without layout motion. */
.rail-project-slot{height:var(--workspace-header-height);min-height:var(--workspace-header-height);padding:4px 8px;border-bottom:1px solid var(--line)}
body[data-workspace=true] .rail-project-trigger{position:relative;isolation:isolate;display:flex;align-items:center;gap:8px;width:40px;height:100%;padding:0 4px;border:0;border-radius:10px;background:none;color:var(--nav-selected);text-align:left;font:400 12px/16px var(--font-ui);cursor:pointer;transition:color 100ms ease-in-out}
.rail-project-trigger::before{content:'';position:absolute;inset:0;z-index:-1;background:var(--nav-active);border-radius:10px;opacity:0;clip-path:inset(0 calc(100% - 40px) 0 0 round 10px);transition:opacity 100ms ease-in-out,clip-path 240ms var(--rail-ease)}
.rail-project-trigger:is(:hover,:focus-visible,[aria-expanded=true])::before{opacity:1}
.project-avatar-wrap{position:relative;display:block;flex:0 0 32px;width:32px;height:32px}
body[data-workspace=true] :is(.rail-project-trigger,.projects-popover) .project-avatar-wrap>.avatar{display:grid;place-items:center;width:32px;height:32px;min-width:32px;border-radius:50%;overflow:hidden;background:var(--side-avatar);color:var(--nav-ink);font:500 13px/1 var(--font-ui)}
.project-avatar-wrap>.avatar>img{display:block;width:100%;height:100%;min-width:0;min-height:0;object-fit:cover}
body[data-workspace=true] .project-avatar-wrap .project-plan-badge{
 position:absolute;right:-3px;bottom:-2px;display:block;padding:0 3px;border:1px solid var(--surface);
 border-radius:4px;background:var(--plan-badge-bg,#e9eaec);color:var(--plan-badge-ink,#4a515c);
 font:700 8px/9px var(--font-ui);letter-spacing:.02em;white-space:nowrap;pointer-events:none
}
.project-plan-badge[data-plan=custom]{max-width:100%;overflow:hidden;text-overflow:ellipsis}
.project-plan-badge[data-plan=trial]{--plan-badge-bg:#dff2e4;--plan-badge-ink:#235e37}
.project-plan-badge[data-plan=pro]{--plan-badge-bg:#e1edff;--plan-badge-ink:#285695}
.project-plan-badge[data-plan=business]{--plan-badge-bg:#d5e6fc;--plan-badge-ink:#204b86}
.project-plan-badge[data-plan=advanced]{--plan-badge-bg:#c7defb;--plan-badge-ink:#194276}
.project-plan-badge[data-plan=plus]{--plan-badge-bg:#b8d4f8;--plan-badge-ink:#123868}
[data-appearance=dark] .project-plan-badge:is([data-plan=free],[data-plan=custom]){--plan-badge-bg:#3b4048;--plan-badge-ink:#e6e9ee}
[data-appearance=dark] .project-plan-badge[data-plan=trial]{--plan-badge-bg:#244735;--plan-badge-ink:#c0edca}
[data-appearance=dark] .project-plan-badge[data-plan=pro]{--plan-badge-bg:#273b59;--plan-badge-ink:#c1dbff}
[data-appearance=dark] .project-plan-badge[data-plan=business]{--plan-badge-bg:#2b4468;--plan-badge-ink:#d0e3ff}
[data-appearance=dark] .project-plan-badge[data-plan=advanced]{--plan-badge-bg:#30517d;--plan-badge-ink:#dbeaff}
[data-appearance=dark] .project-plan-badge[data-plan=plus]{--plan-badge-bg:#365c8b;--plan-badge-ink:#eff6ff}
.rail-project-name{position:absolute;left:44px;right:24px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rail-project-trigger>.icon{position:absolute;right:4px;width:16px;height:16px;flex-shrink:0;color:var(--nav-ink)}
.rail-project-name,.rail-project-trigger>.icon{opacity:0;transform:translateX(-5px);transition:opacity 130ms ease-out,transform 240ms var(--rail-ease)}
@media(min-width:701px){
 body[data-workspace=true] .global-rail:is([data-expanded=true],:has([aria-expanded=true])) .rail-project-trigger{width:192px}
 .rail-project-trigger::before{right:auto;width:192px}
 .rail-project-name{right:auto;width:124px}
 .rail-project-trigger>.icon{right:auto;left:172px}
 .global-rail:is([data-expanded=true],:has([aria-expanded=true])) .rail-project-trigger::before{clip-path:inset(0 round 10px)}
 .global-rail:is([data-expanded=true],:has([aria-expanded=true])) :is(.rail-project-name,.rail-project-trigger>.icon){opacity:1;transform:none;transition-delay:40ms}
}

/* Compact workspace proportions; reference colors and hover rhythm stay intact. */
body[data-workspace=true] .account-popover.projects-popover{width:288px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);padding:0;gap:0;border:1px solid var(--project-picker-border);border-radius:6px;background:var(--surface);color:var(--nav-selected);box-shadow:0 12px 24px rgb(132 146 166 / .16);overflow:hidden;outline:none;transform-origin:top left;animation:project-picker-in 140ms ease-out}
body[data-workspace=true] .projects-popover .projects-list{display:grid;gap:0;padding:3px;min-height:0;scrollbar-gutter:auto;max-height:min(384px,calc(100dvh - 84px));overflow:auto;overscroll-behavior:contain}
body[data-workspace=true] .projects-popover .project-row{display:flex;align-items:center;padding-right:8px;border-radius:2px;background:transparent;min-width:0;transition:background-color 100ms ease-in-out}
body[data-workspace=true] .projects-popover .project-option{flex:1;min-width:0;width:0;height:44px;min-height:44px;gap:10px;padding:8px;border:0;border-radius:2px;background:transparent;color:var(--nav-selected);font:400 13px/18px var(--font-ui);transition:background-color 100ms ease-in-out,color 100ms ease-in-out}
body[data-workspace=true] .projects-popover .project-row:is(:hover,:focus-within){background:var(--project-picker-hover)}
body[data-workspace=true] .projects-popover .project-row[data-selected=true]{background:var(--project-picker-selected)}
body[data-workspace=true] .account-popover.projects-popover .project-option:is([aria-pressed],:hover,:focus-visible){background:transparent}
body[data-workspace=true] .projects-popover .project-option:disabled{opacity:.65;cursor:progress}
body[data-workspace=true] .projects-popover .project-option-name{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body[data-workspace=true] .projects-popover .project-avatar-wrap{flex-basis:28px;width:28px;height:28px}
body[data-workspace=true] .projects-popover .project-avatar-wrap>.avatar{width:28px;height:28px;min-width:28px;font-size:12px}
.project-picker-footer{flex-shrink:0;padding:6px;border-top:1px solid var(--project-picker-border)}
body[data-workspace=true] .projects-popover .new-project-button{justify-content:center;height:32px;min-height:32px;gap:8px;padding:7px 11px;border:1px solid var(--project-picker-border);border-radius:6px;background:var(--surface);color:var(--nav-selected);font:400 12px/16px var(--font-ui);transition:background-color 200ms linear,border-color 200ms linear}
body[data-workspace=true] .projects-popover .new-project-button>.icon{width:16px;height:16px;color:inherit}
body[data-workspace=true] .projects-popover .new-project-button:is(:hover,:focus-visible){background:var(--project-picker-hover);border-color:var(--project-picker-hover-border)}
.projects-popover .no-projects{margin:8px;padding:12px;color:var(--muted);font-size:13px}
@keyframes project-picker-in{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
@media(max-width:700px){body[data-workspace=true] .projects-popover .new-project-button{height:44px;min-height:44px}}
@media(prefers-reduced-motion:reduce){.rail-project-trigger::before,.rail-project-name,.rail-project-trigger>.icon,body[data-workspace=true] .projects-popover,body[data-workspace=true] .projects-popover *{animation:none!important;transition:none!important}}

body[data-workspace=true] .projects-popover .project-pin{display:grid;place-items:center;flex:0 0 32px;width:32px;height:32px;padding:0;border:0;border-radius:6px;background:transparent;color:var(--nav-selected);cursor:pointer;transition:background-color 100ms ease-in-out}
body[data-workspace=true] .projects-popover .project-pin:hover{background:var(--nav-active)}
.projects-popover .project-pin:focus-visible{outline:2px solid currentColor;outline-offset:-2px}
.projects-popover .project-pin:disabled{opacity:.5;cursor:progress}
body[data-workspace=true] .projects-popover .project-picker-group h3{margin:0;padding:8px 8px 4px;font:400 12px/18px var(--font-ui);color:var(--muted)}
@media(pointer:coarse){body[data-workspace=true] .projects-popover .project-pin{flex-basis:44px;width:44px;height:44px}}
