/* Studio visual system: a calm canvas, clear creation controls, and consistent geometry. */
html[data-theme] {
  --studio-radius-control: 11px;
  --studio-radius-card: 16px;
  --studio-shadow-popover: 0 24px 64px color-mix(in srgb, var(--theme-text) 15%, transparent);
}

html[data-theme] .app-shell { background: var(--theme-canvas); }

@media (min-width: 841px) {
  html[data-theme] .app-shell { --control-width: 380px; }
}

html[data-theme] .rail,
html[data-theme] .control-panel,
html[data-theme] .main-stage {
  border-color: var(--theme-border);
}

html[data-theme] .rail,
html[data-theme] .task-shell-header,
html[data-theme] .workspace-topbar {
  background: var(--theme-panel);
}

html[data-theme] .task-shell-header {
  gap: 11px;
  padding: 13px 18px 14px;
  border-color: var(--theme-border);
}

html[data-theme] .task-shell-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

html[data-theme] :is(.context-policy-button, .theme-menu-button) {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: var(--studio-radius-control);
}

html[data-theme] .control-mode-switcher {
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--theme-border);
  border-radius: 13px;
  background: var(--theme-panel-soft);
}

html[data-theme] .control-mode-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 5px 7px;
  border-radius: 9px;
  font-weight: 650;
  text-align: center;
  white-space: nowrap;
}

html[data-theme] .control-mode-button.active {
  background: var(--theme-panel);
  box-shadow: 0 1px 4px color-mix(in srgb, var(--theme-text) 10%, transparent);
}

html[data-theme] .control-mode-stage { background: var(--theme-panel); }

html[data-theme] .plan-mode-panel {
  gap: 16px;
  padding: 23px 20px 28px;
}

html[data-theme] .mode-screen-intro h1 {
  color: var(--theme-text);
  font-size: 25px;
  font-weight: 740;
  letter-spacing: -.035em;
}

html[data-theme] .mode-screen-intro p {
  color: var(--theme-text-muted);
  font-size: 14px;
  line-height: 1.55;
}

html[data-theme] .creation-task-grid { gap: 9px; }

html[data-theme] .creation-task-card {
  grid-template-columns: 42px minmax(0, 1fr) 18px;
  min-height: 82px;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-color: var(--theme-border);
  border-radius: var(--studio-radius-card);
  background: var(--theme-panel);
  box-shadow: none;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

html[data-theme] .creation-task-card:hover { transform: translateY(-1px); }

html[data-theme] .creation-task-card strong {
  color: var(--theme-text);
  font-size: 15px;
  line-height: 1.35;
}

html[data-theme] .creation-task-card small {
  color: var(--theme-text-muted);
  font-size: 13px;
  line-height: 1.45;
}

html[data-theme] .creation-task-card.is-primary {
  border-color: var(--theme-accent);
  background: var(--theme-accent);
  box-shadow: 0 9px 20px color-mix(in srgb, var(--theme-accent) 20%, transparent);
}

html[data-theme] .creation-task-card.is-primary :is(strong, small, b) {
  color: var(--theme-accent-contrast);
}

html[data-theme] .creation-task-card.is-primary small { opacity: .84; }

html[data-theme] .creation-task-card.is-primary .creation-task-card-icon {
  background: color-mix(in srgb, var(--theme-accent-contrast) 19%, transparent);
  color: var(--theme-accent-contrast);
}

html[data-theme] .creation-task-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

html[data-theme] .plan-mode-panel .conversation-studio-trigger {
  min-height: 70px;
  border: 1px solid var(--theme-border-strong);
  border-radius: var(--studio-radius-card);
  background: var(--theme-panel-raised);
}

html[data-theme] .plan-mode-note { color: var(--theme-text-muted); font-size: 13px; }

html[data-theme] .generate-mode-panel {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 20px 20px 18px;
  overflow-x: hidden;
  overflow-y: auto;
}

html[data-theme] .generate-mode-panel > .mode-screen-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
}

html[data-theme] .generate-mode-panel > .mode-screen-intro h1 { font-size: 23px; }

html[data-theme] .generate-mode-panel > .mode-screen-intro p {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

html[data-theme] .generate-mode-panel > .prompt-field {
  flex: 0 0 230px;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 7px;
}

html[data-theme] .generate-mode-panel > .prompt-field textarea#promptInput {
  border: 1px solid var(--theme-border-strong);
  border-radius: 14px;
  background: var(--theme-panel-raised);
  color: var(--theme-text);
  font-size: 15px;
  line-height: 1.65;
}

