:root {
  color-scheme: light;
  --bg: #f5f4ef;
  --surface: #ffffff;
  --surface-soft: #faf8f1;
  --ink: #202520;
  --muted: #687067;
  --line: #dcd8ca;
  --teal: #167b78;
  --teal-soft: #dff1ee;
  --wine: #9f3c5b;
  --wine-soft: #f6e1e8;
  --gold: #a46e1b;
  --gold-soft: #f5e7cc;
  --leaf: #617a35;
  --blue: #3b6f8f;
  --shadow: 0 18px 44px rgba(37, 43, 38, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(22, 123, 120, 0.08), rgba(245, 244, 239, 0) 280px),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.app-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 14px;
}

.eyebrow,
.kicker {
  margin-bottom: 5px;
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 0;
  font-size: 1.45rem;
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
  line-height: 1.25;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: 1rem;
  line-height: 1.25;
}

.layout {
  display: grid;
  gap: 14px;
}

.wizard-card,
.choice-panel,
.result-panel,
.result-card,
.prompt-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.wizard-card {
  min-height: calc(100svh - 118px);
  padding: 16px;
}

.progress-head,
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-head {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  margin: 10px 0 10px;
  background: #e6e1d3;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
  transition: width 180ms ease;
}

.build-line {
  min-height: 42px;
  margin: 0 0 18px;
  border: 1px solid rgba(22, 123, 120, 0.18);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--teal);
  background: var(--teal-soft);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.38;
}

.question-block {
  min-height: 124px;
}

.question-block p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.option-grid {
  display: grid;
  gap: 10px;
  margin: 6px 0 18px;
}

.option-button {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
}

.option-button.is-selected {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.option-button.is-limited {
  opacity: 0.62;
}

.option-check {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: transparent;
  background: #fff;
  font-weight: 900;
}

.option-button.is-selected .option-check {
  border-color: var(--teal);
  color: #fff;
  background: var(--teal);
}

.option-copy {
  display: grid;
  gap: 5px;
}

.option-copy strong {
  font-size: 0.98rem;
  line-height: 1.3;
}

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

.option-meta {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  color: var(--gold);
  background: var(--gold-soft);
  font-size: 0.72rem;
  font-weight: 900;
}

.nav-row {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 9px;
  margin: 0 -16px -16px;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(220, 216, 202, 0.8);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
}

.primary-button,
.ghost-button,
.icon-button {
  min-height: 44px;
  border-radius: 8px;
  font-weight: 900;
}

.primary-button {
  border: 0;
  color: #fff;
  background: var(--ink);
}

.primary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.ghost-button,
.icon-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
}

.ghost-button.small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.84rem;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  padding: 0;
  font-size: 1.1rem;
}

.choice-panel {
  padding: 14px;
}

.panel-title {
  margin-bottom: 12px;
}

.choice-list {
  display: grid;
  gap: 8px;
}

.choice-item {
  display: grid;
  gap: 4px;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-soft);
}

.choice-item strong {
  color: var(--teal);
  font-size: 0.78rem;
}

.choice-item span {
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.38;
}

.empty-choice {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.result-panel {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.result-panel.is-hidden {
  display: none;
}

.result-hero {
  border-radius: 8px;
  padding: 16px;
  color: #fff;
  background: var(--ink);
}

.result-hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.result-hero .kicker {
  color: var(--gold-soft);
}

.result-hero p:last-child {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.5;
}

.hero-button {
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

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

.result-card,
.prompt-card {
  padding: 14px;
}

.axis-list,
.story-list,
.seed-list {
  display: grid;
  gap: 10px;
}

.axis-item {
  display: grid;
  gap: 6px;
}

.axis-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.axis-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8e3d6;
}

.axis-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.story-item,
.seed-item {
  display: grid;
  gap: 4px;
  border-left: 3px solid var(--teal);
  padding-left: 10px;
}

.story-item:nth-child(2),
.seed-item:nth-child(2) {
  border-color: var(--wine);
}

.story-item:nth-child(3),
.seed-item:nth-child(3) {
  border-color: var(--gold);
}

.story-item:nth-child(4) {
  border-color: var(--leaf);
}

.story-item strong,
.seed-item strong {
  font-size: 0.84rem;
}

.story-item span,
.seed-item span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.card-head span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  color: var(--gold);
  background: var(--gold-soft);
  font-size: 0.78rem;
  font-weight: 900;
}

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

.prompt-tab {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 900;
}

.prompt-tab.is-active {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-soft);
}

textarea {
  display: block;
  width: 100%;
  min-height: 360px;
  margin-top: 10px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  outline: none;
  color: var(--ink);
  background: var(--surface-soft);
  font-size: 0.9rem;
  line-height: 1.52;
}

textarea:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(22, 123, 120, 0.24);
  outline-offset: 2px;
}

.copy-status {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--teal);
  font-size: 0.84rem;
  font-weight: 800;
}

@media (min-width: 760px) {
  .app-shell {
    padding: 24px;
  }

  h1 {
    font-size: 2rem;
  }

  .layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
  }

  .wizard-card {
    min-height: 650px;
    padding: 18px;
  }

  .choice-panel {
    position: sticky;
    top: 18px;
  }

  .result-panel {
    grid-column: 1 / -1;
    padding: 18px;
  }

  .result-grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }

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

  .option-button {
    min-height: 100px;
  }

  .nav-row {
    margin: 0;
    padding: 14px 0 0;
    border-top: 0;
    background: transparent;
    backdrop-filter: none;
  }
}

@media (min-width: 1080px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  .result-panel {
    grid-template-columns: minmax(0, 1fr);
  }
}
