:root {
  color-scheme: light;
  --ink: #022451;
  --muted: #5b5e5f;
  --line: #d8dde3;
  --panel: #ffffff;
  --wash: #f6f8fb;
  --accent: #db9d20;
  --accent-dark: #022451;
  --warm: #db9d20;
  --shadow: 0 18px 45px rgba(2, 36, 81, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #f6f8fb 0%, #ffffff 46%, #f6f8fb 100%);
  color: var(--ink);
}

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

.shell {
  width: min(1420px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 12px 0;
}

.workspace {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

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

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2.4vw, 2.15rem);
  line-height: 1.08;
  max-width: 720px;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
}

h3 {
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.top-actions,
.section-head,
.tabs {
  display: flex;
  align-items: center;
}

.top-actions {
  gap: 10px;
  flex-shrink: 0;
}

.tabs {
  gap: 6px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: #f6f8fb;
  overflow-x: auto;
}

.tab,
.ghost-button,
.primary-button,
.icon-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  min-height: 42px;
  cursor: pointer;
}

.tab {
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 0 14px;
  font-weight: 750;
}

.tab small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.1;
}

.tab.is-active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.tab.is-active small {
  color: rgba(255, 255, 255, 0.78);
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  padding: 0 18px;
  font-weight: 850;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.ghost-button {
  padding: 0 14px;
  font-weight: 750;
}

.ghost-button.is-active {
  border-color: var(--accent);
  background: rgba(219, 157, 32, 0.12);
  color: var(--accent-dark);
}

.compact {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.icon-button {
  width: 42px;
  font-size: 1.3rem;
  font-weight: 850;
}

.wide {
  width: 100%;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 470px;
  min-height: 720px;
}

.panel,
.preview {
  padding: 24px;
}

.panel {
  border-right: 1px solid var(--line);
}

.stack {
  display: grid;
  align-content: start;
  gap: 18px;
}

.tab-panel {
  display: none;
}

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

.section-head {
  justify-content: space-between;
  gap: 12px;
}

.prompt-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  background: rgba(219, 157, 32, 0.12);
  color: var(--accent-dark);
  border: 1px solid rgba(219, 157, 32, 0.32);
  font-size: 0.8rem;
  font-weight: 750;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

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

select {
  min-height: 48px;
}

textarea {
  resize: vertical;
  line-height: 1.55;
}

textarea.is-highlighted {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(219, 157, 32, 0.2);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(219, 157, 32, 0.16);
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

input[type="range"] {
  padding: 0;
  accent-color: var(--accent);
}

.preview {
  display: grid;
  align-content: start;
  gap: 18px;
  background: var(--wash);
}

.preview-image {
  min-height: 310px;
  display: grid;
  place-items: center;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(2, 36, 81, 0.94), rgba(219, 157, 32, 0.82)),
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.28), transparent 34%),
    #022451;
  text-align: center;
  padding: 30px;
}

.preview-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-image span {
  display: block;
  font-size: 1.2rem;
  font-weight: 900;
  margin-bottom: 8px;
}

.preview-image p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.86);
}

.prompt-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  background: #fff;
}

.score-card strong {
  color: var(--accent-dark);
  font-size: 1.2rem;
}

.score-target {
  gap: 10px;
}

.score-target-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.score-target-row span:last-child {
  color: var(--warm);
}

.score-meter {
  height: 10px;
  background: #e8edf3;
  overflow: hidden;
}

.score-meter span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #022451, var(--accent));
  transition: width 180ms ease;
}

.next-fix {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(219, 157, 32, 0.34);
  background: rgba(219, 157, 32, 0.08);
  color: var(--ink);
}