html[data-theme] .generate-mode-panel > .prompt-field textarea#promptInput:focus {
  border-color: var(--theme-accent);
  outline: 3px solid color-mix(in srgb, var(--theme-accent) 22%, transparent);
  outline-offset: 1px;
}

html[data-theme] .creation-context-button {
  min-height: 62px;
  padding: 8px 2px;
}

html[data-theme] .creation-toolbelt { gap: 9px; }

html[data-theme] .creation-tool-button {
  display: flex;
  min-height: 84px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 6px;
  border: 1px solid var(--theme-border);
  border-radius: 13px;
  background: var(--theme-panel-raised);
  text-align: center;
}

html[data-theme] .creation-tool-button:nth-child(n) { background: var(--theme-panel-raised); }

html[data-theme] .creation-tool-button:hover {
  border-color: var(--theme-accent);
  background: var(--theme-accent-soft);
}

html[data-theme] .creation-tool-button > svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

html[data-theme] .creation-tool-button > span {
  display: grid;
  width: 100%;
  min-width: 0;
  justify-items: center;
  gap: 1px;
  text-align: center;
}

html[data-theme] .creation-tool-button strong {
  color: var(--theme-text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

html[data-theme] .creation-tool-button small {
  width: 100%;
  color: var(--theme-text-muted);
  font-size: 12px;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
}

html[data-theme] .generate-mode-panel > #generateButton {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex: 0 0 auto;
  margin-top: auto;
  border-radius: 12px;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--theme-accent) 22%, transparent);
}

html[data-theme] :is(.primary-button, .secondary-button, .ghost-button,
  .toolbar-button, .section-toggle-button, .creation-settings-close,
  .creation-settings-footer button, .stepper button, .reference-item button) {
  align-items: center;
  justify-content: center;
  text-align: center;
}

html[data-theme] :is(.primary-button, .secondary-button, .ghost-button) {
  border-radius: var(--studio-radius-control);
}

html[data-theme] :is(.secondary-button, .ghost-button) {
  display: inline-flex;
  gap: 7px;
}

html[data-theme] .main-stage { background: var(--theme-canvas); }

html[data-theme] .workspace-topbar {
  min-height: 76px;
  align-items: center;
  padding: 12px 24px;
  border-bottom: 1px solid var(--theme-border);
}

html[data-theme] .workspace-heading .eyebrow { display: none; }

html[data-theme] .workspace-heading h2 {
  color: var(--theme-text);
  font-size: 19px;
  font-weight: 730;
  letter-spacing: -.02em;
}

html[data-theme] .workspace-tabs {
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--theme-border);
  border-radius: 13px;
  background: var(--theme-panel-soft);
}

html[data-theme] .workspace-tab {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  color: var(--theme-text-muted);
  font-weight: 650;
}

html[data-theme] .workspace-tab.active {
  background: var(--theme-panel);
  color: var(--theme-text);
}

html[data-theme] .workspace-project-button {
  grid-template-columns: 40px minmax(0, 1fr) auto;
  min-height: 70px;
  margin: 18px 24px 0;
  padding: 10px 13px;
  border: 1px solid var(--theme-border);
  border-radius: var(--studio-radius-card);
  background: var(--theme-panel);
  box-shadow: none;
}

html[data-theme] .workspace-project-button:hover { box-shadow: 0 7px 20px color-mix(in srgb, var(--theme-text) 7%, transparent); }

html[data-theme] .workspace-project-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--theme-accent-soft);
  color: var(--theme-accent);
}

html[data-theme] .workspace-project-copy small { font-size: 12px; letter-spacing: .04em; }
html[data-theme] .workspace-project-copy strong { font-size: 15px; font-weight: 720; }

html[data-theme] .workspace-project-action {
  min-height: 40px;
  padding: 0 9px;
  border-radius: 9px;
  background: transparent;
}

html[data-theme] .gallery-grid { gap: 18px; padding: 20px 24px 28px; }

html[data-theme] .empty-state {
  gap: 9px;
  min-height: min(56vh, 520px);
  padding: 36px 22px;
  border: 1px solid var(--theme-border);
  border-radius: 20px;
  background: color-mix(in srgb, var(--theme-panel) 83%, var(--theme-panel-soft));
  color: var(--theme-text-muted);
  text-align: center;
}

html[data-theme] .empty-state.compact { min-height: 34vh; }

