/* Apple-style commercial light UI polish. Functionality is untouched. */
:root {
  color-scheme: light;
  --afy-bg: #f5f5f7;
  --afy-surface: rgba(255, 255, 255, 0.92);
  --afy-surface-solid: #ffffff;
  --afy-surface-soft: #fbfbfd;
  --afy-text: #1d1d1f;
  --afy-muted: #6e6e73;
  --afy-line: rgba(29, 29, 31, 0.1);
  --afy-line-strong: rgba(29, 29, 31, 0.18);
  --afy-blue: #0071e3;
  --afy-blue-strong: #0066cc;
  --afy-green: #34c759;
  --afy-orange: #ff9f0a;
  --afy-red: #ff3b30;
  --afy-shadow: 0 18px 48px rgba(0, 0, 0, 0.06);
  --afy-shadow-soft: 0 8px 28px rgba(0, 0, 0, 0.045);
  --afy-focus: 0 0 0 4px rgba(0, 113, 227, 0.16);
  --bg: var(--afy-bg);
  --surface: var(--afy-surface-solid);
  --surface-2: var(--afy-surface-soft);
  --surface-3: #f5f7fa;
  --line: var(--afy-line);
  --line-strong: var(--afy-line-strong);
  --text: var(--afy-text);
  --muted: var(--afy-muted);
  --muted-strong: #424245;
  --primary: var(--afy-blue);
  --primary-strong: var(--afy-blue-strong);
  --primary-soft: rgba(0, 113, 227, 0.1);
  --success: var(--afy-green);
  --warning: var(--afy-orange);
  --danger: var(--afy-red);
  --shadow-card: var(--afy-shadow);
  --shadow-lift: 0 20px 44px rgba(0, 113, 227, 0.16);
  --radius-lg: 8px;
  --radius-md: 8px;
  --radius-sm: 8px;
  --radius: 8px;
}

html {
  background: var(--afy-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  color: var(--afy-text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  background: linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 48%, #f2f4f7 100%) !important;
  background-attachment: fixed;
}

body::before {
  display: none !important;
}

button,
a,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    color 0.18s ease,
    opacity 0.18s ease,
    transform 0.18s ease;
}

button:not(:disabled),
a[href],
summary,
label,
select {
  cursor: pointer;
}

button:disabled,
.disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 0 !important;
  border-color: rgba(0, 113, 227, 0.42) !important;
  box-shadow: var(--afy-focus) !important;
}

button:not(:disabled):active,
a[href]:active {
  transform: translateY(1px);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.2);
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(29, 29, 31, 0.3);
  background-clip: padding-box;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  min-height: 100vh;
  background: transparent;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  border-right: 1px solid var(--afy-line);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(26px) saturate(180%);
}

.content,
.shell,
.wizard-shell,
.admin-shell,
.app {
  max-width: 1480px;
}

.content {
  min-width: 0;
  padding: 28px;
}

.content-top,
.quick-panel,
.section,
.panel,
.wizard-card,
.wizard-steps,
.wizard-result-head,
.wizard-cost-card,
.admin-head,
.admin-card,
.admin-zone,
.topbar,
.controls-panel,
.result-panel,
.preview-card,
.debug-header,
.debug-summary,
.debug-toolbar,
.debug-panel {
  border: 1px solid var(--afy-line) !important;
  border-radius: 8px !important;
  background: var(--afy-surface) !important;
  box-shadow: var(--afy-shadow-soft) !important;
  backdrop-filter: blur(18px) saturate(180%);
}

.section,
.panel,
.wizard-card,
.admin-card,
.controls-panel,
.result-panel,
.debug-panel {
  box-shadow: var(--afy-shadow) !important;
}

.content-top,
.topbar,
.admin-head,
.header {
  position: sticky;
  top: 0;
  z-index: 20;
  margin-bottom: 20px;
}

.header {
  border: 1px solid var(--afy-line) !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.88) !important;
  box-shadow: var(--afy-shadow-soft) !important;
  backdrop-filter: blur(18px) saturate(180%);
}

h1,
h2,
h3,
.content-heading-stack h2,
.wizard-result-head h1,
.admin-head h1 {
  color: var(--afy-text) !important;
  font-weight: 800 !important;
  letter-spacing: 0 !important;
}

p,
small,
.label,
.field span,
.wizard-field span,
.wizard-label,
.admin-muted,
.lead,
.eyebrow,
.debug-kicker {
  color: var(--afy-muted) !important;
  letter-spacing: 0 !important;
}

.button,
.btn,
.wizard-button,
.admin-button,
.primary-button,
.secondary-button,
.primary-link,
.secondary-link,
.text-button,
.provider-switch-button,
.tab,
.angle-btn,
.workspace-nav-link {
  min-height: 38px;
  border-radius: 8px !important;
  font-weight: 750 !important;
  text-decoration: none;
}

.button-primary,
.btn-primary,
.wizard-button.primary,
.admin-button:not(.secondary):not(.warning):not(.danger),
.primary-button,
.primary-link,
.provider-switch-button.active,
.tab.active,
.step.active .step-num {
  border: 1px solid var(--afy-blue) !important;
  background: var(--afy-blue) !important;
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(0, 113, 227, 0.2) !important;
}

.button-primary:hover,
.btn-primary:hover,
.wizard-button.primary:hover,
.admin-button:not(.secondary):not(.warning):not(.danger):hover,
.primary-button:hover,
.primary-link:hover,
.provider-switch-button.active:hover,
.tab.active:hover {
  border-color: var(--afy-blue-strong) !important;
  background: var(--afy-blue-strong) !important;
  color: #fff !important;
}

.button-secondary,
.btn-secondary,
.wizard-button.secondary,
.admin-button.secondary,
.secondary-button,
.secondary-link,
.text-button,
.tab,
.angle-btn,
.workspace-nav-link,
.provider-switch-button {
  border: 1px solid var(--afy-line) !important;
  background: rgba(255, 255, 255, 0.9) !important;
  color: var(--afy-text) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.button-secondary:hover,
.btn-secondary:hover,
.wizard-button.secondary:hover,
.admin-button.secondary:hover,
.secondary-button:hover,
.secondary-link:hover,
.text-button:hover,
.tab:hover,
.angle-btn:hover,
.workspace-nav-link:hover,
.provider-switch-button:hover {
  border-color: rgba(0, 113, 227, 0.22) !important;
  background: rgba(0, 113, 227, 0.06) !important;
  color: var(--afy-blue) !important;
}

.button-danger,
.admin-button.danger {
  border: 1px solid rgba(255, 59, 48, 0.2) !important;
  background: rgba(255, 59, 48, 0.08) !important;
  color: #b42318 !important;
}

input,
select,
textarea,
.field input,
.field select,
.field textarea,
.fg select,
.fg textarea,
.wizard-field input,
.wizard-field select,
.wizard-field textarea,
.admin-create input,
.admin-create select,
.admin-actions input,
.admin-route-form input,
.admin-route-form select,
.admin-model-form input,
.admin-model-form select,
.admin-announcement-form input,
.admin-announcement-form textarea,
.prompt-panel textarea,
#promptPreview {
  border: 1px solid var(--afy-line) !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.9) !important;
  color: var(--afy-text) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(0, 113, 227, 0.22) !important;
  background: #fff !important;
}

.upload-zone,
.wizard-dropzone,
.drop-zone,
.empty-state,
.wizard-estimate-empty,
.s3-slot-empty,
.angle-preview-empty {
  border-color: rgba(29, 29, 31, 0.14) !important;
  border-radius: 8px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(250, 250, 252, 0.94)) !important;
}

.upload-zone:hover,
.wizard-dropzone:hover,
.drop-zone:hover {
  border-color: rgba(0, 113, 227, 0.28) !important;
  box-shadow: var(--afy-focus);
}

.result-card,
.lib-card,
.task-card,
.model-ref-thumb,
.wizard-prompt-card,
.wizard-progress-result-grid > *,
.recent-grid > *,
.admin-announcement-item,
.admin-route-item,
.admin-model-item,
.preview-card,
.image-stage {
  border: 1px solid var(--afy-line) !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.9) !important;
  box-shadow: var(--afy-shadow-soft);
  overflow: hidden;
}

.result-card:hover,
.lib-card:hover,
.task-card:hover,
.model-ref-thumb:hover,
.wizard-prompt-card:hover,
.recent-grid > *:hover,
.preview-card:hover {
  border-color: rgba(0, 113, 227, 0.18) !important;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.075);
}

.steps,
.wizard-steps,
.provider-switch,
.tabs {
  gap: 8px;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.78) !important;
}

.step-num,
.wizard-step b,
.status-badge,
.admin-badge,
.admin-route-pill,
.source-badge,
.selected-angle-chips .chip {
  border-radius: 999px !important;
}

.progress-bar,
.generation-progress-track,
.wizard-progress-track {
  height: 8px !important;
  border-radius: 999px !important;
  background: rgba(29, 29, 31, 0.08) !important;
}

.progress-fill,
.generation-progress-bar,
.wizard-progress-track i {
  border-radius: 999px !important;
  background: var(--afy-blue) !important;
}

.status,
.status-idle {
  border: 1px solid var(--afy-line);
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.86) !important;
  color: var(--afy-muted) !important;
}

.status-loading {
  border-color: rgba(0, 113, 227, 0.18);
  background: rgba(0, 113, 227, 0.08) !important;
  color: var(--afy-blue) !important;
}

.status-success,
.step.done .step-num {
  border-color: rgba(52, 199, 89, 0.2);
  background: rgba(52, 199, 89, 0.1) !important;
  color: #1f7a3a !important;
}

.status-error {
  border-color: rgba(255, 59, 48, 0.2);
  background: rgba(255, 59, 48, 0.08) !important;
  color: #b42318 !important;
}

.admin-table-wrap,
table,
th,
td {
  border-color: var(--afy-line) !important;
}

th {
  background: rgba(245, 245, 247, 0.9) !important;
  color: var(--afy-muted) !important;
}

tr:hover td {
  background: rgba(0, 113, 227, 0.04);
}

.modal,
.angle-preview-dialog,
.glb-studio-dialog,
.wizard-progress-preview-dialog {
  border: 1px solid var(--afy-line);
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18) !important;
  backdrop-filter: blur(18px) saturate(180%);
}

.angle-preview-modal,
.glb-studio-modal,
.wizard-progress-preview-modal {
  background: rgba(245, 245, 247, 0.72) !important;
  backdrop-filter: blur(18px);
}

pre,
code {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.content,
.sidebar,
.section,
.panel,
.wizard-card,
.admin-card,
.workspace,
.controls-panel,
.result-panel,
.field-grid,
.settings-grid,
.admin-toolbar,
.admin-route-form,
.admin-model-form,
.admin-create {
  min-width: 0;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: minmax(280px, 34vw) minmax(0, 1fr);
  }

  .content,
  .shell,
  .wizard-shell,
  .admin-shell,
  .app {
    padding-inline: 18px;
  }
}

@media (max-width: 760px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-shell {
    display: block;
    max-width: 100%;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: auto;
    max-height: 46vh;
    border-right: 0;
    border-bottom: 1px solid var(--afy-line);
  }

  .content,
  .shell,
  .wizard-shell,
  .admin-shell,
  .app {
    max-width: 100%;
    width: 100%;
    padding: 14px;
  }

  .content-top,
  .content-heading-stack,
  .content-actions,
  .workspace-nav {
    max-width: 100%;
    min-width: 0;
  }

  .workspace-nav {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: flex-start;
  }

  .workspace-nav-link {
    flex: 1 1 calc(33.333% - 8px);
    min-width: 0;
    justify-content: center;
    white-space: nowrap;
  }

  .auth-modal {
    width: 100vw !important;
    max-width: 100vw !important;
    padding: 16px !important;
    overflow-x: hidden !important;
  }

  .auth-dialog {
    width: min(430px, calc(100vw - 32px)) !important;
    max-width: calc(100vw - 32px) !important;
    padding: 18px !important;
  }

  .auth-dialog,
  .auth-dialog > *,
  .auth-field,
  .auth-field input,
  .auth-actions,
  .auth-status {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .auth-actions {
    align-items: stretch !important;
  }

  .auth-switch {
    flex: 1 1 120px;
    min-height: 36px;
    text-align: center;
  }

  .content-top,
  .topbar,
  .admin-head,
  .header {
    position: static;
  }

  .field-grid,
  .settings-grid,
  .wizard-layout,
  .wizard-result-grid,
  .debug-summary,
  .debug-controls,
  .debug-panels,
  .glb-studio-body,
  .admin-create,
  .admin-route-form,
  .admin-model-form,
  .admin-3dkey-form,
  .admin-announcement-form,
  .workspace,
  .compare-grid {
    grid-template-columns: 1fr !important;
  }

  .content-top,
  .quick-panel-head,
  .section-heading,
  .admin-head,
  .admin-toolbar,
  .header,
  .wizard-result-head,
  .wizard-card-title-row {
    align-items: flex-start !important;
    flex-direction: column;
  }

  .section-actions,
  .content-actions,
  .wizard-result-actions,
  .admin-announcement-actions,
  .top-actions {
    width: 100%;
    justify-content: flex-start !important;
  }

  .button,
  .btn,
  .wizard-button,
  .admin-button,
  .primary-button,
  .secondary-button {
    min-width: 0;
    max-width: 100%;
  }
}

/* v3: stronger commercial Apple-style visual refresh. Logic remains untouched. */
:root {
  --afy-bg: #f5f5f7;
  --afy-surface: rgba(255, 255, 255, 0.96);
  --afy-surface-solid: #ffffff;
  --afy-surface-soft: #fafafa;
  --afy-text: #1d1d1f;
  --afy-muted: #6e6e73;
  --afy-line: rgba(29, 29, 31, 0.1);
  --afy-line-strong: rgba(29, 29, 31, 0.18);
  --afy-blue: #007aff;
  --afy-blue-strong: #006edb;
  --afy-shadow: 0 24px 60px rgba(0, 0, 0, 0.08);
  --afy-shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.055);
  --afy-focus: 0 0 0 4px rgba(0, 122, 255, 0.16);
}

