/* Shared presentation layer for the existing SPA and five-stage workbench.
   Keep workflow, storage, permissions and generation code in their owners. */
html[data-theme="light"] {
  --theme-canvas: #f4f1eb;
  --theme-surface: #fffdf9;
  --theme-surface-soft: #f7f5f0;
  --theme-surface-raised: #eee9df;
  --theme-text: #26231d;
  --theme-text-soft: #696459;
  --theme-text-dim: #817a6e;
  --theme-line: rgba(66, 55, 36, .13);
  --theme-line-strong: rgba(66, 55, 36, .22);
  --theme-shadow: 0 8px 24px rgba(66, 55, 36, .055);
}
html[data-theme] :is(.app:not(.product-home-shell), .app > .content, .app .view, .v2-shell, .wk-page, .wk-warehouse, .wk-library) {
  --bg: var(--theme-canvas); --bg-2: var(--theme-surface); --bg-3: var(--theme-surface-soft);
  --surface: var(--theme-surface); --surface-2: var(--theme-surface-soft); --surface-3: var(--theme-surface-raised);
  --text: var(--theme-text); --text-dim: var(--theme-text-soft); --muted: var(--theme-text-soft); --dim: var(--theme-text-dim);
  --line: var(--theme-line); --line-strong: var(--theme-line-strong);
  --ds-color-workspace: var(--theme-canvas); --ds-color-surface: var(--theme-surface);
  --ds-color-surface-secondary: var(--theme-surface-soft); --ds-color-surface-elevated: var(--theme-surface);
  --ds-color-text-primary: var(--theme-text); --ds-color-text-secondary: var(--theme-text-soft);
  --ds-color-text-tertiary: var(--theme-text-dim); --ds-color-border: var(--theme-line);
  --ds-color-border-card: var(--theme-line); --ds-color-border-control: var(--theme-line-strong);
}
/* Legacy chat has its own palette, including dialogs mounted on body. */
html[data-theme] {
  --ch-bg: var(--theme-canvas); --ch-surface: var(--theme-surface); --ch-surface-2: var(--theme-surface-soft);
  --ch-input: var(--theme-surface); --ch-line: var(--theme-line-strong); --ch-text: var(--theme-text);
  --ch-text-dim: var(--theme-text-soft); --ch-text-mute: var(--theme-text-dim);
}
html[data-theme="light"] :is(.ch-page, .ch-modal) { color-scheme: light; }
html[data-theme="light"] .app .view { background: var(--theme-canvas) !important; color: var(--theme-text); }
html[data-theme="light"] :is(.wk-warehouse[data-script-redesign], .xf-page, .sb-page, .el2-page, .fm-page, .vd-page) { color: var(--theme-text) !important; }
html[data-theme="light"] .xf-page { --bg: var(--theme-canvas); --card: var(--theme-surface); --soft: var(--theme-surface-soft); --line: var(--theme-line); --text: var(--theme-text); --muted: var(--theme-text-soft); --accent: var(--ui-accent); }
html[data-theme="light"] :is(.sk-project-head, .sk-pic, .sk-episode-panel, .sk-reader, .wk-panel.wk-settings, .wk-panel.wk-handoff,
  .xf-hero, .xf-tabs, .xf-batch, .xf-gallery, .xf-card, .xf-setting, .xf-modal, .xf-modal-head, .xf-prompt,
  .sb-page, .sb-card, .sb-preview, .sb-pv2, .sb-settings, .sb-prompt, .sb-modal,
  .el2-monitor, .el2-info, .el2-tl, .el2-info-prompt, .el2-tool-link,
  .fm-empty, .fm-films, .fm-card, .fm-panel, .vd-controls, .vd-card) {
  background: var(--theme-surface) !important; color: var(--theme-text); border-color: var(--theme-line) !important;
}
html[data-theme="light"] :is(.sk-meta span, .sk-counts span, .xf-card-head, .xf-toolbar, .xf-empty,
  .el2-block, .el2-block.video, .el2-ruler, .el2-track, .vd-toolbar) {
  background: var(--theme-surface-soft) !important; color: var(--theme-text-soft); border-color: var(--theme-line);
}
html[data-theme="light"] :is(.sk-back-slot .wk-back, .xf-head a) {
  background: var(--theme-surface-soft) !important; color: var(--theme-text) !important; border-color: var(--theme-line-strong) !important;
}
html[data-theme="light"] :is(.xf-hero a:not(.primary), .xf-hero button:not(.primary), .wf-call-history-button) { background: var(--theme-surface-soft) !important; color: var(--theme-text) !important; border-color: var(--theme-line-strong) !important; }
html[data-theme="light"] :is(.xf-hero .primary, .xf-next a, .xf-inspect footer a, .xf-batch .primary, .xf-batch > a) { background: var(--ui-accent) !important; color: #282012 !important; border-color: var(--ui-accent) !important; }
html[data-theme="light"] .xf-tabs button > b { color: var(--ui-accent-strong); background: var(--ui-accent-soft); }
html[data-theme="light"] :is(.sk-reader-head, .sk-reader-empty, .sk-assets, .xf-inspect, .xf-rail, .xf-trace, .xf-trace pre, .xf-drawer > section, .xf-drawer pre, .xf-none, .xf-facts article) { background: var(--theme-surface-soft) !important; color: var(--theme-text); border-color: var(--theme-line); }
html[data-theme="light"] :is(.xf-facts p, .xf-drawer h2, .xf-inspect textarea, .xf-detail h1) { color: var(--theme-text); }
html[data-theme="light"] :is(.xf-pic, .xf-none b) { background: var(--theme-surface-soft) !important; color: var(--theme-text-soft); }
/* The retained asset-settings bookmarks use the independent xs9 palette. */
html[data-theme="light"] #xs9-workspace {
  --x9-canvas: var(--theme-canvas); --x9-panel: var(--theme-surface); --x9-raised: var(--theme-surface-soft);
  --x9-hover: var(--theme-surface-soft); --x9-line: var(--theme-line); --x9-line-strong: var(--theme-line-strong);
  --x9-text: var(--theme-text); --x9-body: var(--theme-text); --x9-muted: var(--theme-text-soft); --x9-soft: var(--theme-text-dim);
  --x9-accent: var(--ui-accent); --x9-ok: #26734b;
  background: var(--theme-canvas);
}
html[data-theme="light"] :is(.xs9-hero, .xs9-hero dl, .xs9-categories, .xs9-toolbar, .xs9-rule, .xs9-gallery,
  .xs9-family-card, .xs9-cover, .xs9-media-empty, .xs9-card-secondary, .xs9-child-count,
  .xs9-detail-drawer, .xs9-detail-drawer .xs9-detail, .xs9-detail-header, .xs9-detail-main,
  .xs9-variant, .xs9-facts article, .xs9-disclosure, .xs9-generation-dock, .xs9-json > section, .xs9-json pre) {
  background: var(--theme-surface) !important; color: var(--theme-text); border-color: var(--theme-line); box-shadow: var(--theme-shadow);
}
html[data-theme="light"] :is(.xs9-family-card h3, .xs9-family-card strong, .xs9-category strong,
  .xs9-detail h1, .xs9-detail h2, .xs9-detail h3, .xs9-json h2, .xs9-facts p) { color: var(--theme-text); }
