:root {
  color-scheme: light;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #d9e2ec;
  --panel: #ffffff;
  --page: #f6f8fb;
  --soft: #eef7f5;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --warn: #b45309;
  --danger: #be123c;
  --blue: #2563eb;
  --shadow: 0 12px 35px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.topbar h1,
.section-head h2,
.prompt-card h3 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.status-pill {
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 13px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.status-pill.ai {
  border-color: rgba(15, 118, 110, 0.28);
  background: var(--soft);
  color: var(--accent-strong);
}

.status-pill.demo {
  border-color: rgba(180, 83, 9, 0.26);
  background: #fff7ed;
  color: var(--warn);
}

.workspace {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 22px;
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.side-panel {
  position: sticky;
  top: 88px;
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.step-list {
  display: grid;
  padding: 10px;
}

.step-item {
  display: block;
  border-radius: 6px;
  padding: 12px 13px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.step-item.active,
.step-item:hover {
  background: var(--soft);
  color: var(--accent-strong);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.metric-grid div {
  padding: 14px 8px;
  text-align: center;
}

.metric-grid div + div {
  border-left: 1px solid var(--line);
}

.metric-grid strong {
  display: block;
  font-size: 24px;
}

.metric-grid span {
  color: var(--muted);
  font-size: 12px;
}

.main-panel {
  display: grid;
  gap: 18px;
}

.band {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 22px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: 22px;
}

.brief-grid,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(15, 118, 110, 0.55);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.span-2 {
  grid-column: span 2;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.upload-zone {
  position: relative;
  min-height: 132px;
  display: grid;
  place-items: center;
  border: 1px dashed #9db2c7;
  border-radius: 8px;
  background: #fbfdff;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.upload-zone:hover {
  border-color: var(--accent);
  background: var(--soft);
}

.upload-zone strong,
.upload-zone span {
  display: block;
}

.upload-zone strong {
  margin-bottom: 6px;
}

.upload-zone span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.upload-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.asset-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.asset-card {
  position: relative;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 36px 8px 8px;
  background: #fff;
}

.asset-card img {
  width: 72px;
  aspect-ratio: 1;
  border-radius: 6px;
  object-fit: cover;
  background: var(--page);
}

.asset-card strong,
.asset-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-card strong {
  font-size: 13px;
}

.asset-card span {
  color: var(--muted);
  font-size: 12px;
}

.check-line {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.check-line input {
  width: 16px;
  height: 16px;
  padding: 0;
}

.icon-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-weight: 900;
  line-height: 1;
}

.primary-btn,
.ghost-btn {
  min-height: 40px;
  border-radius: 6px;
  padding: 9px 14px;
  font-weight: 900;
}

.primary-btn {
  border: 1px solid var(--accent-strong);
  background: var(--accent);
  color: #fff;
}

.primary-btn:hover {
  background: var(--accent-strong);
}

.primary-btn:disabled,
.ghost-btn:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.ghost-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.ghost-btn:hover {
  border-color: #b6c4d4;
  background: #f8fafc;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.prompt-summary {
  margin-top: 16px;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: var(--soft);
  padding: 14px 16px;
  color: #23433f;
}

.prompt-summary p {
  margin: 0;
}

.prompt-summary dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.prompt-summary dt {
  font-weight: 900;
}

.prompt-summary dd {
  margin: 0;
  color: #335852;
}

.prompt-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.prompt-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.prompt-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.prompt-card h3 {
  font-size: 18px;
}

.prompt-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.prompt-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.prompt-card textarea {
  min-height: 190px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
}

.consistency-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.reference-control {
  display: grid;
  gap: 12px;
}

.progress-wrap {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  transition: width 0.2s ease;
}

.run-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.result-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.result-image-wrap {
  background: #edf2f7;
}

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

.result-body {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.result-body strong,
.result-body span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-body span {
  color: var(--muted);
  font-size: 12px;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
  }

  .step-list {
    grid-template-columns: repeat(4, 1fr);
  }

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

@media (max-width: 720px) {
  .topbar,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace {
    padding: 12px;
  }

  .band {
    padding: 16px;
  }

  .brief-grid,
  .settings-grid,
  .upload-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .step-list {
    grid-template-columns: repeat(2, 1fr);
  }
}
