:root {
  --bg: #f5f6fb;
  --bg-accent: #eef0ff;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-solid: #ffffff;
  --text: #192031;
  --muted: #6f778a;
  --line: #dfe3ee;
  --line-strong: #cbd1df;
  --accent: #6654e8;
  --accent-strong: #4f3ed1;
  --accent-soft: #efedff;
  --teal: #12847a;
  --teal-soft: #e6f7f4;
  --good: #18784d;
  --good-soft: #e9f8f0;
  --warn: #9a6500;
  --warn-soft: #fff6df;
  --bad: #b42318;
  --bad-soft: #fff0ee;
  --shadow: 0 18px 50px rgba(33, 40, 75, 0.08);
  --shadow-soft: 0 8px 24px rgba(33, 40, 75, 0.06);
  --radius: 18px;
}
body.dark {
  --bg: #0f121a;
  --bg-accent: #17182a;
  --panel: rgba(25, 28, 39, 0.95);
  --panel-solid: #191c27;
  --text: #f5f6fb;
  --muted: #aeb5c7;
  --line: #303646;
  --line-strong: #42495b;
  --accent: #a899ff;
  --accent-strong: #c3b9ff;
  --accent-soft: #292642;
  --teal: #64d6ca;
  --teal-soft: #173c3a;
  --good: #72d6a2;
  --good-soft: #17382a;
  --warn: #ffd06a;
  --warn-soft: #3b311a;
  --bad: #ff938c;
  --bad-soft: #3d201f;
  --shadow: 0 20px 55px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.24);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, var(--bg-accent), transparent 28rem),
    radial-gradient(circle at 92% 4%, var(--teal-soft), transparent 24rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, input, textarea, select { font: inherit; }
button {
  border: 0;
  border-radius: 11px;
  padding: 10px 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 6px 16px rgba(102, 84, 232, 0.18);
  font-weight: 800;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}
button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 9px 20px rgba(102, 84, 232, 0.25); }
button.secondary { color: var(--accent); background: var(--accent-soft); border: 1px solid var(--line); box-shadow: none; }
button.ghost { color: var(--text); background: transparent; border: 1px solid var(--line); box-shadow: none; }
button.danger { background: var(--bad); box-shadow: none; }
button:disabled { opacity: 0.48; cursor: not-allowed; transform: none; }
a { color: var(--accent); }
code { padding: 2px 5px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.shell { max-width: 1700px; margin: 0 auto; padding: 22px; }
.app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.brand-block { display: flex; align-items: flex-start; gap: 16px; min-width: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(145deg, var(--accent), var(--teal));
  box-shadow: 0 12px 26px rgba(102,84,232,.28);
  font-weight: 900;
  letter-spacing: .05em;
}
.eyebrow, .section-kicker { color: var(--accent); font-size: .72rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.app-header h1 { margin: 2px 0 6px; font-size: clamp(1.7rem, 3vw, 2.6rem); line-height: 1.08; }
.app-header p { max-width: 760px; margin: 0; color: var(--muted); }
.header-tools { display: grid; justify-items: end; gap: 12px; }
.model-badges { display: flex; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.model-badge, .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 850;
  white-space: nowrap;
}
.model-badge.success, .pill.success { color: var(--good); background: var(--good-soft); }
.pill.optional { color: var(--teal); background: var(--teal-soft); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.header-actions { justify-content: flex-end; }
.section-nav {
  position: sticky;
  top: 10px;
  z-index: 20;
  display: flex;
  gap: 8px;
  margin: 16px 0;
  padding: 9px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}
.section-nav a {
  flex: 0 0 auto;
  padding: 8px 12px;
  color: var(--muted);
  border-radius: 9px;
  text-decoration: none;
  font-size: .82rem;
  font-weight: 800;
}
.section-nav a:hover { color: var(--accent); background: var(--accent-soft); }
.overview-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 16px 0; }
.overview-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}
.overview-icon {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  color: #fff;
  background: var(--accent);
  border-radius: 10px;
  font-size: .75rem;
  font-weight: 900;
}
.overview-card strong, .overview-card small { display: block; }
.overview-card strong { font-size: .86rem; }
.overview-card small { color: var(--muted); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workflow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin: 16px 0 22px; }
.workflow-step {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 9px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: center;
  font-size: .78rem;
}
.workflow-step span { color: var(--muted); font-size: .68rem; font-weight: 900; }
.workflow-step.done { color: var(--good); background: var(--good-soft); border-color: transparent; font-weight: 850; }
.workflow-step.done span { color: var(--good); }
.layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(390px, .85fr); gap: 22px; align-items: start; }
.workspace-section-heading {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  align-items: start;
  margin: 30px 2px 12px;
  padding-top: 6px;
}
.workspace-section-heading:first-child { margin-top: 0; }
.workspace-section-heading h2 { margin: 0 0 4px; font-size: 1.2rem; }
.workspace-section-heading p { margin: 0; color: var(--muted); font-size: .88rem; }
.section-kicker { padding-top: 4px; }
.card {
  margin-bottom: 16px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}