html {
  background: #f5f5f7 !important;
}

body {
  background:
    linear-gradient(180deg, #ffffff 0, #f5f5f7 420px, #f5f5f7 100%) !important;
}

body.auth-locked .app-shell,
body.auth-locked .multi-angle-shell,
body.auth-locked .multi-task-shell,
body.auth-locked .studio {
  filter: blur(5px) saturate(0.92) !important;
}

.app-shell {
  gap: 20px !important;
  padding: 20px !important;
}

.sidebar {
  top: 20px !important;
  max-height: calc(100vh - 40px) !important;
  padding: 0 !important;
  border: 1px solid rgba(29, 29, 31, 0.08) !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.9) !important;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.07) !important;
}

.sidebar > .section {
  margin: 10px !important;
}

.content {
  padding: 0 !important;
}

.content-top,
.topbar,
.admin-head,
.header {
  min-height: 76px !important;
  padding: 16px 18px !important;
  border: 1px solid rgba(29, 29, 31, 0.08) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.055) !important;
}

.section,
.panel,
.wizard-card,
.admin-card,
.controls-panel,
.result-panel,
.gallery-card,
.quick-panel,
.auth-card {
  border: 1px solid rgba(29, 29, 31, 0.08) !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.055) !important;
}

.section,
.panel,
.wizard-card,
.admin-card,
.controls-panel,
.result-panel {
  padding: 16px !important;
}

.quick-panel {
  background:
    linear-gradient(180deg, #ffffff, #fbfbfd) !important;
}

.quick-panel-head strong,
.status-badge,
.admin-badge,
.source-badge,
.selected-angle-chips .chip {
  min-height: 24px !important;
  border: 1px solid rgba(0, 122, 255, 0.16) !important;
  color: #006edb !important;
  background: rgba(0, 122, 255, 0.08) !important;
}

h1,
h2,
h3,
.content-heading-stack h2,
.wizard-result-head h1,
.admin-head h1 {
  color: #1d1d1f !important;
  font-weight: 800 !important;
  letter-spacing: 0 !important;
}

.content-heading-stack h2,
.admin-head h1 {
  font-size: clamp(24px, 2vw, 34px) !important;
  line-height: 1.08 !important;
}

.section h2,
.content h2,
.gallery-title,
.wizard-card h2,
.admin-card h2 {
  font-size: 18px !important;
  line-height: 1.2 !important;
}

p,
small,
.lead,
.eyebrow,
.admin-muted,
.wizard-label,
.field span,
.wizard-field span {
  color: #6e6e73 !important;
  font-weight: 650 !important;
}

.workspace-nav,
.provider-switch,
.tabs,
.wizard-steps,
.steps {
  padding: 4px !important;
  border: 1px solid rgba(29, 29, 31, 0.08) !important;
  border-radius: 8px !important;
  background: #f5f5f7 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86) !important;
}

.workspace-nav-link,
.provider-switch-button,
.tab,
.angle-btn {
  min-height: 34px !important;
  border-radius: 8px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: #424245 !important;
  box-shadow: none !important;
}

.workspace-nav-link:hover,
.provider-switch-button:hover,
.tab:hover,
.angle-btn:hover,
.provider-switch-button.active,
.tab.active,
.workspace-nav-link[aria-current="page"] {
  border-color: rgba(29, 29, 31, 0.08) !important;
  background: #ffffff !important;
  color: #1d1d1f !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.07) !important;
}

.button,
.btn,
.wizard-button,
.admin-button,
.primary-button,
.secondary-button,
.primary-link,
.secondary-link,
.text-button,
.auth-button,
.auth-submit,
.announcement-close {
  min-height: 42px !important;
  padding-inline: 16px !important;
  border-radius: 8px !important;
  font-weight: 780 !important;
}

.button-primary,
.btn-primary,
.wizard-button.primary,
.admin-button:not(.secondary):not(.warning):not(.danger),
.primary-button,
.primary-link,
.auth-submit {
  border: 1px solid #007aff !important;
  background: linear-gradient(180deg, #0a84ff, #0071e3) !important;
  color: #ffffff !important;
  box-shadow: 0 12px 26px rgba(0, 122, 255, 0.28) !important;
}

.button-primary:hover,
.btn-primary:hover,
.wizard-button.primary:hover,
.admin-button:not(.secondary):not(.warning):not(.danger):hover,
.primary-button:hover,
.primary-link:hover,
.auth-submit:hover {
  border-color: #006edb !important;
  background: linear-gradient(180deg, #007aff, #006edb) !important;
  transform: translateY(-1px);
}

.button-secondary,
.btn-secondary,
.wizard-button.secondary,
.admin-button.secondary,
.secondary-button,
.secondary-link,
.text-button,
.auth-switch {
  border: 1px solid rgba(29, 29, 31, 0.1) !important;
  background: #ffffff !important;
  color: #1d1d1f !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.045) !important;
}

.button-secondary:hover,
.btn-secondary:hover,
.wizard-button.secondary:hover,
.admin-button.secondary:hover,
.secondary-button:hover,
.secondary-link:hover,
.text-button:hover,
.auth-switch:hover {
  border-color: rgba(0, 122, 255, 0.22) !important;
  color: #007aff !important;
  background: rgba(0, 122, 255, 0.06) !important;
}

input,
select,
textarea,
.field input,
.field select,
.field textarea,
.fg select,
.fg textarea,
.wizard-field input,
.wizard-field select,
.wizard-field textarea,
.admin-create input,
.admin-create select,
.admin-actions input,
.admin-route-form input,
.admin-route-form select,
.admin-model-form input,
.admin-model-form select,
.admin-announcement-form input,
.admin-announcement-form textarea,
.auth-field input,
#promptPreview {
  min-height: 44px !important;
  border: 1px solid rgba(29, 29, 31, 0.12) !important;
  border-radius: 8px !important;
  background: #fbfbfd !important;
  color: #1d1d1f !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

input:focus,
select:focus,
textarea:focus,
.auth-field input:focus {
  border-color: rgba(0, 122, 255, 0.46) !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.14) !important;
}

.upload-zone,
.wizard-dropzone,
.drop-zone,
.empty-state,
.wizard-estimate-empty,
.s3-slot-empty,
.angle-preview-empty {
  border: 1.5px dashed rgba(0, 122, 255, 0.22) !important;
  background:
    linear-gradient(180deg, #ffffff, #fbfbfd) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.74) !important;
}

.upload-zone:hover,
.wizard-dropzone:hover,
.drop-zone:hover {
  border-color: rgba(0, 122, 255, 0.46) !important;
  background: rgba(0, 122, 255, 0.045) !important;
  transform: translateY(-1px);
}

.result-card,
.lib-card,
.task-card,
.model-ref-thumb,
.wizard-prompt-card,
.wizard-progress-result-grid > *,
.recent-grid > *,
.admin-announcement-item,
.admin-route-item,
.admin-model-item,
.preview-card,
.image-stage,
.gallery-card {
  border: 1px solid rgba(29, 29, 31, 0.08) !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.06) !important;
}

.result-card:hover,
.lib-card:hover,
.task-card:hover,
.model-ref-thumb:hover,
.wizard-prompt-card:hover,
.recent-grid > *:hover,
.preview-card:hover,
.gallery-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 122, 255, 0.18) !important;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.09) !important;
}

.auth-card {
  padding: 14px !important;
  gap: 10px !important;
  background: #ffffff !important;
}

.auth-card small {
  color: #6e6e73 !important;
  font-size: 12px !important;
}

.auth-card strong,
.auth-balance-value {
  color: #1d1d1f !important;
}

.auth-modal {
  background: rgba(245, 245, 247, 0.78) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
}

.auth-dialog {
  width: min(460px, calc(100vw - 40px)) !important;
  gap: 18px !important;
  padding: 30px !important;
  border: 1px solid rgba(29, 29, 31, 0.08) !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.18) !important;
}

.auth-dialog h2 {
  color: #1d1d1f !important;
  font-size: 30px !important;
  line-height: 1.05 !important;
  letter-spacing: 0 !important;
}

.auth-dialog p {
  color: #6e6e73 !important;
  font-size: 14px !important;
}

.auth-field {
  gap: 8px !important;
  color: #424245 !important;
  font-size: 13px !important;
  font-weight: 780 !important;
}

.auth-actions {
  gap: 10px !important;
}

.auth-switch {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #007aff !important;
}

.auth-status {
  color: #d70015 !important;
}

.announcement-fab {
  right: 22px !important;
  bottom: 22px !important;
  width: 50px !important;
  min-width: 50px !important;
  height: 50px !important;
  border: 1px solid rgba(0, 122, 255, 0.22) !important;
  border-radius: 999px !important;
  background: #101828 !important;
  box-shadow: 0 20px 50px rgba(16, 24, 40, 0.28) !important;
}

.announcement-panel,
.announcement-modal-dialog {
  border: 1px solid rgba(29, 29, 31, 0.08) !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.15) !important;
}

table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

th {
  background: #fbfbfd !important;
  font-size: 12px !important;
  text-transform: none !important;
}

td,
th {
  padding: 12px !important;
}

tr:hover td {
  background: rgba(0, 122, 255, 0.045) !important;
}

@media (max-width: 760px) {
  .app-shell {
    gap: 14px !important;
    padding: 14px !important;
  }

  .sidebar {
    top: 0 !important;
    max-height: 48vh !important;
  }

  .content-top,
  .topbar,
  .admin-head,
  .header,
  .section,
  .panel,
  .wizard-card,
  .admin-card,
  .controls-panel,
  .result-panel {
    padding: 14px !important;
  }

  .auth-dialog {
    width: min(440px, calc(100vw - 28px)) !important;
    max-width: calc(100vw - 28px) !important;
    padding: 22px !important;
  }

  .auth-dialog h2 {
    font-size: 28px !important;
  }
}

/* v3.1: restore stable button placement after the stronger visual pass. */
.auth-dialog {
  width: min(430px, calc(100vw - 40px)) !important;
  padding: 28px !important;
}

.auth-actions {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  align-items: center !important;
  gap: 10px 14px !important;
}

.auth-submit {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  min-height: 44px !important;
}

.auth-switch {
  width: auto !important;
  min-height: 32px !important;
  padding: 0 !important;
  justify-self: center !important;
  flex: none !important;
  text-align: center !important;
}

.auth-status {
  text-align: center !important;
}

.content-top,
.quick-panel-head,
.section-heading,
.admin-head,
.admin-toolbar,
.header,
.wizard-result-head,
.wizard-card-title-row,
.section-actions,
.content-actions,
.wizard-result-actions,
.admin-announcement-actions,
.top-actions,
.task-actions,
.preview-actions,
.preview-toolbar,
.hist-head,
.upload-actions {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

.content-top,
.quick-panel-head,
.section-heading,
.admin-head,
.admin-toolbar,
.header,
.wizard-result-head,
.wizard-card-title-row,
.hist-head,
.preview-toolbar {
  justify-content: space-between !important;
}

.section-actions,
.content-actions,
.wizard-result-actions,
.admin-announcement-actions,
.top-actions,
.task-actions,
.preview-actions,
.upload-actions {
  justify-content: flex-end !important;
}

.button-mini,
.quick-panel-close-button,
.upload-actions button,
.hist-head .hacts button,
.task-card .tacts button,
.lib-card .del,
.announcement-close {
  min-height: 30px !important;
  height: auto !important;
  padding: 0 10px !important;
  font-size: 12px !important;
}

.workspace-nav-link,
.provider-switch-button,
.tab,
.angle-btn {
  padding-inline: 12px !important;
}

.tabs {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) !important;
}

.field-grid + [style*="grid-template-columns:1fr 1fr"],
#newModelBox > div[style*="grid-template-columns:1fr 1fr"] {
  align-items: center !important;
}

.field-grid + [style*="grid-template-columns:1fr 1fr"] .btn,
#newModelBox > div[style*="grid-template-columns:1fr 1fr"] .btn {
  width: 100% !important;
}

@media (max-width: 760px) {
  .auth-dialog {
    width: min(430px, calc(100vw - 28px)) !important;
    max-width: calc(100vw - 28px) !important;
    padding: 22px !important;
  }

  .auth-actions {
    grid-template-columns: 1fr !important;
  }

  .auth-submit,
  .auth-switch {
    width: 100% !important;
    justify-self: stretch !important;
  }

  .content-top,
  .section-heading,
  .admin-head,
  .admin-toolbar,
  .header,
  .wizard-result-head,
  .wizard-card-title-row {
    align-items: flex-start !important;
    flex-direction: column !important;
  }

  .section-actions,
  .content-actions,
  .wizard-result-actions,
  .admin-announcement-actions,
  .top-actions,
  .task-actions {
    width: 100% !important;
    justify-content: stretch !important;
  }

  .section-actions > *,
  .content-actions > *,
  .wizard-result-actions > *,
  .top-actions > *,
  .task-actions > * {
    flex: 1 1 auto !important;
  }
}

/* v3.2: main workspace toolbar layout, kept compact and deterministic. */
.content > .content-top {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  align-items: stretch !important;
  gap: 12px !important;
  padding: 12px 14px !important;
}

.content > .content-top .content-heading-stack {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 12px !important;
  width: 100% !important;
}

.content > .content-top .content-heading-stack h2 {
  margin: 0 !important;
  white-space: nowrap !important;
}

.content > .content-top .gallery-group-panel {
  display: flex !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
}

.content > .content-top .gallery-group-field {
  flex: 0 1 310px !important;
  min-width: 250px !important;
  max-width: 360px !important;
  min-height: 34px !important;
  grid-template-columns: auto minmax(140px, 1fr) !important;
  border-radius: 8px !important;
}

.content > .content-top .gallery-batch-move-field {
  flex-basis: 300px !important;
}

