:root {
  --bg: #f6f6f7;
  --surface: #fff;
  --surface-soft: #fafafa;
  --ink: #202223;
  --muted: #6d7175;
  --border: #dcdfe3;
  --border-strong: #babfc4;
  --gold: #c5a24f;
  --green: #008060;
  --red: #d72c0d;
  --blue: #2c6ecb;
  --green-soft: #e5f3ef;
  --red-soft: #fff0f0;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.05), 0 8px 24px rgba(33, 43, 54, 0.08);
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: #111213;
  color: #fff;
  padding: 22px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  padding: 8px;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 28px;
}

.brand strong,
.brand small,
.connection-card strong,
.connection-card span {
  display: block;
}

.brand small,
.connection-card span {
  color: #b5b7ba;
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: #e8e8e8;
  padding: 10px 12px;
  text-align: left;
}

.nav-item:hover,
.nav-item.is-active {
  background: #26282a;
  color: #fff;
}

.nav-item.is-active {
  box-shadow: inset 3px 0 0 var(--gold);
}

.nav-item svg,
.primary-button svg,
.secondary-button svg,
.icon-button svg {
  width: 17px;
  height: 17px;
}

.connection-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: auto;
  border: 1px solid #33363a;
  border-radius: var(--radius);
  padding: 12px;
  background: #1b1c1e;
}

.status-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: #8c9196;
  box-shadow: 0 0 0 4px rgba(140, 145, 150, 0.18);
}

.connection-card.is-connected .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(0, 128, 96, 0.2);
}

.connection-card.is-error .status-dot {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(215, 44, 13, 0.2);
}

.main-shell {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 82px;
  border-bottom: 1px solid var(--border);
  background: rgba(246, 246, 247, 0.94);
  padding: 18px 32px;
  backdrop-filter: blur(10px);
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.2;
}

h2 {
  margin-bottom: 4px;
  font-size: 18px;
  line-height: 1.3;
}

p {
  color: var(--muted);
}

main {
  padding: 28px 32px 48px;
}

.topbar-actions,
.action-row,
.publish-bar,
.draft-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  border-radius: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

.primary-button {
  border-color: #111;
  background: #111;
  color: #fff;
  font-weight: 650;
}

.primary-button:hover {
  background: #2c2d2f;
}

.secondary-button:hover {
  border-color: #8c9196;
  background: #f9fafb;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.summary-grid-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
  gap: 18px;
  margin-bottom: 18px;
}

.panel.dashboard-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 220px;
  background:
    linear-gradient(110deg, rgba(17, 18, 19, 0.98), rgba(39, 35, 27, 0.94)),
    #111213;
  color: #fff;
}

.panel.dashboard-welcome h2 {
  max-width: 620px;
  margin-bottom: 10px;
  font-size: 30px;
}

.panel.dashboard-welcome p {
  max-width: 650px;
  margin-bottom: 0;
  color: #d5d6d8;
  font-size: 15px;
}

.section-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.welcome-actions {
  display: grid;
  flex: 0 0 190px;
  gap: 8px;
}

.panel.dashboard-welcome .secondary-button {
  border-color: #55585b;
  background: transparent;
  color: #fff;
}

.process-list {
  display: grid;
  gap: 9px;
}

.process-list > div {
  display: grid;
  grid-template-columns: 34px 110px 1fr;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 9px;
}

.process-list > div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.process-list span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 12px;
  font-weight: 750;
}

.process-list small {
  color: var(--muted);
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 6px 0;
  font-weight: 650;
}

.text-button svg {
  width: 16px;
  height: 16px;
}

.metric-card,
.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 18px;
}

.metric-label,
.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.metric-card strong {
  display: block;
  margin-bottom: 2px;
  font-size: 25px;
  line-height: 1.2;
}

.metric-card small {
  color: var(--muted);
}

.product-workspace,
.usage-grid,
.settings-grid {
  display: grid;
  grid-template-columns: minmax(380px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  margin-bottom: 18px;
}

.creator-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px 18px;
  box-shadow: var(--shadow);
}

.creator-status strong,
.creator-status small {
  display: block;
}

.creator-status small {
  color: var(--muted);
}

.mode-note {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 520px;
  border-radius: 6px;
  background: #fff7e6;
  color: #5c4716;
  padding: 9px 12px;
}

.mode-note svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
}