.workspace-card { position: relative; overflow: hidden; }
.workspace-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(var(--accent), var(--teal));
  opacity: .7;
}
.card h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 1.16rem; }
.card h3 { margin: 20px 0 9px; font-size: 1rem; }
.step-number {
  display: inline-grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: .72rem;
  font-weight: 900;
}
.title-provider { color: var(--muted); font-size: .78rem; font-weight: 700; }
.card-heading-row, .results-heading, .subpanel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.help, .muted { color: var(--muted); font-size: .88rem; }
.help { margin: -4px 0 13px; }
.field { margin-bottom: 12px; }
label { display: block; margin-bottom: 5px; font-size: .86rem; font-weight: 800; }
input, textarea, select {
  width: 100%;
  padding: 10px 11px;
  color: var(--text);
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
input[readonly] { color: var(--good); background: var(--good-soft); font-weight: 850; }
textarea { min-height: 94px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.upload {
  padding: 18px;
  text-align: center;
  background: linear-gradient(135deg, var(--accent-soft), var(--teal-soft));
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
}
.upload input { max-width: 470px; margin-top: 8px; }
.status { margin-top: 10px; padding: 10px 12px; background: var(--accent-soft); border: 1px solid var(--line); border-radius: 10px; font-size: .86rem; }
.status.good { color: var(--good); background: var(--good-soft); }
.status.warn { color: var(--warn); background: var(--warn-soft); }
.status.bad { color: var(--bad); background: var(--bad-soft); }
.notice { padding: 11px 13px; color: var(--muted); background: var(--warn-soft); border-left: 4px solid var(--warn); border-radius: 9px; font-size: .86rem; }
.toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(120px, .35fr)); gap: 9px; margin: 12px 0; }
.table-wrap { max-height: 470px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-solid); }
table { width: 100%; min-width: 840px; border-collapse: collapse; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: .82rem; }
th { position: sticky; top: 0; z-index: 2; background: var(--panel-solid); white-space: nowrap; }
tr:hover td, tr.selected td { background: var(--accent-soft); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.selected-product { border-left: 0; }
.selected-name { margin-bottom: 8px; font-size: 1.07rem; font-weight: 900; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.metric { padding: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 11px; }
.metric small { display: block; color: var(--muted); }
.metric strong { font-size: 1.04rem; }
.extracted-copy { max-height: 220px; padding: 12px; overflow: auto; white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 11px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 12px; }
.image-card { position: relative; overflow: hidden; background: var(--bg); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow-soft); }
.image-card.selected { border: 3px solid var(--accent); }
.image-card img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #fff; }
.image-meta { padding: 8px; font-size: .75rem; }
.image-card input { position: absolute; top: 8px; left: 8px; width: 20px; height: 20px; accent-color: var(--accent); }
.sticky { position: sticky; top: 82px; }
details { margin: 9px 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-solid); }
summary { cursor: pointer; font-weight: 800; }
.subpanel { margin-top: 20px; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(135deg, var(--accent-soft), transparent); }
.subpanel h3 { margin: 3px 0 0; }
.ai-subpanel { border-color: var(--line-strong); }
.output-block { margin: 17px 0; }
.output-block h3 { margin: 0 0 7px; }
.copybox { position: relative; min-height: 54px; padding: 14px 88px 14px 14px; overflow-wrap: anywhere; white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.copybox.single-line { overflow-x: auto; white-space: nowrap; }
.copybox.single-line span { display: inline-block; min-width: max-content; }
.copybox button { position: absolute; top: 7px; right: 7px; padding: 7px 9px; font-size: .75rem; }
.title-option { margin: 8px 0; padding: 11px; border: 1px solid var(--line); border-radius: 11px; }
.title-option.best { background: var(--accent-soft); border-color: var(--accent); }
.count { margin-top: 5px; color: var(--muted); font-size: .82rem; }
.results-card { border-top: 4px solid var(--accent); }
.results-heading h2 { margin: 3px 0 0; }
.hidden { display: none !important; }
footer { padding: 18px 12px 6px; color: var(--muted); text-align: center; font-size: .8rem; }
.browser-actions { margin: 4px 0 12px; }
.browser-actions button { min-height: 48px; }
.browser-helper-setup ol { margin: 10px 0; padding-left: 24px; }
.browser-helper-setup li { margin: 7px 0; }
.large-prompt { min-height: 150px; }
.generation-actions { margin-top: 12px; }
.task-details { margin-top: 10px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; font-size: .86rem; }
.generated-gallery .image-card { display: flex; flex-direction: column; }
.generated-gallery .image-meta { display: grid; gap: 7px; }
.generated-gallery .image-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.generated-gallery .image-actions a, .generated-gallery .image-actions button { flex: 1 1 auto; text-align: center; font-size: .74rem; padding: 7px 8px; }
.generated-gallery .reference-toggle { position: static; width: auto; height: auto; margin-right: 5px; }
.image-studio-card { background: linear-gradient(160deg, var(--panel) 72%, var(--teal-soft)); }
.deployment-card { background: linear-gradient(160deg, var(--panel) 68%, var(--accent-soft)); }
.deployment-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.choice-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 84px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-solid);
  cursor: pointer;
}
.choice-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(102,84,232,.08); }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-dot { width: 18px; height: 18px; border: 2px solid var(--line-strong); border-radius: 50%; box-shadow: inset 0 0 0 4px var(--panel-solid); }
.choice-card:has(input:checked) .choice-dot { background: var(--accent); border-color: var(--accent); }
.choice-card strong, .choice-card small { display: block; }
.choice-card small { margin-top: 3px; color: var(--muted); font-weight: 500; }
.deployment-panel { margin-top: 12px; }
.deployment-summary { padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel-solid); }
.deployment-summary p { margin: 5px 0 0; color: var(--muted); }
.good-summary { border-left: 4px solid var(--good); background: var(--good-soft); }
.deployment-fields { margin-top: 15px; }
.cloud-checklist { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 6px 0 16px; }
.cloud-checklist label { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-solid); }
.cloud-checklist input { width: auto; accent-color: var(--accent); }
.command-preview { margin-top: 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #111522; color: #e8ebf5; }
.command-preview-title { padding: 8px 12px; background: rgba(255,255,255,.06); color: #b8c0d7; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.command-preview pre { margin: 0; padding: 13px; overflow-x: auto; white-space: pre-wrap; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.clean-list { margin: 10px 0; padding-left: 20px; }
.clean-list li { margin: 6px 0; }
@media (max-width: 1250px) {
  .workflow { grid-template-columns: repeat(4, 1fr); }
  .overview-strip { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .header-tools { justify-items: start; }
  .app-header { flex-direction: column; }
  .model-badges, .header-actions { justify-content: flex-start; }
}
@media (max-width: 760px) {
  .shell { padding: 12px; }
  .app-header { padding: 18px; border-radius: 18px; }
  .brand-mark { width: 44px; height: 44px; flex-basis: 44px; }
  .overview-strip { grid-template-columns: 1fr 1fr; }
  .workflow { grid-template-columns: 1fr 1fr; }
  .two, .three, .toolbar, .deployment-choice, .cloud-checklist { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr; }
  .workspace-section-heading { grid-template-columns: 1fr; gap: 4px; }
  .section-nav { top: 4px; }
  .card { padding: 16px; }
}


/* Automation batch additions */
.automation-card, .batch-results-card { border: 1px solid var(--line); }
.automation-header { display:flex; gap:18px; justify-content:space-between; align-items:flex-start; flex-wrap:wrap; }
.automation-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap:14px; margin: 18px 0; }
.toggle-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap:10px; margin-bottom:16px; }
.toggle-grid label { display:flex; gap:10px; align-items:flex-start; background: rgba(111, 94, 246, 0.06); border:1px solid var(--line); border-radius:14px; padding:12px 14px; }
.batch-results-list { display:grid; gap:18px; margin-top:16px; }
.batch-results-pager {
  justify-content: center;
  align-items: center;
  min-height: 44px;
  margin: 14px 0 4px;
}
.batch-results-pager button {
  width: 42px;
  min-width: 42px;
  min-height: 38px;
  padding: 0;
  font-size: 18px;
}
.batch-results-pager strong {
  min-width: 110px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.batch-product-card { border:1px solid var(--line); border-radius:20px; padding:18px; background: var(--card); box-shadow: var(--shadow-sm); }
.batch-product-header { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; flex-wrap:wrap; margin-bottom:10px; }
.batch-product-header-actions { display:flex; justify-content:flex-end; align-items:center; gap:8px; flex-wrap:wrap; }
.batch-product-header-actions .batch-product-cancel { min-height:34px; padding:7px 11px; }
.batch-background-state { display:inline-flex; align-items:center; min-height:34px; padding:7px 10px; border:1px solid rgba(20,122,75,.28); border-radius:8px; background:rgba(20,122,75,.09); color:#0d6840; font-size:12px; font-weight:800; }
.batch-background-policy { margin:12px 0; }
.batch-meta-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap:10px; margin:12px 0 14px; }
.batch-meta-grid .metric { padding:12px; border-radius:14px; background: var(--soft); border:1px solid var(--line); }
.batch-copy-grid { display:grid; gap:12px; margin-top:12px; }
.batch-copy-block { border:1px solid var(--line); border-radius:16px; padding:12px; background:rgba(255,255,255,0.5); }
.batch-copy-block h4 { margin:0 0 8px; font-size:14px; letter-spacing:0.02em; }
.batch-tags { white-space:normal; line-height:1.6; }
.batch-image-gallery { display:grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap:12px; margin-top:14px; }
.batch-image-gallery img { width:100%; aspect-ratio:1 / 1; object-fit:cover; border-radius:16px; border:1px solid var(--line); background:#fff; }
.batch-prompt-image-groups { display:grid; gap:18px; margin-top:14px; }
.batch-prompt-image-group { display:grid; gap:10px; }
.batch-prompt-image-group-heading { font-size:.9rem; font-weight:800; letter-spacing:.02em; text-transform:uppercase; color:var(--ink); }
.batch-image-gallery-grouped { margin-top:0; }
.batch-image-card { display:grid; gap:8px; }
.batch-image-card a { position:relative; display:block; text-decoration:none; }
.batch-image-prompt-badge { position:absolute; top:10px; left:10px; z-index:2; padding:6px 10px; border-radius:999px; background:rgba(17, 24, 39, .86); color:#fff; font-size:.74rem; font-weight:800; letter-spacing:.02em; box-shadow:0 6px 18px rgba(0,0,0,.18); }
.batch-image-caption { font-size:.84rem; color:var(--muted); font-weight:600; }
.batch-warning-list { margin:10px 0 0; padding-left:18px; }
.inline { display:inline-flex; }
.overview-card.accent { background: linear-gradient(135deg, rgba(111, 94, 246, 0.12), rgba(48, 182, 255, 0.12)); }
@media (max-width: 800px) { .automation-header { flex-direction:column; } }
@media (max-width: 800px) { .batch-product-header-actions { width:100%; justify-content:flex-start; } }


/* CSV-only automation refinement */
.csv-drop-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin:20px 0 12px; }
.csv-drop-card { display:grid; grid-template-columns:auto 1fr; align-items:center; gap:14px; min-height:126px; padding:20px; border:2px dashed rgba(95,76,230,.28); border-radius:20px; background:linear-gradient(135deg,rgba(111,94,246,.07),rgba(48,182,255,.06)); cursor:pointer; transition:.2s ease; }
.csv-drop-card:hover { transform:translateY(-2px); border-color:var(--primary); box-shadow:var(--shadow-sm); }
.csv-drop-card input[type=file] { grid-column:1 / -1; width:100%; margin-top:4px; }
.csv-drop-card strong { display:block; font-size:18px; margin-bottom:5px; }
.csv-drop-card small { display:block; color:var(--muted); line-height:1.45; }
.csv-drop-number { display:grid; place-items:center; width:42px; height:42px; border-radius:14px; background:var(--primary); color:white; font-weight:800; }
.csv-status-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-bottom:18px; }
.compact-toggles { grid-template-columns:repeat(3,minmax(0,1fr)); }
.optional-api-panel { margin:14px 0 18px; border:1px solid var(--line); border-radius:16px; padding:14px 16px; background:var(--soft); }
.optional-api-panel summary { cursor:pointer; font-weight:750; }
.helper-note { margin:16px 0; padding:14px 16px; border-radius:16px; background:#fff8dd; border:1px solid #f0d98a; line-height:1.5; }
.batch-keywords { margin-top:8px; display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:8px; }
.batch-keyword-chip { border:1px solid var(--line); border-radius:12px; padding:8px 10px; background:var(--soft); font-size:13px; }
@media (max-width:900px) { .csv-drop-grid,.csv-status-grid,.compact-toggles { grid-template-columns:1fr; } }


/* Verified complete-batch result states */
.batch-status-badge { display:inline-flex; align-items:center; gap:7px; padding:7px 11px; border-radius:999px; border:1px solid var(--line); font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.04em; }
.batch-status-badge.queued { background:rgba(120,120,130,.10); }
.batch-status-badge.opening, .batch-status-badge.extracting, .batch-status-badge.processing, .batch-status-badge.recovering { background:rgba(240,166,35,.14); color:#8a5700; }
.batch-status-badge.complete { background:rgba(20,122,75,.13); color:#0d6840; }
.batch-status-badge.failed { background:rgba(180,35,24,.12); color:#9b1d14; }
.batch-product-card[data-status="queued"], .batch-product-card[data-status="opening"], .batch-product-card[data-status="extracting"], .batch-product-card[data-status="processing"], .batch-product-card[data-status="recovering"] { border-style:dashed; }
.batch-product-card[data-status="failed"] { border-color:rgba(180,35,24,.45); }
.batch-product-card[data-status="complete"] { border-color:rgba(20,122,75,.38); }
.batch-progress-note { margin-top:12px; padding:11px 13px; border-radius:13px; background:var(--soft); border:1px solid var(--line); }
.batch-actions-disabled { opacity:.55; pointer-events:none; }


/* Product approval queue */
.approval-panel { margin-top:18px; padding:18px; border:1px solid var(--line); border-radius:20px; background:linear-gradient(135deg,rgba(111,94,246,.055),rgba(48,182,255,.04)); }
.approval-panel-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; flex-wrap:wrap; }
.approval-panel-heading h3 { margin:3px 0 6px; }
.approval-summary { display:inline-flex; align-items:center; min-height:38px; padding:8px 13px; border-radius:999px; background:var(--soft); border:1px solid var(--line); font-weight:800; white-space:nowrap; }
.approval-toolbar { margin:14px 0; }
.approval-list { display:grid; gap:12px; }
.approval-product-card { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:16px; align-items:center; padding:16px; border:1px solid var(--line); border-radius:17px; background:var(--card); box-shadow:var(--shadow-sm); }
.approval-product-card.approved { border-color:rgba(20,122,75,.5); background:linear-gradient(135deg,rgba(20,122,75,.07),var(--card)); }
.approval-product-card.pending { border-style:dashed; }
.approval-product-card h4 { margin:0 0 5px; font-size:16px; }
.approval-product-meta { display:flex; flex-wrap:wrap; gap:7px 13px; color:var(--muted); font-size:13px; }
.approval-product-link { margin-top:7px; font-size:12px; word-break:break-all; }
.approval-product-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
.approval-badge { display:inline-flex; padding:6px 9px; border-radius:999px; font-size:11px; font-weight:850; text-transform:uppercase; letter-spacing:.04em; background:rgba(120,120,130,.1); border:1px solid var(--line); }
.approval-badge.approved { color:#0d6840; background:rgba(20,122,75,.13); }
button.approve-button { background:#147a4b; }
button.decline-button { background:#b42318; color:#fff; }
button.decline-button:hover { filter:brightness(.95); }
@media (max-width:760px) {
  .approval-product-card { grid-template-columns:1fr; }
  .approval-product-actions { justify-content:flex-start; }
}


/* Full original Etsy Item details extraction */
.batch-original-listing {
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(111, 94, 246, 0.035);
  overflow: hidden;
}
.batch-original-listing > summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 800;
  background: rgba(111, 94, 246, 0.08);
}
.batch-original-listing .batch-copy-grid,
.batch-original-listing .actions {
  margin: 14px;
}
.batch-description-block > div {
  white-space: pre-wrap;
  line-height: 1.55;
  max-height: 520px;
  overflow: auto;
}

.backup-tag-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.backup-tag-row:last-child { border-bottom: 0; }
.batch-title-option { padding: 10px 0; border-bottom: 1px solid var(--line); }
.batch-title-option:last-child { border-bottom: 0; }


/* Physical and digital workflow */
.listing-type-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin:16px 0; }
.listing-type-card { display:flex; gap:14px; align-items:flex-start; border:1px solid var(--line); border-radius:18px; padding:16px; background:var(--soft); }
.listing-type-card p { margin:5px 0 0; color:var(--muted); line-height:1.5; }
.listing-type-icon { width:38px; height:38px; flex:0 0 38px; display:grid; place-items:center; border-radius:12px; font-weight:900; color:white; background:var(--primary); }
.listing-type-card.digital .listing-type-icon { background:#0f8b69; }
.approval-workflow-controls { display:grid; grid-template-columns:minmax(180px,240px) minmax(240px,1fr); gap:12px; margin-top:14px; }
.digital-file-panel { border:1px dashed var(--line); border-radius:14px; padding:12px; background:rgba(15,139,105,.06); }
.digital-file-panel.hidden { display:none; }
.digital-file-status.good { color:#087b58; }
.digital-file-status.bad { color:#b42318; }
.workflow-type-pill { display:inline-flex; padding:5px 10px; border-radius:999px; font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.05em; background:rgba(99,82,241,.1); }
.workflow-type-pill.digital { background:rgba(15,139,105,.12); color:#087b58; }
.image-readiness { display:flex; align-items:center; gap:8px; }
.image-readiness-bar { flex:1; min-width:90px; height:8px; overflow:hidden; border-radius:999px; background:var(--line); }
.image-readiness-bar span { display:block; height:100%; background:var(--primary); }
.requirement-checklist { display:grid; gap:8px; margin:12px 0; }
.requirement-checklist div { padding:10px 12px; border-radius:12px; border:1px solid var(--line); background:var(--soft); }
.requirement-checklist .ready { border-color:rgba(15,139,105,.35); background:rgba(15,139,105,.08); }
.requirement-checklist .pending { border-color:rgba(184,120,0,.30); background:rgba(255,190,62,.10); }
.requirement-checklist .missing { border-color:rgba(180,35,24,.25); background:rgba(180,35,24,.06); }
.etsy-publish-panel { margin:16px 0; }
@media (max-width:760px) { .listing-type-grid, .approval-workflow-controls { grid-template-columns:1fr; } }


/* Digital product category and format controls */
.default-workflow-panel {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 16px;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--soft);
}
.segmented-workflow { display:flex; flex-wrap:wrap; gap:8px; }
.segmented-workflow label {
  display:flex;
  gap:8px;
  align-items:center;
  padding:10px 13px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--card);
  cursor:pointer;
}
.digital-type-reference { margin: 16px 0; }
.digital-reference-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
  gap:10px;
  margin-top:12px;
}
.digital-reference-grid > div {
  display:flex;
  flex-direction:column;
  gap:4px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--soft);
}
.digital-reference-grid span { font-size:12px; color:var(--muted); }
.digital-config-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
  gap:12px;
  margin-top:12px;
}
.digital-generation-request { min-height:100px; resize:vertical; }
.digital-format-help {
  padding:10px 12px;
  border-radius:12px;
  background:rgba(111,94,246,.07);
  border:1px solid var(--line);
  margin-top:8px;
  font-size:13px;
}
.digital-readiness-grid {
  display:grid;
  gap:8px;
  margin-top:10px;
}
.digital-readiness-grid > div { padding:8px 10px; border-radius:10px; border:1px solid var(--line); }
.digital-readiness-grid .ready { background:rgba(34,197,94,.08); }
.digital-readiness-grid .missing { background:rgba(239,68,68,.08); }
@media (max-width: 760px) {
  .default-workflow-panel { flex-direction:column; align-items:flex-start; }
}


/* Explicit Physical / Digital product toggle */
.workflow-choice-panel {
  margin: 20px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(111, 94, 246, 0.035), rgba(15, 139, 105, 0.025));
}
.workflow-choice-heading,
.global-digital-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.listing-type-grid.selectable {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.listing-type-card.selectable {
  position: relative;
  cursor: pointer;
  min-height: 150px;
  align-items: flex-start;
  background: var(--card);
  border: 2px solid var(--line);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease, background .15s ease;
  user-select: none;
}
.listing-type-card.selectable:hover {
  transform: translateY(-1px);
  border-color: rgba(111, 94, 246, .55);
  box-shadow: 0 10px 28px rgba(34, 35, 58, .08);
}
.listing-type-card.selectable input[type="radio"] {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 22px;
  height: 22px;
  cursor: pointer;
  accent-color: #6552e8;
}
.listing-type-card.selectable.selected.physical {
  border-color: #6552e8;
  background: rgba(101, 82, 232, .08);
  box-shadow: 0 0 0 4px rgba(101, 82, 232, .09);
}
.listing-type-card.selectable.selected.digital {
  border-color: #0f8b69;
  background: rgba(15, 139, 105, .08);
  box-shadow: 0 0 0 4px rgba(15, 139, 105, .09);
}
.listing-type-card .listing-type-copy {
  padding-right: 30px;
}
.workflow-check {
  position: absolute;
  right: 16px;
  bottom: 14px;
  display: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
}
.listing-type-card.selected .workflow-check { display: flex; }
.listing-type-card.selected.physical .workflow-check { background: #6552e8; }
.listing-type-card.selected.digital .workflow-check { background: #0f8b69; }
.global-digital-controls {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(15, 139, 105, .34);
  border-radius: 18px;
  background: rgba(15, 139, 105, .055);
}
.global-digital-controls.hidden { display: none; }
.digital-config-grid.global {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.pill.digital {
  color: #087458;
  background: rgba(15, 139, 105, .11);
  border-color: rgba(15, 139, 105, .28);
}
@media (max-width: 850px) {
  .listing-type-grid.selectable,
  .digital-config-grid.global { grid-template-columns: 1fr; }
}


/* Reference example uploads */
.reference-examples-panel {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(78, 110, 255, 0.06), rgba(29, 174, 128, 0.05));
}
.reference-examples-heading,
.reference-file-toolbar {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}
.reference-upload-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(280px, 1.1fr);
  gap: 14px;
  margin: 16px 0;
}
.reference-drop-card {
  display: flex;
  gap: 14px;
  align-items: center;
  min-height: 118px;
  padding: 16px;
  border: 2px dashed rgba(99, 82, 224, 0.35);
  border-radius: 18px;
  background: rgba(255,255,255,0.58);
  cursor: pointer;
}
.reference-drop-card input { display: none; }
.reference-drop-card small { display: block; margin-top: 5px; color: var(--muted); line-height: 1.45; }
.reference-drop-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 14px;
  color: white;
  background: linear-gradient(135deg, #6550e8, #14986c);
  font-size: 26px;
  font-weight: 800;
}
.reference-file-list { display: grid; gap: 9px; margin-top: 12px; }
.reference-file-chip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}
.reference-file-chip strong,
.reference-file-chip small { display: block; overflow-wrap: anywhere; }
.reference-file-chip small { color: var(--muted); margin-top: 3px; }
.product-reference-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(103, 87, 230, 0.045);
}
.product-reference-panel summary { cursor: pointer; font-weight: 750; }
.product-reference-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(250px, 1.2fr);
  gap: 12px;
  margin-top: 12px;
}
.reference-mini-list { display: grid; gap: 7px; margin-top: 10px; }
.reference-mini-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.reference-preview-image {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin-right: 10px;
  vertical-align: middle;
}
.api-reference-ready {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}
@media (max-width: 780px) {
  .reference-upload-grid,
  .product-reference-grid { grid-template-columns: 1fr; }
}

/* ========================================================================== 
   Etsy Product Studio Pro — professional dashboard redesign
   ========================================================================== */
:root {
  --bg: #eef2f7;
  --bg-accent: #e7ebff;
  --panel: rgba(255, 255, 255, 0.97);
  --panel-solid: #ffffff;
  --text: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --accent: #635bff;
  --accent-strong: #4f46e5;
  --accent-soft: #f0efff;
  --teal: #0f9f8f;
  --teal-soft: #e9faf7;
  --good: #067647;
  --good-soft: #ecfdf3;
  --warn: #b54708;
  --warn-soft: #fffaeb;
  --bad: #b42318;
  --bad-soft: #fef3f2;
  --nav-bg: #101828;
  --nav-muted: #98a2b3;
  --shadow: 0 20px 44px rgba(16, 24, 40, 0.08);
  --shadow-soft: 0 8px 24px rgba(16, 24, 40, 0.06);
  --radius: 18px;
}
body.dark {
  --bg: #0b101b;
  --bg-accent: #141a2a;
  --panel: rgba(20, 27, 42, 0.98);
  --panel-solid: #161d2c;
  --text: #f9fafb;
  --muted: #aeb7c6;
  --line: #2d3648;
  --line-strong: #3e495e;
  --accent: #a49cff;
  --accent-strong: #8178ff;
  --accent-soft: #282443;
  --nav-bg: #070b13;
}
body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 32% -15%, rgba(99, 91, 255, .16), transparent 32rem),
    linear-gradient(180deg, #f8fafc 0, var(--bg) 20rem);
}
body.dark {
  background:
    radial-gradient(circle at 35% -10%, rgba(99, 91, 255, .16), transparent 30rem),
    var(--bg);
}
.shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 24px 30px 64px 292px;
}
.section-nav {
  position: fixed;
  inset: 18px auto 18px 18px;
  z-index: 50;
  width: 248px;
  margin: 0;
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  overflow-y: auto;
  border: 0;
  border-radius: 22px;
  background: linear-gradient(180deg, #172033 0%, var(--nav-bg) 100%);
  box-shadow: 0 24px 55px rgba(16, 24, 40, .22);
}
.section-nav::before {
  content: "ETSY STUDIO PRO";
  display: block;
  padding: 8px 12px 20px;
  margin-bottom: 8px;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.1);
  font-size: .9rem;
  font-weight: 900;
  letter-spacing: .12em;
}
.section-nav::after {
  content: "Local automation workspace";
  margin-top: auto;
  padding: 18px 12px 4px;
  color: var(--nav-muted);
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: .72rem;
  line-height: 1.5;
}
.section-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  color: #d0d5dd;
  border-radius: 11px;
  font-size: .84rem;
  font-weight: 750;
}
.section-nav a span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: #c7d7fe;
  background: rgba(255,255,255,.07);
  border-radius: 8px;
  font-size: .68rem;
  font-weight: 900;
}
.section-nav a:hover,
.section-nav a:focus-visible {
  color: #fff;
  background: rgba(99, 91, 255, .25);
}
.app-header {
  position: relative;
  overflow: hidden;
  min-height: 178px;
  align-items: center;
  padding: 30px 32px;
  border: 0;
  border-radius: 24px;
  color: #fff;
  background:
    radial-gradient(circle at 92% 0%, rgba(255,255,255,.22), transparent 19rem),
    linear-gradient(130deg, #111827 0%, #312e81 50%, #635bff 100%);
  box-shadow: 0 24px 55px rgba(55, 48, 163, .2);
}
.app-header::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -110px;
  width: 300px;
  height: 300px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  box-shadow: 0 0 0 36px rgba(255,255,255,.04), 0 0 0 72px rgba(255,255,255,.025);
  pointer-events: none;
}
.brand-block,
.header-tools { position: relative; z-index: 1; }
.brand-mark {
  width: 58px;
  height: 58px;
  flex-basis: 58px;
  border: 1px solid rgba(255,255,255,.24);
  background: rgba(255,255,255,.14);
  box-shadow: none;
  backdrop-filter: blur(12px);
}
.app-header .eyebrow { color: #ddd9ff; }
.app-header h1 { margin-top: 4px; font-size: clamp(2rem, 3.6vw, 3.15rem); }
.app-header p { color: #e6e7f0; max-width: 800px; font-size: .98rem; }
.header-tools { max-width: 430px; }
.model-badge {
  color: #fff;
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.16);
}
.model-badge.success { color: #b7f7d4; background: rgba(6,118,71,.25); border-color: rgba(183,247,212,.2); }
.app-header button.secondary,
.app-header button.ghost {
  color: #fff;
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.2);
}
.app-header button.danger { background: rgba(180,35,24,.7); }
.dashboard-status-bar {
  display: grid;
  grid-template-columns: 1.35fr repeat(4, 1fr);
  gap: 1px;
  margin: 16px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--line);
  box-shadow: var(--shadow-soft);
}
.dashboard-status-bar > div {
  min-width: 0;
  padding: 15px 18px;
  background: var(--panel-solid);
}
.dashboard-status-bar strong,
.dashboard-status-bar small { display: block; }
.dashboard-status-bar strong { font-size: .94rem; }
.dashboard-status-bar small { margin-top: 2px; color: var(--muted); font-size: .74rem; }
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
}
.status-dot.online { background: #12b76a; box-shadow: 0 0 0 4px rgba(18,183,106,.12); }
.overview-strip {
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 10px;
}
.overview-card {
  padding: 14px 15px;
  border-radius: 15px;
  box-shadow: none;
}
.overview-card.accent {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
}
.overview-card.accent small { color: rgba(255,255,255,.75); }
.overview-card.accent .overview-icon { color: var(--accent); background: #fff; }
.workflow {
  grid-template-columns: repeat(8, minmax(95px, 1fr));
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.65);
}
.workflow-step { min-height: 38px; background: transparent; border: 0; border-radius: 10px; }
.workflow-step.done { background: var(--good-soft); }
.layout { grid-template-columns: minmax(0, 1fr) 430px; gap: 22px; }
.workspace-section-heading {
  grid-template-columns: 88px 1fr;
  margin-top: 40px;
  padding: 0 4px;
}
.workspace-section-heading h2 { font-size: 1.35rem; letter-spacing: -.02em; }
.section-kicker {
  width: max-content;
  padding: 7px 9px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 8px;
  font-size: .64rem;
}
.card {
  padding: 22px;
  border-color: var(--line);
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(16,24,40,.045);
}
.workspace-card::before { display: none; }
.automation-card {
  border-top: 4px solid var(--accent);
  background:
    linear-gradient(180deg, rgba(99,91,255,.035), transparent 180px),
    var(--panel);
}
.automation-header {
  margin: -3px -3px 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.card h2 { font-size: 1.12rem; letter-spacing: -.01em; }
.step-number { border-radius: 9px; }
input, textarea, select {
  min-height: 43px;
  padding: 10px 12px;
  border-radius: 10px;
  border-color: #d8dde8;
  box-shadow: 0 1px 2px rgba(16,24,40,.02);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(99,91,255,.11);
}
button {
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, #635bff, #4f46e5);
  box-shadow: 0 5px 14px rgba(79,70,229,.17);
}
button:hover:not(:disabled) { transform: translateY(-1px); }
.status {
  border-radius: 11px;
  border: 1px solid var(--line);
}
.csv-drop-grid,
.reference-upload-grid { gap: 14px; }
.drop-zone,
.csv-drop-card,
.reference-drop-card,
.digital-file-drop-card {
  position: relative;
  min-height: 116px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  overflow: hidden;
  color: var(--text);
  border: 1.5px dashed #b9c0cf;
  border-radius: 16px;
  background: #fbfcff;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease;
}
body.dark .drop-zone,
body.dark .csv-drop-card,
body.dark .reference-drop-card,
body.dark .digital-file-drop-card { background: #141b29; }
.drop-zone::after {
  content: "DROP FILES";
  position: absolute;
  right: 14px;
  top: 12px;
  padding: 4px 7px;
  color: #667085;
  background: #f2f4f7;
  border-radius: 6px;
  font-size: .59rem;
  font-weight: 900;
  letter-spacing: .1em;
}
.drop-zone:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(99,91,255,.1);
}
.drop-zone.drag-active {
  border-color: var(--accent);
  border-style: solid;
  background: #eeecff;
  box-shadow: inset 0 0 0 2px rgba(99,91,255,.15), 0 14px 30px rgba(99,91,255,.16);
  transform: scale(1.01);
}
.drop-zone.drag-active::after { content: "RELEASE TO UPLOAD"; color: #fff; background: var(--accent); }
.drop-zone.uploading { opacity: .7; pointer-events: none; }
.drop-zone.uploading::after { content: "UPLOADING…"; color: #fff; background: var(--teal); }
.csv-drop-number,
.reference-drop-icon {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 1rem;
  font-weight: 900;
}
.drop-zone strong { display: block; margin-bottom: 4px; font-size: .95rem; }
.drop-zone small { display: block; max-width: 520px; color: var(--muted); font-weight: 550; line-height: 1.45; }
.drop-zone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.workflow-choice-panel,
.reference-examples-panel,
.approval-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfcfe;
}
body.dark .workflow-choice-panel,
body.dark .reference-examples-panel,
body.dark .approval-panel { background: rgba(255,255,255,.02); }
.listing-type-card {
  min-height: 150px;
  padding: 22px;
  border-radius: 16px;
  background: var(--panel-solid);
}
.listing-type-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,91,255,.1), 0 12px 28px rgba(99,91,255,.09);
}
.approval-product-card,
.batch-product-card {
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: 0 7px 18px rgba(16,24,40,.045);
}
.approval-product-card { background: var(--panel-solid); }
.approval-product-actions {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: #f9fafb;
}
body.dark .approval-product-actions { background: rgba(255,255,255,.025); }
.reference-file-chip {
  border-radius: 12px;
  background: var(--panel-solid);
}
.digital-file-drop-card { min-height: 92px; margin: 10px 0 14px; }
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel-solid);
}
table th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #475467;
  background: #f8fafc;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}