.content > .content-top .gallery-group-path {
  flex: 1 1 260px !important;
  min-width: 220px !important;
  max-width: none !important;
  min-height: 32px !important;
  border-radius: 8px !important;
  justify-content: flex-start !important;
}

.content > .content-top .gallery-group-order-actions {
  display: inline-flex !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  gap: 6px !important;
}

.content > .content-top .button,
.content > .content-top .workspace-nav-link {
  min-height: 34px !important;
  padding: 0 12px !important;
  white-space: nowrap !important;
  flex: 0 0 auto !important;
}

.content > .content-top .button-mini,
.content > .content-top .workspace-nav-link {
  min-height: 30px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
}

.content > .content-top .content-actions {
  display: grid !important;
  width: 100% !important;
  grid-template-columns: minmax(0, 1fr) repeat(4, max-content) !important;
  grid-template-areas:
    "nav exportAll current selected log"
    "move move move move refresh" !important;
  align-items: center !important;
  justify-content: stretch !important;
  gap: 8px !important;
}

.content > .content-top .workspace-nav {
  grid-area: nav !important;
  width: fit-content !important;
  max-width: 100% !important;
  justify-self: start !important;
  display: inline-flex !important;
  flex-wrap: wrap !important;
  gap: 4px !important;
  padding: 3px !important;
}

.content > .content-top #exportAllButton {
  grid-area: exportAll !important;
}

.content > .content-top #exportCurrentPageButton {
  grid-area: current !important;
}

.content > .content-top #exportSelectedButton {
  grid-area: selected !important;
}

.content > .content-top #taskLogButton {
  grid-area: log !important;
}

.content > .content-top #refreshButton {
  grid-area: refresh !important;
  justify-self: end !important;
}

.content > .content-top .gallery-batch-move-tools {
  grid-area: move !important;
  display: inline-flex !important;
  justify-self: end !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  min-width: 440px !important;
}

.content > .content-top #moveSelectedGalleryButton {
  min-width: 128px !important;
  flex: 0 0 auto !important;
}

.content > .content-top .gallery-batch-move-tools .gallery-batch-move-field {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  max-width: none !important;
}

@media (max-width: 1280px) {
  .content > .content-top .content-actions {
    grid-template-columns: minmax(0, 1fr) repeat(3, max-content) !important;
    grid-template-areas:
      "nav nav nav nav"
      "exportAll current selected log"
      "move move move refresh" !important;
  }
}

@media (max-width: 760px) {
  .content > .content-top .content-heading-stack {
    grid-template-columns: 1fr !important;
    align-items: stretch !important;
  }

  .content > .content-top .gallery-group-panel,
  .content > .content-top .gallery-batch-move-tools {
    align-items: stretch !important;
    flex-wrap: wrap !important;
    min-width: 0 !important;
  }

  .content > .content-top .gallery-group-field,
  .content > .content-top .gallery-batch-move-field,
  .content > .content-top .gallery-group-path {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .content > .content-top .content-actions {
    grid-template-columns: 1fr 1fr !important;
    grid-template-areas:
      "nav nav"
      "exportAll current"
      "selected log"
      "move move"
      "refresh refresh" !important;
  }

  .content > .content-top .workspace-nav {
    width: 100% !important;
  }

  .content > .content-top .workspace-nav-link {
    flex: 1 1 calc(50% - 6px) !important;
    justify-content: center !important;
  }

  .content > .content-top #refreshButton,
  .content > .content-top .content-actions > .button {
    width: 100% !important;
    justify-self: stretch !important;
  }
}

/* v3.4: clearer left sidebar sections and normal switch controls. */
.sidebar {
  background: #f7f8fa !important;
  border-color: rgba(29, 29, 31, 0.08) !important;
  box-shadow: inset -1px 0 0 rgba(29, 29, 31, 0.04), 0 18px 44px rgba(0, 0, 0, 0.05) !important;
}

.sidebar > .section {
  position: relative !important;
  margin: 10px !important;
  padding: 14px !important;
  border: 1px solid rgba(29, 29, 31, 0.1) !important;
  background: #ffffff !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.045) !important;
}

.sidebar > .section::before {
  position: absolute;
  left: 14px;
  top: 14px;
  width: 4px;
  height: 18px;
  border-radius: 999px;
  content: "";
  background: #007aff;
  box-shadow: 0 6px 14px rgba(0, 122, 255, 0.22);
}

.sidebar > .quick-panel::before {
  background: #34c759;
  box-shadow: 0 6px 14px rgba(52, 199, 89, 0.2);
}

.sidebar .section-heading,
.sidebar .quick-panel-head {
  min-height: 38px !important;
  padding-left: 14px !important;
  margin-bottom: 10px !important;
  border-bottom: 1px solid rgba(29, 29, 31, 0.07) !important;
}

.sidebar .section-heading h2::before,
.sidebar .content-top h2::before {
  content: none !important;
}

.quick-panel {
  gap: 10px !important;
}

.quick-panel .auth-card {
  display: grid !important;
  gap: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid rgba(29, 29, 31, 0.09) !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

.quick-panel .auth-card-row {
  min-height: 44px !important;
  padding: 10px 12px !important;
  border-bottom: 1px solid rgba(29, 29, 31, 0.07) !important;
}

.quick-panel .auth-card-row:last-child {
  border-bottom: 0 !important;
}

.quick-panel .auth-card-row:first-child {
  background: #fbfbfd !important;
}

.quick-panel .auth-card small {
  color: #6e6e73 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

.quick-panel .auth-card strong {
  color: #1d1d1f !important;
  font-size: 15px !important;
  font-weight: 760 !important;
}

.quick-panel .auth-button,
.quick-panel .auth-button.secondary {
  min-height: 32px !important;
  border: 1px solid rgba(29, 29, 31, 0.1) !important;
  border-radius: 8px !important;
  background: #f5f5f7 !important;
  color: #1d1d1f !important;
  box-shadow: none !important;
}

.quick-panel #authAdminLink,
.quick-panel .auth-button:not(.secondary) {
  border-color: #101828 !important;
  background: #101828 !important;
  color: #ffffff !important;
}

.quick-panel .auth-balance-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 12px !important;
  border-top: 0 !important;
  border-bottom: 1px solid rgba(29, 29, 31, 0.07) !important;
  background: #ffffff !important;
}

.quick-panel .auth-balance-meta {
  gap: 3px !important;
}

.quick-panel .auth-balance-value {
  font-size: 18px !important;
  line-height: 1.1 !important;
}

.quick-panel .auth-balance-hint {
  color: #6e6e73 !important;
  font-size: 11px !important;
}

.quick-panel .auth-balance-actions {
  justify-content: flex-end !important;
}

.quick-panel .auth-balance-price {
  display: inline-flex !important;
  min-height: 24px !important;
  align-items: center !important;
  padding: 0 8px !important;
  border-radius: 999px !important;
  background: #f5f5f7 !important;
  color: #6e6e73 !important;
}

.quick-panel .provider-switch {
  padding: 4px !important;
  border-radius: 8px !important;
  background: #f5f5f7 !important;
}

.quick-panel .provider-switch-button {
  min-height: 32px !important;
  border-radius: 8px !important;
}

.toggle-row,
.retry-settings-panel {
  border-radius: 8px !important;
}

.toggle-field,
.config-section .toggle-field,
.retry-settings-panel .toggle-field {
  display: flex !important;
  min-height: 44px !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 10px 12px !important;
  border: 1px solid rgba(29, 29, 31, 0.1) !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  box-shadow: none !important;
  color: #1d1d1f !important;
}

.toggle-field:hover {
  transform: none !important;
  border-color: rgba(0, 122, 255, 0.22) !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.045) !important;
}

.toggle-field span {
  order: 1 !important;
  min-width: 0 !important;
  color: #424245 !important;
  font-size: 13px !important;
  font-weight: 720 !important;
}

.toggle-field input[type="checkbox"] {
  order: 2 !important;
  flex: 0 0 auto !important;
  width: 42px !important;
  height: 24px !important;
  min-height: 24px !important;
  padding: 0 !important;
  border: 1px solid rgba(29, 29, 31, 0.16) !important;
  border-radius: 999px !important;
  background: #e5e5ea !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08) !important;
}

.toggle-field input[type="checkbox"]::after {
  top: 2px !important;
  left: 2px !important;
  width: 18px !important;
  height: 18px !important;
  background: #ffffff !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22) !important;
}

.toggle-field input[type="checkbox"]:checked {
  border-color: #34c759 !important;
  background: #34c759 !important;
  box-shadow: none !important;
}

.toggle-field input[type="checkbox"]:checked::after {
  transform: translateX(18px) !important;
}

.retry-settings-panel {
  gap: 10px !important;
  padding: 10px !important;
  border: 1px solid rgba(0, 122, 255, 0.16) !important;
  background: #f5f9ff !important;
}

.retry-settings-tip {
  padding: 8px 10px !important;
  border-radius: 8px !important;
  background: rgba(0, 122, 255, 0.06) !important;
}

/* v3.5: compact account/current-model block in the main sidebar. */
.sidebar > .quick-panel {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 118px !important;
  grid-template-areas:
    "auth auth"
    "model switch" !important;
  gap: 6px !important;
  padding: 8px !important;
}

.sidebar > .quick-panel::before {
  left: 8px !important;
  top: 10px !important;
  height: 14px !important;
}

.quick-panel .auth-card {
  display: grid !important;
  grid-area: auth !important;
  grid-template-columns: minmax(0, 1fr) auto auto !important;
  grid-template-areas: "user balance logout" !important;
  align-items: center !important;
  gap: 8px !important;
  min-height: 0 !important;
  padding: 6px 8px !important;
  border-radius: 8px !important;
}

.quick-panel .auth-card-row {
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.quick-panel .auth-card-row:first-child {
  grid-area: logout !important;
  justify-content: flex-end !important;
}

.quick-panel .auth-card-row:first-child small {
  display: none !important;
}

.quick-panel .auth-card-row:nth-child(2) {
  grid-area: user !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  overflow: hidden !important;
}

.quick-panel .auth-card strong {
  font-size: 14px !important;
  line-height: 1.2 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.quick-panel .auth-card small {
  font-size: 11px !important;
  line-height: 1.2 !important;
}

.quick-panel .auth-button,
.quick-panel .auth-button.secondary,
.quick-panel #authAdminLink {
  min-height: 26px !important;
  padding: 0 9px !important;
  font-size: 12px !important;
}

.quick-panel .auth-balance-row {
  grid-area: balance !important;
  display: flex !important;
  min-height: 26px !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 6px !important;
  padding: 0 !important;
  border-top: 0 !important;
  border-bottom: 0 !important;
  white-space: nowrap !important;
}

.quick-panel .auth-balance-meta {
  display: flex !important;
  min-width: 0 !important;
  align-items: baseline !important;
  gap: 8px !important;
}

.quick-panel .auth-balance-meta small {
  display: none !important;
}

.quick-panel .auth-balance-value {
  font-size: 14px !important;
  line-height: 1 !important;
}

.quick-panel .auth-balance-hint {
  display: none !important;
}

.quick-panel .auth-balance-actions {
  flex: 0 0 auto !important;
  gap: 5px !important;
}

.quick-panel .auth-balance-price {
  min-height: 20px !important;
  padding: 0 6px !important;
  font-size: 10px !important;
}

.quick-panel .quick-panel-head {
  grid-area: model !important;
  min-height: 28px !important;
  margin: 0 !important;
  padding: 0 0 0 14px !important;
  border-bottom: 0 !important;
}

.quick-panel .quick-panel-head-main {
  gap: 6px !important;
}

.quick-panel .quick-panel-head span {
  font-size: 11px !important;
}

.quick-panel .quick-panel-head strong {
  min-height: 22px !important;
  padding: 0 8px !important;
  font-size: 11px !important;
}

.quick-panel .quick-panel-close-button {
  min-height: 26px !important;
  padding: 0 9px !important;
}

.quick-panel .provider-switch {
  grid-area: switch !important;
  min-height: 28px !important;
  padding: 3px !important;
}

.quick-panel .provider-switch-button {
  min-height: 22px !important;
  font-size: 11px !important;
}

/* v3.7: ultra-compact quick panel requested for the main sidebar. */
.sidebar > .quick-panel {
  position: relative !important;
  grid-template-columns: minmax(0, 1fr) 92px !important;
  grid-template-areas: "auth switch" !important;
  align-items: center !important;
  min-height: 0 !important;
  padding: 7px 8px !important;
}

.quick-panel .auth-card {
  grid-template-columns: minmax(0, 1fr) auto auto !important;
  grid-template-areas: "user balance logout" !important;
  gap: 6px !important;
  min-height: 34px !important;
  padding: 4px 6px !important;
}

.quick-panel .auth-card-row:nth-child(2) > div {
  display: none !important;
}

.quick-panel .auth-card strong {
  font-size: 13px !important;
}

.quick-panel .auth-button,
.quick-panel .auth-button.secondary,
.quick-panel #authAdminLink {
  min-height: 24px !important;
  padding: 0 8px !important;
  font-size: 11px !important;
}

.quick-panel .auth-balance-row {
  min-height: 24px !important;
  gap: 5px !important;
}

.quick-panel .auth-balance-value {
  font-size: 13px !important;
}

.quick-panel .auth-balance-price {
  display: none !important;
}

.quick-panel .auth-balance-actions {
  gap: 4px !important;
}

.quick-panel .quick-panel-head {
  position: absolute !important;
  right: 8px !important;
  bottom: -30px !important;
  z-index: 2 !important;
  width: auto !important;
  min-height: 24px !important;
  padding: 0 !important;
}

.quick-panel .quick-panel-head-main {
  display: none !important;
}

.quick-panel .quick-panel-close-button {
  min-height: 24px !important;
  padding: 0 8px !important;
  font-size: 11px !important;
}

.quick-panel .provider-switch {
  min-height: 34px !important;
  padding: 3px !important;
}

.quick-panel .provider-switch-button {
  min-height: 26px !important;
}

/* v3.8: keep account, balance, channel, and close controls in one compact row. */
.sidebar > .quick-panel {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 64px 38px !important;
  grid-template-areas: "auth switch close" !important;
  align-items: center !important;
  gap: 6px !important;
  min-height: 54px !important;
  padding: 8px !important;
  overflow: visible !important;
}

.sidebar > .quick-panel::before {
  left: 8px !important;
  top: 8px !important;
  width: 3px !important;
  height: 10px !important;
}

.quick-panel .auth-card {
  grid-area: auth !important;
  display: grid !important;
  grid-template-columns: minmax(42px, 0.85fr) minmax(70px, 1fr) auto auto !important;
  grid-template-areas: "user balance charge logout" !important;
  align-items: center !important;
  gap: 6px !important;
  min-width: 0 !important;
  min-height: 38px !important;
  height: 38px !important;
  padding: 0 6px 0 9px !important;
  border: 1px solid rgba(29, 29, 31, 0.08) !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  overflow: hidden !important;
}

.quick-panel .auth-card-row,
.quick-panel .auth-card-row:first-child,
.quick-panel .auth-card-row:nth-child(2),
.quick-panel .auth-balance-row,
.quick-panel .auth-balance-actions {
  display: contents !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.quick-panel .auth-card-row:first-child small,
.quick-panel .auth-card-row:nth-child(2) > div,
.quick-panel .auth-balance-meta small,
.quick-panel .auth-balance-hint,
.quick-panel .auth-balance-price {
  display: none !important;
}

.quick-panel #authUsername {
  grid-area: user !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.quick-panel .auth-card strong,
.quick-panel .auth-balance-value {
  font-size: 13px !important;
  line-height: 1 !important;
}

.quick-panel .auth-balance-meta {
  grid-area: balance !important;
  display: flex !important;
  min-width: 0 !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 0 !important;
}

.quick-panel .auth-balance-value {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.quick-panel #authBalanceRechargeButton {
  grid-area: charge !important;
}

.quick-panel #authLogoutButton {
  grid-area: logout !important;
}

.quick-panel .auth-button,
.quick-panel .auth-button.secondary,
.quick-panel #authAdminLink {
  min-height: 28px !important;
  padding: 0 8px !important;
  border-radius: 8px !important;
  font-size: 11px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.quick-panel .quick-panel-head {
  display: contents !important;
  position: static !important;
  width: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

.quick-panel .quick-panel-head-main {
  display: none !important;
}

.quick-panel .quick-panel-close-button {
  grid-area: close !important;
  width: 38px !important;
  min-width: 0 !important;
  min-height: 38px !important;
  padding: 0 !important;
  border-radius: 8px !important;
  font-size: 11px !important;
}

.quick-panel .provider-switch {
  grid-area: switch !important;
  min-width: 0 !important;
  min-height: 38px !important;
  height: 38px !important;
  padding: 3px !important;
  border-radius: 8px !important;
}

.quick-panel .provider-switch-button {
  min-width: 0 !important;
  min-height: 30px !important;
  padding: 0 6px !important;
  border-radius: 7px !important;
  font-size: 11px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

/* v3.9: strict vertical rhythm for the main sidebar parameter blocks. */
.sidebar > .config-section {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 10px !important;
  padding: 14px !important;
}

.sidebar > .config-section .section-heading {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  min-height: 42px !important;
  margin: 0 !important;
  padding: 0 0 10px 14px !important;
}

.sidebar > .config-section .section-heading .button {
  align-self: center !important;
  min-height: 42px !important;
  padding: 0 16px !important;
}

.sidebar > .config-section > .field-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  align-items: start !important;
  gap: 8px !important;
  margin: 0 !important;
}

.sidebar > .config-section > .field-grid-single {
  grid-template-columns: minmax(0, 1fr) !important;
}

.sidebar > .config-section > .field-grid > .field {
  display: grid !important;
  grid-template-rows: 14px 44px !important;
  align-content: start !important;
  min-height: 61px !important;
}

.sidebar > .config-section > .field-grid > .field > span,
.sidebar > .config-section .retry-count-field > span {
  display: flex !important;
  align-items: center !important;
  height: 14px !important;
  margin: 0 0 3px !important;
  line-height: 1 !important;
}

.sidebar > .config-section > .field-grid > .field select,
.sidebar > .config-section > .field-grid > .field input[type="text"],
.sidebar > .config-section .retry-count-field input {
  height: 44px !important;
  min-height: 44px !important;
}

.sidebar > .config-section > .field-grid:nth-of-type(3) > .field:last-child {
  grid-column: auto !important;
}

.sidebar > .config-section > .field-grid:nth-of-type(4) > .field:last-child,
.sidebar > .config-section .field:has(#thinkingMode) {
  grid-column: 1 / -1 !important;
}

.sidebar > .config-section .field:has(#aspectRatio) {
  grid-column: auto !important;
}

.sidebar > .config-section .retry-settings-panel {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  align-items: start !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 10px !important;
}

.sidebar > .config-section .retry-toggle-field,
.sidebar > .config-section .retry-settings-tip {
  grid-column: 1 / -1 !important;
}

.sidebar > .config-section .retry-settings-row {
  display: contents !important;
}

.sidebar > .config-section .retry-count-field {
  display: grid !important;
  grid-template-rows: 14px 44px !important;
  align-content: start !important;
  min-height: 61px !important;
}

.sidebar > .config-section #saveRetrySettingsButton {
  align-self: end !important;
  width: 100% !important;
  min-height: 44px !important;
  height: 44px !important;
}

.sidebar > .config-section .retry-settings-tip {
  margin: 0 !important;
}

.sidebar > .config-section .dir-picker-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 82px 46px !important;
  align-items: stretch !important;
  gap: 5px !important;
  height: 44px !important;
}

