/* Shared reading hierarchy. Image galleries retain their visual layout. */
:root {
  --ink: #2b3431;
  --muted: #616c66;
  --line: #dbe2dc;
  --type-title: 24px;
  --type-section: 16px;
  --type-body: 14px;
  --type-helper: 12px;
}
body::after { opacity: .035; }
.studio-sidebar { background: #f7f9f5f5; }
.product-header { background: #fafcf8ed; }
.studio-sidebar .brand small,
.sidebar-heading, .sidebar-footer, .header-location,
.help-button, .api-status, .page-subtitle, .workspace-edition,
.studio-footer { color: var(--muted); font-size: var(--type-helper); }
.studio-sidebar .nav-item { color: #48544c; font-size: var(--type-body); }
.studio-sidebar .nav-item.active { font-weight: 600; }
.sidebar-account { flex: 0 0 auto; padding-top: 14px; }
.sidebar-account .nav-item { min-height: 44px; padding: 10px 12px; border-color: transparent; background: transparent; }
.sidebar-account .nav-item span { color: inherit; font-size: inherit; }
.sidebar-account .nav-item:hover { background: #e8eee6; }
.sidebar-account .nav-item.active { background: #deebe1; }
.account-controls .account-header-button { font-size: var(--type-body); }
.workspace-heading h1 { color: var(--ink); font-size: var(--type-title); font-weight: 600; }
.workspace-heading > div { min-width: 0; }
.workspace-balance { display: flex; align-items: center; justify-content: flex-end; flex: 0 1 auto; gap: 10px; min-width: 0; max-width: 50%; min-height: 44px; padding: 7px 0 7px 10px; border: 0; border-radius: 6px; background: transparent; color: #205f4b; text-align: right; }
.workspace-balance > span { color: var(--muted); font-size: var(--type-helper); white-space: nowrap; }
.workspace-balance strong { min-width: 0; font-size: 20px; font-weight: 600; line-height: 1.3; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.workspace-balance svg { flex: 0 0 14px; width: 14px; height: 14px; color: var(--muted); }
.workspace-balance:hover { color: #174d3b; background: #f7faf580; }
.workspace-balance:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 4px; }
.page-subtitle { line-height: 1.6; }
.workspace-edition { padding: 3px 8px; border: 1px solid #cbd8ca; border-radius: 4px; white-space: nowrap; }
.editor-column, .result-panel, .gallery-view, .model-workbench {
  border-color: #ced8cf;
  background: #fcfdfaf7;
  box-shadow: none;
}
.editor-heading h2, .model-workbench-heading h2,
.section-heading h2, .result-toolbar h2,
.inline-history-heading h2, .favorites-heading h2,
.gallery-empty h3, .studio-help h3 {
  color: var(--ink);
  font-size: var(--type-section);
  font-weight: 600;
}
.setting-label, .field-label, .design-field,
.general-modes button, .generation-modes button,
.prompt-history-button, .favorite-prompt-trigger,
.workspace-tabs button, .gallery-filters button,
.work-search input, .design-field input {
  color: #465249;
  font-size: var(--type-body);
}
.optional, .char-count, .text-link, .prompt-preview,
.prompt-presets button, .drop-zone small,
.result-toolbar p, .starter-note,
.task-card p, .task-card small, .task-title span, .task-summary,
.inline-history-heading p, .inline-history-empty,
.model-feedback .model-selection-status,
.resolution-field .setting-label, .model-count {
  color: var(--muted);
  font-size: var(--type-helper);
  line-height: 1.6;
}
.model-feedback .model-selection-status[data-state=error] { color: #9b473b; }
.model-output-row { border-color: var(--line); }
.resolution-card-label, .ratio-options b { font-size: var(--type-body); font-weight: 500; }
.resolution-card-price { color: var(--muted); font-size: var(--type-helper); }
.model-count select { font-size: var(--type-body); }
.prompt-wrap textarea, .design-field input { color: var(--ink); border-color: #c7d2c8; }
.prompt-wrap textarea::placeholder, .design-field input::placeholder,
.work-search input::placeholder { color: #69736d; }
.prompt-presets button { background: #f6f8f3; }
.general-modes, .generation-modes { background: #eef2eb; }
.prompt-history-button, .favorite-prompt-trigger { font-weight: 400; }
.ratio-options label > span { color: #465249; }
.generate-dock { background: #f5f8f0; }
.generate-button .button-copy strong { font-size: var(--type-body); font-weight: 600; }
.workspace-tabs button { font-weight: 500; }
.workspace-tabs button[aria-selected=true] { color: #216a49; font-weight: 600; }
.empty-state h2 { color: var(--ink); font-size: var(--type-section); font-weight: 600; }
.empty-state > p, .help-steps p, .help-note p,
.starter-prompts button, .gallery-empty { color: var(--muted); font-size: var(--type-body); }
.starter-prompts { flex-wrap: wrap; }
.starter-prompts button { min-height: 40px; background: #fff; }
.empty-art { margin-bottom: 12px; }
.studio-help h2, .history-dialog h2 { font-size: var(--type-title); font-weight: 600; }
.studio-help .eyebrow, .history-dialog .eyebrow { display: none; }
.history-card p, .favorite-card p { font-size: var(--type-body); }
.history-card small, .favorite-card small { font-size: var(--type-helper); }
.nav-count, #promptHistoryCount, .footer-help { font-size: var(--type-helper); }
.form-message:empty { display: none; }
.model-feedback:not(:has(> :not([hidden]))) { display: none; }
.api-status[data-state=ready] { display: none; }
.result-panel:has(#emptyState:not([hidden])) > .result-toolbar { display: none; }

/* A compact navigation rail leaves the canvas most of the available width. */
.sidebar-collapse-toggle { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 36px; width: 36px; height: 36px; margin-left: -6px; padding: 8px; border: 0; border-radius: 6px; background: transparent; color: #536359; }
.sidebar-collapse-toggle:hover { background: #e8eee6; color: #216a49; }
.sidebar-collapse-toggle svg { width: 20px; height: 20px; }
.navigation-tooltip { position: fixed; z-index: 60; max-width: min(260px, calc(100vw - 100px)); padding: 7px 10px; border: 1px solid #d3ddd2; border-radius: 6px; background: #fff; color: #263c30; box-shadow: 0 3px 12px #253c3014; font-size: 12px; line-height: 1.5; pointer-events: none; }
@media (min-width: 821px) {
  :root { --sidebar-width: 224px; }
  body.sidebar-collapsed { --sidebar-width: 72px; }
  .studio-sidebar { padding: 16px 12px 14px; }
  .studio-sidebar .product-brand { display: flex; align-items: center; min-height: 44px; padding: 0 10px; margin-bottom: 28px; }
  .studio-sidebar .brand { gap: 10px; }
  .studio-sidebar .brand strong { font-size: 24px; }
  .studio-sidebar .brand small { display: none; }
  .studio-sidebar .brand-mark, .studio-sidebar .brand-mark img { width: 30px; height: 36px; }
  .studio-sidebar .nav-item { min-height: 44px; padding: 10px 12px; border-color: transparent; }
  .studio-sidebar .nav-item.active { border-color: transparent; }
  .studio-sidebar .nav-item.active::after { display: none; }
  .sidebar-footer { padding-top: 14px; }
  .product-header { padding-inline: 24px; gap: 14px; }
  .workspace-frame { padding: 18px 24px 0; }
  .workspace-heading, .model-workbench, .app-shell, body[data-view=assets] .app-shell { max-width: 1760px; }
  .workspace-heading { min-height: 54px; margin-bottom: 14px; }
  .editor-column, .result-panel, .gallery-view, .model-workbench { border-color: #d4ddd3; }
  body.sidebar-collapsed .studio-sidebar { padding-inline: 12px; }
  body.sidebar-collapsed .product-brand { padding-inline: 0; justify-content: center; }
  body.sidebar-collapsed .brand > span:last-child,
  body.sidebar-collapsed .nav-item > span,
  body.sidebar-collapsed .sidebar-heading > span,
  body.sidebar-collapsed .sidebar-footer { display: none; }
  body.sidebar-collapsed .sidebar-heading { min-height: 18px; padding: 0; }
  body.sidebar-collapsed .personal-heading { min-height: 1px; margin: 15px 10px 11px; border-top: 1px solid var(--line); }
  body.sidebar-collapsed .primary-nav { overflow-x: hidden; }
  body.sidebar-collapsed .nav-item { width: 100%; padding-inline: 0; justify-content: center; gap: 0; }
  body.sidebar-collapsed .nav-item svg { width: 20px; height: 20px; }
  body.sidebar-collapsed .sidebar-account { padding-top: 14px; }
}
@media (min-width: 1024px) {
  .app-shell { grid-template-columns: clamp(310px, 28vw, 400px) minmax(0, 1fr); gap: 18px; }
}
@media (max-width: 820px) {
  .sidebar-collapse-toggle { display: none; }
}

@media (min-width: 1280px) {
  /* Keep the first brief field in the initial 1366×768 viewport while the
     editor itself remains scrollable. */
  .workspace-heading { min-height: 50px; margin-bottom: 10px; }
  .model-workbench { padding: 10px 14px 8px; }
  .model-workbench-heading { margin-bottom: 6px; }
  .editor-column { height: max(420px, calc(100dvh - 282px)); max-height: 820px; }
  .result-panel { min-height: max(420px, calc(100dvh - 282px)); }
  .brief-heading { margin-top: 12px; }
  .empty-state { min-height: max(280px, calc(100dvh - 430px)); }
}
@media (max-width: 820px) {
  .workspace-heading h1 { font-size: var(--type-title); }
  .workspace-heading { min-height: 58px; }
  .empty-state { min-height: 240px; padding: 22px 4px; }
  .empty-art { width: 52px; height: 60px; margin-bottom: 12px; }
  .empty-art > img { width: 42px; height: 50px; }
  .starter-prompts { margin: 16px 0 10px; gap: 8px; }
  .starter-prompts button { font-size: var(--type-helper); }
  .prompt-wrap textarea, .design-field input, .work-search input,
  .model-count select { font-size: 16px; }
  /* Keep scrolling on touch screens free of stacked live blur surfaces. */
  body { background: #e8efea; }
  body::before, body::after { content: none; }
  .studio-sidebar, .product-header, .model-workbench, .editor-column,
  .result-panel, .generate-dock, .sidebar-scrim,
  .account-dialog, .account-page-intro, .account-guest-card,
  .account-detail-card, .account-usage { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .account-page-view .account-page .account-profile-card,
  .account-page-view .account-page .account-rules-card,
  .account-page-view .account-page .account-usage,
  .account-page-view .account-page .account-guest-card { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .studio-sidebar { background: #f7f9f5; }
  .product-header { background: #fafcf8; }
  .model-workbench, .editor-column, .result-panel { background: #fcfdfa; }
  .generate-dock { background: #f6faf3; }
  dialog::backdrop, .account-dialog::backdrop { backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (max-width: 560px) {
  .workspace-heading { gap: 12px; }
  .workspace-balance { flex-direction: column; align-items: flex-end; justify-content: center; gap: 2px; max-width: 45%; }
  .workspace-balance strong { font-size: 18px; }
  .workspace-balance svg { display: none; }
  .workspace-tabs { gap: 18px; }
  .workspace-tabs button { font-size: var(--type-body); }
  .result-toolbar { padding-inline: 15px; }
  .canvas { padding-inline: 15px; }
  .resolution-card-price { font-size: var(--type-helper); }
  .resolution-field .setting-label, .model-count { font-size: var(--type-helper); }
  .empty-state h2 { font-size: var(--type-section); }
  .empty-state > p { font-size: var(--type-body); }
}
