/* Shared workspace geometry and menus. Existing page themes and routes are retained. */
:root {
  --xc-page-w: min(1920px, calc(100vw - 48px)); --xc-page-pad: 24px;
  --xc-title: 20px; --xc-lead: 14px; --xc-body: 14px; --xc-meta: 12.5px;
}
/* Native menus need an opaque surface; translucent page tokens render white on Windows. */
html select { color-scheme: light; }
html select :is(option,optgroup) {
  background-color: #f7f4ee !important;
  color: #26211a !important;
}
html select option:checked {
  background-color: #eadfc8 !important;
  color: #26211a !important;
}
html select option:disabled {
  background-color: #f7f4ee !important;
  color: #817b72 !important;
}
html:is(.theme-dark,.studio-theme-dark) select { color-scheme: dark !important; }
html:is(.theme-dark,.studio-theme-dark) select :is(option,optgroup) {
  background-color: #252629 !important;
  color: #f0efeb !important;
}
html:is(.theme-dark,.studio-theme-dark) select option:checked {
  background-color: #414348 !important;
  color: #f6e8b6 !important;
}
html:is(.theme-dark,.studio-theme-dark) select option:disabled {
  background-color: #252629 !important;
  color: #96979c !important;
}
:root, html.theme-dark, html.studio-theme-dark { --xc-topbar-h: var(--xc-measured-topbar-h,86px); }
html.studio-shell-on:not(.studio-canvas-full) { --xc-topbar-h: var(--xc-measured-topbar-h,86px); }
body.xc-home { --xc-page-w: min(1920px, calc(100vw - 48px)); }
body.xc-home .wb-page, body.xc-activity .wb-page, .wb-page, body.xc-team .scene, body.xc-account .shell, .xc-help-wrap, .gal-wrap, .mg-wrap,
.xc-film .film-wrap, .page > .wrap, body.xc-api .wrap, body.xc-typed .wrap,
body.xc-api .api-shell,
.xc-assemble .asm-gate-panel, .xc-autoscript .as-gate-panel,
.canvas-gate .studio-proj-layout, .canvas-gate .studio-proj-topbar {
  width: min(var(--xc-page-w), calc(100% - 32px)) !important;
  max-width: var(--xc-page-w) !important; margin-inline: auto;
}
.xc-home .wb-sec-head h2 { font-size: 19px; }
.xc-home .wb-qcard h5, .xc-home .wb-skill .t { font-size: 15px; line-height: 1.45; }
.xc-home .wb-qcard p, .xc-home .wb-skill .d { font-size: 13px; line-height: 1.65; }
.xc-home .wb-qcard, .xc-home .wb-skill { border-radius: 12px; }
.xc-home .wb-btn { min-height: 38px; font-size: 13px; }
.xc-header { background: #fdfcf9; backdrop-filter: none; -webkit-backdrop-filter: none; }
html:is(.theme-dark,.studio-theme-dark) .xc-header { background: #1b1d21; }
.xc-nav { flex: 1 1 auto; }
.xc-pill-menu {
  --workshop-menu-bg: #fdfcf9; --workshop-menu-text: #27241e; --workshop-menu-muted: #686154;
  position: fixed; left: var(--xc-menu-left,12px); top: var(--xc-menu-top,80px);
  box-sizing: border-box; width: min(570px, calc(100vw - 24px)); max-height: var(--xc-menu-space,calc(100dvh - 100px));
  overflow-y: auto; overflow-x: hidden; scrollbar-width: none;
  background: var(--workshop-menu-bg); color: var(--workshop-menu-text);
  border: 1px solid rgba(130,116,87,.24); box-shadow: 0 14px 42px rgba(57,45,21,.14);
  padding: 12px; backdrop-filter: none;
}
.xc-pill-menu::-webkit-scrollbar { display: none; }
html:is(.theme-dark,.studio-theme-dark) .xc-pill-menu {
  --workshop-menu-bg: #1b1d21; --workshop-menu-text: #f0ede5; --workshop-menu-muted: #b4b0a6;
  border-color: #383b41; box-shadow: 0 16px 48px rgba(0,0,0,.3);
}
.xc-nav-dropdown[open] .xc-pill-menu { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.xc-pill-menu-head { grid-column: 1 / -1; border-bottom-color: rgba(130,116,87,.24); padding: 8px 10px 14px; }
.xc-pill-menu-head b { font-size: 15px; }
.xc-pill-menu-head small, .xc-pill-menu > :is(a,button) small { color: var(--workshop-menu-muted); font-size: 12px; line-height: 1.5; }
.xc-pill-menu > :is(a,button) { min-width: 0; min-height: 62px; padding: 10px; color: var(--workshop-menu-text); text-align: left; }
.xc-pill-menu > :is(a,button) b { font-size: 14px; }
.xc-pill-menu > :is(a,button) > span { min-width: 0; }
.xc-pill-menu > a > i, .xc-pill-menu .xc-menu-icon { color: #8a6d1f; background: rgba(138,109,31,.08); border-color: rgba(138,109,31,.2); }
html:is(.theme-dark,.studio-theme-dark) .xc-pill-menu > a > i,
html:is(.theme-dark,.studio-theme-dark) .xc-pill-menu .xc-menu-icon { color: #e4d49e; }
.xc-pill-menu > :is(a,button):hover { background: rgba(138,109,31,.1); }
.xc-pill-menu > :is(a,button):focus-visible { outline: 2px solid #9b7a28; outline-offset: -2px; }
@media (max-width: 1500px) {
  .xc-header { flex-wrap: wrap; }
  .xc-brand-badge { display: none; }
  .xc-header-actions { gap: 5px; }
  .xc-header-actions .xc-top-btn { padding: 7px 10px; }
  .xc-nav { order: 3; flex-basis: 100%; margin-left: 0; overflow-x: auto; overflow-y: hidden; }
  .xc-nav-item { padding: 7px 12px; }
}
@media (max-width: 640px) {
  :root, body.xc-home { --xc-page-w: calc(100vw - 24px); --xc-page-pad: 12px; }
  .xc-pill-menu { position: fixed; left: 12px; top: var(--xc-menu-top,80px); width: calc(100vw - 24px); }
  .xc-pill-menu > :is(a,button) { gap: 7px; padding: 8px; min-height: 58px; }
  .xc-pill-menu > :is(a,button) b { font-size: 13px; }
  .xc-pill-menu > :is(a,button) small { font-size: 11px; }
  .xc-header-actions { flex-basis: 100%; flex-wrap: wrap; justify-content: flex-start; }
}

/* The project gate uses the same outer width as the other workspace pages. */
body.xc-canvas .canvas-gate .studio-proj-workspace,
body.xc-canvas .canvas-gate .studio-proj-workspace.gate-has-rail {
  width: min(var(--xc-page-w), calc(100% - 32px)) !important;
  max-width: var(--xc-page-w) !important; box-sizing: border-box;
  padding-inline: 0 !important;
}
.canvas-gate .studio-proj-workspace :is(.studio-proj-layout,.studio-proj-topbar) {
  width: 100% !important; max-width: none !important;
}