.sidebar > .config-section .dir-picker-row input,
.sidebar > .config-section .dir-picker-row .button {
  height: 44px !important;
  min-height: 44px !important;
}

.sidebar > .config-section .advanced-group {
  margin: 0 !important;
}

/* v4.0: remove channel selector from the top account strip; keep logout as the account action. */
.sidebar > .quick-panel {
  grid-template-columns: minmax(0, 1fr) 38px !important;
  grid-template-areas: "auth close" !important;
}

.quick-panel .provider-switch {
  display: none !important;
}

.quick-panel .auth-card {
  grid-template-columns: minmax(42px, 0.85fr) minmax(70px, 1fr) auto auto !important;
  grid-template-areas: "user balance charge logout" !important;
}

/* v4.1: align every visible block in the parameter section to one left/right rail. */
.sidebar > .config-section {
  gap: 9px !important;
  padding: 14px !important;
}

.sidebar > .config-section::before {
  left: 14px !important;
}

.sidebar > .config-section .section-heading {
  width: 100% !important;
  padding: 0 0 10px 14px !important;
}

.sidebar > .config-section > .field-grid,
.sidebar > .config-section .retry-settings-panel,
.sidebar > .config-section .advanced-group {
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.sidebar > .config-section .retry-settings-panel {
  padding: 10px !important;
}

.sidebar > .config-section .retry-toggle-field,
.sidebar > .config-section .retry-count-field,
.sidebar > .config-section #saveRetrySettingsButton,
.sidebar > .config-section .retry-settings-tip {
  margin: 0 !important;
}

.sidebar > .config-section .retry-settings-tip {
  width: 100% !important;
}

.sidebar > .config-section .dir-picker-row {
  width: 100% !important;
}

.sidebar > .config-section .advanced-group-summary {
  padding-left: 10px !important;
  padding-right: 10px !important;
}

/* v4.3: desktop gallery toolbar alignment. */
@media (min-width: 1200px) {
  .content > .content-top {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 8px !important;
    padding: 10px 12px !important;
  }

  .content > .content-top .content-heading-stack {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 12px !important;
    min-height: 38px !important;
  }

  .content > .content-top .content-heading-stack h2 {
    min-height: 38px !important;
    margin: 0 !important;
  }

  .content > .content-top .gallery-group-panel {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 6px !important;
    min-width: 0 !important;
    height: 38px !important;
    overflow: hidden !important;
  }

  .content > .content-top .gallery-group-order-actions {
    display: contents !important;
  }

  .content > .content-top .gallery-group-field {
    flex: 0 0 310px !important;
    min-width: 260px !important;
    max-width: 310px !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 3px 4px 3px 10px !important;
    grid-template-columns: auto minmax(150px, 1fr) !important;
    align-items: center !important;
  }

  .content > .content-top .gallery-group-field select {
    height: 30px !important;
    min-height: 30px !important;
    padding: 0 10px !important;
  }

  .content > .content-top .gallery-group-path {
    flex: 1 1 220px !important;
    min-width: 180px !important;
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 10px !important;
  }

  .content > .content-top .button,
  .content > .content-top .workspace-nav-link {
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 11px !important;
  }

  .content > .content-top .button-mini,
  .content > .content-top .workspace-nav-link {
    height: 30px !important;
    min-height: 30px !important;
    padding: 0 10px !important;
  }

  .content > .content-top .content-actions {
    display: flex !important;
    width: 100% !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 8px 10px !important;
  }

  .content > .content-top .workspace-nav {
    order: 1 !important;
    flex: 0 0 auto !important;
    align-self: center !important;
    height: 38px !important;
    min-height: 38px !important;
    overflow: hidden !important;
  }

  .content > .content-top #exportAllButton {
    order: 2 !important;
  }

  .content > .content-top #exportCurrentPageButton {
    order: 3 !important;
  }

  .content > .content-top #exportSelectedButton {
    order: 4 !important;
  }

  .content > .content-top #taskLogButton {
    order: 5 !important;
  }

  .content > .content-top .gallery-batch-move-tools {
    order: 6 !important;
    flex: 0 0 auto !important;
    justify-self: start !important;
    align-items: center !important;
    height: 38px !important;
    min-height: 38px !important;
    flex-wrap: nowrap !important;
  }

  .content > .content-top .gallery-batch-move-tools .gallery-batch-move-field {
    flex: 0 0 306px !important;
    width: 306px !important;
    min-width: 306px !important;
    max-width: 306px !important;
    height: 38px !important;
    min-height: 38px !important;
  }

  .content > .content-top #moveSelectedGalleryButton,
  .content > .content-top #refreshButton {
    height: 34px !important;
    min-height: 34px !important;
  }

  .content > .content-top #refreshButton {
    order: 7 !important;
  }
}

/* v4.4: group the desktop gallery toolbar into clear visual clusters. */
@media (min-width: 1200px) {
  .content > .content-top {
    gap: 10px !important;
  }

  .content > .content-top .content-heading-stack {
    align-items: start !important;
  }

  .content > .content-top .gallery-group-panel {
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
    height: auto !important;
    min-height: 40px !important;
    overflow: visible !important;
  }

  .content > .content-top .gallery-toolbar-group,
  .content > .content-top .gallery-group-order-actions,
  .content > .content-top .workspace-nav,
  .content > .content-top .gallery-batch-move-tools {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    min-height: 40px !important;
    height: auto !important;
    padding: 4px !important;
    border: 1px solid rgba(29, 29, 31, 0.08) !important;
    border-radius: 10px !important;
    background: #f8f9fb !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85) !important;
  }

  .content > .content-top .gallery-group-order-actions {
    flex: 0 0 auto !important;
  }

  .content > .content-top .gallery-toolbar-group-manage,
  .content > .content-top .gallery-toolbar-group-export {
    background: #ffffff !important;
  }

  .content > .content-top .gallery-toolbar-group-path,
  .content > .content-top .gallery-batch-move-tools {
    background: #f6faff !important;
    border-color: rgba(0, 122, 255, 0.14) !important;
  }

  .content > .content-top .gallery-toolbar-group-refresh {
    background: #ffffff !important;
  }

  .content > .content-top .gallery-group-field {
    height: 34px !important;
    min-height: 34px !important;
  }

  .content > .content-top .gallery-group-panel > .gallery-group-field {
    flex: 0 0 310px !important;
  }

  .content > .content-top .gallery-group-path {
    flex: 1 1 240px !important;
    min-width: 220px !important;
    max-width: 420px !important;
  }

  .content > .content-top .button,
  .content > .content-top .workspace-nav-link {
    height: 30px !important;
    min-height: 30px !important;
  }

  .content > .content-top .content-actions {
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .content > .content-top .workspace-nav {
    order: 1 !important;
    flex: 0 0 auto !important;
    overflow: visible !important;
  }

  .content > .content-top .gallery-toolbar-group-export {
    order: 2 !important;
  }

  .content > .content-top .gallery-batch-move-tools {
    order: 3 !important;
    flex: 0 0 auto !important;
  }

  .content > .content-top .gallery-toolbar-group-refresh {
    order: 4 !important;
  }

  .content > .content-top .gallery-batch-move-tools .gallery-batch-move-field {
    height: 34px !important;
    min-height: 34px !important;
  }

  .content > .content-top .gallery-batch-move-tools #moveSelectedGalleryButton,
  .content > .content-top .gallery-toolbar-group-refresh #refreshButton {
    height: 30px !important;
    min-height: 30px !important;
  }
}

