/* Viewport workspace: white surfaces remain in workspace-light.css.
   Each tool has one input scroll body and one independent result canvas. */
body:not(.auth-locked) { --workspace-control-width: clamp(360px, 39vw, 500px); }
body:not(.auth-locked) :is(.cf-workbench,.lai-workspace,.pkg-workbench,.model-workbench) {
  min-width:0; min-height:0; border-radius:12px;
}
body:not(.auth-locked) :is(.cf-config,.lai-brief,.pkg-config,.model-config) {
  min-width:0; min-height:0; margin:0;
}
body:not(.auth-locked) :is(.cf-config-body,.lai-brief fieldset,.pkg-config-body,.model-config-scroll) {
  min-width:0; min-height:0; overscroll-behavior:contain;
  scrollbar-width:thin; scrollbar-color:#bdcfd1 transparent;
}
body:not(.auth-locked) :is(.cf-results,.lai-results,.pkg-results,.model-results) {
  min-width:0; min-height:0; padding:20px; scrollbar-gutter:stable;
}
body:not(.auth-locked) :is(.cf-results-head,.lai-results header,.pkg-results-head,.model-results-head) {
  gap:12px; margin:0 0 14px; flex-wrap:wrap;
}
body:not(.auth-locked) :is(.cf-results-head,.lai-results header,.pkg-results-head,.model-results-head) h2 {
  font-size:20px; line-height:1.3; margin:0;
}
body:not(.auth-locked) :is(.cf-submit,.lai-submit,.pkg-submit,.model-config-submit) {
  flex:0 0 auto; position:relative; padding:12px 16px;
  background:var(--ws-surface); border-top:1px solid var(--ws-line);
  backdrop-filter:none; z-index:3;
}
body:not(.auth-locked) :is(.cf-submit,.lai-submit,.pkg-submit,.model-config-submit) .primary {
  min-height:42px; padding:10px 14px; font-size:13px;
}
body:not(.auth-locked) :is(.cf-submit,.lai-submit,.pkg-submit,.model-config-submit) :is(p,span) {
  line-height:1.45; font-size:11px; overflow-wrap:anywhere;
}
body:not(.auth-locked) :is(.cf-submit,.lai-submit,.pkg-submit,.model-config-submit) p:empty { display:none; }
body:not(.auth-locked) .cf-submit #cf-target-wrap { flex-direction:row; align-items:center; gap:10px; margin-bottom:8px; }
body:not(.auth-locked) .cf-submit #cf-target { flex:1; min-width:0; min-height:34px; padding:6px 9px; }
body:not(.auth-locked) #cf-product-count:not([hidden]) {
  display:grid; grid-template-columns:minmax(120px,.8fr) minmax(0,1.2fr); align-items:center; gap:12px;
}
body:not(.auth-locked) #cf-product-count .cf-field { margin:0; }
body:not(.auth-locked) #cf-product-count .cf-note { margin:0; font-size:11px; }
body:not(.auth-locked) :is(.cf-config-body,.lai-brief,.pkg-config-body,.model-config-scroll) :is(input,select,textarea) {
  box-sizing:border-box; max-width:100%; font-size:13px;
}
body:not(.auth-locked) :is(.cf-config-body,.lai-brief,.pkg-config-body,.model-config-scroll) textarea {
  min-height:78px; line-height:1.55; resize:vertical;
}
body:not(.auth-locked) :is(.cf-config-body,.lai-brief,.pkg-config-body,.model-config-scroll) :is(select,input:not([type=checkbox],[type=radio],[type=range],[type=file],[type=color])) {
  min-height:38px; padding:8px 10px;
}
/* Short choices share a row; authored text retains the full input width. */
body:not(.auth-locked) :is(.lai-generation-settings,.pkg-generation-settings,.model-generation-settings) {
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 12px;
}
body:not(.auth-locked) [data-workspace-output-settings] > :is(.member-resolution,.generation-model-choice) {
  min-width:0; margin:0; padding:0; border:0; background:transparent;
}
body:not(.auth-locked) [data-workspace-output-settings] .generation-model-status {
  display:flex; flex-wrap:wrap; align-items:center; gap:4px 6px;
  min-height:38px; margin:0; font-size:12px; line-height:1.5;
}
body:not(.auth-locked) [data-workspace-output-settings] .member-resolution label {
  display:flex; flex-direction:column; align-items:stretch; gap:6px;
  margin:0; font-size:12px;
}
body:not(.auth-locked) [data-workspace-output-settings] .member-resolution small {
  display:block; margin-top:5px; line-height:1.45;
}
body:not(.auth-locked) .lai-brief fieldset { padding:16px; }
body:not(.auth-locked) .lai-brief :is(h2,p) { margin-top:0; }
body:not(.auth-locked) .lai-kicker { margin-bottom:6px; }
body:not(.auth-locked) .lai-brief h2 { font-size:17px; margin-bottom:6px; }
body:not(.auth-locked) .lai-brief label { margin-top:12px; }
body:not(.auth-locked) .lai-brief :is(input,textarea,select) { margin-top:6px; }
body:not(.auth-locked) .lai-generation-settings { border-top:1px solid var(--ws-line); margin-top:16px; padding-top:14px; }
body:not(.auth-locked) .lai-generation-settings label { margin:0; }
body:not(.auth-locked) :is(.pkg-section,.model-config-section) { padding:14px 16px; }
body:not(.auth-locked) .pkg-section label { gap:6px; margin-bottom:10px; }
body:not(.auth-locked) .pkg-section h2 { font-size:15px; margin:5px 0 12px; }
body:not(.auth-locked) .pkg-generation-settings > :not(.member-resolution,.generation-model-choice) { grid-column:1/-1; }
body:not(.auth-locked) .model-config-section h2 { font-size:17px; }
body:not(.auth-locked) .model-config-section input { margin-bottom:12px; }
body:not(.auth-locked) .model-config-section textarea { min-height:100px; margin-bottom:10px; }
body:not(.auth-locked) .model-kicker { margin-bottom:6px; }
body:not(.auth-locked) .pa-workbench .cf-config-body > .cf-section { padding:12px 16px; }
body:not(.auth-locked) .pa-workbench .cf-field { gap:6px; margin-bottom:10px; }
body:not(.auth-locked) .pa-workbench .cf-upload { min-height:84px; padding:8px; gap:4px; }
body:not(.auth-locked) .pa-directions { gap:6px; margin:10px 0; }
body:not(.auth-locked) .pa-directions button { padding:9px; gap:4px; }
body:not(.auth-locked) .pa-directions small { line-height:1.45; }
body:not(.auth-locked) .pa-workbench .cf-generation-settings { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 12px; }
body:not(.auth-locked) .pa-workbench .cf-generation-settings > :not(.member-resolution,.generation-model-choice) { grid-column:1/-1; }
body:not(.auth-locked) .pa-workbench .cf-config-body .cf-note { margin:6px 0; line-height:1.5; }
body:not(.auth-locked) .pa-workbench .cf-config-body .cf-note:empty { display:none; }
body:not(.auth-locked) :is(.cf-workbench,.lai-workspace,.pkg-workbench):has(>.member-feature-notice:not([hidden])) { padding-top:0; }
body:not(.auth-locked) :is(.cf-workbench,.lai-workspace,.pkg-workbench)>.member-feature-notice {
  position:static; grid-column:1/-1; border-radius:0; padding:8px 16px; align-items:center;
}
@media(min-width:901px) {
  body:not(.auth-locked) .sidebar { width:224px; padding:16px 12px 10px; }
  body:not(.auth-locked) .shell { margin-left:224px; }
  body:not(.auth-locked).nav-collapsed .sidebar { width:72px; padding:12px 8px; }
  body:not(.auth-locked).nav-collapsed .shell { margin-left:72px; }
  body:not(.auth-locked).nav-collapsed .sidebar-brand-row { flex-direction:column; gap:8px; margin-bottom:12px; }
  body:not(.auth-locked).nav-collapsed .sidebar-brand-row .brand { display:flex; padding:0; }
  body:not(.auth-locked).nav-collapsed .sidebar-brand-row .brand > span { display:none; }
  body:not(.auth-locked).nav-collapsed .sidebar-brand-row .brand-symbol { width:30px; height:30px; }
  body:not(.auth-locked).nav-collapsed .sidebar-collapse { width:30px; height:24px; font-size:18px; }
  body:not(.auth-locked) .sidebar nav :is(a,button) { min-height:38px; }
  body:not(.auth-locked) .topbar { height:56px; min-height:56px; flex:0 0 56px; padding:0 20px; }
  body:not(.auth-locked):has(#commerce-flow-root,#logo-studio-root,#packaging-studio-root,#model-workbench-root) {
    height:100dvh; overflow:hidden;
  }
  body:not(.auth-locked):has(#commerce-flow-root,#logo-studio-root,#packaging-studio-root,#model-workbench-root) .shell {
    height:100dvh; min-height:0; display:flex; flex-direction:column; overflow:hidden;
  }
  body:not(.auth-locked):has(#commerce-flow-root,#logo-studio-root,#packaging-studio-root,#model-workbench-root) .shell main {
    width:100%; max-width:none; flex:1; min-height:0; display:flex; flex-direction:column;
    padding:12px; box-sizing:border-box; overflow:hidden;
  }
  /* The route name is already in the topbar; retain the h1 for accessibility. */
  body:not(.auth-locked):has(#commerce-flow-root,#logo-studio-root,#packaging-studio-root,#model-workbench-root) #main > .heading-row {
    position:absolute; width:1px; height:1px; padding:0; margin:-1px;
    overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0;
  }
  body:not(.auth-locked):has(#commerce-flow-root,#logo-studio-root,#packaging-studio-root,#model-workbench-root) .shell > footer { display:none; }
  :is(#commerce-flow-root,#logo-studio-root,#packaging-studio-root,#model-workbench-root) {
    display:flex; flex:1; min-height:0; min-width:0; overflow:hidden;
  }
  body:not(.auth-locked) :is(.cf-workbench,.lai-workspace,.pkg-workbench,.model-workbench) {
    width:100%; height:100%; min-height:0; margin:0;
    grid-template-columns:var(--workspace-control-width) minmax(0,1fr);
    grid-template-rows:minmax(0,1fr); overflow:hidden;
  }
  body:not(.auth-locked) :is(.cf-workbench,.lai-workspace,.pkg-workbench):has(>.member-feature-notice:not([hidden])) {
    grid-template-rows:auto minmax(0,1fr);
  }
  body:not(.auth-locked) :is(.cf-config,.lai-brief,.pkg-config,.model-config) {
    display:flex; flex-direction:column; height:100%; max-height:none; overflow:hidden;
  }
  body:not(.auth-locked) :is(.cf-config-body,.lai-brief fieldset,.pkg-config-body,.model-config-scroll) {
    flex:1; overflow-y:auto; scrollbar-gutter:stable;
  }
  body:not(.auth-locked) :is(.cf-results,.lai-results,.pkg-results,.model-results) { overflow-y:auto; overscroll-behavior:contain; }
  body:not(.auth-locked) .cf-results .rg-hero img { height:clamp(220px,calc(100dvh - 330px),600px); }
  body:not(.auth-locked) .pa-empty { min-height:min(480px,calc(100dvh - 170px)); }
  body:not(.auth-locked) .model-preview-frame { height:min(58dvh,560px); min-height:280px; }
}
@media(min-width:901px) and (max-width:1100px) {
  body:not(.auth-locked) { --workspace-control-width:360px; }
  body:not(.auth-locked):not(.nav-collapsed) { --workspace-control-width:320px; }
}
@media(max-width:900px) {
  body:not(.auth-locked):has(#commerce-flow-root,#logo-studio-root,#packaging-studio-root,#model-workbench-root),
  body:not(.auth-locked):has(#commerce-flow-root,#logo-studio-root,#packaging-studio-root,#model-workbench-root) .shell {
    height:auto; min-height:100dvh; overflow:visible;
  }
  body:not(.auth-locked) .topbar { height:48px; padding:0 14px; }
  body:not(.auth-locked) .shell main { padding:14px 12px 28px; }
  body:not(.auth-locked) #main > .heading-row { margin-bottom:12px; }
  body:not(.auth-locked) #main > .heading-row h1 { font-size:20px; }
  body:not(.auth-locked) #main > .heading-row .eyebrow { display:none; }
  body:not(.auth-locked) :is(#commerce-flow-root,#logo-studio-root,#packaging-studio-root,#model-workbench-root) { display:block; overflow:visible; }
  body:not(.auth-locked) :is(.cf-workbench,.lai-workspace,.pkg-workbench,.model-workbench) {
    display:grid; grid-template-columns:minmax(0,1fr); height:auto; min-height:0; overflow:visible;
  }
  body:not(.auth-locked) :is(.cf-config,.lai-brief,.pkg-config,.model-config) { height:auto; max-height:none; overflow:visible; border-right:0; }
  body:not(.auth-locked) :is(.cf-config-body,.lai-brief fieldset,.pkg-config-body,.model-config-scroll) { max-height:none; overflow:visible; }
  body:not(.auth-locked) :is(.cf-results,.lai-results,.pkg-results,.model-results) { overflow:visible; padding:16px; }
  body:not(.auth-locked) :is(.cf-submit,.lai-submit,.pkg-submit,.model-config-submit) { position:sticky; bottom:0; }
  body:not(.auth-locked) .pa-workbench .cf-two { grid-template-columns:repeat(2,minmax(0,1fr)); }
  body:not(.auth-locked) .member-feature-notice { min-width:0; overflow-wrap:anywhere; gap:6px; }
  body:not(.auth-locked) .member-feature-notice a { white-space:normal; }
}
@media(max-width:800px) {
  body:not(.auth-locked) .sidebar { position:relative; width:100%; height:auto; padding:10px 12px; }
  body:not(.auth-locked) .sidebar-brand-row { margin-bottom:0; padding-bottom:8px; }
  body:not(.auth-locked) .sidebar-account:has(.account-sidebar-trigger) { position:absolute; top:10px; right:12px; margin:0; width:38px; }
  body:not(.auth-locked) .sidebar-account .account-sidebar-trigger { min-height:36px; padding:2px; justify-content:center; border-radius:9px; }
  body:not(.auth-locked) .sidebar-account .account-sidebar-trigger :is(strong,small) { display:none; }
  body:not(.auth-locked) .sidebar-account .account-sidebar-trigger > span:not(.avatar) { display:none; }
  body:not(.auth-locked) .sidebar nav { scrollbar-width:thin; }
  body:not(.auth-locked) .shell { margin-left:0; }
}