.next-fix strong {
  color: var(--warm);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.next-fix span {
  color: var(--ink);
  line-height: 1.42;
  font-size: 0.9rem;
}

.score-breakdown {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.score-dimension {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: #f6f8fb;
  border: 1px solid var(--line);
}

.score-dimension span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.score-dimension strong {
  color: var(--accent-dark);
  font-size: 1rem;
}

.score-dimension input {
  min-height: 20px;
}

.insight-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.9rem;
}

.walkthrough-hero {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  background: #fff;
}

.walkthrough-hero h2 {
  margin-bottom: 8px;
  font-size: 1.35rem;
}

.walkthrough-hero p:last-child {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.walkthrough-progress {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.walkthrough-progress span {
  display: grid;
  place-items: center;
  min-height: 34px;
  border: 1px solid rgba(219, 157, 32, 0.3);
  background: rgba(219, 157, 32, 0.1);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 850;
}

.walkthrough-step {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  background: #fff;
}

.step-copy {
  display: grid;
  gap: 6px;
}

.step-copy h3 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.step-copy p {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.52;
}

.step-number {
  color: var(--warm);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.compact-choices {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.choice-button {
  min-height: 88px;
  padding: 13px;
  border: 1px solid var(--line);
  background: #f6f8fb;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.compact-choices .choice-button {
  min-height: 52px;
  text-align: center;
  font-weight: 850;
}

.choice-button strong,
.choice-button span {
  display: block;
}

.choice-button strong {
  margin-bottom: 5px;
  font-size: 0.92rem;
}

.choice-button span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.choice-button:hover,
.choice-button.is-selected {
  border-color: var(--accent);
  background: rgba(219, 157, 32, 0.12);
}

.prompt-pieces {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.prompt-pieces article {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #f6f8fb;
}

.prompt-pieces strong {
  color: var(--accent-dark);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.prompt-pieces span {
  color: var(--muted);
  line-height: 1.42;
  font-size: 0.88rem;
}

.walkthrough-finish {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.walkthrough-finish .primary-button,
.walkthrough-finish .ghost-button {
  min-height: 40px;
}

.walkthrough-finish span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

.image-prompt-upload {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1.2fr);
  gap: 14px;
}

.upload-drop {
  align-content: center;
  min-height: 230px;
  padding: 18px;
  border: 1px dashed rgba(2, 36, 81, 0.35);
  background: #f6f8fb;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
}

.upload-drop input {
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  position: absolute;
  pointer-events: none;
}

.upload-drop span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.upload-drop small {
  max-width: 260px;
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.45;
}

.uploaded-preview {
  min-height: 230px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
  color: var(--muted);
  font-weight: 800;
}

.uploaded-preview img {
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: contain;
  background: #f6f8fb;
}

.image-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.image-facts article {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #f6f8fb;
}

.image-facts strong {
  color: var(--accent-dark);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.image-facts span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.42;
}

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

.variant-card {
  border: 1px solid var(--line);
  background: #f6f8fb;
  padding: 14px;
}

.variant-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.48;
  font-size: 0.9rem;
}

.brief-list {
  display: grid;
  gap: 14px;
}

.panel-intro {
  max-width: 880px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 0;
}

.example-lead {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  background: #fff;
}

.example-lead img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.example-lead p {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

.example-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.example-tags span,
.example-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(219, 157, 32, 0.3);
  background: rgba(219, 157, 32, 0.1);
  color: var(--accent-dark);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

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

.example-card {
  display: grid;
  grid-template-columns: minmax(150px, 34%) minmax(0, 1fr);
  border: 1px solid var(--line);
  background: #fff;
  min-height: 290px;
}

.example-image {
  width: 100%;
  height: 100%;
  min-height: 290px;
  object-fit: cover;
}

.example-bright {
  filter: brightness(1.08) saturate(0.96) contrast(0.94);
}

.example-editorial {
  filter: contrast(1.18) saturate(0.82) brightness(0.9);
}

.example-cinematic {
  filter: sepia(0.16) contrast(1.08) saturate(1.1) brightness(0.88);
}

.example-reference {
  filter: contrast(0.98) saturate(0.72);
}

.example-copy {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
}

.example-copy p,
.example-copy dd {
  color: var(--muted);
  line-height: 1.48;
}

.example-copy p {
  margin-bottom: 0;
}

.example-copy dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.example-copy dt {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.example-copy dd {
  margin: 3px 0 0;
  font-size: 0.88rem;
}

.brief-list article {
  border: 1px solid var(--line);
  background: #fff;
  padding: 16px;
}

.brief-list p,
.small-note {
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 0;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  background: var(--ink);
  color: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  transition: 160ms ease;
}

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

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

  .panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 680px) {
  .shell {
    width: 100%;
    padding: 0;
  }

  .workspace {
    border-left: 0;
    border-right: 0;
  }

  .topbar,
  .tabs {
    align-items: stretch;
    flex-direction: column;
  }

  .tabs {
    flex-direction: row;
    overflow-x: auto;
  }

  .top-actions {
    width: 100%;
  }

  .primary-button {
    flex: 1;
  }

  .two {
    grid-template-columns: 1fr;
  }

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

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

  .walkthrough-hero {
    display: grid;
  }

  .walkthrough-progress,
  .choice-grid,
  .compact-choices,
  .prompt-pieces,
  .image-prompt-upload,
  .image-facts {
    grid-template-columns: 1fr;
  }

  .example-grid,
  .example-lead {
    grid-template-columns: 1fr;
  }

  .example-card {
    grid-template-columns: 1fr;
  }

  .example-image {
    aspect-ratio: 4 / 3;
    min-height: 0;
  }

  .panel,
  .preview {
    padding: 18px;
  }
}

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

  .score-breakdown {
    grid-template-columns: 1fr;
  }
}