/* v4.5: make the desktop gallery toolbar groups visually obvious. */
@media (min-width: 1200px) {
  .content > .content-top {
    padding: 12px !important;
    gap: 12px !important;
  }

  .content > .content-top .content-heading-stack {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    gap: 14px !important;
  }

  .content > .content-top .gallery-group-panel,
  .content > .content-top .content-actions {
    align-items: stretch !important;
    gap: 10px !important;
  }

  .content > .content-top .gallery-group-panel {
    min-height: 58px !important;
  }

  .content > .content-top .content-actions {
    min-height: 58px !important;
  }

  .content > .content-top .gallery-group-panel > .gallery-group-field,
  .content > .content-top .gallery-group-order-actions,
  .content > .content-top .gallery-toolbar-group,
  .content > .content-top .workspace-nav,
  .content > .content-top .gallery-batch-move-tools {
    position: relative !important;
    align-self: stretch !important;
    min-height: 58px !important;
    height: 58px !important;
    padding: 18px 8px 7px !important;
    border: 1px solid rgba(29, 29, 31, 0.14) !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    box-shadow: none !important;
  }

  .content > .content-top .gallery-group-panel > .gallery-group-field,
  .content > .content-top .gallery-toolbar-group-path,
  .content > .content-top .gallery-batch-move-tools {
    background: #f4f9ff !important;
    border-color: rgba(0, 122, 255, 0.28) !important;
  }

  .content > .content-top .gallery-toolbar-group-manage,
  .content > .content-top .gallery-toolbar-group-export {
    background: #fbfbfd !important;
  }

  .content > .content-top .gallery-group-panel > .gallery-group-field::before,
  .content > .content-top .gallery-group-order-actions::before,
  .content > .content-top .gallery-toolbar-group::before,
  .content > .content-top .workspace-nav::before,
  .content > .content-top .gallery-batch-move-tools::before {
    position: absolute !important;
    left: 8px !important;
    top: 5px !important;
    color: #6e6e73 !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    content: "" !important;
  }

  .content > .content-top .gallery-group-panel > .gallery-group-field::before {
    content: "分组选择" !important;
  }

  .content > .content-top .gallery-group-order-actions::before {
    content: "排序" !important;
  }

  .content > .content-top .gallery-toolbar-group-manage::before {
    content: "分组管理" !important;
  }

  .content > .content-top .gallery-toolbar-group-path::before {
    content: "路径与导出" !important;
  }

  .content > .content-top .workspace-nav::before {
    content: "工作台" !important;
  }

  .content > .content-top .gallery-toolbar-group-export::before {
    content: "图片导出" !important;
  }

  .content > .content-top .gallery-batch-move-tools::before {
    content: "移动图片" !important;
  }

  .content > .content-top .gallery-toolbar-group-refresh::before {
    content: "刷新" !important;
  }

  .content > .content-top .gallery-group-panel > .gallery-group-field {
    flex: 0 0 320px !important;
    display: grid !important;
    grid-template-columns: auto minmax(170px, 1fr) !important;
    align-items: center !important;
  }

  .content > .content-top .gallery-group-panel > .gallery-group-field > span {
    margin: 0 !important;
  }

  .content > .content-top .gallery-group-field,
  .content > .content-top .gallery-group-field select {
    min-height: 30px !important;
    height: 30px !important;
  }

  .content > .content-top .button,
  .content > .content-top .workspace-nav-link {
    height: 30px !important;
    min-height: 30px !important;
  }

  .content > .content-top .gallery-toolbar-group-path {
    flex: 1 1 520px !important;
  }

  .content > .content-top .gallery-group-path {
    height: 30px !important;
    min-height: 30px !important;
    max-width: none !important;
  }

  .content > .content-top .workspace-nav {
    flex-wrap: nowrap !important;
  }

  .content > .content-top .gallery-batch-move-tools .gallery-batch-move-field {
    height: 30px !important;
    min-height: 30px !important;
  }
}