.panel {
  padding: 18px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.panel-header p {
  margin-bottom: 0;
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: 178px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, #fbfbfb);
  padding: 20px;
  text-align: center;
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.dropzone-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 999px;
  background: #f4ead2;
  color: #80631b;
}

.dropzone small,
.empty-line,
.draft-item span {
  color: var(--muted);
}

.image-preview {
  display: grid;
  min-height: 320px;
  place-items: center;
  margin: 14px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #eee;
  overflow: hidden;
}

.image-preview.is-empty {
  background: var(--surface-soft);
}

.image-preview img {
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: cover;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  font-weight: 400;
}

input,
select {
  height: 42px;
  min-height: 42px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #111;
  outline: 2px solid rgba(197, 162, 79, 0.24);
}

.full-span {
  grid-column: 1 / -1;
}

.generated-card {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 14px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 160px;
  color: var(--muted);
  text-align: center;
}

.empty-state svg {
  width: 32px;
  height: 32px;
  margin-bottom: 8px;
}

.empty-state strong,
.empty-state span {
  display: block;
}

.generated-summary {
  display: grid;
  gap: 12px;
}

.generated-summary strong {
  display: block;
}

.editor-panel {
  margin-top: 0;
}

.chip,
.toast {
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
}

.chip {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 4px 10px;
  background: var(--green-soft);
  color: var(--green);
  white-space: nowrap;
}

.variant-preview {
  margin-top: 16px;
}

.variant-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.variant-head strong {
  display: block;
  margin-bottom: 4px;
}

.variant-head small {
  display: block;
}

.variant-head span {
  color: var(--muted);
}

.variant-table {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.variant-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  border-top: 1px solid var(--border);
  padding: 9px 12px;
}

.variant-row:first-child {
  border-top: 0;
}

.variant-row-head {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.variant-more {
  padding: 9px 12px;
  color: var(--muted);
}

.publish-bar {
  justify-content: space-between;
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: #fffaf0;
}

.publish-bar strong,
.publish-bar span {
  display: block;
}

.publish-bar span {
  color: var(--muted);
}

.queue-list {
  display: grid;
  gap: 10px;
}

.products-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.search-field {
  position: relative;
  flex: 1;
  max-width: 560px;
}

.search-field svg {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 17px;
  height: 17px;
  color: var(--muted);
  transform: translateY(-50%);
}

.search-field input {
  padding-left: 38px;
}

.products-toolbar select {
  width: auto;
  min-width: 190px;
}

.product-table {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.product-row {
  display: grid;
  grid-template-columns: minmax(280px, 2fr) 135px 100px 110px 120px 42px;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  border-top: 1px solid var(--border);
  padding: 8px 12px;
}

.product-row:first-child {
  border-top: 0;
}

.product-row-head {
  min-height: 42px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.product-cell {
  min-width: 0;
}

.product-main-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-main-cell > div {
  min-width: 0;
}

.product-main-cell img,
.product-image-empty {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 5px;
  background: #f0f0f0;
  object-fit: cover;
}

.product-image-empty svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.product-main-cell strong,
.product-main-cell small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-main-cell small {
  color: var(--muted);
}

.status-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 650;
}

.status-active {
  background: var(--green-soft);
  color: var(--green);
}

.status-preparing {
  background: #fff4d7;
  color: #7a5716;
}

.status-archived {
  background: #eceff1;
  color: #5c5f62;
}

.product-actions {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
}

.icon-link {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 5px;
  color: var(--ink);
  border: 0;
  background: transparent;
  padding: 0;
  text-decoration: none;
  appearance: none;
}

.icon-link:hover {
  background: #f1f2f3;
}

.icon-link svg {
  width: 16px;
  height: 16px;
}

.table-loading,
.empty-line {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.draft-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.draft-item strong,
.draft-item span {
  display: block;
}

.usage-meter {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface-soft);
}

.usage-meter-top,
.limit-markers {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.meter-track {
  height: 12px;
  margin: 14px 0 10px;
  border-radius: 999px;
  background: #e4e7eb;
  overflow: hidden;
}

.meter-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--gold));
}

.check-list {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 16px 0 0;
  list-style: none;
}

.check-list li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-list svg {
  width: 18px;
  height: 18px;
  color: var(--green);
}

.settings-list {
  display: grid;
  gap: 10px;
}

.settings-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.settings-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.settings-list span {
  color: var(--muted);
}

.settings-list strong {
  text-align: right;
  overflow-wrap: anywhere;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 16px;
  background: #111;
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  background: var(--green);
}

.toast-error {
  background: var(--red);
}

.toast-info {
  background: var(--blue);
}

.busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(246, 246, 244, 0.72);
  backdrop-filter: blur(2px);
}