html[data-theme] .empty-mark {
  position: relative;
  width: 80px;
  height: 72px;
  margin: 0 0 9px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

html[data-theme] .empty-mark::before,
html[data-theme] .empty-mark::after {
  position: absolute;
  content: "";
  width: 54px;
  height: 54px;
  border: 1px solid var(--theme-border-strong);
  border-radius: 13px;
  background: var(--theme-panel);
}

html[data-theme] .empty-mark::before { top: 5px; left: 7px; transform: rotate(-12deg); }

html[data-theme] .empty-mark::after {
  top: 12px;
  left: 20px;
  transform: rotate(8deg);
  background: radial-gradient(circle at 70% 31%, var(--theme-accent) 0 5px, transparent 6px),
    linear-gradient(145deg, transparent 48%, var(--theme-accent-soft) 49% 100%), var(--theme-panel);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--theme-text) 9%, transparent);
}

html[data-theme] .empty-state h3 {
  margin: 0;
  color: var(--theme-text);
  font-size: 22px;
  font-weight: 720;
  letter-spacing: -.02em;
}

html[data-theme] .empty-state p {
  margin: 0;
  color: var(--theme-text-muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
}

html[data-theme] .empty-state .ghost-button {
  min-height: 44px;
  margin-top: 11px;
  padding: 0 18px;
  border: 0;
  background: var(--theme-accent);
  color: var(--theme-accent-contrast);
  font-weight: 700;
}

html[data-theme] :is(.image-tile, .saved-tile, .loading-card) {
  border-radius: var(--studio-radius-card);
  border-color: var(--theme-border);
  box-shadow: none;
}

html[data-theme] .creation-settings-dialog {
  border: 1px solid var(--theme-border);
  border-radius: 20px;
  box-shadow: var(--studio-shadow-popover);
}

html[data-theme] :is(.creation-settings-header, .creation-settings-footer) {
  border-color: var(--theme-border);
  background: var(--theme-panel);
}

html[data-theme] .creation-settings-header h2 { font-weight: 730; letter-spacing: -.02em; }

/* The edit workspace had fixed light surfaces under theme-aware text. */
html[data-theme] .control-mode-stage > .iteration-panel.embedded-inspector {
  background: var(--theme-panel);
  color: var(--theme-text);
}

html[data-theme] .control-mode-stage > .iteration-panel .inspector-header h2,
html[data-theme] .control-mode-stage > .iteration-panel .iteration-path-hint strong {
  color: var(--theme-text);
}

html[data-theme] .control-mode-stage > .iteration-panel .iteration-path-hint span {
  color: var(--theme-text-muted);
}

html[data-theme] .control-mode-stage > .iteration-panel .selected-preview {
  border-color: var(--theme-border);
  background: var(--theme-panel-raised);
}

html[data-theme] .control-mode-stage > .iteration-panel .selected-preview.empty {
  color: var(--theme-text-muted);
}

html[data-theme] .control-mode-stage > .iteration-panel :is(textarea, input) {
  border-color: var(--theme-border-strong);
  background: var(--theme-panel-raised);
  color: var(--theme-text);
}

html[data-theme] .empty-edit-picker label { color: var(--theme-accent-contrast); }

@media (max-width: 840px) {
  html[data-theme] .task-shell-header { padding: 11px 14px 13px; }
  html[data-theme] .plan-mode-panel { padding: 20px 15px 24px; }
  html[data-theme] .generate-mode-panel { gap: 12px; padding: 15px 14px 17px; }
  html[data-theme] .generate-mode-panel > .prompt-field { flex-basis: 190px; }
  html[data-theme] .creation-tool-button { min-height: 68px; }
  html[data-theme] .workspace-topbar { padding-inline: 16px; }
  html[data-theme] .workspace-project-button { margin-inline: 16px; }
  html[data-theme] .gallery-grid { padding-inline: 16px; }
}

@media (max-width: 420px) {
  html[data-theme] .creation-task-card { min-height: 76px; }
  html[data-theme] .creation-tool-button small { display: none; }
  html[data-theme] .creation-tool-button { min-height: 64px; }
  html[data-theme] .workspace-project-action { font-size: 12px; }
  html[data-theme] .empty-state { min-height: 300px; }
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme] .creation-task-card,
  html[data-theme] .creation-tool-button { transition: none; }
}

/* Keep the task chooser readable inside the fixed-height creation rail. */
html[data-theme] .plan-mode-panel {
  gap: 11px;
  padding: 18px 16px 20px;
}

html[data-theme] .plan-mode-panel > :is(.mode-screen-intro, .creation-task-grid, .conversation-studio-trigger) {
  flex: 0 0 auto;
}