/* v4.6: let the main workspace use the full browser width on desktop. */
@media (min-width: 1200px) {
  html,
  body {
    width: 100% !important;
  }

  .app-shell {
    width: 100% !important;
    max-width: none !important;
    grid-template-columns: minmax(320px, 380px) minmax(0, 1fr) !important;
  }

  .content {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  .content > .content-top,
  .content > .gallery,
  .gallery-group-section,
  .gallery-group-body {
    width: 100% !important;
    max-width: none !important;
  }

  .gallery-group-body {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    justify-content: stretch !important;
  }

  .gallery-group-body .gallery-card {
    width: 100% !important;
    justify-self: stretch !important;
  }
}

/* v4.7: compact the gallery group controls into one operational row. */
@media (min-width: 1200px) {
  .content > .content-top {
    padding: 8px 12px !important;
    gap: 8px !important;
  }

  .content > .content-top .content-heading-stack {
    grid-template-columns: auto minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 10px !important;
  }

  .content > .content-top .content-heading-stack h2 {
    font-size: 20px !important;
    line-height: 32px !important;
  }

  .content > .content-top .gallery-group-panel {
    display: flex !important;
    width: fit-content !important;
    max-width: 100% !important;
    min-height: 34px !important;
    height: 34px !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 2px 4px !important;
    border: 1px solid rgba(29, 29, 31, 0.12) !important;
    border-radius: 8px !important;
    background: #f8fafc !important;
  }

  .content > .content-top .gallery-group-panel > .gallery-group-field,
  .content > .content-top .gallery-toolbar-group-manage {
    position: static !important;
    align-self: center !important;
    min-height: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .content > .content-top .gallery-group-panel > .gallery-group-field::before,
  .content > .content-top .gallery-toolbar-group-manage::before {
    display: none !important;
    content: none !important;
  }

  .content > .content-top .gallery-group-panel > .gallery-group-field {
    flex: 0 1 300px !important;
    width: 300px !important;
    min-width: 220px !important;
    max-width: 300px !important;
    grid-template-columns: 34px minmax(150px, 1fr) !important;
    gap: 6px !important;
  }

  .content > .content-top .gallery-group-panel > .gallery-group-field > span {
    color: #64748b !important;
    font-size: 11px !important;
    font-weight: 800 !important;
  }

  .content > .content-top .gallery-group-field select {
    min-height: 28px !important;
    height: 28px !important;
    padding: 0 28px 0 9px !important;
    border-radius: 6px !important;
    font-size: 12px !important;
  }

  .content > .content-top .gallery-toolbar-group-manage {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    gap: 4px !important;
    padding-left: 6px !important;
    border-left: 1px solid rgba(29, 29, 31, 0.1) !important;
  }

  .content > .content-top .gallery-toolbar-group-manage .button {
    min-height: 28px !important;
    height: 28px !important;
    padding: 0 10px !important;
    border-radius: 6px !important;
    font-size: 12px !important;
  }
}

/* v4.8: dense desktop controls with width-aware wrapping. */
@media (min-width: 1024px) {
  .app-shell .button,
  .app-shell button.button {
    min-height: 28px !important;
    height: 28px !important;
    padding: 0 9px !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
  }

  .app-shell .button-mini,
  .app-shell button.button-mini {
    min-height: 26px !important;
    height: 26px !important;
    padding-inline: 8px !important;
    font-size: 11px !important;
  }

  .app-shell .icon-button {
    min-width: 28px !important;
    width: auto !important;
    min-height: 28px !important;
    height: 28px !important;
    padding: 0 7px !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
  }

  .app-shell .provider-switch-button,
  .app-shell .preview-tool,
  .app-shell .preview-close {
    min-height: 28px !important;
    height: 28px !important;
    padding: 0 8px !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  .section-actions,
  .task-actions,
  .task-prompt-ai-row,
  .task-prompt-history-row,
  .gallery-actions,
  .preview-actions,
  .content-actions,
  .gallery-toolbar-group,
  .workspace-nav {
    gap: 4px !important;
  }

  .content > .content-top .content-actions {
    display: flex !important;
    min-height: 32px !important;
    height: auto !important;
    align-items: center !important;
    align-content: center !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
  }

  .content > .content-top .gallery-toolbar-group,
  .content > .content-top .workspace-nav,
  .content > .content-top .gallery-batch-move-tools {
    position: static !important;
    align-self: center !important;
    display: inline-flex !important;
    min-height: 32px !important;
    height: 32px !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 2px 3px !important;
    border: 1px solid rgba(29, 29, 31, 0.1) !important;
    border-radius: 7px !important;
    background: #ffffff !important;
    box-shadow: none !important;
  }

  .content > .content-top .gallery-toolbar-group::before,
  .content > .content-top .workspace-nav::before,
  .content > .content-top .gallery-batch-move-tools::before {
    display: none !important;
    content: none !important;
  }

  .content > .content-top .workspace-nav {
    width: auto !important;
    max-width: 100% !important;
    flex: 0 1 auto !important;
    flex-wrap: wrap !important;
  }

  .content > .content-top .gallery-toolbar-group-export,
  .content > .content-top .gallery-toolbar-group-refresh {
    flex: 0 0 auto !important;
  }

  .content > .content-top .gallery-batch-move-tools {
    flex: 0 1 auto !important;
  }

  .content > .content-top .gallery-batch-move-tools .gallery-batch-move-field {
    flex: 0 1 230px !important;
    width: 230px !important;
    min-width: 190px !important;
    min-height: 28px !important;
    height: 28px !important;
    padding: 0 4px !important;
    border: 0 !important;
    background: transparent !important;
  }

  .content > .content-top .gallery-batch-move-tools .gallery-batch-move-field select {
    min-height: 26px !important;
    height: 26px !important;
    font-size: 11px !important;
  }
}

/* v4.11: use horizontal space when desktop height cannot fit both sidebar sections. */
@media (min-width: 1024px) and (max-height: 999px) {
  .app-shell {
    grid-template-columns: clamp(560px, 52vw, 760px) minmax(0, 1fr) !important;
  }

  .app-shell .sidebar {
    display: grid !important;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr) !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    align-content: start !important;
    align-items: start !important;
    gap: 6px !important;
    overflow: hidden !important;
  }

  .app-shell .sidebar > .quick-panel {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    width: auto !important;
    margin: 6px 6px 0 !important;
  }

  .app-shell .sidebar > .config-section {
    grid-column: 1 !important;
    grid-row: 2 !important;
    width: auto !important;
    margin: 0 0 6px 6px !important;
  }

  .app-shell .sidebar > .section:nth-of-type(3) {
    grid-column: 2 !important;
    grid-row: 2 !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 6px 6px 0 !important;
  }

  .app-shell .sidebar > .section:nth-of-type(3) .section-heading {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 4px !important;
    min-height: 54px !important;
    height: auto !important;
    padding: 0 0 4px 12px !important;
  }

  .app-shell .sidebar > .section:nth-of-type(3) .section-actions {
    display: grid !important;
    grid-template-columns: minmax(58px, 0.8fr) repeat(3, auto) !important;
    align-items: center !important;
    justify-content: stretch !important;
    gap: 3px !important;
  }

  .app-shell .sidebar > .section:nth-of-type(3) .inline-field {
    min-width: 0 !important;
    min-height: 28px !important;
    height: 28px !important;
    gap: 3px !important;
    padding: 0 4px !important;
  }

  .app-shell .sidebar > .section:nth-of-type(3) .inline-field select {
    width: 34px !important;
    min-height: 24px !important;
    height: 24px !important;
    padding: 0 14px 0 4px !important;
  }

  .app-shell .sidebar > .section:nth-of-type(3) .task-item {
    padding: 6px !important;
  }

  .app-shell .sidebar > .section:nth-of-type(3) .task-prompt {
    min-height: 56px !important;
    height: 56px !important;
    padding: 7px 8px !important;
  }

  .app-shell .sidebar > .section:nth-of-type(3) .task-prompt-tools {
    gap: 4px !important;
  }

  .app-shell .sidebar > .section:nth-of-type(3) .task-prompt-history-row {
    min-height: 30px !important;
    height: 30px !important;
  }

  .app-shell .sidebar > .section:nth-of-type(3) .task-prompt-history-select,
  .app-shell .sidebar > .section:nth-of-type(3) .task-scene-preset-select {
    min-height: 28px !important;
    height: 28px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    font-size: 11px !important;
  }

  .app-shell .sidebar > .section:nth-of-type(3) .task-scene-summary {
    min-height: 28px !important;
    height: 28px !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
  }

  .app-shell .sidebar > .section:nth-of-type(3) .status {
    min-height: 28px !important;
    padding: 5px 7px !important;
  }
}

@media (min-width: 1024px) and (max-height: 749px) {
  .app-shell .sidebar > .quick-panel {
    min-height: 30px !important;
    height: 30px !important;
    padding: 2px 4px !important;
  }

  .app-shell .sidebar > .config-section .section-heading {
    min-height: 22px !important;
    height: 22px !important;
  }

  .app-shell .sidebar > .config-section .field-grid > .field {
    grid-template-rows: 10px 24px !important;
    min-height: 36px !important;
  }

  .app-shell .sidebar > .config-section .field-grid > .field > span,
  .app-shell .sidebar > .config-section .retry-count-field > span {
    height: 10px !important;
    margin-bottom: 2px !important;
    font-size: 9px !important;
  }

  .app-shell .sidebar > .config-section .field-grid > .field select,
  .app-shell .sidebar > .config-section .field-grid > .field input[type="text"] {
    min-height: 24px !important;
    height: 24px !important;
  }

  .app-shell .sidebar > .config-section .toggle-field {
    min-height: 24px !important;
    height: 24px !important;
  }

  .app-shell .sidebar > .config-section .retry-count-field {
    grid-template-rows: 10px 22px !important;
    min-height: 34px !important;
  }

  .app-shell .sidebar > .config-section .retry-count-field input {
    min-height: 22px !important;
    height: 22px !important;
  }

  .app-shell .sidebar > .config-section .advanced-group-summary {
    min-height: 24px !important;
    height: 24px !important;
  }

  .app-shell .sidebar > .section:nth-of-type(3) .section-heading {
    min-height: 42px !important;
  }

  .app-shell .sidebar > .section:nth-of-type(3) .task-prompt {
    min-height: 36px !important;
    height: 36px !important;
  }

  .app-shell .sidebar > .section:nth-of-type(3) .status.status-idle {
    display: none !important;
  }
}

/* v4.16: keep the homepage sidebar single-column; compact vertically without side-by-side panels. */
@media (min-width: 1024px) and (max-height: 999px) {
  .app-shell {
    grid-template-columns: minmax(320px, 380px) minmax(0, 1fr) !important;
  }

  .app-shell .sidebar {
    display: flex !important;
    flex-direction: column !important;
    align-content: normal !important;
    align-items: stretch !important;
    gap: 4px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .app-shell .sidebar > .quick-panel,
  .app-shell .sidebar > .config-section,
  .app-shell .sidebar > .section:nth-of-type(3) {
    width: auto !important;
    min-width: 0 !important;
    margin: 4px 6px 0 !important;
  }

  .app-shell .sidebar > .quick-panel {
    min-height: 40px !important;
    height: 40px !important;
    padding: 3px 5px !important;
  }

  .app-shell .sidebar > .config-section {
    margin-top: 0 !important;
  }

  .app-shell .sidebar > .section:nth-of-type(3) {
    margin-top: 0 !important;
    margin-bottom: 6px !important;
  }

  .app-shell .sidebar > .config-section .retry-settings-tip {
    display: none !important;
  }

  .app-shell .sidebar > .section:nth-of-type(3) .section-heading {
    min-height: 48px !important;
  }

  .app-shell .sidebar > .section:nth-of-type(3) .task-prompt {
    min-height: 42px !important;
    height: 42px !important;
  }

  .app-shell .sidebar > .section:nth-of-type(3) .task-reference-block {
    margin-top: 4px !important;
    padding-top: 4px !important;
  }

  .app-shell .sidebar > .section:nth-of-type(3) .task-reference-list {
    margin-top: 4px !important;
    gap: 4px !important;
  }

  .app-shell .sidebar > .section:nth-of-type(3) .task-reference-list .reference-meta {
    display: none !important;
  }

  .app-shell .sidebar > .section:nth-of-type(3) .task-reference-list .reference-item.reference-slot-card {
    gap: 3px !important;
    padding: 3px !important;
  }

  .app-shell .sidebar > .section:nth-of-type(3) .task-reference-list .reference-preview,
  .app-shell .sidebar > .section:nth-of-type(3) .task-reference-list .reference-placeholder,
  .app-shell .sidebar > .section:nth-of-type(3) .task-reference-list .reference-image {
    width: 48px !important;
    height: 48px !important;
  }
}

@media (min-width: 1024px) and (max-height: 899px) {
  html body .app-shell button:not(.reference-preview):not(.gallery-preview):not(.announcement-fab) {
    min-height: 24px !important;
    height: 24px !important;
    padding: 0 7px !important;
    font-size: 11px !important;
  }

  .app-shell .sidebar > .config-section {
    gap: 4px !important;
    padding: 8px !important;
  }

  .app-shell .sidebar > .config-section::before {
    left: 8px !important;
    top: 8px !important;
    height: 12px !important;
  }

  .app-shell .sidebar > .config-section .section-heading {
    min-height: 24px !important;
    height: 24px !important;
    padding: 0 0 3px 10px !important;
  }

  .app-shell .sidebar > .config-section .section-heading h2 {
    font-size: 16px !important;
    line-height: 20px !important;
  }

  .app-shell .sidebar > .config-section .field-grid > .field {
    grid-template-rows: 11px 26px !important;
    min-height: 39px !important;
  }

  .app-shell .sidebar > .config-section .field-grid > .field > span,
  .app-shell .sidebar > .config-section .retry-count-field > span {
    height: 11px !important;
    margin-bottom: 2px !important;
    font-size: 10px !important;
  }

  .app-shell .sidebar > .config-section .field-grid > .field select,
  .app-shell .sidebar > .config-section .field-grid > .field input[type="text"] {
    min-height: 26px !important;
    height: 26px !important;
    font-size: 11px !important;
  }

  .app-shell .sidebar > .config-section .retry-settings-panel {
    gap: 4px !important;
    padding: 4px !important;
  }

  .app-shell .sidebar > .config-section .toggle-field {
    min-height: 28px !important;
    height: 28px !important;
    padding: 3px 7px !important;
  }

  .app-shell .sidebar > .config-section .toggle-field input[type="checkbox"] {
    width: 32px !important;
    height: 18px !important;
    min-height: 18px !important;
  }

  .app-shell .sidebar > .config-section .toggle-field input[type="checkbox"]::after {
    top: 1px !important;
    left: 1px !important;
    width: 14px !important;
    height: 14px !important;
  }

  .app-shell .sidebar > .config-section .toggle-field input[type="checkbox"]:checked::after {
    transform: translateX(14px) !important;
  }

  .app-shell .sidebar > .config-section .retry-count-field {
    grid-template-rows: 11px 24px !important;
    min-height: 37px !important;
  }

  .app-shell .sidebar > .config-section .retry-count-field input,
  .app-shell .sidebar > .config-section #saveRetrySettingsButton,
  .app-shell .sidebar > .config-section .dir-picker-row,
  .app-shell .sidebar > .config-section .dir-picker-row input,
  .app-shell .sidebar > .config-section .dir-picker-row .button {
    min-height: 24px !important;
    height: 24px !important;
  }

  .app-shell .sidebar > .config-section .retry-settings-tip {
    padding: 3px 5px !important;
    font-size: 9px !important;
    line-height: 1.25 !important;
  }

  .app-shell .sidebar > .config-section .advanced-group-summary {
    min-height: 28px !important;
    height: 28px !important;
    padding: 3px 6px !important;
  }

  .app-shell .content > .content-top .gallery-toolbar-group-refresh #refreshButton,
  .announcement-fab,
  .announcement-close {
    min-width: 24px !important;
    width: 24px !important;
    min-height: 24px !important;
    height: 24px !important;
  }

  .app-shell .content > .content-top .gallery-toolbar-group,
  .app-shell .content > .content-top .workspace-nav,
  .app-shell .content > .content-top .gallery-batch-move-tools {
    min-height: 28px !important;
    height: 28px !important;
    padding: 2px !important;
  }

  .app-shell .content > .content-top .content-actions {
    min-height: 28px !important;
  }
}

/* v4.19: Mobbin-inspired neutral product UI without changing homepage workflow. */
:root {
  --mobbin-ink: #111111;
  --mobbin-muted: #6f6f6b;
  --mobbin-canvas: #f5f5f3;
  --mobbin-surface: #ffffff;
  --mobbin-soft: #f1f1ef;
  --mobbin-line: #dededb;
  --mobbin-line-strong: #c9c9c5;
}

html,
body {
  background: var(--mobbin-canvas) !important;
  color: var(--mobbin-ink) !important;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif !important;
}

.app-shell {
  background: var(--mobbin-canvas) !important;
}

.app-shell .sidebar {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.app-shell .sidebar > .section,
.app-shell .content > .content-top,
.app-shell .gallery-group-section,
.app-shell .task-item,
.app-shell .gallery-card,
.app-shell .reference-item,
.app-shell .task-log-card {
  border: 1px solid var(--mobbin-line) !important;
  border-radius: 8px !important;
  background: var(--mobbin-surface) !important;
  box-shadow: none !important;
}

.app-shell .sidebar > .section::before,
.app-shell .content-heading-stack::before {
  width: 3px !important;
  border-radius: 2px !important;
  background: var(--mobbin-ink) !important;
  box-shadow: none !important;
}

.app-shell h1,
.app-shell h2,
.app-shell h3,
.app-shell strong {
  color: var(--mobbin-ink) !important;
  letter-spacing: 0 !important;
}

.app-shell .section-heading,
.app-shell .quick-panel-head,
.app-shell .content-heading-stack {
  border-color: #ececea !important;
}

.app-shell .field > span,
.app-shell .inline-field > span,
.app-shell .task-reference-title,
.app-shell .gallery-group-field > span,
.app-shell .gallery-batch-move-field > span,
.app-shell .quick-panel-head span,
.app-shell .status,
.app-shell small {
  color: var(--mobbin-muted) !important;
}

.app-shell select,
.app-shell input:not([type="checkbox"]),
.app-shell textarea,
.app-shell .inline-field,
.app-shell .task-prompt-history-row,
.app-shell .task-scene-summary,
.app-shell .gallery-group-panel,
.app-shell .gallery-toolbar-group,
.app-shell .workspace-nav,
.app-shell .gallery-batch-move-tools {
  border-color: var(--mobbin-line) !important;
  border-radius: 7px !important;
  background: #f8f8f7 !important;
  color: var(--mobbin-ink) !important;
  box-shadow: none !important;
}

.app-shell select:focus,
.app-shell input:not([type="checkbox"]):focus,
.app-shell textarea:focus {
  border-color: var(--mobbin-ink) !important;
  box-shadow: 0 0 0 2px rgba(17, 17, 17, 0.08) !important;
}

.app-shell .button-primary,
.app-shell .btn-primary,
.app-shell .workspace-nav-link[aria-current="page"] {
  border-color: var(--mobbin-ink) !important;
  background: var(--mobbin-ink) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

.app-shell .button-primary:hover,
.app-shell .btn-primary:hover,
.app-shell .workspace-nav-link[aria-current="page"]:hover {
  border-color: #2d2d2b !important;
  background: #2d2d2b !important;
}

.app-shell .button-secondary,
.app-shell .icon-button,
.app-shell .preview-tool,
.app-shell .preview-close,
.app-shell .workspace-nav-link,
.app-shell .auth-button,
.app-shell .quick-panel-close-button {
  border-color: var(--mobbin-line) !important;
  background: var(--mobbin-surface) !important;
  color: var(--mobbin-ink) !important;
  box-shadow: none !important;
}

.app-shell .button-secondary:hover,
.app-shell .icon-button:hover,
.app-shell .preview-tool:hover,
.app-shell .workspace-nav-link:hover {
  border-color: var(--mobbin-line-strong) !important;
  background: var(--mobbin-soft) !important;
  transform: none !important;
  box-shadow: none !important;
}

.app-shell .button-danger {
  border-color: #f0cccc !important;
  background: #fff5f5 !important;
  color: #b42318 !important;
  box-shadow: none !important;
}

.app-shell .retry-settings-panel {
  border-color: var(--mobbin-line) !important;
  background: #fafafa !important;
  box-shadow: none !important;
}

.app-shell .toggle-field {
  border-color: var(--mobbin-line) !important;
  background: var(--mobbin-surface) !important;
}

.app-shell .toggle-field input[type="checkbox"] {
  border-color: var(--mobbin-line-strong) !important;
  background: #d9d9d6 !important;
}

.app-shell .toggle-field input[type="checkbox"]:checked {
  border-color: var(--mobbin-ink) !important;
  background: var(--mobbin-ink) !important;
}

.app-shell .advanced-group,
.app-shell .advanced-group-summary,
.app-shell .task-scene-analysis {
  border-color: var(--mobbin-line) !important;
  background: #fafafa !important;
  box-shadow: none !important;
}

.app-shell .advanced-group-kicker,
.app-shell .task-order,
.app-shell .gallery-group-save-path-status,
.app-shell .gallery-group-count {
  color: #2563eb !important;
}

.app-shell .advanced-group-state {
  border-color: var(--mobbin-line) !important;
  background: var(--mobbin-surface) !important;
}

.app-shell .advanced-group-state::before,
.app-shell .advanced-group-state::after {
  background: var(--mobbin-ink) !important;
}

.app-shell .gallery-group-head,
.app-shell .task-head,
.app-shell .gallery-card .action-row {
  border-color: #ececea !important;
}

.app-shell .gallery-card:hover,
.app-shell .task-item:hover,
.app-shell .reference-item:hover {
  border-color: var(--mobbin-line-strong) !important;
  box-shadow: 0 8px 22px rgba(17, 17, 17, 0.06) !important;
  transform: none !important;
}

.app-shell .empty-state,
.app-shell .task-reference-empty {
  border-color: var(--mobbin-line-strong) !important;
  background: #fafafa !important;
  color: var(--mobbin-muted) !important;
}

body.auth-locked .auth-modal {
  background: rgba(245, 245, 243, 0.94) !important;
  backdrop-filter: blur(8px) !important;
}

body.auth-locked .auth-dialog {
  border: 1px solid var(--mobbin-line) !important;
  border-radius: 8px !important;
  background: var(--mobbin-surface) !important;
  box-shadow: 0 18px 48px rgba(17, 17, 17, 0.12) !important;
}

body.auth-locked .auth-dialog h2,
body.auth-locked .auth-dialog strong {
  color: var(--mobbin-ink) !important;
  letter-spacing: 0 !important;
}

body.auth-locked .auth-dialog p,
body.auth-locked .auth-dialog label {
  color: var(--mobbin-muted) !important;
}

body.auth-locked .auth-dialog input {
  border: 1px solid var(--mobbin-line) !important;
  border-radius: 7px !important;
  background: #f8f8f7 !important;
  color: var(--mobbin-ink) !important;
  box-shadow: none !important;
}

body.auth-locked .auth-dialog input:focus {
  border-color: var(--mobbin-ink) !important;
  box-shadow: 0 0 0 2px rgba(17, 17, 17, 0.08) !important;
}

body.auth-locked .auth-submit {
  border: 1px solid var(--mobbin-ink) !important;
  border-radius: 7px !important;
  background: var(--mobbin-ink) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

body.auth-locked .auth-submit:hover {
  border-color: #2d2d2b !important;
  background: #2d2d2b !important;
  transform: none !important;
}

body.auth-locked .auth-switch {
  color: var(--mobbin-ink) !important;
}

/* Uiverse-inspired interaction polish: restrained motion, tactile controls and familiar symbols. */
.app-shell button:not(.reference-preview):not(.gallery-preview),
.app-shell .workspace-nav-link,
.app-shell select,
.app-shell input,
.app-shell textarea {
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background-color 140ms ease,
    box-shadow 140ms ease !important;
}

.app-shell button:not(.reference-preview):not(.gallery-preview):focus-visible,
.app-shell .workspace-nav-link:focus-visible,
.app-shell select:focus-visible,
.app-shell input:focus-visible,
.app-shell textarea:focus-visible {
  outline: 2px solid var(--mobbin-ink) !important;
  outline-offset: 2px !important;
}

@media (hover: hover) {
  html body .app-shell .button-primary:hover,
  html body .app-shell .workspace-nav-link[aria-current="page"]:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 5px 14px rgba(17, 17, 17, 0.16) !important;
  }

  html body .app-shell .button-secondary:hover,
  html body .app-shell .icon-button:hover,
  html body .app-shell .workspace-nav-link:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 10px rgba(17, 17, 17, 0.07) !important;
  }
}

html body .app-shell button:not(.reference-preview):not(.gallery-preview):active,
html body .app-shell .workspace-nav-link:active {
  transform: translateY(0) scale(0.98) !important;
  box-shadow: none !important;
}

.app-shell .toggle-field input[type="checkbox"]::after {
  transition: transform 160ms ease, box-shadow 160ms ease !important;
}

.app-shell .toggle-field:hover input[type="checkbox"] {
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.06) !important;
}

.app-shell #addTaskButton,
.app-shell #stopButton,
.app-shell #generateButton,
.app-shell #exportAllButton,
.app-shell #exportCurrentGroupButton,
.app-shell #taskLogButton,
.app-shell #refreshButton {
  gap: 4px !important;
}

.app-shell #addTaskButton::before {
  content: "+";
  font-size: 13px;
  font-weight: 900;
}

.app-shell #stopButton::before {
  content: "\25A0";
  font-size: 8px;
}

