:root {
  color-scheme: dark;
  --bg: #08090b;
  --surface: #111318;
  --surface-2: #171a21;
  --line: #292d36;
  --text: #f6f7fb;
  --muted: #a7adba;
  --soft: #737b8c;
  --accent: #29d17f;
  --accent-2: #b7f7d4;
  --danger: #ff6b6b;
  --radius: 8px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 18% 0%, rgba(41, 209, 127, 0.16), transparent 32rem),
    linear-gradient(180deg, #0b0d11 0%, var(--bg) 42%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 32px;
  align-items: end;
  padding: 26px 0 36px;
}

.eyebrow,
.panel-kicker,
.flow-heading span,
.slides-header span,
.result-header span {
  margin: 0 0 10px;
  color: var(--accent-2);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  font-size: clamp(2.35rem, 7vw, 5.8rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.hero-text {
  max-width: 650px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.6;
}

.hero-panel {
  display: grid;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 19, 24, 0.78);
  box-shadow: var(--shadow);
}

.hero-panel strong {
  font-size: 1.35rem;
  line-height: 1.2;
}

.hero-panel span:last-child {
  color: var(--muted);
  line-height: 1.5;
}

.tool {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 19, 24, 0.92);
  box-shadow: var(--shadow);
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 9, 11, 0.52);
}

.mode-tab {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-weight: 750;
  transition: 180ms ease;
}

.mode-tab.active {
  border-color: rgba(41, 209, 127, 0.34);
  background: rgba(41, 209, 127, 0.12);
  color: var(--text);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.78fr);
  min-height: 760px;
}

.form-column,
.result-column {
  padding: 26px;
}

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

.flow-heading {
  margin-bottom: 24px;
}

.flow-heading h2,
.result-header h2 {
  font-size: 1.45rem;
  line-height: 1.2;
}

.flow-heading p {
  max-width: 720px;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.55;
}

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

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #d7dce5;
  border-radius: var(--radius);
  background: #f8fafc;
  color: #111827;
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: #7b8494;
}

input,
select {
  min-height: 48px;
  padding: 0 13px;
}

input[type="color"] {
  height: 48px;
  padding: 5px;
  background: #f8fafc;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(41, 209, 127, 0.68);
  box-shadow: 0 0 0 3px rgba(41, 209, 127, 0.22);
}

.palette-panel {
  display: grid;
  grid-column: 1 / -1;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}

.palette-heading {
  display: grid;
  gap: 6px;
}

.palette-heading span {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-2);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.palette-heading strong {
  font-size: 1.05rem;
}

.reference-palette-toggle {
  display: flex;
  gap: 10px;
  align-items: center;
  width: fit-content;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.reference-palette-toggle input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

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

.add-item-button {
  min-height: 42px;
  border: 1px solid rgba(183, 247, 212, 0.65);
  border-radius: var(--radius);
  background: var(--accent-2);
  color: #062013;
  font-weight: 850;
}

.add-item-button:hover {
  background: #d2ffe4;
}

.add-color-button {
  justify-self: start;
  min-width: 150px;
}

.color-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.color-topline {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.color-topline span {
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 800;
}

.remove-color {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
  color: var(--soft);
}

.remove-color:hover {
  border-color: rgba(255, 107, 107, 0.5);
  color: var(--danger);
}

.color-controls {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 8px;
}

.color-controls input[type="color"] {
  width: 52px;
}

.slides-section {
  margin-top: 24px;
}

.slides-header,
.result-header {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.slides-header h3 {
  font-size: 1.15rem;
}

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

#add-slide {
  width: 100%;
  margin-top: 12px;
}

.slide-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 38px;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.slide-number {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: var(--radius);
  background: rgba(41, 209, 127, 0.12);
  color: var(--accent-2);
  font-size: 0.85rem;
  font-weight: 800;
}

.slide-fields {
  display: grid;
  gap: 10px;
}

.remove-slide {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
  color: var(--soft);
  font-size: 1.1rem;
}

.remove-slide:hover {
  border-color: rgba(255, 107, 107, 0.5);
  color: var(--danger);
}

.primary-button,
.secondary-button,
.copy-button {
  border: 0;
  border-radius: var(--radius);
  font-weight: 800;
}

.primary-button {
  width: 100%;
  min-height: 54px;
  margin-top: 20px;
  background: var(--accent);
  color: #06110b;
}

.secondary-button,
.copy-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: #111827;
}

.result-column {
  display: grid;
  grid-template-rows: auto minmax(360px, 1fr) auto;
  gap: 16px;
  background: rgba(8, 9, 11, 0.26);
}

textarea {
  min-height: 420px;
  resize: vertical;
  padding: 16px;
  line-height: 1.55;
}

.steps {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}

.steps strong {
  display: block;
  margin-bottom: 10px;
}

.steps ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.45;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10;
  padding: 13px 16px;
  border: 1px solid rgba(41, 209, 127, 0.4);
  border-radius: var(--radius);
  background: #111b15;
  color: var(--accent-2);
  font-weight: 800;
  box-shadow: var(--shadow);
}

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

  .hero {
    align-items: stretch;
  }

  .hero-panel {
    max-width: none;
  }

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

  .workspace {
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding: 22px 0;
  }

  .hero {
    gap: 18px;
    padding-bottom: 22px;
  }

  .hero-text {
    font-size: 1rem;
  }

  .color-list,
  .mode-tabs,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .form-column,
  .result-column {
    padding: 18px;
  }

  .slide-item {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .remove-slide {
    grid-column: 2;
    width: 100%;
  }

  .slides-header,
  .result-header {
    align-items: stretch;
    flex-direction: column;
  }

  .secondary-button,
  .add-color-button,
  .add-item-button,
  .copy-button {
    width: 100%;
  }
}