html[data-theme] .plan-mode-panel .mode-screen-intro { gap: 3px; }
html[data-theme] .plan-mode-panel .mode-screen-intro > span { display: none; }
html[data-theme] .plan-mode-panel .mode-screen-intro h1 { font-size: 24px; }
html[data-theme] .plan-mode-panel .mode-screen-intro p { font-size: 13px; line-height: 1.4; }

html[data-theme] .plan-mode-panel .creation-task-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
}

html[data-theme] .plan-mode-panel .creation-task-card {
  min-height: 64px;
  padding: 9px 12px;
  gap: 11px;
}

html[data-theme] .plan-mode-panel .creation-task-card :is(strong, small) { line-height: 1.3; }

html[data-theme] .plan-mode-panel .conversation-studio-trigger {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  min-height: 64px;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  overflow: hidden;
}

html[data-theme] .plan-mode-panel .conversation-studio-trigger-icon {
  width: 42px;
  height: 42px;
}

html[data-theme] .plan-mode-panel .conversation-studio-trigger-copy { gap: 2px; }
html[data-theme] .plan-mode-panel .conversation-studio-trigger-copy small { font-size: 11px; line-height: 1.2; }
html[data-theme] .plan-mode-panel .conversation-studio-trigger-copy strong { font-size: 14px; line-height: 1.3; }
html[data-theme] .plan-mode-panel .conversation-studio-trigger-action { grid-column: auto; align-self: center; font-size: 13px; }
html[data-theme] .plan-mode-panel .plan-mode-note { display: none; }

/* A compact composer in the rail, with a full-view editor for longer prompts. */
html[data-theme] .generate-mode-panel > .prompt-field .field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

html[data-theme] .generate-mode-panel > .prompt-field .field-label > label {
  color: var(--theme-text);
  font-size: 14px;
  font-weight: 700;
}

html[data-theme] .prompt-field-actions { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; }
html[data-theme] .prompt-field-actions > strong { color: var(--theme-text-subtle); font-size: 12px; font-weight: 500; }

html[data-theme] .prompt-editor-open {
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--theme-border-strong);
  border-radius: 8px;
  background: var(--theme-panel-raised);
  color: var(--theme-accent);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

html[data-theme] .prompt-editor-open:hover,
html[data-theme] .prompt-editor-open:focus-visible { border-color: var(--theme-accent); outline: none; }

body.prompt-editor-open { overflow: hidden; }
.prompt-editor-backdrop[hidden] { display: none !important; }
.prompt-editor-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147482900;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--theme-scrim, rgba(15, 23, 42, .65));
  backdrop-filter: blur(8px);
}

.prompt-editor-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 16px;
  width: min(980px, 100%);
  height: min(780px, calc(100dvh - 32px));
  min-height: 0;
  padding: clamp(16px, 2.5vw, 26px);
  border: 1px solid var(--theme-border);
  border-radius: 20px;
  background: var(--theme-panel);
  color: var(--theme-text);
  box-shadow: 0 28px 90px rgba(15, 23, 42, .24);
}

.prompt-editor-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.prompt-editor-header > div { min-width: 0; }
.prompt-editor-header span { color: var(--theme-accent); font-size: 11px; font-weight: 750; letter-spacing: .1em; }
.prompt-editor-header h2 { margin: 4px 0 3px; font-size: clamp(20px, 2.5vw, 26px); line-height: 1.25; }
.prompt-editor-header p { margin: 0; color: var(--theme-text-muted); font-size: 13px; line-height: 1.45; }
.prompt-editor-close {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--theme-border);
  border-radius: 9px;
  background: var(--theme-panel-raised);
  color: var(--theme-text);
  font: inherit;
  font-size: 23px;
  cursor: pointer;
}

.prompt-editor-dialog > textarea {
  width: 100%;
  min-height: 0;
  padding: 20px 22px;
  border: 1px solid var(--theme-border-strong);
  border-radius: 14px;
  outline: none;
  resize: none;
  background: var(--theme-panel-raised);
  color: var(--theme-text);
  font: inherit;
  font-size: 16px;
  line-height: 1.7;
}

.prompt-editor-dialog > textarea:focus { border-color: var(--theme-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-accent) 18%, transparent); }
.prompt-editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.prompt-editor-footer > span { color: var(--theme-text-muted); font-size: 13px; }
.prompt-editor-footer > span.is-over-limit { color: #b42318; font-weight: 700; }
.prompt-editor-footer .secondary-button { min-height: 40px; padding: 8px 18px; }

html[data-theme] .creation-settings-content .prompt-assist-panel { gap: 12px; }
html[data-theme] .creation-settings-content .prompt-assist-result {
  display: -webkit-box;
  min-height: 108px;
  max-height: 108px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  white-space: pre-wrap;
}

html[data-theme] .prompt-assist-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
html[data-theme] .prompt-assist-actions > button { min-width: 0; min-height: 42px; }
html[data-theme] .prompt-assist-panel.compact-assist:not(.expanded) .prompt-assist-actions { display: none; }

html[data-theme] .creation-settings-content .output-settings-body { position: relative; }
.model-info-button { display: none; }

.model-info-backdrop[hidden] { display: none !important; }
.model-info-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147482900;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--theme-scrim, rgba(15, 23, 42, .65));
}