.app-shell #generateButton::before {
  content: "\25B6";
  font-size: 8px;
}

.app-shell #exportAllButton::before,
.app-shell #exportCurrentGroupButton::before {
  content: "\2193";
  font-size: 12px;
  font-weight: 900;
}

.app-shell #taskLogButton::before {
  content: "\2261";
  font-size: 12px;
  font-weight: 900;
}

.app-shell #refreshButton::before {
  content: "\21BB";
  font-size: 12px;
  font-weight: 900;
}

.app-shell #refreshButton {
  font-size: 0 !important;
  gap: 0 !important;
}

@media (min-width: 1024px) and (max-height: 749px) {
  .app-shell .sidebar > .quick-panel {
    min-height: 30px !important;
    height: 30px !important;
    padding: 2px 4px !important;
  }

  .app-shell .sidebar > .config-section .section-heading {
    min-height: 22px !important;
    height: 22px !important;
  }

  .app-shell .sidebar > .config-section .field-grid > .field {
    grid-template-rows: 10px 24px !important;
    min-height: 36px !important;
  }

  .app-shell .sidebar > .config-section .field-grid > .field > span,
  .app-shell .sidebar > .config-section .retry-count-field > span {
    height: 10px !important;
    margin-bottom: 2px !important;
    font-size: 9px !important;
  }

  .app-shell .sidebar > .config-section .field-grid > .field select,
  .app-shell .sidebar > .config-section .field-grid > .field input[type="text"] {
    min-height: 24px !important;
    height: 24px !important;
  }

  .app-shell .sidebar > .config-section .toggle-field {
    min-height: 24px !important;
    height: 24px !important;
  }

  .app-shell .sidebar > .config-section .retry-count-field {
    grid-template-rows: 10px 22px !important;
    min-height: 34px !important;
  }

  .app-shell .sidebar > .config-section .retry-count-field input {
    min-height: 22px !important;
    height: 22px !important;
  }

  .app-shell .sidebar > .config-section .advanced-group-summary {
    min-height: 24px !important;
    height: 24px !important;
  }

  .app-shell .sidebar > .section:nth-of-type(3) .section-heading {
    min-height: 42px !important;
  }

  .app-shell .sidebar > .section:nth-of-type(3) .task-prompt {
    min-height: 36px !important;
    height: 36px !important;
  }

  .app-shell .sidebar > .section:nth-of-type(3) .status.status-idle {
    display: none !important;
  }
}

@media (min-width: 1024px) and (max-height: 999px) {
  .app-shell .sidebar > .section:nth-of-type(3) .task-prompt-history-row {
    grid-template-columns: minmax(80px, 1fr) auto auto !important;
    min-height: 30px !important;
    height: 30px !important;
    gap: 3px !important;
    padding: 2px 3px !important;
  }

  .app-shell .sidebar > .section:nth-of-type(3) .task-prompt-history-label {
    display: none !important;
  }

  .app-shell .sidebar > .section:nth-of-type(3) .task-prompt-history-select {
    grid-column: auto !important;
    min-width: 80px !important;
    width: 100% !important;
  }
}

/* v4.9: compact every homepage action and the full parameter stack. */
@media (min-width: 1024px) {
  .app-shell button:not(.reference-preview):not(.gallery-preview):not(.announcement-fab) {
    min-height: 28px !important;
    height: 28px !important;
    padding: 0 9px !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
  }

  .app-shell #refreshButton {
    min-height: 28px !important;
    height: 28px !important;
  }

  .app-shell .sidebar > .section {
    margin: 6px !important;
    padding: 10px !important;
  }

  .app-shell .sidebar > .config-section {
    gap: 5px !important;
    padding: 10px !important;
  }

  .app-shell .sidebar > .config-section::before {
    left: 10px !important;
    top: 10px !important;
    width: 3px !important;
    height: 14px !important;
  }

  .app-shell .sidebar > .config-section .section-heading {
    min-height: 28px !important;
    height: 28px !important;
    margin: 0 !important;
    padding: 0 0 4px 12px !important;
  }

  .app-shell .sidebar > .config-section .section-heading h2 {
    font-size: 18px !important;
    line-height: 24px !important;
  }

  .app-shell .sidebar > .config-section > .field-grid {
    gap: 5px !important;
  }

  .app-shell .sidebar > .config-section .field-grid > .field {
    grid-template-rows: 12px 30px !important;
    min-height: 44px !important;
  }

  .app-shell .sidebar > .config-section .field-grid > .field > span,
  .app-shell .sidebar > .config-section .retry-count-field > span {
    height: 12px !important;
    margin: 0 0 2px !important;
    font-size: 11px !important;
  }

  .app-shell .sidebar > .config-section .field-grid > .field select,
  .app-shell .sidebar > .config-section .field-grid > .field input[type="text"],
  .app-shell .sidebar > .config-section .retry-count-field input,
  .app-shell .sidebar > .config-section .dir-picker-row input {
    min-height: 30px !important;
    height: 30px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-radius: 7px !important;
    font-size: 12px !important;
  }

  .app-shell .sidebar > .config-section .retry-settings-panel {
    gap: 5px !important;
    padding: 5px !important;
  }

  .app-shell .sidebar > .config-section .toggle-field {
    min-height: 32px !important;
    height: 32px !important;
    gap: 8px !important;
    padding: 4px 8px !important;
  }

  .app-shell .sidebar > .config-section .toggle-field span {
    font-size: 12px !important;
  }

  .app-shell .sidebar > .config-section .toggle-field input[type="checkbox"] {
    width: 36px !important;
    height: 20px !important;
    min-height: 20px !important;
  }

  .app-shell .sidebar > .config-section .toggle-field input[type="checkbox"]::after {
    width: 14px !important;
    height: 14px !important;
  }

  .app-shell .sidebar > .config-section .toggle-field input[type="checkbox"]:checked::after {
    transform: translateX(16px) !important;
  }

  .app-shell .sidebar > .config-section .retry-count-field {
    grid-template-rows: 12px 28px !important;
    min-height: 42px !important;
  }

  .app-shell .sidebar > .config-section .retry-count-field input {
    min-height: 28px !important;
    height: 28px !important;
  }

  .app-shell .sidebar > .config-section .retry-settings-tip {
    padding: 4px 6px !important;
    font-size: 10px !important;
    line-height: 1.3 !important;
  }

  .app-shell .sidebar > .config-section .dir-picker-row,
  .app-shell .sidebar > .config-section .dir-picker-row input,
  .app-shell .sidebar > .config-section .dir-picker-row .button {
    min-height: 28px !important;
    height: 28px !important;
  }

  .app-shell .sidebar > .config-section .advanced-group-summary {
    min-height: 34px !important;
    height: 34px !important;
    padding: 4px 8px !important;
  }

  .app-shell .sidebar > .config-section .advanced-group-body {
    gap: 5px !important;
    padding: 5px 8px 8px !important;
  }

  .app-shell .sidebar > .config-section .advanced-group-body .field-grid,
  .app-shell .sidebar > .config-section .advanced-group-body .toggle-row {
    margin: 0 !important;
  }

  .app-shell .sidebar > .config-section .advanced-group-copy {
    display: flex !important;
    min-width: 0 !important;
    align-items: center !important;
    gap: 6px !important;
  }

  .app-shell .sidebar > .config-section .advanced-group-kicker {
    flex: 0 0 auto !important;
    font-size: 10px !important;
  }

  .app-shell .sidebar > .config-section .advanced-group-copy strong {
    min-width: 0 !important;
    overflow: hidden !important;
    font-size: 10px !important;
    line-height: 1 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .app-shell .sidebar > .config-section .advanced-group-state {
    flex-basis: 20px !important;
    width: 20px !important;
    height: 20px !important;
  }

  .app-shell .sidebar > .section:not(.config-section) .section-heading {
    min-height: 32px !important;
    margin-bottom: 6px !important;
    padding-left: 12px !important;
  }
}

@media (min-width: 1024px) and (max-width: 1439px) {
  .app-shell {
    gap: 8px !important;
    padding: 8px !important;
  }

  .content > .content-top {
    padding: 6px 8px !important;
    gap: 5px !important;
  }

  .content > .content-top .workspace-nav-link,
  .content > .content-top .gallery-toolbar-group .button {
    padding-inline: 7px !important;
    font-size: 11px !important;
  }

  .content > .content-top .gallery-batch-move-tools .gallery-batch-move-field {
    width: 205px !important;
    min-width: 170px !important;
  }
}

/* Keep the parameter-panel actions on the same compact desktop rhythm. */
@media (min-width: 1024px) {
  .app-shell .sidebar > .config-section .section-heading .button,
  .app-shell .sidebar > .config-section #saveRetrySettingsButton,
  .app-shell .sidebar > .config-section .dir-picker-row .button {
    min-height: 28px !important;
    height: 28px !important;
    padding: 0 9px !important;
  }

  .app-shell .sidebar > .config-section .section-heading {
    min-height: 28px !important;
  }

  .app-shell .sidebar > .config-section .dir-picker-row {
    height: 28px !important;
    grid-template-columns: minmax(0, 1fr) 70px 40px !important;
  }

  .app-shell .content > .content-top .gallery-toolbar-group-refresh #refreshButton {
    min-height: 28px !important;
    height: 28px !important;
  }

  .announcement-fab,
  .announcement-close {
    min-width: 28px !important;
    width: 28px !important;
    min-height: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    line-height: 1 !important;
  }
}

/* Final low-height overrides must win over the normal desktop dimensions above. */
@media (min-width: 1024px) and (max-height: 899px) {
  html body .app-shell button:not(.reference-preview):not(.gallery-preview):not(.announcement-fab) {
    min-height: 24px !important;
    height: 24px !important;
    padding: 0 7px !important;
    font-size: 11px !important;
  }

  .app-shell .sidebar > .config-section {
    gap: 4px !important;
    padding: 8px !important;
  }

  .app-shell .sidebar > .config-section::before {
    left: 8px !important;
    top: 8px !important;
    height: 12px !important;
  }

  .app-shell .sidebar > .config-section .section-heading {
    min-height: 24px !important;
    height: 24px !important;
    padding: 0 0 3px 10px !important;
  }

  .app-shell .sidebar > .config-section .section-heading h2 {
    font-size: 16px !important;
    line-height: 20px !important;
  }

  .app-shell .sidebar > .config-section .field-grid > .field {
    grid-template-rows: 10px 24px !important;
    min-height: 36px !important;
  }

  .app-shell .sidebar > .config-section .field-grid > .field > span,
  .app-shell .sidebar > .config-section .retry-count-field > span {
    height: 10px !important;
    margin-bottom: 2px !important;
    font-size: 9px !important;
  }

  .app-shell .sidebar > .config-section .field-grid > .field select,
  .app-shell .sidebar > .config-section .field-grid > .field input[type="text"] {
    min-height: 24px !important;
    height: 24px !important;
    font-size: 11px !important;
  }

  .app-shell .sidebar > .config-section .retry-settings-panel {
    gap: 4px !important;
    padding: 4px !important;
  }

  .app-shell .sidebar > .config-section .toggle-field {
    min-height: 24px !important;
    height: 24px !important;
    padding: 3px 7px !important;
  }

  .app-shell .sidebar > .config-section .toggle-field input[type="checkbox"] {
    width: 32px !important;
    height: 18px !important;
    min-height: 18px !important;
  }

  .app-shell .sidebar > .config-section .toggle-field input[type="checkbox"]::after {
    top: 1px !important;
    left: 1px !important;
    width: 14px !important;
    height: 14px !important;
  }

  .app-shell .sidebar > .config-section .toggle-field input[type="checkbox"]:checked::after {
    transform: translateX(14px) !important;
  }

  .app-shell .sidebar > .config-section .retry-count-field {
    grid-template-rows: 10px 22px !important;
    min-height: 34px !important;
  }

  .app-shell .sidebar > .config-section .retry-count-field input,
  .app-shell .sidebar > .config-section #saveRetrySettingsButton,
  .app-shell .sidebar > .config-section .dir-picker-row,
  .app-shell .sidebar > .config-section .dir-picker-row input,
  .app-shell .sidebar > .config-section .dir-picker-row .button {
    min-height: 24px !important;
    height: 24px !important;
  }

  .app-shell .sidebar > .config-section #saveConfigButton,
  .app-shell .sidebar > .config-section #saveRetrySettingsButton,
  .app-shell .content > .content-top #refreshButton {
    min-height: 24px !important;
    height: 24px !important;
  }

  .app-shell .sidebar > .config-section .retry-settings-tip {
    padding: 3px 5px !important;
    font-size: 9px !important;
    line-height: 1.25 !important;
  }

  .app-shell .sidebar > .config-section .advanced-group-summary {
    min-height: 24px !important;
    height: 24px !important;
    padding: 3px 6px !important;
  }

  .app-shell .sidebar > .section:nth-of-type(3) .inline-field {
    min-height: 26px !important;
    height: 26px !important;
  }

  .app-shell .content > .content-top .gallery-toolbar-group-refresh #refreshButton,
  .announcement-fab,
  .announcement-close {
    min-width: 24px !important;
    width: 24px !important;
    min-height: 24px !important;
    height: 24px !important;
  }

  .app-shell .content > .content-top .gallery-toolbar-group,
  .app-shell .content > .content-top .workspace-nav,
  .app-shell .content > .content-top .gallery-batch-move-tools {
    min-height: 28px !important;
    height: 28px !important;
    padding: 2px !important;
  }

  .app-shell .content > .content-top .content-actions {
    min-height: 28px !important;
  }
}
/* v4.23: pure visual polish only. No functional/DOM behavior changes. */