.busy-overlay[hidden] {
  display: none;
}

.busy-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(340px, calc(100vw - 40px));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 22px;
  text-align: center;
}

.busy-card small {
  color: var(--muted);
}

.busy-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 999px;
  animation: busy-spin 820ms linear infinite;
}

@keyframes busy-spin {
  to {
    transform: rotate(360deg);
  }
}

.wizard-steps {
  display: grid;
  grid-template-columns: auto minmax(40px, 1fr) auto minmax(40px, 1fr) auto;
  align-items: center;
  max-width: 900px;
  margin: 0 auto 24px;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  text-align: left;
}

.wizard-step > span {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 750;
}

.wizard-step strong,
.wizard-step small {
  display: block;
  white-space: nowrap;
}

.wizard-step small {
  font-size: 11px;
}

.wizard-step.is-active {
  color: var(--ink);
}

.wizard-step.is-active > span,
.wizard-step.is-complete > span {
  border-color: #111;
  background: #111;
  color: #fff;
}

.wizard-line {
  height: 1px;
  margin: 0 14px;
  background: var(--border);
}

.wizard-panel {
  display: none;
}

.wizard-panel.is-active {
  display: grid;
  gap: 18px;
}

.brief-layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.8fr) minmax(0, 1.2fr);
  gap: 24px;
}

.brief-layout-simple {
  grid-template-columns: minmax(340px, 0.9fr) minmax(0, 1.1fr);
}

.dropzone-large {
  min-height: 270px;
}

.source-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.source-gallery .empty-line {
  grid-column: 1 / -1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.source-image-card {
  position: relative;
  min-width: 0;
}

.source-image-card img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  object-fit: cover;
}

.source-image-card > span {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-image-card > button {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.82);
  color: #fff;
}

.source-image-card > button svg {
  width: 14px;
  height: 14px;
}

.brief-controls {
  display: grid;
  align-content: start;
  gap: 14px;
}

.choice-group {
  display: grid;
  gap: 8px;
  border: 0;
  padding: 0;
  margin: 0;
}

.choice-group legend {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.choice-card {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px;
  background: var(--surface);
  cursor: pointer;
}

.choice-card:has(input:checked) {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
  background: #fffaf0;
}

.choice-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 6px;
  background: #f1f2f3;
}

.choice-icon svg {
  width: 18px;
  height: 18px;
}

.choice-card strong,
.choice-card small {
  display: block;
}

.choice-card small,
.field-help {
  color: var(--muted);
}

.field-help {
  font-weight: 400;
}

.wizard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.wizard-footer > span {
  color: var(--muted);
}

.file-button {
  position: relative;
  cursor: pointer;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.generated-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.gallery-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.gallery-card.is-primary {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}

.gallery-image-wrap {
  position: relative;
}

.gallery-image-wrap img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.image-source-badge,
.primary-badge {
  position: absolute;
  top: 8px;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
}

.image-source-badge {
  left: 8px;
  background: rgba(17, 17, 17, 0.8);
  color: #fff;
}

.primary-badge {
  right: 8px;
  background: var(--gold);
  color: #111;
}

.gallery-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px;
}

.gallery-card-actions > button {
  border: 0;
  background: transparent;
  padding: 5px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
}

.gallery-card-actions > div {
  display: flex;
  gap: 2px;
}

.gallery-card-actions .icon-link {
  border: 0;
  background: transparent;
}

.gallery-card-actions .icon-link:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.workflow-help {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fbfbfa;
  margin-top: 8px;
  padding: 18px 16px 14px;
}

.workflow-help summary {
  cursor: pointer;
  font-weight: 750;
  color: var(--ink);
}

.workflow-help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
}

.workflow-help-grid strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}

.workflow-help-grid p {
  margin: 0;
  line-height: 1.45;
}

.workflow-help-grid small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.prompt-confirm {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fffaf0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.prompt-confirm input {
  margin-top: 2px;
  width: auto;
}

.media-library-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.media-library-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.media-library-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
  background: var(--surface-soft);
}

.media-library-card div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.media-library-card p {
  margin: 0;
  min-height: 54px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.danger-link {
  color: var(--red);
}

.refine-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 12px;
  margin-top: 16px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 14px;
}

.options-builder {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 16px 0;
}

.option-builder {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface-soft);
}

.option-builder-head {
  margin-bottom: 10px;
}

.option-builder-head strong,
.option-builder-head small {
  display: block;
}