body.dark table th { color: #cbd5e1; background: #111827; }
table td { border-color: #eef1f5; }
.sticky { top: 18px; }
.results-card {
  border-top: 4px solid var(--teal);
  box-shadow: 0 14px 34px rgba(16,24,40,.08);
}
.output-block {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbfcfe;
}
body.dark .output-block { background: rgba(255,255,255,.02); }
.copybox { border-radius: 10px; }
footer {
  margin-top: 28px;
  padding: 18px 20px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: .78rem;
}

@media (max-width: 1360px) {
  .layout { grid-template-columns: minmax(0, 1fr) 360px; }
  .overview-strip { grid-template-columns: repeat(3, 1fr); }
  .dashboard-status-bar { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1120px) {
  .shell { padding: 18px; }
  .section-nav {
    position: sticky;
    inset: auto;
    top: 8px;
    width: auto;
    flex-direction: row;
    padding: 8px;
    overflow-x: auto;
    border-radius: 14px;
  }
  .section-nav::before,
  .section-nav::after { display: none; }
  .section-nav a { width: auto; flex: 0 0 auto; }
  .app-header { min-height: auto; }
  .layout { grid-template-columns: 1fr; }
  aside .sticky { position: static; }
  .workflow { overflow-x: auto; grid-template-columns: repeat(8, 120px); }
}
@media (max-width: 780px) {
  .shell { padding: 10px; }
  .app-header { padding: 22px; border-radius: 18px; align-items: flex-start; }
  .brand-mark { width: 46px; height: 46px; flex-basis: 46px; }
  .header-tools { justify-items: start; }
  .header-actions { justify-content: flex-start; }
  .dashboard-status-bar { grid-template-columns: repeat(2, 1fr); }
  .overview-strip { grid-template-columns: repeat(2, 1fr); }
  .workspace-section-heading { grid-template-columns: 1fr; gap: 7px; }
  .automation-grid,
  .csv-drop-grid,
  .reference-upload-grid,
  .listing-type-grid,
  .digital-config-grid { grid-template-columns: 1fr !important; }
  .card { padding: 17px; }
  .drop-zone { min-height: 104px; padding: 17px; }
  .actions button { flex: 1 1 150px; }
}
@media (max-width: 480px) {
  .dashboard-status-bar { grid-template-columns: 1fr; }
  .overview-strip { grid-template-columns: 1fr; }
  .app-header h1 { font-size: 1.8rem; }
  .model-badges { justify-content: flex-start; }
}
.overview-card small { white-space: normal; line-height: 1.25; }
.overview-card { min-height: 66px; }


.api-setup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin: 16px 0 18px;
}
.api-setup-card {
  background: linear-gradient(180deg, rgba(99,102,241,0.08), rgba(255,255,255,0.9));
  border: 1px solid rgba(99,102,241,0.18);
  border-radius: 20px;
  padding: 18px;
}
.key-file-block {
  margin-top: 10px;
  background: rgba(15,23,42,0.96);
  color: #eef2ff;
  border-radius: 16px;
  overflow: hidden;
}
.key-file-block strong {
  display: block;
  padding: 12px 14px 0;
}
.key-file-block pre {
  margin: 0;
  padding: 12px 14px 16px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
}
.api-bullet-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--text-muted, #5b6478);
}
.automation-ai-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 18px;
}
.prompt-field.wide textarea {
  min-height: 120px;
}
.product-ai-panel {
  margin-top: 14px;
  border: 1px solid rgba(148,163,184,0.28);
  border-radius: 16px;
  background: rgba(248,250,252,0.9);
  padding: 14px;
}
.product-ai-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.batch-prompt-block {
  border: 1px solid rgba(148,163,184,0.25);
  border-radius: 16px;
  padding: 14px;
  background: rgba(248,250,252,0.85);
  margin-top: 14px;
}
.batch-prompt-block h4 {
  margin-bottom: 8px;
}
.batch-prompt-text {
  white-space: pre-wrap;
  line-height: 1.55;
}