/* Soft product surface: quieter chrome, clearer section bands. */
html body {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.05), transparent 28rem),
    linear-gradient(180deg, #f7f8fa 0%, #f3f4f6 52%, #eef0f3 100%) !important;
}

html body::before {
  opacity: 0.28 !important;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.02) 1px, transparent 1px) !important;
  background-size: 48px 48px !important;
}

html body .app-shell {
  gap: 14px !important;
  padding: 14px !important;
}

html body .app-shell .sidebar {
  background: rgba(248, 249, 251, 0.96) !important;
  border: 1px solid rgba(15, 23, 42, 0.06) !important;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.05) !important;
}

html body .app-shell .sidebar > .section {
  margin: 8px !important;
  padding: 12px !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: 12px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(252, 252, 253, 0.98)) !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.035) !important;
}

html body .app-shell .sidebar > .section::before {
  left: 12px !important;
  top: 14px !important;
  width: 3px !important;
  height: 16px !important;
  border-radius: 999px !important;
  background: linear-gradient(180deg, #2563eb, #60a5fa) !important;
  box-shadow: none !important;
}

html body .app-shell .sidebar > .quick-panel {
  min-height: 48px !important;
  height: auto !important;
  padding: 8px !important;
  overflow: visible !important;
}

html body .app-shell .sidebar > .quick-panel::before {
  background: linear-gradient(180deg, #16a34a, #4ade80) !important;
}

html body .app-shell .sidebar .section-heading,
html body .app-shell .sidebar .quick-panel-head {
  min-height: 32px !important;
  margin-bottom: 8px !important;
  padding-left: 12px !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
}

html body .app-shell .sidebar .section-heading h2,
html body .app-shell .content > .content-top h2 {
  color: #111827 !important;
  font-size: 16px !important;
  font-weight: 750 !important;
  letter-spacing: 0 !important;
}

/* Shared control rhythm: same heights, same radius, less visual noise. */
html body .app-shell .button,
html body .app-shell button.button,
html body .app-shell .workspace-nav-link,
html body .app-shell .provider-switch-button,
html body .app-shell .auth-button,
html body .app-shell .icon-button {
  border-radius: 8px !important;
  box-shadow: none !important;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease !important;
}

html body .app-shell .button:hover,
html body .app-shell button.button:hover,
html body .app-shell .workspace-nav-link:hover,
html body .app-shell .provider-switch-button:hover,
html body .app-shell .auth-button:hover {
  transform: translateY(-1px) !important;
}

html body .app-shell .button-primary {
  border-color: #111827 !important;
  background: linear-gradient(180deg, #1f2937, #111827) !important;
  color: #ffffff !important;
}

html body .app-shell .button-primary:hover {
  border-color: #0b1220 !important;
  background: linear-gradient(180deg, #111827, #0b1220) !important;
}

html body .app-shell .button-secondary,
html body .app-shell .workspace-nav-link,
html body .app-shell .provider-switch-button,
html body .app-shell .auth-button.secondary {
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  background: #f8fafc !important;
  color: #111827 !important;
}

html body .app-shell .button-secondary:hover,
html body .app-shell .workspace-nav-link:hover,
html body .app-shell .provider-switch-button:hover,
html body .app-shell .auth-button.secondary:hover {
  border-color: rgba(37, 99, 235, 0.28) !important;
  background: #eef4ff !important;
  color: #1d4ed8 !important;
}

html body .app-shell .button-danger {
  border-color: rgba(220, 38, 38, 0.18) !important;
  background: #fff1f2 !important;
  color: #b91c1c !important;
}

html body .app-shell .button-danger:hover {
  border-color: rgba(220, 38, 38, 0.28) !important;
  background: #ffe4e6 !important;
}

html body .app-shell .workspace-nav-link[aria-current="page"],
html body .app-shell .provider-switch-button.active {
  border-color: rgba(17, 24, 39, 0.92) !important;
  background: #111827 !important;
  color: #ffffff !important;
}

/* Parameter panel: denser vertical rhythm, clearer field labels. */
html body .app-shell .sidebar > .config-section {
  gap: 8px !important;
  padding: 12px !important;
}

html body .app-shell .sidebar > .config-section .field-grid {
  gap: 8px !important;
}

html body .app-shell .sidebar > .config-section .field-grid > .field {
  gap: 0 !important;
  align-content: start !important;
}

html body .app-shell .sidebar > .config-section .field-grid > .field > span,
html body .app-shell .sidebar > .config-section .retry-count-field > span {
  color: #6b7280 !important;
  font-size: 11px !important;
  font-weight: 650 !important;
}

html body .app-shell .sidebar > .config-section .field-grid > .field select,
html body .app-shell .sidebar > .config-section .field-grid > .field input[type="text"],
html body .app-shell .sidebar > .config-section .retry-count-field input,
html body .app-shell .sidebar > .config-section .dir-picker-row input {
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  color: #111827 !important;
  box-shadow: none !important;
}

html body .app-shell .sidebar > .config-section .field-grid > .field select:focus,
html body .app-shell .sidebar > .config-section .field-grid > .field input[type="text"]:focus,
html body .app-shell .sidebar > .config-section .retry-count-field input:focus,
html body .app-shell .sidebar > .config-section .dir-picker-row input:focus {
  border-color: rgba(37, 99, 235, 0.45) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
  outline: none !important;
}

html body .app-shell .sidebar > .config-section .retry-settings-panel,
html body .app-shell .sidebar > .config-section .toggle-row,
html body .app-shell .sidebar > .config-section .advanced-group {
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: 10px !important;
  background: #fafafa !important;
}

html body .app-shell .sidebar > .config-section .toggle-field {
  border-radius: 8px !important;
  background: #ffffff !important;
}

html body .app-shell .sidebar > .config-section .retry-settings-tip {
  border: 1px solid rgba(37, 99, 235, 0.08) !important;
  background: rgba(37, 99, 235, 0.05) !important;
  color: #4b5563 !important;
}

/* Task panel: group action buttons into one clean control strip. */
html body .app-shell .sidebar > .section:nth-of-type(3) .section-heading {
  align-items: center !important;
  gap: 8px !important;
  padding-bottom: 8px !important;
}

html body .app-shell .sidebar > .section:nth-of-type(3) .section-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 6px !important;
  padding: 4px !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: 10px !important;
  background: #f8fafc !important;
}

html body .app-shell .sidebar > .section:nth-of-type(3) .inline-field {
  min-height: 30px !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: 8px !important;
  background: #ffffff !important;
}

html body .app-shell .sidebar > .section:nth-of-type(3) .task-item {
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.03) !important;
}

html body .app-shell .sidebar > .section:nth-of-type(3) .task-prompt {
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  border-radius: 10px !important;
  background: #fcfcfd !important;
}

html body .app-shell .sidebar > .section:nth-of-type(3) .task-prompt:focus {
  border-color: rgba(37, 99, 235, 0.4) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
  outline: none !important;
}

html body .app-shell .sidebar > .section:nth-of-type(3) .task-prompt-tools,
html body .app-shell .sidebar > .section:nth-of-type(3) .task-reference-head {
  gap: 6px !important;
}

html body .app-shell .sidebar > .section:nth-of-type(3) .status {
  border-radius: 10px !important;
}

/* Top workspace toolbar: one-row groups, aligned labels, less wasted height. */
html body .app-shell .content > .content-top {
  gap: 10px !important;
  padding: 12px 14px !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: 14px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 250, 251, 0.98)) !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.04) !important;
}

html body .app-shell .content > .content-top .content-heading-stack {
  gap: 10px !important;
}

html body .app-shell .content > .content-top .gallery-group-panel,
html body .app-shell .content > .content-top .content-actions {
  gap: 8px !important;
}

html body .app-shell .content > .content-top .gallery-toolbar-group,
html body .app-shell .content > .content-top .workspace-nav,
html body .app-shell .content > .content-top .gallery-batch-move-tools,
html body .app-shell .content > .content-top .gallery-group-order-actions {
  align-items: center !important;
  min-height: 36px !important;
  height: auto !important;
  padding: 4px !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: 10px !important;
  background: #f8fafc !important;
  box-shadow: none !important;
}

html body .app-shell .content > .content-top .gallery-group-field,
html body .app-shell .content > .content-top .gallery-batch-move-field,
html body .app-shell .content > .content-top .gallery-group-path {
  min-height: 32px !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: 8px !important;
  background: #ffffff !important;
}

html body .app-shell .content > .content-top .gallery-group-field > span,
html body .app-shell .content > .content-top .gallery-batch-move-field > span {
  color: #6b7280 !important;
  font-size: 11px !important;
  font-weight: 650 !important;
}

html body .app-shell .content > .content-top .button,
html body .app-shell .content > .content-top .workspace-nav-link {
  min-height: 30px !important;
  height: 30px !important;
  padding: 0 10px !important;
}

/* Result cards: denser meta, cleaner frames, less card-in-card noise. */
html body .app-shell .gallery {
  gap: 12px !important;
}

html body .app-shell .gallery-card {
  overflow: hidden !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04) !important;
}

html body .app-shell .gallery-card:hover {
  border-color: rgba(37, 99, 235, 0.2) !important;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08) !important;
  transform: translateY(-1px) !important;
}

html body .app-shell .gallery-body {
  gap: 8px !important;
  padding: 12px !important;
}

html body .app-shell .gallery-title {
  color: #111827 !important;
  font-size: 14px !important;
  font-weight: 720 !important;
}

html body .app-shell .gallery-time,
html body .app-shell .gallery-group-name,
html body .app-shell .gallery-credit {
  color: #6b7280 !important;
  font-size: 11px !important;
}

html body .app-shell .detail-grid {
  gap: 6px !important;
}

html body .app-shell .detail-box {
  min-height: 42px !important;
  padding: 8px !important;
  border: 1px solid rgba(15, 23, 42, 0.06) !important;
  border-radius: 8px !important;
  background: #f8fafc !important;
}

html body .app-shell .detail-box strong {
  color: #111827 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

html body .app-shell .action-row {
  gap: 6px !important;
}

/* Desktop viewport fit: fill width, reduce empty chrome. */
@media (min-width: 1280px) {
  html body .app-shell {
    grid-template-columns: minmax(360px, 400px) minmax(0, 1fr) !important;
    gap: 16px !important;
    padding: 16px !important;
  }

  html body .app-shell .content {
    min-width: 0 !important;
  }

  html body .app-shell .content > .content-top .content-actions {
    grid-template-columns: minmax(0, 1fr) repeat(4, max-content) !important;
    grid-template-areas:
      "nav exportAll current selected log"
      "move move move move refresh" !important;
    align-items: center !important;
  }

  html body .app-shell .content > .content-top .gallery-batch-move-tools {
    justify-self: stretch !important;
    min-width: 0 !important;
  }

  html body .app-shell .gallery {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
  }
}

/* Medium desktop height: keep one-column sidebar, slightly taller prompts. */
@media (min-width: 1024px) and (min-height: 750px) and (max-height: 999px) {
  html body .app-shell {
    grid-template-columns: minmax(340px, 380px) minmax(0, 1fr) !important;
  }

  html body .app-shell .sidebar {
    gap: 0 !important;
  }

  html body .app-shell .sidebar > .section {
    margin: 6px 8px 0 !important;
    padding: 10px !important;
  }

  html body .app-shell .sidebar > .section:nth-of-type(3) .task-prompt {
    min-height: 84px !important;
    height: 84px !important;
  }

  html body .app-shell .content > .content-top {
    gap: 8px !important;
    padding: 10px 12px !important;
  }

  html body .app-shell .content > .content-top .gallery-toolbar-group,
  html body .app-shell .content > .content-top .workspace-nav,
  html body .app-shell .content > .content-top .gallery-batch-move-tools {
    min-height: 32px !important;
  }
}

/* Short desktop height: compress chrome first, keep content readable. */
@media (min-width: 1024px) and (max-height: 749px) {
  html body .app-shell {
    gap: 10px !important;
    padding: 10px !important;
  }

  html body .app-shell .sidebar > .section {
    margin: 4px 6px 0 !important;
    padding: 8px !important;
  }

  html body .app-shell .sidebar > .section:nth-of-type(3) .task-prompt {
    min-height: 64px !important;
    height: 64px !important;
  }

  html body .app-shell .content > .content-top {
    gap: 6px !important;
    padding: 8px 10px !important;
  }

  html body .app-shell .content > .content-top .gallery-toolbar-group,
  html body .app-shell .content > .content-top .workspace-nav,
  html body .app-shell .content > .content-top .gallery-batch-move-tools,
  html body .app-shell .content > .content-top .content-actions {
    min-height: 28px !important;
  }

  html body .app-shell .gallery-body {
    padding: 10px !important;
  }
}

/* Mobile keeps stacked groups without stretching controls unevenly. */
@media (max-width: 760px) {
  html body .app-shell {
    gap: 10px !important;
    padding: 10px !important;
  }

  html body .app-shell .sidebar > .section,
  html body .app-shell .content > .content-top,
  html body .app-shell .gallery-card {
    border-radius: 12px !important;
  }

  html body .app-shell .content > .content-top .content-actions {
    gap: 6px !important;
  }

  html body .app-shell .content > .content-top .button,
  html body .app-shell .content > .content-top .workspace-nav-link {
    min-height: 32px !important;
    height: 32px !important;
  }
}
