/* One navigation layout for the workspace and its tools. Original editors remain intact. */
body{--workspace-nav-width:224px;--ws-line:#e5e5e7;--ws-motion:180ms cubic-bezier(.2,.7,.2,1)}
body.workspace-nav-collapsed{--workspace-nav-width:72px}
.ws-sidebar{position:sticky;top:82px;align-self:start;height:calc(100dvh - 82px);overflow-y:auto;scrollbar-width:thin;display:flex;flex-direction:column;gap:22px;padding:24px 16px 20px;background:#fff;border-right:1px solid var(--ws-line)}.ws-sidebar-top{display:flex;align-items:center;gap:12px;min-height:48px;padding:10px 14px;border:1px solid #e9e9eb;border-radius:11px;background:#f3f3f4;font-size:14px;font-weight:600}.ws-menu-button,.ws-menu-close{display:none}.ws-navigation{display:flex;flex-direction:column;gap:6px}.ws-nav-home,.ws-nav-shortcut{display:flex;align-items:center;gap:13px;padding:12px 14px;border-radius:10px;font-size:14px;min-height:46px}.ws-nav-home{background:#ececed;color:#242424;font-weight:600}.ws-nav-shortcut{color:#636363;margin-bottom:15px}.ws-nav-group{margin:0}.ws-nav-group summary{list-style:none;display:flex;align-items:center;gap:13px;min-height:49px;padding:12px 14px;border-radius:9px;font-size:14px;font-weight:600;color:#555;cursor:pointer}.ws-nav-group summary::-webkit-details-marker{display:none}.ws-nav-group summary::after{content:"";width:6px;height:6px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(-45deg);margin-left:auto;transition:transform var(--ws-motion)}.ws-nav-group[open] summary::after{transform:rotate(45deg)}.ws-nav-group[open] summary{color:#242424}.ws-nav-children{display:flex;flex-direction:column;gap:3px;margin:2px 0 10px 23px;border-left:1px solid var(--ws-line);padding-left:7px}.ws-nav-children a{display:flex;align-items:center;gap:10px;min-height:44px;padding:9px 10px;border-radius:8px;font-size:13px;color:#626262}.ws-nav-children svg{width:17px;height:17px}.ws-sidebar-bottom{display:flex;flex-direction:column;margin-top:auto;border-top:1px solid var(--ws-line);padding-top:15px;gap:4px}.ws-nav-caption{font-size:12px;color:#858585;margin:0 14px 6px}.ws-sidebar-bottom a{display:flex;align-items:center;gap:13px;padding:10px 14px;min-height:44px;font-size:13px;color:#626262;border-radius:8px}.ws-sidebar-bottom svg{width:18px;height:18px}
[data-shared-workspace-nav] [hidden]{display:none!important}
[data-shared-workspace-nav] .ws-nav-short-label{display:none!important}
[data-shared-workspace-nav] .ws-nav-description{display:none!important}
.ws-sidebar-toggle{display:flex;align-items:center;gap:10px;flex:none;width:100%;min-height:36px;padding:8px 12px;border:1px solid #e5e5e7;border-radius:8px;background:#fff;color:#626262;font:inherit;font-size:12px;cursor:pointer}
.ws-sidebar-toggle svg{width:20px;height:20px;flex:none}
.ws-sidebar-toggle:hover{background:#f4f4f5;color:#242424}
[data-shared-workspace-nav] svg{width:20px;height:20px;display:block;flex:none}
[data-shared-workspace-nav] a,[data-shared-workspace-nav] summary{transition:background 140ms ease,color 140ms ease;text-decoration:none}
[data-shared-workspace-nav] a:hover,[data-shared-workspace-nav] summary:hover{background:#f3f3f4;color:#242424}
[data-shared-workspace-nav] a[aria-current="page"]{background:#ececed!important;color:#242424!important;font-weight:600}
[data-shared-workspace-nav] .ws-nav-home:not([aria-current]){background:transparent;font-weight:450;color:#626262}
[data-shared-workspace-nav] :focus-visible{outline:2px solid #6c727b!important;outline-offset:2px}
@media(min-width:980px){
 body.workspace-page .ws-layout{grid-template-columns:var(--workspace-nav-width) minmax(0,1fr)!important}
 body[data-shared-navigation] :is(.studio-shell,.tts-layout,.cv-layout,.chat-shell){grid-template-columns:var(--workspace-nav-width) minmax(0,1fr)!important}
 body[data-shared-navigation][data-shared-navigation] .unified-workspace-sidebar{position:sticky;top:48px;align-self:start;display:flex;flex-direction:column;width:var(--workspace-nav-width);height:calc(100dvh - 48px);min-height:0;max-height:calc(100dvh - 48px);padding:14px 12px;gap:14px;background:#fff;border:0;border-right:1px solid #e5e5e7;overflow:auto;scrollbar-width:thin;box-sizing:border-box}
 body[data-shared-navigation]:not(.studio-page) .unified-workspace-sidebar{top:72px;height:calc(100dvh - 72px);max-height:calc(100dvh - 72px)}
 body[data-shared-navigation][data-shared-navigation] .unified-workspace-sidebar .ws-navigation{display:flex;flex:0 0 auto;flex-direction:column;gap:6px;overflow:visible;margin:0;padding:0}
 body[data-shared-navigation][data-shared-navigation] .unified-workspace-sidebar .ws-navigation a{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:10px;width:auto;height:auto;min-height:42px;padding:9px 10px;color:#626262;font-size:13px;line-height:1.5;text-align:left;border-radius:8px;box-sizing:border-box}
 body[data-shared-navigation][data-shared-navigation] .unified-workspace-sidebar .ws-navigation a>span{width:auto;white-space:normal;letter-spacing:0}
 body[data-shared-navigation][data-shared-navigation] .unified-workspace-sidebar .ws-nav-group{border:0;padding:0;margin:0;background:transparent}
 body[data-shared-navigation][data-shared-navigation] .unified-workspace-sidebar .ws-nav-group summary{display:flex;gap:10px;align-items:center;padding:10px 12px;min-height:44px;border:0;font-size:14px;font-weight:600;line-height:1.5;color:#555;background:transparent}
 body[data-shared-navigation][data-shared-navigation] .unified-workspace-sidebar .ws-nav-children{display:flex;flex-direction:column;gap:3px;margin:2px 0 10px 20px;padding:0 0 0 7px;border-left:1px solid #e5e5e7}
 body[data-shared-navigation][data-shared-navigation] .unified-workspace-sidebar details:not([open])>.ws-nav-children{display:none}
 body[data-shared-navigation][data-shared-navigation] .unified-workspace-sidebar .ws-sidebar-top{font-size:14px;min-height:42px;padding:9px 10px;gap:10px;line-height:1.5}
 body[data-shared-navigation][data-shared-navigation] .unified-workspace-sidebar #sidebar-admin-entry{display:none!important}
 body[data-shared-navigation] .studio-header .sidebar-account{margin:0 0 0 12px;padding:0;display:flex;flex-direction:row;gap:12px;align-items:center}
 body[data-shared-navigation] .studio-header .sidebar-balance{width:auto;min-height:30px;padding:3px 9px;display:flex;flex-direction:row;gap:7px;white-space:nowrap}
 body[data-shared-navigation] .studio-header .sidebar-balance small{white-space:nowrap}
 body[data-shared-navigation] .studio-header .avatar-button{width:30px;height:30px;flex:none}
 body[data-shared-navigation] .studio-header .studio-site-home{order:3;margin-left:12px}
 body[data-shared-navigation] .studio-header .sidebar-account{margin-left:auto}
 body[data-shared-navigation] .ws-menu-close{display:none}
 body.workspace-nav-collapsed [data-shared-workspace-nav]{padding-inline:10px;gap:12px}
 body.workspace-nav-collapsed [data-shared-workspace-nav] .ws-sidebar-toggle{justify-content:center;padding:8px 0}
 body.workspace-nav-collapsed [data-shared-workspace-nav] .ws-sidebar-toggle svg{transform:rotate(180deg)}
 body.workspace-nav-collapsed [data-shared-workspace-nav] :is(.ws-sidebar-top,.ws-nav-caption,.ws-nav-children,.ws-sidebar-toggle>span){display:none!important}
 body.workspace-nav-collapsed [data-shared-workspace-nav] :is(a,summary){justify-content:center!important;padding:12px 0!important;gap:0!important;min-height:46px!important}
 body.workspace-nav-collapsed [data-shared-workspace-nav] :is(a,summary)>span:not([data-ws-icon]){display:none!important}
 body.workspace-nav-collapsed [data-shared-workspace-nav] summary::after{display:none}
 body.workspace-nav-collapsed [data-shared-workspace-nav] .ws-nav-current-group>summary{background:#ececed;color:#242424}
 body.workspace-nav-collapsed [data-shared-workspace-nav] .ws-nav-shortcut{margin-bottom:12px}
 body.workspace-nav-collapsed [data-shared-workspace-nav] .ws-sidebar-bottom{padding-top:12px}
 .shared-chat-history{position:relative;flex:none;margin:0 0 12px;border-bottom:1px solid #e5e5e7}
 .shared-chat-history>summary{cursor:pointer;padding:10px 0;font-size:13px;color:#626262}
 .shared-chat-history .conversation-list{max-height:220px;overflow:auto}
}
/* Keep the same 72px rail on every shared-navigation page. Full names remain
   available in the expanded menu and in each control's accessible name. */
@media(min-width:980px){
 body.workspace-nav-collapsed [data-shared-workspace-nav]{width:72px;min-width:72px;max-width:72px;overflow-x:hidden;gap:10px;box-sizing:border-box}
 body.workspace-nav-collapsed [data-shared-workspace-nav] :is(a,summary,[data-sidebar-toggle]){display:flex;flex-direction:column!important;align-items:center!important;justify-content:center;gap:3px!important;min-height:48px!important;padding:7px 0!important}
 body.workspace-nav-collapsed [data-shared-workspace-nav] :is(a,summary,[data-sidebar-toggle])>.ws-nav-short-label{display:block!important;flex:none;width:100%;max-width:52px;padding:0;background:transparent;color:inherit;font-size:10px;line-height:14px;font-weight:400;letter-spacing:0;white-space:nowrap;text-align:center}
 body.workspace-nav-collapsed [data-shared-workspace-nav] :is(a,summary,[data-sidebar-toggle]) svg{width:18px;height:18px;flex:none}
}
@media(prefers-reduced-motion:reduce){[data-shared-workspace-nav] *{transition:none!important;animation:none!important}}

/* The native popover sits above the scrolling rail without widening it. Its
   links are the original permission-checked controls, temporarily moved here. */
[data-shared-workspace-nav] .ws-nav-flyout{--nav-popup-bg:#fff;--nav-popup-line:#e5e5e7;--nav-popup-ink:#242424;--nav-popup-muted:#7b7b80;--nav-popup-soft:#f4f5f5;position:fixed;inset:auto;box-sizing:border-box;width:min(336px,calc(100vw - 24px));max-height:calc(100dvh - 24px);margin:0;padding:0;border:1px solid var(--nav-popup-line);border-radius:16px;background:var(--nav-popup-bg);color:var(--nav-popup-ink);box-shadow:0 12px 36px #20242b1a;overflow:auto;overscroll-behavior:contain;text-align:left;font:inherit}
[data-shared-workspace-nav] .ws-nav-flyout::backdrop{background:transparent;pointer-events:none}
[data-shared-workspace-nav] .ws-nav-flyout>header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:15px 16px 13px;border-bottom:1px solid var(--nav-popup-line)}
[data-shared-workspace-nav] .ws-nav-flyout>header strong{font-size:14px;font-weight:600;line-height:22px}
[data-shared-workspace-nav] .ws-nav-flyout>header>span{font-size:11px;line-height:20px;color:var(--nav-popup-muted)}
:root body .ws-sidebar[data-shared-workspace-nav] .ws-nav-flyout>.ws-nav-children{display:flex!important;flex-direction:column;gap:3px;margin:0!important;padding:8px!important;border:0!important}
:root body .ws-sidebar[data-shared-workspace-nav] .ws-nav-flyout>.ws-nav-children>a{display:grid!important;grid-template-columns:34px minmax(0,1fr);grid-template-rows:auto auto;column-gap:11px!important;row-gap:3px!important;align-items:center!important;justify-content:initial!important;box-sizing:border-box;min-height:62px!important;width:100%;padding:10px!important;border:1px solid transparent;border-radius:11px;color:var(--nav-popup-ink);text-align:left;line-height:1.5;white-space:normal}
:root body .ws-sidebar[data-shared-workspace-nav] .ws-nav-flyout>.ws-nav-children>a:hover,:root body .ws-sidebar[data-shared-workspace-nav] .ws-nav-flyout>.ws-nav-children>a[aria-current=page]{background:var(--nav-popup-soft)!important;border-color:var(--nav-popup-line);color:var(--nav-popup-ink)!important}
:root body .ws-sidebar[data-shared-workspace-nav] .ws-nav-flyout>.ws-nav-children>a>span[aria-hidden=true]:not(.ws-nav-short-label){display:grid!important;place-items:center;grid-column:1;grid-row:1/3;width:34px!important;height:34px;border:1px solid var(--nav-popup-line);border-radius:10px;background:var(--nav-popup-soft)}
:root body .ws-sidebar[data-shared-workspace-nav] .ws-nav-flyout>.ws-nav-children>a>.ws-nav-label{display:block!important;grid-column:2;grid-row:1;font-size:13px;font-weight:600;line-height:20px;white-space:normal}
:root body .ws-sidebar[data-shared-workspace-nav] .ws-nav-flyout>.ws-nav-children>a>.ws-nav-description{display:block!important;grid-column:2;grid-row:2;min-width:0;font-size:11px;font-weight:400;line-height:18px;color:var(--nav-popup-muted);white-space:normal;overflow-wrap:anywhere}
:root body .ws-sidebar[data-shared-workspace-nav] .ws-nav-flyout>.ws-nav-children>a>.ws-nav-short-label{display:none!important}
:root body .ws-sidebar[data-shared-workspace-nav] .ws-nav-flyout>.ws-nav-children>a svg{width:18px;height:18px}
:root body .ws-sidebar[data-shared-workspace-nav] .ws-nav-flyout [hidden]{display:none!important}
html[data-wwx-appearance=dark] [data-shared-workspace-nav] .ws-nav-flyout{--nav-popup-bg:#292d34;--nav-popup-line:#454a53;--nav-popup-ink:#f1f1f3;--nav-popup-muted:#b7bac2;--nav-popup-soft:#333841}

@media(min-width:980px){[data-shared-workspace-nav] .ws-sidebar-toggle{position:sticky;top:0;z-index:2;background:#fff}body.workspace-nav-collapsed [data-shared-workspace-nav] .ws-nav-current-group>summary{background:#ececed!important;color:#242424!important}}

@media(max-width:979px){
 body[data-shared-navigation] :is(.studio-shell,.tts-layout,.cv-layout,.chat-shell){display:flex;flex-direction:column}
 body[data-shared-navigation] .unified-workspace-sidebar{position:relative;top:0;height:auto;max-height:none;width:100%;min-height:0;flex:none;padding:10px 14px;border-right:0;border-bottom:1px solid #e5e5e7;gap:10px;overflow:visible}
 body[data-shared-navigation] .unified-workspace-sidebar .ws-sidebar-toggle{position:static;min-height:40px}
 body[data-shared-navigation].workspace-nav-collapsed .unified-workspace-sidebar>:not(.ws-sidebar-toggle){display:none!important}
 body[data-shared-navigation]:not(.workspace-nav-collapsed) .unified-workspace-sidebar{max-height:60dvh;overflow-y:auto}
 body[data-shared-navigation] .unified-workspace-sidebar .ws-sidebar-top{display:none}
 body[data-shared-navigation] .chat-main{flex:1;min-height:0;width:100%}
}

/* The home drawer uses the same breakpoint as shared tool navigation. Its
   explicit open/close controls must survive the common sidebar defaults. */
@media(max-width:979px){
 body.workspace-page .ws-menu-button,body.workspace-page .ws-menu-close{display:inline-flex}
 body.workspace-page [data-shared-workspace-nav] .ws-sidebar-toggle{display:none}
 body.workspace-page .ws-sidebar{position:fixed;top:68px;bottom:0;left:0;z-index:40;width:min(292px,calc(100vw - 30px));height:calc(100dvh - 68px);max-height:calc(100dvh - 68px);overflow-y:auto}
}
