.mask-toolbar button:disabled {
  cursor: not-allowed;
  opacity: .38;
}

.background-config-block {
  margin-top: 13px;
}

.local-background-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.local-background-options button,
.color-choice {
  position: relative;
  display: grid;
  min-height: 44px;
  place-items: end center;
  padding: 5px;
  overflow: hidden;
  border: 1px solid #dfe5ed;
  border-radius: 8px;
  background: #fff;
  color: #647187;
  font-size: 8px;
  cursor: pointer;
}

.local-background-options button::before,
.color-choice::before {
  position: absolute;
  top: 5px;
  width: 22px;
  height: 18px;
  border: 1px solid #d7dce4;
  border-radius: 5px;
  content: '';
}

.local-background-options .transparent::before {
  background: conic-gradient(#e4e7ec 25%, #fff 0 50%, #e4e7ec 0 75%, #fff 0);
  background-size: 8px 8px;
}

.local-background-options .white::before { background: #fff; }
.local-background-options .gray::before { background: #f1f3f6; }

.local-background-options button.active,
.color-choice.active {
  border-color: #6190eb;
  background: #edf4ff;
  color: #275dbf;
  font-weight: 800;
}

.color-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.color-choice::before { background: var(--custom-color, #e8f0ff); }

.background-upload {
  display: flex !important;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 7px;
  border: 1px dashed #cdd7e5;
  border-radius: 8px;
  color: #5d6e86 !important;
  font-size: 8px !important;
  cursor: pointer;
}

.background-upload input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0;
}

.background-upload.active {
  border-color: #6190eb;
  background: #edf4ff;
  color: #275dbf !important;
}

.compact-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 10px;
}

.compact-controls label {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px;
  color: #68758a;
  font-size: 8px;
}

.compact-controls input {
  grid-column: 1 / -1;
  width: 100%;
}

.alignment-row {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  color: #69768a;
  font-size: 8px;
}

.alignment-row > div { display: flex; }

.alignment-row button {
  flex: 1;
  padding: 5px;
  border: 1px solid #dfe5ed;
  background: #fff;
  color: #68758a;
  font-size: 8px;
  cursor: pointer;
}

.alignment-row button:first-child { border-radius: 6px 0 0 6px; }
.alignment-row button:last-child { border-radius: 0 6px 6px 0; }
.alignment-row button.active { border-color: #6994e8; background: #edf4ff; color: #285cbd; }

.simple-check {
  display: flex !important;
  grid-template-columns: auto 1fr !important;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  color: #667387 !important;
  font-size: 8px !important;
}

.simple-check input { width: auto !important; height: auto !important; }
.background-options { grid-template-columns: repeat(2, 1fr); }

.background-options button {
  position: relative;
  min-height: 44px;
  padding: 20px 5px 5px;
  overflow: hidden;
}

.background-options button::before {
  position: absolute;
  inset: 4px 4px auto;
  height: 13px;
  border-radius: 5px;
  background: linear-gradient(115deg, hsl(var(--hue) 75% 88%), hsl(calc(var(--hue) + 48) 70% 62%));
  content: '';
}

.background-options.collapsed button:nth-child(n+9) { display: none; }

.subtle-button {
  width: 100%;
  margin-top: 7px;
  padding: 7px;
  border: 0;
  border-radius: 7px;
  background: #f0f4fa;
  color: #4f6f9f;
  font-size: 8px;
  cursor: pointer;
}

@media (max-width: 620px) {
  .local-background-options { grid-template-columns: repeat(2, 1fr); }
  .compact-controls { grid-template-columns: 1fr; }
}

.image-hero-actions { display: flex; gap: 10px; margin-top: 17px; }
.image-hero-actions a { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; border: 1px solid rgba(255,255,255,.28); border-radius: 10px; color: #fff; font-size: 10px; font-weight: 800; text-decoration: none; }
.image-hero-actions a.primary { border-color: #fff; background: #fff; color: #285cae; }
.image-hero-compact { padding: 56px 0 44px; background: radial-gradient(circle at 88% 15%, rgba(99,143,229,.2), transparent 28%), linear-gradient(135deg, #122340, #244875); }
.image-hero-compact .image-hero-inner { display: flex; align-items: flex-end; justify-content: space-between; width: min(1180px, calc(100% - 36px)); gap: 30px; }
.image-hero-compact .eyebrow { display: block; margin-bottom: 12px; color: #b8cef4; font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.image-hero-compact h1 { margin: 0; font-size: 40px; line-height: 1.22; letter-spacing: normal; }
.image-hero-compact p { max-width: 690px; margin: 16px 0 0; color: #d8e2f2; font-size: 15px; font-weight: 400; line-height: 1.8; }
.image-hero-compact .image-hero-actions { display: flex; flex: 0 0 auto; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 12px; margin: 0; }
.image-hero-compact .image-hero-actions > a { min-height: 48px; justify-content: center; gap: 8px; padding: 0 18px; border-radius: 10px; font-size: 15px; font-weight: 600; white-space: nowrap; }
.hero-credit-summary {
  display: grid;
  min-width: 236px;
  min-height: 76px;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 12px;
  background: rgba(255, 255, 255, .09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
  color: #fff;
}
.hero-credit-summary > div { display: grid; gap: 3px; }
.hero-credit-summary > div:last-child { justify-items: end; padding-left: 13px; border-left: 1px solid rgba(255, 255, 255, .16); }
.hero-credit-summary span { color: #bfd0e9; font-size: 10px; }
.hero-credit-summary strong { display: flex; align-items: baseline; gap: 3px; line-height: 1; }
.hero-credit-summary strong b { font-size: 27px; font-weight: 800; }
.hero-credit-summary strong em { color: #dce7f6; font-size: 11px; font-style: normal; font-weight: 500; }
.hero-credit-summary small { max-width: 118px; overflow: hidden; color: #bdcce1; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.hero-credit-summary button { padding: 0; border: 0; background: transparent; color: #fff; font-size: 11px; font-weight: 700; cursor: pointer; }
.hero-credit-summary button i { margin-left: 3px; }

@media (max-width: 980px) {
  .image-hero-compact .image-hero-inner { align-items: flex-start; flex-direction: column; gap: 22px; }
}

@media (max-width: 620px) {
  .image-hero-compact { padding: 38px 0; }
  .image-hero-compact .image-hero-inner { width: min(100% - 22px, 1180px); gap: 22px; }
  .image-hero-compact h1 { font-size: 30px; }
  .image-hero-compact .image-hero-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .image-hero-compact .image-hero-actions > a { width: 100%; min-height: 46px; padding: 0 15px; font-size: 15px; }
  .hero-credit-summary { width: 100%; min-width: 0; }
}
.credit-purchase-link { display: flex; margin-top: 15px; text-decoration: none; }

/* Two-column editing workspace, aligned with the batch-processing page. */
.studio-section { padding: 32px 18px 70px; }
.workspace-mode-bar {
  display: flex;
  width: min(1180px, 100%);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto 16px;
  padding: 14px 16px;
  border: 1px solid #e1e8f1;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 7px 24px rgba(30, 52, 84, .05);
}
.workspace-mode-bar > div:first-child { display: grid; gap: 3px; }
.workspace-mode-bar strong { color: #18283e; font-size: 17px; }
.workspace-mode-bar small { color: #76849a; font-size: 12px; }
.workspace-mode-switch {
  display: flex;
  gap: 5px;
  padding: 4px;
  border-radius: 11px;
  background: #f0f4fa;
}
.workspace-mode-switch button {
  min-height: 38px;
  padding: 0 15px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #607087;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.workspace-mode-switch button.active { background: #fff; color: #285fc5; box-shadow: 0 3px 11px rgba(41, 78, 135, .12); }
.workspace-mode-switch i { margin-right: 5px; }
.studio-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  max-width: 1180px;
  min-height: 680px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.canvas-panel,
.tools-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 9px 30px rgba(30, 52, 84, .06);
}
.tools-panel { border-left: 1px solid var(--line); }
.upload-stage,
.editor-stage { min-height: 680px; }

.history-panel {
  display: block;
  max-width: 1180px;
  min-height: 0;
  margin: 20px auto 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 9px 30px rgba(30, 52, 84, .06);
}
.history-panel .history-heading { width: 100%; padding: 16px 20px; }
.history-heading-actions { display: flex; align-items: center; gap: 10px; }
.history-filters { display: flex; gap: 4px; padding: 3px; border-radius: 9px; background: #f1f4f9; }
.history-filters button {
  width: auto !important;
  height: 30px !important;
  padding: 0 11px !important;
  border-radius: 7px !important;
  color: #69768a !important;
  font-size: 11px !important;
}
.history-filters button.active { background: #fff !important; color: #285fc5 !important; box-shadow: 0 2px 7px rgba(33, 65, 113, .11); }
.history-content { display: grid; width: 100%; gap: 18px; padding: 14px 20px 22px; }
.history-group { min-width: 0; }
.history-group > h3 { margin: 0 0 9px; color: #5d6c82; font-size: 12px; }
.history-panel .history-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  min-height: 88px;
  padding: 0;
  overflow: visible;
}
.history-panel .history-empty { grid-column: 1 / -1; padding: 30px 12px; font-size: 13px; }
.history-panel .history-item {
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  margin: 0;
  padding: 10px;
  border: 1px solid #e6ebf2;
  background: #f8fafd;
}
.history-panel .history-item img,
.history-panel .history-placeholder { width: 54px; height: 54px; }
.history-panel .history-item strong { font-size: 13px; }
.history-panel .history-item small { font-size: 10px; }
.unified-batch-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  width: min(1180px, 100%);
  min-height: 600px;
  margin: 0 auto;
}
.unified-batch-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 9px 30px rgba(30, 52, 84, .06);
}
.batch-upload-card { padding: 22px; }
.batch-settings-card { padding: 18px; }
.unified-batch-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.unified-batch-head h2 { margin: 0 0 6px; color: #17283f; font-size: 19px; }
.unified-batch-head p { margin: 0; color: #77859a; font-size: 13px; line-height: 1.6; }
.batch-count-pill { flex: 0 0 auto; padding: 7px 11px; border-radius: 999px; background: #eef4ff; color: #5070a5; font-size: 12px; }
.batch-count-pill strong { color: #235fc8; font-size: 15px; }
.unified-batch-drop {
  display: grid;
  min-height: 150px;
  place-items: center;
  padding: 20px;
  border: 2px dashed #ced9e8;
  border-radius: 15px;
  background: #f8fafd;
  color: #53647b;
  text-align: center;
  cursor: pointer;
}
.unified-batch-drop.drag { border-color: #4b7de0; background: #eef4ff; }
.unified-batch-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.unified-batch-drop > span { display: grid; justify-items: center; gap: 7px; }
.unified-batch-drop i { color: #4c7ee0; font-size: 31px; }
.unified-batch-drop strong { color: #25364d; font-size: 16px; }
.unified-batch-drop small { color: #8491a3; font-size: 12px; }
.unified-batch-files { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin-top: 16px; }
.unified-batch-empty { grid-column: 1 / -1; padding: 48px 18px; border-radius: 12px; background: #f8fafd; color: #8793a5; font-size: 13px; text-align: center; }
.unified-batch-file { position: relative; min-width: 0; overflow: hidden; border: 1px solid #e2e8f0; border-radius: 11px; background: #fff; }
.unified-batch-file img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #edf1f6; }
.unified-batch-file button { position: absolute; top: 6px; right: 6px; width: 25px; height: 25px; border: 0; border-radius: 50%; background: rgba(20, 30, 44, .76); color: #fff; font-size: 17px; cursor: pointer; }
.unified-batch-file footer { display: grid; gap: 2px; padding: 8px; }
.unified-batch-file footer strong { overflow: hidden; color: #34445a; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.unified-batch-file footer small { color: #8995a6; font-size: 10px; }
.unified-batch-progress { margin-top: 16px; padding: 13px; border-radius: 11px; background: #f4f7fb; }
.unified-progress-track { height: 7px; overflow: hidden; border-radius: 99px; background: #dfe6ef; }
.unified-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #3474e6, #71a2f4); transition: width .2s; }
.unified-batch-progress > div:last-child { display: flex; justify-content: space-between; margin-top: 8px; color: #6f7d91; font-size: 11px; }
.unified-operation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.unified-operation-grid button { display: flex; min-height: 58px; align-items: center; gap: 9px; padding: 9px; border: 1px solid #e0e6ef; border-radius: 11px; background: #fff; color: #405168; text-align: left; cursor: pointer; }
.unified-operation-grid button.active { border-color: #6391eb; background: #edf4ff; color: #275fc4; box-shadow: inset 0 0 0 1px #8fb0ef; }
.unified-operation-grid i { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border-radius: 8px; background: #eff3f8; font-size: 14px; }
.unified-operation-grid button.active i { background: #d9e7ff; }
.unified-operation-grid span { display: grid; gap: 3px; font-size: 12px; font-weight: 800; }
.unified-operation-grid small { color: #8794a6; font-size: 9px; font-weight: 500; }
.unified-batch-config { min-height: 108px; margin-top: 14px; padding: 13px; border-radius: 11px; background: #f7f9fc; }
.unified-batch-config section { display: grid; gap: 11px; }
.unified-batch-config label { display: grid; gap: 7px; color: #56667c; font-size: 12px; font-weight: 700; }
.unified-batch-config select { width: 100%; min-height: 39px; padding: 0 10px; border: 1px solid #dbe2ec; border-radius: 8px; background: #fff; color: #26374e; font-size: 12px; }
.unified-rights-check { grid-template-columns: auto 1fr !important; align-items: flex-start; font-weight: 500 !important; line-height: 1.55; }
.unified-rights-check input { margin-top: 3px; }
.batch-mode-tip { display: flex; gap: 8px; margin-top: 12px; padding: 10px; border-radius: 9px; background: #fff8e8; color: #80611e; font-size: 10px; line-height: 1.55; }
.batch-mode-tip i { margin-top: 2px; color: #d99a12; }
.unified-batch-cost { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 12px; }
.unified-batch-cost > span { display: grid; gap: 3px; color: #6b798d; font-size: 12px; }
.unified-batch-cost small { color: #909bab; font-size: 10px; }
.unified-batch-cost > strong { color: #245fc8; font-size: 24px; }
.batch-settings-card .run-button { width: 100%; }
.unified-batch-history { display: grid; gap: 9px; }
.unified-history-card { overflow: hidden; border: 1px solid #e5eaf1; border-radius: 11px; background: #f9fbfd; }
.unified-history-card > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 13px; }
.unified-history-card h4 { margin: 0 0 4px; color: #2f4057; font-size: 12px; }
.unified-history-card p { margin: 0; color: #8490a1; font-size: 10px; }
.unified-history-state { flex: 0 0 auto; padding: 5px 8px; border-radius: 99px; background: #fff2dc; color: #a96a00; font-size: 10px; font-weight: 800; }
.unified-history-state.completed { background: #e5f7ee; color: #168153; }
.unified-history-state.failed { background: #ffeaed; color: #c23d50; }
.unified-history-results { display: flex; gap: 7px; overflow-x: auto; padding: 0 13px 12px; }
.unified-history-result { display: block; width: 64px; flex: 0 0 auto; color: #738096; font-size: 9px; text-align: center; text-decoration: none; }
.unified-history-result img { display: block; width: 64px; height: 52px; margin-bottom: 4px; border-radius: 7px; object-fit: cover; background: #edf1f6; }
.unified-history-result.pending { display: grid; height: 52px; place-items: center; border-radius: 7px; background: #eef2f7; }

.history-heading strong,
.tools-heading strong { font-size: 16px; }
.history-heading small,
.tools-heading small { font-size: 12px; }
.service-status { padding: 6px 9px; font-size: 11px; }
.tool-tabs { gap: 9px; padding: 14px; }
.tool-tabs button { min-height: 58px; gap: 10px; padding: 10px; }
.tool-tabs i { width: 32px; height: 32px; font-size: 14px; }
.tool-tabs span { font-size: 13px; }
.tool-tabs small { margin-top: 4px; font-size: 10px; }
.tool-config { height: 360px; padding: 18px; }
.tool-config h3 { margin: 4px 0 11px; font-size: 14px; }
.tool-config p { margin: 12px 0; font-size: 12px; line-height: 1.65; }
.choice-grid label span { min-height: 42px; padding: 7px; font-size: 12px; }
.background-options button,
.size-options button { font-size: 11px; }
.rights-check { font-size: 12px; }
.run-button { min-height: 52px; font-size: 15px; }
.run-button b { font-size: 10px; }
.charge-note { font-size: 11px; }
.canvas-toolbar > div:first-child strong { font-size: 15px; }
.canvas-toolbar > div:first-child span { font-size: 11px; }
.canvas-toolbar button,
.tool-button { min-height: 38px; font-size: 12px; }
.upload-dropzone small { font-size: 12px; }
.upload-security { font-size: 11px; }
.asset-thumb span { font-size: 9px; }
.local-background-options button,
.color-choice,
.background-upload,
.compact-controls label,
.alignment-row,
.alignment-row button,
.simple-check,
.subtle-button { font-size: 11px !important; }

@media (max-width: 980px) {
  .studio-shell { display: grid; grid-template-columns: 1fr; }
  .unified-batch-workspace { grid-template-columns: 1fr; }
  .tools-panel { border-top: 1px solid var(--line); }
  .tool-config { height: auto; max-height: 430px; }
  .history-panel .history-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .history-panel { display: block; }
  .history-panel .history-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .unified-batch-files { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .studio-section { padding: 20px 10px 55px; }
  .studio-shell,
  .history-panel,
  .unified-batch-card { border-radius: 15px; }
  .workspace-mode-bar { align-items: stretch; flex-direction: column; gap: 10px; padding: 12px; }
  .workspace-mode-switch { display: grid; grid-template-columns: 1fr 1fr; }
  .workspace-mode-switch button { padding: 0 9px; }
  .history-panel .history-heading { padding: 14px; }
  .history-heading { align-items: flex-start; gap: 10px; }
  .history-heading-actions { align-items: flex-end; flex-direction: column-reverse; }
  .history-content { padding: 12px 14px 14px; }
  .history-panel .history-list { grid-template-columns: 1fr; }
  .unified-batch-files { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .batch-upload-card,
  .batch-settings-card { padding: 14px; }
  .tool-tabs span { font-size: 12px; }
  .tool-tabs small { font-size: 10px; }
  .choice-grid.three { grid-template-columns: repeat(3, 1fr); }
}