html[data-theme="light"] :is(.xs9-card-secondary > span, .xs9-cover figcaption) { color: var(--theme-text); background: rgba(255,253,249,.94); border-color: var(--theme-line); }
html[data-theme="light"] .xs9-card-secondary b { color: var(--theme-text); }
html[data-theme="light"] :is(.xs9-category.is-active, .xs9-category:hover, .xs9-card-secondary:hover, .xs9-child-count:hover) { color: var(--theme-text); background: var(--theme-surface-soft) !important; border-color: var(--ui-accent); }
html[data-theme="light"] :is(.xs9-toolbar, .xs9-detail, .xs9-json) :is(input, select, textarea, button:not(.is-primary)) { color: var(--theme-text); background: var(--theme-surface-soft); border-color: var(--theme-line-strong); }
html[data-theme="light"] :is(.xuanya-detail-media > figure, .xuanya-detail-media img, .xuanya-detail-thumb, .xuanya-detail-thumb img, .xuanya-variant img) { background: var(--theme-surface-soft) !important; }
html[data-theme="light"] :is(.xuanya-variant > span, .char-wall-card, .cwc-img, .cwc-meta, .image-action-toolbar) { background: var(--theme-surface-soft) !important; color: var(--theme-text); border-color: var(--theme-line); }
html[data-theme="light"] :is(.prompt-reference-thumb, .prompt-reference-thumb img, .prompt-reference-thumb video) { background: var(--theme-surface-soft) !important; }
html[data-theme="light"] #login-modal,
html[data-theme="light"] #login-modal > .login-card { color: var(--theme-text); background: var(--theme-canvas); }
html[data-theme="light"] #login-modal :is(.login-auth-glass, .login-auth-panel) { color: var(--theme-text); background: var(--theme-surface); }
html[data-theme="light"] #login-modal .login-form :is(input, select) { color: var(--theme-text); background: var(--theme-surface-soft); border: 1px solid var(--theme-line-strong); }
html[data-theme="light"] #login-modal :is(.login-auth-head h1, .login-register-title, .login-method-tabs button.active) { color: var(--theme-text); }
html[data-theme="light"] #login-modal .login-showreel { background-color: var(--theme-surface-soft); }
html[data-theme="light"] .pay-dialog { --bg: var(--theme-surface-soft); --bg-2: var(--theme-surface); --text: var(--theme-text); --text-dim: var(--theme-text-soft); --line: var(--theme-line-strong); background: var(--theme-surface); color: var(--theme-text); }
html[data-theme="light"] .image-action-toolbar button { color: var(--theme-text); }
/* Retained five-stage bookmarks also load five-stage-polish-v1.css. */
html[data-theme="light"] .vd-page.xv-ready {
  --xv-bg: var(--theme-canvas); --xv-panel: var(--theme-surface); --xv-raised: var(--theme-surface-soft);
  --xv-line: var(--theme-line); --xv-line-strong: var(--theme-line-strong); --xv-text: var(--theme-text);
  --xv-body: var(--theme-text); --xv-muted: var(--theme-text-soft); --xv-accent: var(--ui-accent);
  background: var(--theme-canvas);
}
html[data-theme="light"] .vd-page.xv-ready :is(.xv-hero, .xv-edit-link, .vd-main, .vd-eps, .vd-player,
  .vd-timeline, .vd-card, .vd-compose, .fm-panel, .fm-switch-row, .fm-summary, .fm-film-row, .fm-films) {
  background: var(--theme-surface) !important; color: var(--theme-text); border-color: var(--theme-line);
}
html[data-theme="light"] .vd-page.xv-ready :is(.xv-hero strong, .vd-ep-no, .vd-eps-head, .vd-compose-title, .fm-panel-title, .fm-summary strong) { color: var(--theme-text); }
html[data-theme="light"] .vd-page.xv-ready :is(select, input) { color-scheme: light; color: var(--theme-text); background: var(--theme-surface-soft); }
html[data-theme="light"] body[data-workflow-route="shots"] :is(.sb-shot-row, .sb-shot-row > .sb-gen-col,
  .sb-shot-row > .sb-board-col, .sb-shot-row > .sb-preview-col, .sb-x-reference-rail,
  .sb-ff-section.sb-x-frame-card, .sb-frame-slot, .sb-frame-slot-bar, .sb-vp-wrap--ff) {
  background: var(--theme-surface) !important; color: var(--theme-text); border-color: var(--theme-line) !important;
  box-shadow: var(--theme-shadow) !important;
}
html[data-theme="light"] body[data-workflow-route="shots"] :is(.sb-vp-edit, .sb-x-frame-title strong, .sb-x-frame-card > header strong, .sb-x-reference-head strong, .sb-x-prompt-head strong, .sb-frame-op) { color: var(--theme-text) !important; }
body[data-workflow-route="shots"] :is(.sb-page, .sb-shot-rows, .sb-shot-row, .sb-x-frame-grid, .sb-ff-box) { min-width: 0; max-width: 100%; }
body[data-workflow-route="shots"] :is(.sb-page, .sb-shot-rows) { width: 100%; }
body[data-workflow-route="shots"] .sb-workspace { flex: 1 1 0 !important; width: 100%; max-width: 100%; }
body[data-workflow-route="shots"] .sb-3col { min-width: 0; width: 100%; }
body[data-workflow-route="shots"] .sb-gen-col :is(img, video) { max-width: 100%; object-fit: contain; }
body[data-workflow-route="shots"] .sb-x-frame-card .sb-frame-thumb-inline { width: 100% !important; height: 100% !important; min-width: 0; }
body[data-workflow-route="shots"] .sb-x-frame-card .sb-frame-thumb-inline img { width: 100%; height: 100%; object-fit: contain; }
html[data-theme="light"] .v2-shell :is(.visual-style-dialog, .visual-style-dialog-head, .visual-style-dialog-tools, .visual-style-canvas) { color: var(--theme-text); background: var(--theme-surface); border-color: var(--theme-line-strong); }
html[data-theme="light"] .v2-shell .visual-style-dialog :is(.btn.ghost, #visual-style-zoom-level) { color: var(--theme-text); }
html[data-theme="light"] .v2-shell .visual-style-dialog-head p { color: var(--theme-text-soft); }
html[data-theme="light"] :is(.timeline-clip strong, .sb-vp-edit) { color: var(--theme-text) !important; }
html[data-theme="light"] .timeline-clip { background: var(--theme-surface-soft); }
html[data-theme="light"] .timeline-clip.active { background: color-mix(in srgb, var(--ui-accent) 12%, var(--theme-surface)); }
html[data-theme="light"] :is(.sk-project-copy h1, .sk-counts b, .sk-reader h2, .sk-episode-item strong,
  .xf-card h3, .xf-head h1, .el2-info h3, .fm-page h2, .vd-controls h3) { color: var(--theme-text) !important; }
html[data-theme="light"] :is(.sk-project-copy > p, .sk-pic > span, .xf-card p, .el2-mon-empty, .fm-empty p) { color: var(--theme-text-soft); }

/* Empty media surrounds are surfaces, not a separate dark theme. Actual
   image/video pixels and the existing pan/zoom/timeline behavior are preserved. */
html[data-theme="light"] :is(.sg-preview-media, .sg-output img, .sg-output video, .sg-thumbnail-placeholder,
  .sg-history-item img, .sg-reference-file img, .sg-viewer-stage,
  .program-monitor, .program-monitor-empty, .timeline-clip-thumb, .timeline-clip-thumb img,
  .drawer-hero, .media-box, .media-placeholder, .el2-mon-view, .sb-pv2, .vd-player,
  .xf-cover, .xf-cover img, .xf-preview, .fm-preview) {
  background: var(--theme-surface-soft) !important; color: var(--theme-text-soft); border-color: var(--theme-line);
}
html[data-theme="light"] :is(.detail-drawer, .drawer-head, .drawer-content, .modal-card, .modal-head,
  .asset-preview, .asset-preview-pane, .asset-settings-panel, .prompt-composer, .prompt-input-shell,
  .prompt-reference-tray, .storyboard-global-analysis, .storyboard-role-card,
  .editing-episode-rail, .editing-episode-rail header, .editing-monitor-card, .editing-inspector,
  .timeline-panel, .timeline-toolbar, .timeline-ruler, .timeline-track, .timeline-clip,
  .preview-workbench, .script-reader, .script-editor, .analysis-wire-card) {
  color: var(--theme-text); background-color: var(--theme-surface); border-color: var(--theme-line);
}
html[data-theme="light"] .v2-shell :is(.btn.danger, .error-text, .danger-text) { color: #b43f35; }
html[data-theme="light"] .detail-drawer :is(.btn.danger, .btn.danger-subtle) { color: #b43f35 !important; border-color: #e6b5af; background: #fff4f2; }
html[data-theme="light"] .v2-shell :is(.btn.ghost, .segmented button, .editing-episode-button:not(.active) span) {
  color: var(--theme-text-soft); background-color: var(--theme-surface-soft); border-color: var(--theme-line);
}
html[data-theme="light"] :is(.frame-composer, .shot-video-workspace, .storyboard-shot-card, .xuanya-family-card) {
  box-shadow: var(--theme-shadow);
}
html[data-theme="light"] :is(.view, .v2-shell, .detail-drawer, .ch-modal) :is(input:not([type="range"]):not([type="checkbox"]):not([type="radio"]), select, textarea) {
  color: var(--theme-text); background-color: var(--theme-surface); border-color: var(--theme-line-strong);
}
html[data-theme] :is(input, select, textarea, button, a):focus-visible { outline: 2px solid var(--ui-accent, #c9a95d); outline-offset: 3px; }

/* Shared sizing: shrinkable columns, consistent spacing and usable controls. */
.app { max-width: 100%; height: 100dvh; }
.app > .content, .app .view, .v2-shell > *, .panel, .panel-head > *, .settings-form > *,
.wk-page > *, .wk-warehouse > *, .sg-layout > *, .account-settings-layout > * { min-width: 0; }
.view :is(input, select, textarea), .v2-shell :is(input, select, textarea), .detail-drawer :is(input, select, textarea) { max-width: 100%; box-sizing: border-box; font: inherit; }
.view :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select),
.v2-shell .settings-form :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select) { min-height: 38px; }
.view :is(h1, h2, h3, p), .v2-shell :is(h2, h3, p), .drawer-head h2 { overflow-wrap: anywhere; }
.view :is(.row, .wk-panel-actions, .account-page-actions), .v2-shell :is(.panel-head, .section-heading) { gap: 10px; }
.view table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.view :is(.card, .wk-panel, .account-card) { border-radius: 12px; }
.wk-page, .wk-library, .wk-warehouse { width: 100%; }
.wk-project-grid, .canvas-library-grid { align-items: stretch; }
.wk-project-card, .canvas-library-card { min-width: 0; height: 100%; }
.wk-project-card .wk-project-body { flex: 1; }
.standalone-generation { width: 100%; max-width: 1600px; }
.sg-layout { grid-template-columns: minmax(320px, .92fr) minmax(0, 1.08fr); gap: 20px; align-items: stretch; }
.sg-form, .sg-result-panel { padding: clamp(16px, 1.8vw, 26px); border-radius: 14px; }
.sg-result-panel { display: flex; flex-direction: column; }
.sg-preview-media { flex: 1; min-height: clamp(240px, 30vw, 440px); }
.sg-history-section { margin-top: 16px; }
.sg-form textarea { min-height: 128px; line-height: 1.65; }
.sg-form .sg-optional textarea { min-height: 84px; }
.sg-preview-heading, .sg-history-heading { align-items: center; }
.sg-history-heading select { min-width: 0; max-width: 100%; }
.ch-topbar, .ch-input-models { flex-wrap: wrap; }
.ch-topbar-left, .ch-input-models > * { min-width: 0; }
.ch-input-bar textarea { max-height: min(240px, 30dvh); }
.v2-shell .stage-scroll { padding: clamp(12px, 1.5vw, 24px); }
.v2-shell .panel-head { flex-wrap: wrap; }
.v2-shell :is(.asset-toolbar, .storyboard-controls, .timeline-toolbar) { gap: 10px; }
.v2-shell .asset-grid { align-items: stretch; }
.v2-shell .xuanya-family-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); align-items: stretch; }
.v2-shell .xuanya-family-card { min-width: 0; }
.v2-shell .editing-workbench:not(.preview-workbench) { grid-template-columns: 56px minmax(0, 1fr) var(--inspector-width, 380px); }
.v2-shell .editing-monitor-card > header { min-height: 44px; height: auto; gap: 8px; flex-wrap: wrap; }
.v2-shell .editing-monitor-time { min-width: 0; }
.v2-shell .editing-inspector-head h2 { font-size: clamp(18px, 1.5vw, 23px); }
.v2-shell .detail-drawer { width: min(820px, 85vw); }
.v2-shell .drawer-layer { grid-template-columns: minmax(0, 1fr) min(820px, 85vw); }
.v2-shell .drawer-head { flex-wrap: wrap; }
.v2-shell :is(.drawer-content, .modal-card) { min-width: 0; }
.view :is(.sk-project-head, .el2-top) { grid-template-columns: minmax(0, 1fr) minmax(240px, .5fr); }
.view .sk-project-head { grid-template-columns: minmax(160px, 220px) minmax(0, 1fr) minmax(190px, 240px); gap: 18px; }
.view .sk-cover { width: 100%; }
.view .xf-body { min-width: 0; }
#xs9-workspace .xs9-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); align-items: stretch; }
#xs9-workspace .xs9-family-card { min-height: 250px; }
#xs9-workspace .xs9-card-panels { min-height: 148px; }
#xs9-workspace :is(.xs9-compact-head small, .xs9-compact-head > div:last-child > span, .xs9-card-secondary b, .xs9-card-secondary small, .xs9-child-count span, .xs9-child-count small, .xs9-compact-foot > button) { font-size: 11px; }
#xs9-workspace .xs9-category small { font-size: 11px; }

@media (max-width: 1100px) {
  .sg-layout { grid-template-columns: minmax(0, 1fr); }
  .sg-result-panel { min-height: 0; }
  .sg-preview-media { flex: initial; min-height: 280px; }
  .view .el2-top { grid-template-columns: minmax(0, 1fr); }
  .view .sk-project-head { grid-template-columns: minmax(140px, 190px) minmax(0, 1fr); }
  .view .sk-head-side { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--theme-line); padding: 14px 0 0; }
}
@media (max-width: 760px) {
  #studio-head .wb-head { display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 12px 14px; }
  #studio-head .wb-head-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
  #studio-head .wb-back { flex: 0 0 auto; white-space: nowrap; }
  #studio-head .wb-head-title { min-width: 0; overflow: hidden; }
  #studio-head .wb-head-title strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .view :is(.row, .wk-page-head, .wk-panel-head, .account-page-head) { flex-wrap: wrap; }
  .v2-shell .editing-workbench:not(.preview-workbench) { grid-template-columns: 48px minmax(0, 1fr); }
  .v2-shell .editing-monitor-card > header { padding: 8px 10px; }
  .v2-shell .editing-inspector { grid-column: 2; }
  .v2-shell .detail-drawer { width: 100vw; }
  .v2-shell .drawer-layer { grid-template-columns: 0 minmax(0, 1fr); }
  .drawer-layer .detail-drawer { width: 100vw !important; max-width: 100%; border-left: 0; }
  .drawer-layer .drawer-head { gap: 10px; }
  .drawer-layer .drawer-head-actions { flex-shrink: 0; flex-wrap: nowrap; }
  .drawer-layer .drawer-head-actions .btn { white-space: nowrap; min-height: 36px; }
  .v2-shell .drawer-content { padding: 14px; }
  .v2-shell .visual-style-dialog-head { flex-wrap: wrap; padding: 10px 12px; }
  .v2-shell .stage-tab { padding-left: 12px; text-align: center; }
  .v2-shell .stage-tab b { display: none; }
  .v2-shell .stage-tab span { font-size: 12px; }
  .sg-parameters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .view .sk-project-head { grid-template-columns: minmax(0, 1fr); }
  .view .sk-cover { max-width: 100%; height: 180px; }
  .view .wk-warehouse[data-script-redesign] { padding: 14px !important; }
  .view .sk-analysis-main { grid-template-columns: minmax(0, 1fr); }
  .view .sk-episode-panel { max-height: 200px; overflow: auto; }
  #xs9-workspace { padding: 10px; }
  #xs9-workspace .xs9-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #xs9-workspace .xs9-toolbar > :first-child { grid-column: 1 / -1; }
  #xs9-workspace .xs9-rule { grid-template-columns: 34px minmax(0, 1fr); }
  #xs9-workspace .xs9-rule > :last-child { grid-column: 2; }
}
@media (max-width: 480px) {
  .standalone-generation { padding: 8px 0; }
  .sg-controls { grid-template-columns: minmax(0, 1fr); }
  .sg-controls > .field:first-child { grid-column: auto; }
  .sg-preview-media { min-height: 240px; }
  .sg-history-heading { align-items: flex-start; }
  .sg-history-heading > div { width: 100%; }
  .v2-shell .stage-scroll { padding: 10px; }
  .v2-shell .topbar { padding: 10px 12px; gap: 8px; }
  .v2-shell .project-picker { min-width: 0; }
  .v2-shell .project-picker select { width: 100%; max-width: 100%; }
  .v2-shell .timeline-toolbar { flex-wrap: wrap; height: auto; padding: 8px; }
  .v2-shell .timeline-panel { grid-template-rows: auto minmax(0, 1fr); }
  .account-stats { grid-template-columns: minmax(0, 1fr); }
  #xs9-workspace .xs9-toolbar { grid-template-columns: minmax(0, 1fr); }
  #xs9-workspace .xs9-gallery { padding: 12px; }
}