.competitor-research-panel {
  margin-top: 18px;
  border: 1px solid rgba(99,102,241,0.22);
  border-radius: 18px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(99,102,241,0.055), rgba(255,255,255,0.72));
}
.competitor-research-grid {
  display: grid;
  grid-template-columns: minmax(280px, 2fr) minmax(170px, .65fr) minmax(190px, .75fr);
  gap: 14px;
  align-items: end;
  margin: 14px 0;
}
.competitor-fetch-field button { width: 100%; }
.competitor-research-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.competitor-research-card {
  display: block;
  overflow: hidden;
  border: 1px solid rgba(148,163,184,.3);
  border-radius: 13px;
  background: rgba(255,255,255,.88);
  text-decoration: none;
  color: inherit;
}
.competitor-research-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}
.competitor-research-card span {
  display: block;
  padding: 7px 8px;
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 780px) {
  .competitor-research-grid { grid-template-columns: 1fr; }
}

.generation-monitor {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-solid);
  box-shadow: var(--shadow-soft);
}
.generation-monitor-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; flex-wrap:wrap; }
.generation-monitor-head strong { display:block; font-size:.95rem; }
.generation-monitor-head span { display:block; margin-top:3px; color:var(--muted); font-size:.8rem; }
.generation-notify-toggle { display:flex; align-items:center; gap:7px; margin:0; color:var(--muted); font-size:.78rem; font-weight:700; }
.generation-notify-toggle input { width:auto; accent-color:var(--accent); }
.generation-overall-track, .generation-sheet-track { overflow:hidden; width:100%; height:10px; border-radius:999px; background:var(--bg); border:1px solid var(--line); }
.generation-overall-track { margin-top:12px; height:12px; }
.generation-overall-track span, .generation-sheet-track span { display:block; width:0; height:100%; border-radius:inherit; background:linear-gradient(90deg, var(--accent), var(--teal)); transition:width .35s ease; }
.generation-monitor-meta { display:flex; justify-content:space-between; gap:12px; margin-top:7px; color:var(--muted); font-size:.78rem; font-weight:700; }
.generation-sheet-list { display:grid; gap:9px; margin-top:13px; }
.generation-sheet-row { padding:10px; border:1px solid var(--line); border-radius:11px; background:var(--bg); }
.generation-sheet-row.complete { border-color:var(--good); background:var(--good-soft); }
.generation-sheet-row.failed { border-color:var(--bad); background:var(--bad-soft); }
.generation-sheet-row.active { border-color:var(--accent); }
.generation-sheet-heading { display:flex; justify-content:space-between; gap:10px; align-items:center; margin-bottom:6px; font-size:.8rem; }
.generation-sheet-heading strong { font-size:.84rem; }
.generation-sheet-state { color:var(--muted); font-weight:800; text-transform:uppercase; letter-spacing:.04em; font-size:.7rem; }
.generation-sheet-detail { margin-top:6px; color:var(--muted); font-size:.76rem; overflow-wrap:anywhere; }

.generation-sheet-row.cancelled { border-color:#e6a93f; background:#fff8ea; }
.generation-sheet-heading-actions { display:flex; align-items:center; gap:8px; margin-left:auto; flex-wrap:wrap; justify-content:flex-end; }
.generation-sheet-cancel { padding:5px 9px; font-size:.72rem; line-height:1.1; }
.autosave-status { display:inline-flex; align-items:center; min-height:34px; padding:0 10px; border:1px solid var(--line); border-radius:999px; color:var(--muted); font-size:.74rem; font-weight:800; white-space:nowrap; background:var(--panel-solid); }
.autosave-status.saved { color:var(--good); border-color:color-mix(in srgb, var(--good) 45%, var(--line)); }
.autosave-status.saving { color:var(--accent); }
.autosave-status.error { color:var(--bad); border-color:color-mix(in srgb, var(--bad) 45%, var(--line)); }
@media (max-width: 820px) { .autosave-status { order:3; width:100%; justify-content:center; } }

/* Simplified final Etsy listing details */
.listing-details-copybox,
.batch-listing-details-text {
  white-space: pre-wrap;
  line-height: 1.65;
}

.listing-details-copybox #finalListingDetails {
  display: block;
  padding-right: 8px;
}

.batch-listing-details-block {
  margin-top: 14px;
}

.batch-listing-details-text {
  overflow-wrap: anywhere;
}