.model-info-dialog {
  display: grid;
  gap: 16px;
  width: min(420px, 100%);
  padding: 20px;
  border: 1px solid var(--theme-border);
  border-radius: 18px;
  background: var(--theme-panel);
  color: var(--theme-text);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
}

.model-info-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.model-info-dialog h2 { margin: 0; font-size: 18px; }
.model-info-dialog header button { width: 32px; height: 32px; border: 1px solid var(--theme-border); border-radius: 8px; background: var(--theme-panel-raised); color: var(--theme-text); font: inherit; font-size: 20px; cursor: pointer; }
.model-info-dialog p { margin: 0; color: var(--theme-text-muted); font-size: 14px; line-height: 1.6; white-space: pre-wrap; }
.model-info-dialog > .secondary-button { justify-self: end; min-height: 40px; padding-inline: 18px; }

@media (max-height: 690px) {
  html[data-theme] .plan-mode-panel { gap: 7px; padding-block: 13px; }
  html[data-theme] .plan-mode-panel .mode-screen-intro p { display: none; }
  html[data-theme] .plan-mode-panel .creation-task-card { min-height: 57px; padding-block: 7px; }
  html[data-theme] .plan-mode-panel .conversation-studio-trigger { min-height: 57px; padding-block: 7px; }
}

@media (max-width: 600px) {
  .prompt-editor-backdrop { padding: 0; }
  .prompt-editor-dialog { width: 100%; height: 100dvh; gap: 12px; padding: 16px; border: 0; border-radius: 0; }
  .prompt-editor-dialog > textarea { padding: 14px; font-size: 15px; }
  .prompt-editor-header p { font-size: 12px; }
}

@media (max-width: 640px) and (max-height: 720px) {
  html[data-theme] .creation-settings-content { padding: 14px 18px 16px; }
  html[data-theme] .creation-settings-content .output-settings-body { gap: 12px; }
  html[data-theme] .creation-settings-content .output-settings-body > .field { gap: 5px; }
  html[data-theme] .creation-settings-content .output-settings-body .model-search-status,
  html[data-theme] .creation-settings-content .output-settings-body .model-note {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  html[data-theme] .creation-settings-content .output-settings-body .model-info-button {
    position: absolute;
    top: 0;
    right: 0;
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 5px;
    border: 0;
    background: transparent;
    color: var(--theme-accent);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
  }
  html[data-theme] .creation-settings-content .prompt-assist-header { gap: 7px; padding-bottom: 10px; }
  html[data-theme] .creation-settings-content .prompt-assist-result { min-height: 88px; max-height: 88px; -webkit-line-clamp: 3; }
}

/* Browse large batches a page at a time so the drawer itself stays in view. */
html[data-theme] .batch-drawer { grid-template-rows: auto auto auto minmax(0, 1fr) auto; }
html[data-theme] .batch-drawer-prompt-heading > button {
  padding: 4px 6px;
  border: 0;
  background: transparent;
  color: var(--theme-accent);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
html[data-theme] .batch-drawer-prompt-heading > button:disabled { opacity: .45; cursor: default; }

.batch-drawer-pagination[hidden] { display: none !important; }
.batch-drawer-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 22px 14px;
  border-top: 1px solid var(--theme-border);
  background: var(--theme-panel);
}

.batch-drawer-pagination button {
  min-height: 36px;
  padding: 6px 11px;
  border: 1px solid var(--theme-border-strong);
  border-radius: 9px;
  background: var(--theme-panel-raised);
  color: var(--theme-accent);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.batch-drawer-pagination button:disabled { opacity: .42; cursor: default; }
.batch-drawer-pagination > span { min-width: 0; color: var(--theme-text-muted); font-size: 12px; text-align: center; }

@media (max-width: 640px) {
  .batch-drawer-pagination { padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); }
  html[data-theme] .batch-drawer-image-frame { height: min(32dvh, 280px); min-height: 0; aspect-ratio: auto; }
  html[data-theme] .batch-drawer-grid { align-content: start; padding: 12px 16px 16px; }
}