.option-builder-head small,
.empty-values {
  color: var(--muted);
}

.option-builder-head label {
  max-width: 240px;
}

.selected-values {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 34px;
  margin-bottom: 10px;
}

.value-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 5px 8px 5px 10px;
  background: #fff;
}

.value-chip button {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #eceff1;
  padding: 0;
}

.value-chip svg {
  width: 11px;
  height: 11px;
}

.empty-values {
  font-size: 12px;
}

.value-picker {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
}

.final-review {
  display: grid;
  grid-template-columns: minmax(240px, 0.65fr) minmax(0, 1.35fr);
  gap: 24px;
}

.review-media {
  position: relative;
}

.review-media img {
  width: 100%;
  max-height: 520px;
  border-radius: var(--radius);
  object-fit: cover;
}

.review-media span {
  position: absolute;
  right: 10px;
  bottom: 10px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.82);
  color: #fff;
  padding: 5px 9px;
  font-size: 12px;
}

.review-content h3 {
  margin: 0 0 10px;
  font-size: 26px;
}

.review-content > p {
  white-space: pre-line;
}

.review-content dl {
  display: grid;
  margin: 20px 0 0;
  border-top: 1px solid var(--border);
}

.review-content dl > div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

.review-content dt {
  color: var(--muted);
}

.review-content dd {
  margin: 0;
  font-weight: 650;
}

.review-variant-section {
  margin-top: 22px;
}

.review-variant-section h4 {
  margin: 0 0 9px;
}

.review-variant-table {
  overflow-x: auto;
}

.review-variant-table .variant-row {
  min-width: 620px;
}

.final-mode-note {
  max-width: none;
  margin-top: 18px;
}

#shopify-type {
  margin-top: 8px;
}

.edit-change-review {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 16px;
}

.edit-change-review h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.edit-change-review p {
  margin: 0 0 12px;
}

.change-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.change-list li {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.change-list strong {
  font-size: 12px;
}

.payload-preview {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #101114;
  color: #f5f7fb;
  overflow: hidden;
}

.payload-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 12px 14px;
}

.payload-preview-head strong,
.payload-preview-head span {
  display: block;
}

.payload-preview-head span {
  color: #b9c0cc;
  font-size: 12px;
}

.payload-preview .icon-link {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.payload-preview pre {
  max-height: 520px;
  margin: 0;
  overflow: auto;
  padding: 14px;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(17, 18, 19, 0.78);
  padding: 20px;
}

.login-screen[hidden] {
  display: none;
}

.login-card {
  width: min(420px, 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 24px;
  display: grid;
  gap: 14px;
}

.login-card .brand-mark {
  margin: 0 auto 4px;
}

.login-card h2,
.login-card p {
  margin: 0;
  text-align: center;
}

.login-card p,
#login-error {
  color: var(--muted);
}

#login-error {
  min-height: 18px;
  font-size: 13px;
}

#login-error:not(:empty) {
  color: var(--red);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .brand span:not(.brand-mark),
  .nav-item {
    font-size: 0;
  }

  .nav-item {
    justify-content: center;
  }

  .connection-card {
    display: none;
  }

  .product-workspace,
  .dashboard-grid,
  .brief-layout,
  .usage-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .generated-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .media-library-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .summary-grid-four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-table {
    overflow-x: auto;
  }

  .product-row {
    min-width: 860px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding: 10px;
  }

  .brand {
    flex: 0 0 auto;
  }

  .brand span:not(.brand-mark) {
    display: none;
  }

  .nav-list {
    display: flex;
    min-width: max-content;
  }

  .nav-item {
    min-width: 42px;
  }

  .topbar {
    position: static;
    align-items: stretch;
    flex-direction: column;
    padding: 18px;
  }

  main {
    padding: 18px;
  }

  .summary-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .panel-header,
  .publish-bar,
  .draft-item,
  .creator-status,
  .dashboard-welcome,
  .products-toolbar,
  .wizard-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .wizard-steps {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .wizard-line {
    display: none;
  }

  .wizard-step {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
  }

  .source-gallery,
  .generated-gallery,
  .workflow-help-grid,
  .media-library-grid,
  .options-builder,
  .final-review,
  .refine-bar {
    grid-template-columns: 1fr;
  }

  .welcome-actions {
    flex-basis: auto;
  }

  .products-toolbar select,
  .search-field {
    width: 100%;
    max-width: none;
  }

  .variant-row {
    grid-template-columns: 1fr 1fr;
  }
}