/* V24 batch completion tracker and compact digital-file details */
.batch-progress-tracker { margin-top:10px; padding:11px 13px; border:1px solid var(--line); border-radius:13px; background:var(--card); }
.batch-progress-tracker-head { display:flex; justify-content:space-between; align-items:center; gap:12px; font-size:12px; }
.batch-progress-tracker-head span { font-variant-numeric:tabular-nums; font-weight:850; }
.batch-progress-track { height:10px; margin-top:8px; overflow:hidden; border-radius:999px; background:rgba(120,120,130,.14); box-shadow:inset 0 0 0 1px rgba(120,120,130,.08); }
.batch-progress-track > span { display:block; height:100%; min-width:0; border-radius:inherit; background:linear-gradient(90deg,#6f5ef6,#30b6ff); transition:width .35s ease; }
.batch-product-card[data-status="complete"] .batch-progress-track > span { background:linear-gradient(90deg,#147a4b,#35b978); }
.batch-product-card[data-status="failed"] .batch-progress-track > span { background:linear-gradient(90deg,#b42318,#ed6a5a); }
.batch-progress-sub { margin-top:7px; color:var(--muted); font-size:11px; }
.button-link { display:inline-flex; align-items:center; justify-content:center; min-height:38px; padding:9px 14px; border-radius:11px; border:1px solid var(--line); text-decoration:none; font-weight:800; line-height:1; }
.button-link.secondary { background:var(--soft); color:var(--text); }
.button-link:hover { filter:brightness(.98); transform:translateY(-1px); }
.batch-collapsible { margin-top:10px; }
.batch-collapsible > summary { cursor:pointer; font-weight:800; color:var(--text); }
.batch-collapsible[open] > summary { margin-bottom:9px; }
.batch-collapsible .batch-prompt-text { max-height:260px; overflow:auto; white-space:pre-wrap; }
.batch-image-prompt-disclosure > summary {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  list-style:none;
}
.batch-image-prompt-disclosure > summary::-webkit-details-marker { display:none; }
.batch-image-prompt-disclosure > summary::before {
  content:"▸";
  flex:0 0 auto;
  font-size:14px;
  transform:translateY(-1px);
  transition:transform .18s ease;
}
.batch-image-prompt-disclosure[open] > summary::before { transform:rotate(90deg) translateX(1px); }
.batch-image-prompt-disclosure > summary > span { flex:1 1 auto; }
.batch-copy-prompt-button {
  flex:0 0 auto;
  min-height:34px;
  padding:7px 11px;
  border-radius:10px;
  white-space:nowrap;
}
.batch-image-prompt-disclosure .batch-prompt-text {
  max-height:420px;
  margin-top:10px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--card);
  overflow:auto;
}

/* Digital Variation Lab */
.digital-variations-workspace { display: grid; gap: 22px; }
.variations-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center;
  padding: 34px; border-radius: 28px; color: #fff;
  background: radial-gradient(circle at 92% 10%, rgba(255,255,255,.22), transparent 27%), linear-gradient(135deg, #5b21b6, #7c3aed 48%, #0f766e);
  box-shadow: 0 24px 60px rgba(76,29,149,.23);
}
.variations-hero h2 { margin: 6px 0 12px; max-width: 850px; font-size: clamp(1.65rem, 3vw, 2.75rem); line-height: 1.03; color: #fff; }
.variations-hero p { margin: 0; max-width: 900px; color: rgba(255,255,255,.84); line-height: 1.65; }
.variations-hero .section-kicker { color: rgba(255,255,255,.72); }
.variations-hero-badge { width: 142px; height: 142px; display: grid; place-content: center; text-align: center; border-radius: 28px; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.28); backdrop-filter: blur(12px); }
.variations-hero-badge strong { font-size: 3.3rem; line-height: 1; }
.variations-hero-badge span { margin-top: 6px; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.variations-step-heading { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.variations-step-heading h3 { margin: 0 0 4px; }
.variations-input-grid { display: grid; grid-template-columns: minmax(260px, 2fr) minmax(160px, .75fr) minmax(180px, .9fr); gap: 14px; }
.variation-search-preview { margin: 7px 0 0; line-height: 1.35; overflow-wrap: anywhere; }
.variation-search-preview.good { color: var(--success, #16804b); }
.variation-search-preview.bad { color: var(--danger, #b42318); }
.variation-keyword-upload { display:grid; grid-template-columns:minmax(260px,1fr) minmax(300px,1.15fr); gap:14px; align-items:stretch; margin-top:16px; padding:16px; border:1px solid rgba(124,58,237,.16); border-radius:18px; background:rgba(124,58,237,.035); }
.variation-keyword-upload-copy h4 { margin:4px 0 7px; font-size:1rem; }
.variation-keyword-upload-copy p { margin:0; line-height:1.5; }
.variation-keyword-drop-zone { min-height:132px; display:grid; place-content:center; gap:5px; padding:18px; text-align:center; cursor:pointer; border:2px dashed rgba(124,58,237,.35); border-radius:16px; background:var(--card,#fff); transition:border-color .18s ease, background .18s ease, transform .18s ease; }
.variation-keyword-drop-zone:hover,.variation-keyword-drop-zone:focus-visible,.variation-keyword-drop-zone.drag-active { outline:none; border-color:#7c3aed; background:rgba(124,58,237,.07); transform:translateY(-1px); }
.variation-keyword-drop-zone.loading { opacity:.7; pointer-events:none; }
.variation-keyword-drop-zone.loaded { border-style:solid; border-color:rgba(22,128,75,.45); background:rgba(22,128,75,.055); }
.variation-keyword-drop-zone span,.variation-keyword-drop-zone small { color:var(--muted,#667085); }
.variation-keyword-drop-zone small { margin-top:5px; overflow-wrap:anywhere; }
.variation-keyword-summary { grid-column:1 / -1; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px 14px; align-items:center; padding:13px 14px; border:1px solid rgba(22,128,75,.2); border-radius:14px; background:rgba(22,128,75,.05); }
.variation-keyword-summary.hidden { display:none; }
.variation-keyword-summary > div:first-child { display:flex; flex-wrap:wrap; gap:8px 14px; align-items:center; }
.variation-keyword-summary > div:first-child span { color:var(--success,#16804b); font-weight:800; }
.variation-keyword-preview { grid-column:1 / -1; display:flex; flex-wrap:wrap; gap:6px; }
.variation-keyword-preview span { padding:5px 8px; border-radius:999px; background:rgba(124,58,237,.1); font-size:.75rem; }
.variations-actions { margin-top: 16px; }
.variation-progress { margin-top: 16px; padding: 16px; border: 1px solid var(--border, #e5e7eb); border-radius: 16px; background: rgba(124,58,237,.04); }
.variation-progress > div:first-child { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.variation-progress > div:first-child span { color: var(--muted, #667085); }
.variation-live-panel { margin-top: 12px; overflow: hidden; border: 1px solid rgba(124,58,237,.18); border-radius: 15px; background: var(--card, #fff); }
.variation-live-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border-bottom: 1px solid rgba(124,58,237,.12); background: rgba(124,58,237,.045); }
.variation-live-head span { color: var(--muted, #667085); font-variant-numeric: tabular-nums; font-weight: 800; }
.variation-live-updates { max-height: 230px; margin: 0; padding: 5px 14px 8px; overflow: auto; list-style: none; }
.variation-live-updates li { display: grid; grid-template-columns: 82px minmax(0,1fr) auto; gap: 10px; align-items: start; padding: 8px 0; border-bottom: 1px solid rgba(15,23,42,.06); font-size: .84rem; line-height: 1.38; }
.variation-live-updates li:last-child { border-bottom: 0; }
.variation-live-updates time { color: var(--muted, #667085); font-variant-numeric: tabular-nums; }
.variation-live-updates strong { min-width: 42px; text-align: right; color: #6d28d9; font-variant-numeric: tabular-nums; }
.variation-live-updates li.good span { color: var(--success, #16804b); }
.variation-live-updates li.warn span { color: #a15c00; }
.variation-live-updates li.bad span { color: var(--danger, #b42318); }
.variation-research-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 14px; }
.variation-research-card { overflow: hidden; border: 1px solid var(--border, #e5e7eb); border-radius: 16px; background: var(--card, #fff); }
.variation-research-card a { color: inherit; text-decoration: none; }
.variation-research-card img { width: 100%; aspect-ratio: 1 / 1; display: block; object-fit: cover; background: #f3f4f6; }
.variation-research-card div { padding: 11px; }
.variation-research-card strong { display: block; margin-bottom: 5px; font-size: .72rem; color: #7c3aed; }
.variation-research-card span { display: -webkit-box; overflow: hidden; font-size: .84rem; line-height: 1.35; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.variation-analysis-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.variation-analysis-card { padding: 16px; border-radius: 16px; background: rgba(124,58,237,.05); border: 1px solid rgba(124,58,237,.14); }
.variation-analysis-card h3 { margin: 0 0 10px; font-size: .9rem; }
.variation-analysis-card ul { margin: 0; padding-left: 18px; color: var(--muted, #667085); line-height: 1.5; }
.variation-result-list { display: grid; gap: 18px; }
.variation-result-card { border: 1px solid var(--border, #e5e7eb); border-radius: 20px; overflow: hidden; background: var(--card, #fff); }
.variation-result-head { display: flex; justify-content: space-between; gap: 16px; padding: 18px 20px; background: linear-gradient(90deg, rgba(124,58,237,.08), rgba(15,118,110,.06)); }
.variation-result-head h3 { margin: 0 0 5px; }
.variation-result-head p { margin: 0; color: var(--muted, #667085); }
.variation-result-status { align-self: flex-start; white-space: nowrap; }
.variation-result-body { display: grid; grid-template-columns: minmax(220px, 320px) minmax(0, 1fr); gap: 20px; padding: 20px; }
.variation-image-panel img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 16px; background: #f3f4f6; }
.variation-image-placeholder { width: 100%; aspect-ratio: 1 / 1; display: grid; place-content: center; text-align: center; padding: 20px; border: 1px dashed var(--border, #d0d5dd); border-radius: 16px; color: var(--muted, #667085); background: rgba(124,58,237,.03); }
.variation-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.variation-detail-block { padding: 13px; border-radius: 14px; background: rgba(15,23,42,.035); }
.variation-detail-block.wide { grid-column: 1 / -1; }
.variation-detail-block strong { display: block; margin-bottom: 7px; font-size: .73rem; letter-spacing: .06em; text-transform: uppercase; color: #6d28d9; }
.variation-detail-block p { margin: 0; white-space: pre-wrap; line-height: 1.55; }
.variation-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.variation-tags span { padding: 6px 9px; border-radius: 999px; background: rgba(124,58,237,.1); font-size: .78rem; }
.variation-card-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
body[data-active-page="variations"] .brand-mark { background: linear-gradient(135deg, #7c3aed, #0f766e); }
.section-nav.canva-rail .nav-item.product-page-nav.variations.active { background: rgba(124,58,237,.18); color: #fff; }
@media (max-width: 900px) {
  .variations-hero { grid-template-columns: 1fr; }
  .variations-hero-badge { width: 100%; height: auto; padding: 18px; grid-auto-flow: column; gap: 10px; }
  .variations-input-grid, .variation-result-body, .variation-keyword-upload { grid-template-columns: 1fr; }
}
@media (max-width: 620px) { .variation-detail-grid { grid-template-columns: 1fr; } .variation-detail-block.wide { grid-column: auto; } }

/* Digital Variation Lab: optional example references and extracted listing details */
.variation-example-upload { display:grid; grid-template-columns:minmax(260px,1fr) minmax(300px,1.15fr); gap:14px; align-items:stretch; margin-top:16px; padding:16px; border:1px solid rgba(14,116,144,.18); border-radius:18px; background:rgba(14,116,144,.035); }
.variation-example-upload textarea { width:100%; margin-top:7px; resize:vertical; min-height:74px; }
.variation-example-drop-zone { border-color:rgba(14,116,144,.35); }
.variation-example-drop-zone:hover,.variation-example-drop-zone:focus-visible,.variation-example-drop-zone.drag-active { border-color:#0e7490; background:rgba(14,116,144,.07); }
.variation-example-list { grid-column:1 / -1; display:grid; gap:7px; }
.variation-example-item { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; align-items:center; padding:9px 10px; border-radius:10px; background:rgba(255,255,255,.72); border:1px solid rgba(14,116,144,.14); }
.variation-example-item div { min-width:0; }
.variation-example-item strong,.variation-example-item span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.variation-example-item span { color:var(--muted,#667085); font-size:.76rem; margin-top:2px; }
.variation-example-item button { padding:6px 9px; }
.variation-research-card .variation-research-copy { padding:11px; }
.variation-research-card .variation-research-copy > strong { margin-bottom:5px; }
.variation-research-card .variation-research-title { display:-webkit-box; overflow:hidden; font-size:.84rem; line-height:1.35; -webkit-line-clamp:3; -webkit-box-orient:vertical; font-weight:700; }
.variation-research-card .variation-research-description { display:-webkit-box; overflow:hidden; margin-top:8px; color:var(--muted,#667085); font-size:.76rem; line-height:1.42; -webkit-line-clamp:5; -webkit-box-orient:vertical; }
.variation-research-meta { display:flex; flex-wrap:wrap; gap:5px; margin-top:9px; }
.variation-research-meta em { padding:4px 7px; border-radius:999px; background:rgba(22,128,75,.08); color:var(--success,#16804b); font-size:.67rem; font-style:normal; font-weight:800; }
.variation-research-meta em.missing { background:rgba(185,28,28,.07); color:#b91c1c; }
@media (max-width: 800px) { .variation-example-upload { grid-template-columns:1fr; } }

/* Digital Variation Lab: clearly separate the 15 research inputs from selected output packages. */
.variation-output-plan { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-top:16px; padding:15px 17px; border:1px solid rgba(124,58,237,.22); border-radius:16px; background:linear-gradient(135deg,rgba(124,58,237,.08),rgba(14,116,144,.055)); }
.variation-output-plan > div { min-width:190px; }
.variation-output-plan .section-kicker { display:block; margin-bottom:4px; }
.variation-output-plan strong { display:block; font-size:1.08rem; }
.variation-output-plan p { max-width:820px; margin:0; color:var(--muted,#667085); line-height:1.5; }
.variation-primary-image { width:100%; aspect-ratio:1 / 1; object-fit:cover; border-radius:16px; background:#f3f4f6; }
.variation-image-strip { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:5px; margin-top:8px; }
.variation-image-strip a { display:block; overflow:hidden; border-radius:7px; border:1px solid var(--border,#e5e7eb); background:#f3f4f6; }
.variation-image-strip img { width:100%; aspect-ratio:1 / 1; display:block; object-fit:cover; border-radius:0; }
.variation-image-counts { display:flex; flex-wrap:wrap; justify-content:space-between; gap:6px; margin-top:7px; color:var(--muted,#667085); font-size:.72rem; font-weight:800; }
@media (max-width:800px) { .variation-output-plan { align-items:flex-start; flex-direction:column; } }

/* Completed Etsy Product Studio ZIP import */
.completed-zip-import-panel {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--line, rgba(95, 76, 230, .18));
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(111, 94, 246, .06), rgba(48, 182, 255, .045));
}
.completed-zip-import-panel .compact-heading { margin-bottom: 12px; }
.completed-zip-import-panel h3 { margin: 2px 0 4px; }
.completed-batch-drop-zone { margin: 10px 0 12px; min-height: 112px; }
.completed-batch-drop-zone code { overflow-wrap: anywhere; }
body.dark .completed-zip-import-panel { background: linear-gradient(145deg, rgba(124, 58, 237, .10), rgba(14, 116, 144, .08)); }

/* R30 bundled draft extension: Make is intentionally hidden and disabled. */
.etsy-publish-panel { display: none !important; }

/* R40 digital product relationship controls */
.digital-relationship-panel {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid rgba(87, 106, 82, 0.28);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(249, 247, 240, 0.98), rgba(238, 243, 235, 0.92));
}
.digital-relationship-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.digital-relationship-heading strong { display: block; font-size: 1rem; }
.digital-relationship-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.digital-relationship-option,
.digital-preserve-seo-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(70, 84, 67, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  cursor: pointer;
}
.digital-relationship-option:has(input:checked) {
  border-color: rgba(51, 92, 61, 0.8);
  box-shadow: inset 0 0 0 1px rgba(51, 92, 61, 0.22), 0 8px 24px rgba(34, 54, 39, 0.08);
  background: rgba(239, 247, 238, 0.95);
}
.digital-relationship-option input,
.digital-preserve-seo-option input { margin-top: 3px; flex: 0 0 auto; }
.digital-relationship-option span,
.digital-preserve-seo-option span { display:block; flex:1 1 auto; min-width: 0; width:100%; overflow-wrap:anywhere; }
.digital-relationship-option strong,
.digital-preserve-seo-option strong { display: block; color: var(--text, #232622); }
.digital-relationship-option small,
.digital-preserve-seo-option small { display: block; margin-top: 4px; line-height: 1.45; color: var(--muted, #636b63); overflow-wrap:anywhere; }
.digital-relationship-option strong,
.digital-preserve-seo-option strong { overflow-wrap:anywhere; }
.digital-relationship-option,
.digital-preserve-seo-option { min-width:0; }
.digital-preserve-seo-option { margin-top: 12px; cursor: default; }
.digital-product-direction-summary {
  margin: 12px 0;
  padding: 12px 14px;
  border-left: 4px solid #587056;
  border-radius: 10px;
  background: rgba(88, 112, 86, 0.09);
  line-height: 1.5;
}
@media (max-width: 820px) {
  .digital-relationship-options { grid-template-columns: 1fr; }
  .digital-relationship-heading { flex-direction: column; }
}

/* R42 relationship-card layout hardening.
   Global form rules set every input to width:100%; radio/checkbox controls must opt out. */
.digital-relationship-options {
  align-items: stretch;
}
.digital-relationship-option,
.digital-preserve-seo-option {
  display: grid !important;
  grid-template-columns: 18px minmax(0, 1fr) !important;
  align-items: start !important;
  column-gap: 12px !important;
  min-width: 0 !important;
  height: auto !important;
}
.digital-relationship-option input[type="radio"],
.digital-preserve-seo-option input[type="checkbox"] {
  width: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  max-height: 18px !important;
  margin: 2px 0 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  flex: none !important;
}
.digital-relationship-option > span,
.digital-preserve-seo-option > span {
  display: block !important;
  min-width: 0 !important;
  width: auto !important;
  max-width: 100% !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  writing-mode: horizontal-tb !important;
}
.digital-relationship-option strong,
.digital-relationship-option small,
.digital-preserve-seo-option strong,
.digital-preserve-seo-option small {
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  writing-mode: horizontal-tb !important;
}
@media (max-width: 980px) {
  .digital-relationship-options { grid-template-columns: 1fr !important; }
}

/* R70 product-version slider and canonical-anchor status */
.digital-version-slider {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(88, 112, 86, 0.26);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
}
.digital-version-slider-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.digital-version-slider-heading strong { display: block; }
.digital-version-slider-heading small {
  display: block;
  margin-top: 4px;
  line-height: 1.45;
  color: var(--muted, #636b63);
}
.digital-version-badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(88, 112, 86, 0.13);
  color: var(--text, #232622);
  font-size: .78rem;
  font-weight: 900;
  white-space: nowrap;
}
.digital-version-slider input[type="range"],
.product-version-slider input[type="range"] {
  width: 100% !important;
  margin: 14px 0 7px !important;
  accent-color: #587056;
}
.digital-version-scale {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted, #636b63);
  font-size: .74rem;
  font-weight: 750;
}
.digital-version-scale span:last-child { text-align: right; }
.digital-version-current {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(88, 112, 86, 0.08);
  line-height: 1.45;
}
.product-version-slider {
  grid-column: 1 / -1;
  padding: 12px 14px;
  border: 1px solid rgba(88, 112, 86, 0.22);
  border-radius: 12px;
  background: rgba(88, 112, 86, 0.06);
}
.product-version-slider .digital-version-current { margin-top: 8px; }
@media (max-width: 680px) {
  .digital-version-slider-heading { flex-direction: column; }
  .digital-version-scale { font-size: .69rem; }
}

/* R71 — separate SAME vs DIFFERENT digital prompt families */
.digital-prompt-family-selector {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(95, 119, 89, .28);
  border-radius: 18px;
  background: rgba(255, 255, 255, .72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}
.digital-prompt-family-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.digital-prompt-family-heading strong,
.digital-prompt-family-heading small { display: block; }
.digital-prompt-family-heading small {
  margin-top: 5px;
  color: var(--muted, #686876);
  line-height: 1.45;
}
.digital-prompt-family-badge {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(67, 112, 78, .12);
  color: #285f3a;
  font-size: .76rem;
  font-weight: 800;
  white-space: nowrap;
}
.digital-prompt-family-badge.related {
  background: rgba(116, 78, 255, .13);
  color: #5f3fd7;
}
.digital-prompt-family-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.digital-prompt-family-button {
  min-height: 82px;
  padding: 15px 16px;
  border: 2px solid rgba(104, 106, 119, .2);
  border-radius: 16px;
  background: rgba(255,255,255,.82);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.digital-prompt-family-button:hover { transform: translateY(-1px); }
.digital-prompt-family-button strong,
.digital-prompt-family-button span { display: block; }
.digital-prompt-family-button strong { font-size: .92rem; }
.digital-prompt-family-button span {
  margin-top: 5px;
  color: var(--muted, #686876);
  font-size: .78rem;
}
.digital-prompt-family-button.same.active {
  border-color: rgba(48, 112, 66, .72);
  background: rgba(69, 128, 83, .1);
  box-shadow: 0 0 0 3px rgba(69,128,83,.08);
}
.digital-prompt-family-button.related.active {
  border-color: rgba(116, 78, 255, .8);
  background: rgba(116, 78, 255, .09);
  box-shadow: 0 0 0 3px rgba(116,78,255,.08);
}
.digital-prompt-family-status {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(80, 91, 78, .07);
  color: var(--text, #27272d);
  font-size: .82rem;
  line-height: 1.45;
}
.digital-prompt-loader-actions .digital-same-loader,
.digital-prompt-loader-actions .digital-related-loader {
  border-width: 2px;
}
.digital-prompt-loader-actions .digital-same-loader.active {
  border-color: rgba(48,112,66,.72);
  background: rgba(69,128,83,.12);
}
.digital-prompt-loader-actions .digital-related-loader.active {
  border-color: rgba(116,78,255,.8);
  background: rgba(116,78,255,.12);
}
.digital-prompt-loader-help {
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 4px solid rgba(69,128,83,.7);
  border-radius: 8px;
  background: rgba(69,128,83,.07);
}
.digital-prompt-loader-help.related {
  border-left-color: rgba(116,78,255,.82);
  background: rgba(116,78,255,.07);
}
body.dark .digital-prompt-family-selector,
body.dark .digital-prompt-family-button {
  background: rgba(255,255,255,.045);
}
@media (max-width: 760px) {
  .digital-prompt-family-heading { flex-direction: column; }
  .digital-prompt-family-buttons { grid-template-columns: 1fr; }
  .digital-prompt-family-badge { white-space: normal; }
}

/* R118 — permanent prior-product history */
.product-history-section {
  scroll-margin-top: 24px;
}
.product-history-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) minmax(180px, .7fr) auto;
  gap: 14px;
  align-items: end;
  margin: 16px 0;
}
.product-history-toolbar-actions {
  margin: 0;
  align-self: end;
}
.product-history-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.product-history-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line, #d9d9df);
  border-radius: 16px;
  background: var(--card, #fff);
  box-shadow: 0 6px 20px rgba(31, 35, 48, .06);
}
.product-history-card-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 1rem;
}
.history-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .02em;
  background: #eef1f6;
}
.history-completed,
.history-imported { background: #e6f6ed; color: #17643a; }
.history-previously-completed { background: #def8f1; color: #0c6a55; border: 1px solid #a9dfd1; }
.history-declined,
.history-failed { background: #fff0ef; color: #9d2c25; }
.history-queued,
.history-processing { background: #fff6dc; color: #7a5710; }
.history-redo { background: #eee9ff; color: #5537a5; }
.history-final-title {
  margin-top: 6px;
  font-size: .9rem;
  font-weight: 650;
}
.history-meta {
  margin-top: 6px;
  color: var(--muted, #657080);
  font-size: .82rem;
  line-height: 1.45;
}
.product-history-card a {
  display: inline-block;
  margin-top: 8px;
  font-size: .84rem;
}
.product-history-actions {
  display: flex;
  justify-content: flex-end;
}
@media (max-width: 850px) {
  .product-history-toolbar,
  .product-history-card {
    grid-template-columns: 1fr;
  }
  .product-history-actions {
    justify-content: stretch;
  }
  .product-history-actions button {
    width: 100%;
  }
}

/* R160 live per-image progress and dependency-aware ETA */
.generation-image-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
  margin-top:10px;
}
.generation-image-row {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:5px 10px;
  align-items:center;
  padding:8px 9px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--panel-solid);
  min-width:0;
}
.generation-image-copy { min-width:0; }
.generation-image-copy strong { display:block; font-size:.76rem; }
.generation-image-copy span {
  display:block;
  margin-top:2px;
  color:var(--muted);
  font-size:.68rem;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.035em;
  overflow-wrap:anywhere;
}
.generation-image-time {
  color:var(--muted);
  font-size:.7rem;
  font-weight:750;
  text-align:right;
  white-space:normal;
}
.generation-image-track {
  grid-column:1 / -1;
  height:6px;
  overflow:hidden;
  border-radius:999px;
  background:var(--bg);
  border:1px solid var(--line);
}
.generation-image-track span {
  display:block;
  width:0;
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg,var(--accent),var(--teal));
  transition:width .35s ease;
}
.generation-image-row.complete { border-color:var(--good); background:var(--good-soft); }
.generation-image-row.complete .generation-image-track span { background:var(--good); }
.generation-image-row.failed { border-color:var(--bad); background:var(--bad-soft); }
.generation-image-row.failed .generation-image-track span { background:var(--bad); }
.generation-image-row.cancelled { border-color:#e6a93f; background:#fff8ea; }
@media (max-width:720px) {
  .generation-image-grid { grid-template-columns:1fr; }
  .generation-monitor-meta { align-items:flex-start; flex-direction:column; }
  .generation-image-time { max-width:52%; }
}

/* R160 live progress turbo refresh */
.generation-monitor-head .generation-notify-toggle{align-self:flex-start;}



/* R160 batch product live image tracker */
.batch-live-image-tracker{margin-top:12px;padding:12px;border:1px solid var(--line);border-radius:14px;background:var(--panel-solid);}
.batch-live-image-tracker-header{display:flex;justify-content:space-between;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:10px;font-size:.83rem;}
.batch-live-image-tracker-header span{color:var(--muted);font-size:.77rem;}
.batch-mini-image-section + .batch-mini-image-section{margin-top:10px;}
.batch-mini-image-heading{margin-bottom:6px;font-size:.78rem;font-weight:800;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;}
.batch-mini-image-note{margin:-2px 0 10px;padding:8px 10px;border-radius:10px;background:var(--good-soft);color:var(--good);font-size:.76rem;font-weight:800;line-height:1.35;}
.batch-mini-image-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(86px,1fr));gap:8px;}
.batch-mini-image-slot{padding:8px;border-radius:10px;border:1px solid var(--line);background:var(--bg);display:grid;gap:2px;min-height:58px;align-content:start;}
.batch-mini-image-slot span{font-weight:900;font-size:.82rem;}
.batch-mini-image-slot small{font-size:.7rem;color:var(--muted);line-height:1.2;}
.batch-mini-image-slot.ready{background:var(--good-soft);border-color:transparent;}
.batch-mini-image-slot.ready span,.batch-mini-image-slot.ready small{color:var(--good);}
.batch-mini-image-slot.active{background:var(--accent-soft);border-color:transparent;}
.batch-mini-image-slot.active span,.batch-mini-image-slot.active small{color:var(--accent);}
.batch-mini-image-slot.failed{background:var(--bad-soft);border-color:transparent;}
.batch-mini-image-slot.failed span,.batch-mini-image-slot.failed small{color:var(--bad);}
.batch-mini-image-slot.waiting{background:var(--warn-soft);border-color:transparent;}
.batch-mini-image-slot.waiting span,.batch-mini-image-slot.waiting small{color:var(--warn);}


/* R160 dominant-variant master lock */


/* R160 ultra-detailed prompt contracts */


/* R196: prominent synchronized image-quality buttons */
.image-quality-choice-panel {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--border, #d9d9df) 76%, #7c3aed 24%);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface, #ffffff) 94%, #7c3aed 6%);
  box-shadow: 0 12px 34px rgba(50, 34, 94, .08);
}
.image-quality-choice-panel.prominent { border-width: 2px; }
.image-quality-choice-panel.compact { margin: 16px 0 22px; }
.image-quality-choice-panel.studio { margin: 0; padding: 12px; }
.image-quality-choice-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.image-quality-choice-heading strong { display: block; font-size: 1rem; }
.image-quality-choice-heading .help { margin: 5px 0 0; }
.image-quality-current-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 11px;
  border-radius: 999px;
  background: #5b21b6;
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .01em;
}
.image-quality-choice-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.image-quality-choice-button {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 86px;
  padding: 14px;
  border: 2px solid color-mix(in srgb, var(--border, #d9d9df) 86%, #7c3aed 14%);
  border-radius: 15px;
  background: var(--surface, #fff);
  color: var(--text, #1d1b24);
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.image-quality-choice-button:hover {
  transform: translateY(-1px);
  border-color: #8b5cf6;
  box-shadow: 0 10px 26px rgba(91, 33, 182, .13);
}
.image-quality-choice-button:focus-visible {
  outline: 3px solid rgba(124, 58, 237, .28);
  outline-offset: 2px;
}
.image-quality-choice-button.active,
.image-quality-choice-button[aria-pressed="true"] {
  border-color: #6d28d9;
  background: color-mix(in srgb, var(--surface, #fff) 88%, #8b5cf6 12%);
  box-shadow: 0 12px 30px rgba(91, 33, 182, .18);
}
.image-quality-choice-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface, #fff) 70%, #7c3aed 30%);
  color: #4c1d95;
  font-size: 1rem;
  font-weight: 900;
}
.image-quality-choice-button.active .image-quality-choice-icon { background: #6d28d9; color: #fff; }
.image-quality-choice-button strong { display: block; font-size: .98rem; }
.image-quality-choice-button small { display: block; margin-top: 4px; color: var(--muted, #686471); line-height: 1.3; }
.image-quality-choice-check {
  min-width: 58px;
  padding: 5px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface, #fff) 76%, #ddd 24%);
  color: var(--muted, #686471);
  font-size: .72rem;
  font-weight: 800;
  text-align: center;
}
.image-quality-choice-button.active .image-quality-choice-check { background: #6d28d9; color: #fff; }
.image-quality-field { grid-column: 1 / -1; }
.image-quality-field #kieResolution { margin-top: 10px; }
body.dark .image-quality-choice-panel,
html[data-theme="dark"] .image-quality-choice-panel {
  background: rgba(91, 33, 182, .12);
  border-color: rgba(167, 139, 250, .48);
}
body.dark .image-quality-choice-button,
html[data-theme="dark"] .image-quality-choice-button {
  background: rgba(26, 23, 36, .96);
  color: #f8f7fb;
  border-color: rgba(167, 139, 250, .32);
}
body.dark .image-quality-choice-button.active,
html[data-theme="dark"] .image-quality-choice-button.active {
  background: rgba(109, 40, 217, .28);
  border-color: #a78bfa;
}
body.dark .image-quality-choice-icon,
html[data-theme="dark"] .image-quality-choice-icon { color: #ede9fe; }
@media (max-width: 760px) {
  .image-quality-choice-heading { flex-direction: column; }
  .image-quality-choice-buttons { grid-template-columns: 1fr; }
  .image-quality-choice-button { min-height: 78px; }
}


/* R244: universal image-prompt routing plus preserved editable digital output controls. */
.product-digital-output-controls {
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid rgba(101, 82, 232, .22);
  border-radius: 16px;
  background: rgba(101, 82, 232, .045);
}
.product-digital-output-controls .help { margin-top: 7px; line-height: 1.42; }
.digital-output-lock-status {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 14px;
  padding: 11px 13px;
  border-radius: 13px;
  border: 1px solid rgba(15, 139, 105, .26);
  background: rgba(15, 139, 105, .07);
}
.digital-output-lock-status.manual {
  border-color: rgba(101, 82, 232, .34);
  background: rgba(101, 82, 232, .08);
}
.digital-output-lock-status span { color: var(--muted); font-size: 12px; line-height: 1.45; }
#globalDigitalControls .digital-config-grid.global { display: grid !important; }

/* R294: single-product catalog database filter */
.catalog-single-product-filter {
  margin-top: 12px;
}
.catalog-single-product-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-weight: 800;
  color: var(--text, #191827);
}
.catalog-single-product-toggle input {
  width: 18px;
  height: 18px;
}

/* R298: removed-row drawer and blank-search database visibility */
.catalog-filter-removal-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(101, 82, 232, .18);
  border-radius: 14px;
  background: rgba(101, 82, 232, .045);
  color: var(--text, #191827);
}
.catalog-filter-removal-summary strong { font-weight: 900; }
.catalog-filter-removal-summary span { color: var(--muted, #6b687a); font-weight: 700; }
.catalog-filter-removal-summary small { flex-basis: 100%; color: var(--muted, #6b687a); font-weight: 700; }
.catalog-removed-rows-disclosure {
  margin-top: 12px;
  border: 1px solid rgba(101, 82, 232, .18);
  border-radius: 16px;
  background: var(--card, #fff);
  overflow: hidden;
}
.catalog-removed-rows-disclosure summary {
  cursor: pointer;
  padding: 13px 15px;
  font-weight: 900;
  color: var(--text, #191827);
  user-select: none;
}
.catalog-removed-rows-disclosure[open] summary { border-bottom: 1px solid rgba(101, 82, 232, .14); }
.catalog-removed-rows-body { padding: 12px; }
.catalog-filter-removed-note,
.catalog-filter-removed-empty {
  margin-bottom: 10px;
  color: var(--muted, #6b687a);
  font-weight: 700;
  line-height: 1.45;
}
.catalog-filter-removed-list {
  display: grid;
  gap: 9px;
  max-height: 460px;
  overflow: auto;
  padding-right: 4px;
}
.catalog-filter-removed-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid rgba(101, 82, 232, .14);
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
}
.catalog-filter-removed-row strong,
.catalog-filter-removed-row a,
.catalog-filter-removed-row small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catalog-filter-removed-row a { margin-top: 4px; color: var(--accent, #5b4df5); }
.catalog-filter-removed-row small { margin-top: 5px; color: var(--muted, #6b687a); font-weight: 700; }
.catalog-filter-removed-row > span {
  justify-self: end;
  max-width: 220px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(101, 82, 232, .12);
  color: var(--accent, #4c3fe8);
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}
body.dark .catalog-filter-removal-summary,
html[data-theme="dark"] .catalog-filter-removal-summary,
body.dark .catalog-removed-rows-disclosure,
html[data-theme="dark"] .catalog-removed-rows-disclosure {
  background: rgba(124, 58, 237, .10);
  border-color: rgba(167, 139, 250, .28);
}
body.dark .catalog-filter-removed-row,
html[data-theme="dark"] .catalog-filter-removed-row {
  background: rgba(15, 23, 42, .58);
  border-color: rgba(167, 139, 250, .22);
}
body.dark .catalog-filter-removed-row > span,
html[data-theme="dark"] .catalog-filter-removed-row > span {
  color: #ede9fe;
  background: rgba(167, 139, 250, .20);
}
@media (max-width: 760px) {
  .catalog-filter-removed-row { grid-template-columns: 1fr; }
  .catalog-filter-removed-row > span { justify-self: start; max-width: 100%; text-align: left; }
}

/* R298: permanent database delete controls */
.catalog-database-selection-toolbar .secondary.danger {
  border-color: rgba(220, 38, 38, .22);
  background: rgba(220, 38, 38, .08);
  color: #9f1239;
}
.catalog-database-selection-toolbar .secondary.danger:hover:not(:disabled) {
  border-color: rgba(220, 38, 38, .42);
  background: rgba(220, 38, 38, .13);
}
body.dark .catalog-database-selection-toolbar .secondary.danger,
html[data-theme="dark"] .catalog-database-selection-toolbar .secondary.danger {
  color: #fecdd3;
  border-color: rgba(251, 113, 133, .35);
  background: rgba(127, 29, 29, .28);
}
.catalog-single-product-toggle input:disabled + span,
.catalog-single-product-toggle:has(input:disabled) {
  opacity: .86;
  cursor: not-allowed;
}

/* R305: database-mode research cards for Variation Lab */
.variation-research-card.database-only .variation-research-placeholder {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  padding: 1rem;
  border-radius: 18px;
  border: 1px dashed rgba(111, 85, 255, 0.35);
  background: rgba(255, 255, 255, 0.72);
  color: #262238;
}
.variation-research-placeholder span {
  color: rgba(38, 34, 56, 0.65);
  font-size: 0.86rem;
}

/* R410: collapsible final listing details with one-click copy. */
.listing-details-disclosure,
.batch-listing-details-disclosure {
  overflow: hidden;
}
.listing-details-disclosure > summary,
.batch-listing-details-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.listing-details-disclosure > summary::-webkit-details-marker,
.batch-listing-details-disclosure > summary::-webkit-details-marker { display: none; }
.listing-details-disclosure > summary::before,
.batch-listing-details-disclosure > summary::before {
  content: "▾";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 2px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
}
.listing-details-disclosure:not([open]) > summary::before,
.batch-listing-details-disclosure:not([open]) > summary::before { content: "▸"; }
.listing-details-disclosure > summary > span,
.batch-listing-details-disclosure > summary > span { flex: 1; min-width: 0; }
.listing-details-disclosure .listing-details-copybox { margin-top: 10px; }
.batch-listing-details-disclosure .batch-listing-details-text { margin-top: 10px; }
.batch-copy-listing-button,
.listing-details-disclosure > summary button {
  flex: 0 0 auto;
  min-height: 32px;
}


/* R424 — prior-product redo button click/layout repair */
.product-history-card {
  overflow: visible;
}
.product-history-card-main {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.product-history-actions {
  position: relative;
  z-index: 3;
  min-width: 148px;
  display: grid;
  gap: 8px;
  justify-items: stretch;
}
.history-queue-state {
  display: block;
  max-width: 190px;
  color: #14734a;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}
.product-history-actions .history-redo-button {
  pointer-events: auto;
  min-height: 44px;
  min-width: 142px;
  white-space: nowrap;
  cursor: pointer;
}
.product-history-actions .history-redo-button:disabled {
  cursor: not-allowed;
  opacity: .62;
}
.product-history-actions .history-redo-button.history-redo-working {
  opacity: .82;
}
@media (max-width: 900px) {
  .product-history-card {
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: stretch;
  }
  .history-card-selector,
  .product-history-card-main,
  .product-history-actions {
    grid-column: 1 / -1 !important;
  }
  .history-card-selector {
    display: inline-flex;
    justify-content: flex-start;
    justify-items: start;
  }
  .product-history-actions {
    min-width: 0;
    justify-content: stretch;
  }
  .product-history-actions .history-redo-button {
    width: 100%;
  }
}


/* R459: keep top automation action buttons physically clickable above helper/status panels. */
.automation-actions,
.actions.automation-actions {
  position: relative;
  z-index: 50;
  pointer-events: auto;
}
#automationRunButton,
#automationContinueButton,
#automationPickButton,
#openBatchResultsButton {
  position: relative;
  z-index: 51;
  pointer-events: auto !important;
  cursor: pointer;
}
#automationRunButton[aria-disabled="false"],
#automationContinueButton[aria-disabled="false"] {
  opacity: 1;
  filter: none;
}


/* R460: interface self-diagnostic guard for top automation buttons. */
.automation-actions,
.actions.automation-actions {
  isolation: isolate;
  position: relative;
  z-index: 500;
  pointer-events: auto;
}
#automationRunButton,
#automationContinueButton,
#automationPickButton,
#openBatchResultsButton {
  position: relative;
  z-index: 501;
  pointer-events: auto !important;
  touch-action: manipulation;
}


/* R463: completed digital products get a visible download strip above the details grid. */
.batch-ready-download-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid rgba(16, 185, 129, 0.25);
  background: rgba(16, 185, 129, 0.08);
  border-radius: 16px;
}
.batch-ready-download-strip button,
.batch-ready-download-strip .button-link {
  position: relative;
  z-index: 30;
  pointer-events: auto !important;
}
.button-link.disabled,
.button-link[aria-disabled="true"] {
  opacity: 0.75;
  cursor: default;
  pointer-events: none;
}


.batch-live-preview-strip{display:flex;gap:10px;flex-wrap:wrap;margin:12px 0 14px}.batch-live-preview{display:block;width:72px;height:72px;border-radius:12px;overflow:hidden;border:1px solid rgba(17,24,39,.1);background:#fff}.batch-live-preview img{display:block;width:100%;height:100%;object-fit:cover}.dark .batch-live-preview{background:#111827;border-color:rgba(255,255,255,.1)}




/* R497 stable low-end rendering + first-click responsiveness */
html { scroll-behavior: auto !important; background: var(--premium-bg, var(--bg)); }
body { min-height: 100vh; background-color: var(--premium-bg, var(--bg)) !important; background-image: none !important; }
body::before, .r119-ambient, .r119-page-grain { display: none !important; }

/* content-visibility caused white/empty blocks while fast-scrolling on slower PCs. */
#batchResultsList > *,
#automationApprovalList > *,
.product-history-list > *,
.batch-result-card,
.approval-product-card,
.product-history-card,
.automation-card,
.history-card {
  content-visibility: visible !important;
  contain: none !important;
}

/* Solid surfaces avoid transparent/blur repaint flashes. */
.app-header,
.card,
.workspace-card,
.batch-result-card,
.approval-product-card,
.product-history-card,
.generation-sheet-card,
.batch-live-image-tracker,
.status,
.panel {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  background-color: var(--premium-surface, var(--panel-solid)) !important;
}

/* Reduce costly paint effects without hiding any content. */
.card,
.workspace-card,
.batch-result-card,
.approval-product-card,
.product-history-card,
.app-header {
  box-shadow: 0 2px 12px rgba(31, 35, 56, .07) !important;
}

button,
a.button,
[role="button"],
input,
select,
textarea {
  touch-action: manipulation;
}
button,
a.button,
.nav-item,
.r119-dock-button {
  transition: none !important;
  animation: none !important;
}
button:active,
a.button:active,
.nav-item:active { transform: none !important; }

/* Keep images and cards painted with a stable placeholder while decoding. */
img { background-color: var(--premium-surface-soft, var(--panel-solid)); }
.gallery img,
.batch-live-preview img,
.batch-result-card img { min-height: 1px; }

@media (prefers-reduced-motion: reduce), (max-resolution: 1.25dppx) {
  * { animation: none !important; transition: none !important; }
}


/* R514: stable low-end-PC rendering without content-visibility white flashes. */
.batch-product-card,.product-history-card{contain:layout paint style;}
.batch-actions-disabled [data-download-product-zip],button[data-download-product-zip][disabled]{pointer-events:none;opacity:.48;cursor:not-allowed;}
.batch-finalizing-download-strip{min-height:58px;}
html.product-studio-ui-ready body{visibility:visible;}

/* R533 live buyer-PDF timer and stage-aware ETA */
.buyer-pdf-live-timing {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(190px, 1.5fr) repeat(5, minmax(110px, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent, #6d5dfc) 24%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--card) 88%, rgba(109,93,252,.08));
}
.buyer-pdf-timing-cell {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: color-mix(in srgb, var(--card) 94%, transparent);
}
.buyer-pdf-timing-cell small {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.buyer-pdf-timing-cell strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}
.buyer-pdf-timing-note {
  margin: 7px 3px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
@media (max-width: 1100px) {
  .buyer-pdf-live-timing { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .buyer-pdf-timing-cell:first-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .buyer-pdf-live-timing { grid-template-columns: 1fr; }
  .buyer-pdf-timing-cell:first-child { grid-column: auto; }
}


/* R533 buyer-PDF process explanations and diagnostics */
.buyer-pdf-process-breakdown {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 92%, var(--accent, #6d5dfc) 8%);
  border-radius: 14px;
  background: color-mix(in srgb, var(--card) 96%, rgba(109,93,252,.04));
}
.buyer-pdf-process-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .01em;
}
.buyer-pdf-process-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.buyer-pdf-process-compact > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.buyer-pdf-process-compact span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.buyer-pdf-process-compact.is-failed {
  border-color: color-mix(in srgb, #d94b4b 42%, var(--line));
}
@media (max-width: 640px) {
  .buyer-pdf-process-compact { align-items: stretch; flex-direction: column; }
}
.buyer-pdf-process-subheading {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.buyer-pdf-process-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.buyer-pdf-process-step {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--card) 97%, transparent);
}
.buyer-pdf-process-step.is-current {
  border-color: color-mix(in srgb, var(--accent, #6d5dfc) 45%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent, #6d5dfc) 18%, transparent) inset;
  background: color-mix(in srgb, var(--card) 90%, rgba(109,93,252,.08));
}
.buyer-pdf-process-step.is-done,
.buyer-pdf-process-step.is-passed {
  border-color: color-mix(in srgb, #18a957 22%, var(--line));
}
.buyer-pdf-process-step.is-failed {
  border-color: color-mix(in srgb, #d94b4b 42%, var(--line));
  background: color-mix(in srgb, var(--card) 91%, rgba(217,75,75,.09));
}
.buyer-pdf-process-step-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.buyer-pdf-process-step-head strong {
  font-size: 12px;
  line-height: 1.35;
}
.buyer-pdf-process-step-head span {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--line) 70%, transparent);
  color: var(--muted);
}
.buyer-pdf-process-step.is-current .buyer-pdf-process-step-head span {
  background: color-mix(in srgb, var(--accent, #6d5dfc) 20%, transparent);
  color: var(--accent, #6d5dfc);
}
.buyer-pdf-process-step.is-done .buyer-pdf-process-step-head span,
.buyer-pdf-process-step.is-passed .buyer-pdf-process-step-head span {
  background: color-mix(in srgb, #18a957 16%, transparent);
  color: #16834a;
}
.buyer-pdf-process-step.is-failed .buyer-pdf-process-step-head span {
  background: color-mix(in srgb, #d94b4b 16%, transparent);
  color: #b63232;
}
.buyer-pdf-process-step-body,
.buyer-pdf-process-step-diagnosis {
  font-size: 11px;
  line-height: 1.52;
}
.buyer-pdf-process-step-diagnosis {
  margin-top: 7px;
  color: var(--muted);
}
@media (max-width: 900px) {
  .buyer-pdf-process-grid { grid-template-columns: 1fr; }
}


/* R533 current-stage timing diagnostic */
.buyer-pdf-current-step-time {
  margin: -1px 0 8px;
  padding: 6px 8px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent, #6d5dfc) 9%, transparent);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.buyer-pdf-current-step-time.is-overdue {
  background: color-mix(in srgb, #d97706 13%, transparent);
  color: color-mix(in srgb, #d97706 75%, var(--ink));
}
.buyer-pdf-current-step-time.is-overdue::after {
  content: " · taking longer than this stage's normal budget";
  font-weight: 750;
}

.buyer-pdf-completed-step-time {
  margin: -1px 0 8px;
  color: #16834a;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}
