:root {
  --ink: #17211d;
  --muted: #718078;
  --line: #e3ebe6;
  --paper: #f7faf7;
  --panel: #ffffff;
  --accent: #00a86b;
  --accent-dark: #04744d;
  --accent-soft: #e9fbf3;
  --rose: #ff5a4f;
  --gold: #ffbd2e;
  --ivory: #fff8e7;
  --focus: rgba(0, 168, 107, 0.18);
  --shadow: none;
  --button-shadow: none;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(0, 168, 107, 0.14), transparent 30rem),
    radial-gradient(circle at bottom right, rgba(255, 189, 46, 0.18), transparent 28rem),
    linear-gradient(135deg, rgba(255, 90, 79, 0.08), transparent 36rem),
    var(--paper);
  font-family: "Plus Jakarta Sans", Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  -webkit-tap-highlight-color: transparent;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  width: min(1480px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(14px, 2.3vw, 34px);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 640px);
  gap: clamp(16px, 2.2vw, 30px);
  align-items: start;
  justify-content: center;
}

.panel,
.stage {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(227, 235, 230, 0.98);
  border-radius: 8px;
  box-shadow: none;
  backdrop-filter: blur(14px);
}

.panel {
  padding: 22px;
  position: static;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid #eef4f0;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: 8px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: none;
  font-size: 1.35rem;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.13rem, 2.4vw, 1.28rem);
  line-height: 1.12;
}

.brand p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.form-grid,
.form-section {
  display: grid;
  gap: 16px;
}

.flow-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 4px;
  background: #f0f6f2;
  border: 1px solid #e2ece6;
  border-radius: 8px;
}

.flow-step {
  min-height: 42px;
  gap: 6px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 850;
}

.flow-step span {
  width: 22px;
  height: 22px;
  color: inherit;
  background: #ffffff;
  border: 1px solid #dce8e1;
}

.flow-step.is-active {
  color: #ffffff;
  background: var(--accent);
}

.flow-step.is-active span {
  color: var(--accent-dark);
  background: #ffffff;
  border-color: transparent;
}

.step-panel {
  display: none;
  gap: 16px;
}

.step-panel.is-active {
  display: grid;
}

.step-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.step-controls.two {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
}

.secondary {
  color: var(--accent-dark);
  background: #ffffff;
  border: 1px solid #cfeee0;
}

.secondary:hover {
  background: var(--accent-soft);
}

.final-card {
  min-height: 138px;
  align-content: center;
}

.final-copy {
  display: grid;
  gap: 6px;
  padding: 14px;
  background: #f6fbf8;
  border: 1px solid #e0ede6;
  border-radius: 8px;
}

.final-copy strong {
  font-size: 1rem;
}

.final-copy small {
  color: var(--muted);
  font-weight: 650;
  line-height: 1.45;
}

.form-section {
  padding: 15px;
  background: #ffffff;
  border: 1px solid #edf3ef;
  border-radius: 8px;
}

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-dark);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.title-icon,
.field-icon,
.upload-icon {
  display: inline-grid;
  place-items: center;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: 999px;
  box-shadow: none;
}

.title-icon {
  width: 22px;
  height: 22px;
  font-size: 0.82rem;
}

.field-icon {
  width: 24px;
  height: 24px;
  margin-right: 7px;
  font-size: 0.86rem;
  font-weight: 950;
  vertical-align: middle;
}

.upload-icon {
  width: 38px;
  height: 38px;
  margin: 0 auto 2px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  font-size: 1.25rem;
}

label {
  display: grid;
  gap: 0;
  color: #2d3a4d;
  font-size: 0.88rem;
  font-weight: 760;
}

.slider-field {
  display: grid;
  gap: 9px;
}

.choice-group {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.choice-group-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 900;
}

.choice-group-head small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.field-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  color: #2d3a4d;
  font-size: 0.88rem;
  font-weight: 820;
}

.choice-slider {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(156px, 0.64fr);
  gap: 14px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 12px;
  padding: 4px 2px 8px;
  scrollbar-width: none;
}

.choice-slider::-webkit-scrollbar {
  display: none;
}

.choice-slider.compact {
  grid-auto-columns: minmax(134px, 0.42fr);
}

.choice-slider.size-slider {
  grid-auto-columns: minmax(166px, 0.58fr);
}

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

.choice-card {
  min-height: 154px;
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  align-items: stretch;
  gap: 8px;
  padding: 10px;
  color: var(--ink);
  text-align: left;
  background: #ffffff;
  border: 1px solid #e5eee8;
  border-radius: 8px;
  box-shadow: none;
  scroll-snap-align: start;
  scroll-margin-inline: 12px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.choice-card:hover {
  border-color: #bee8d5;
  transform: translateY(-1px);
}

.choice-visual {
  width: 100%;
  height: 82px;
  display: inline-grid;
  place-items: center;
  color: #ffffff;
  background:
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.48), transparent 28%),
    linear-gradient(135deg, #00a86b, #04744d);
  border: 0;
  border-radius: 8px;
  font-size: 1.75rem;
  font-weight: 950;
  overflow: hidden;
  position: relative;
}

.choice-visual::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -22px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.24);
}

.visual-food { background: radial-gradient(circle at 28% 24%, rgba(255,255,255,.45), transparent 28%), linear-gradient(135deg, #ff7a45, #ffbd2e); }
.visual-fashion { background: radial-gradient(circle at 28% 24%, rgba(255,255,255,.45), transparent 28%), linear-gradient(135deg, #ff5a4f, #7c4dff); }
.visual-beauty { background: radial-gradient(circle at 28% 24%, rgba(255,255,255,.48), transparent 28%), linear-gradient(135deg, #ff6fae, #c056d8); }
.visual-electronic { background: radial-gradient(circle at 28% 24%, rgba(255,255,255,.45), transparent 28%), linear-gradient(135deg, #2f80ed, #00a86b); }
.visual-service { background: radial-gradient(circle at 28% 24%, rgba(255,255,255,.45), transparent 28%), linear-gradient(135deg, #00a86b, #1d6f52); }
.visual-craft { background: radial-gradient(circle at 28% 24%, rgba(255,255,255,.45), transparent 28%), linear-gradient(135deg, #b8743d, #ffbd2e); }
.visual-drink { background: radial-gradient(circle at 28% 24%, rgba(255,255,255,.45), transparent 28%), linear-gradient(135deg, #00b8d9, #00a86b); }
.visual-health { background: radial-gradient(circle at 28% 24%, rgba(255,255,255,.45), transparent 28%), linear-gradient(135deg, #20c997, #2f80ed); }
.visual-education { background: radial-gradient(circle at 28% 24%, rgba(255,255,255,.45), transparent 28%), linear-gradient(135deg, #5b7cfa, #00a86b); }
.visual-grocery { background: radial-gradient(circle at 28% 24%, rgba(255,255,255,.45), transparent 28%), linear-gradient(135deg, #83c23a, #ffbd2e); }
.visual-farm { background: radial-gradient(circle at 28% 24%, rgba(255,255,255,.45), transparent 28%), linear-gradient(135deg, #6ab04c, #04744d); }
.visual-sale { background: radial-gradient(circle at 28% 24%, rgba(255,255,255,.45), transparent 28%), linear-gradient(135deg, #ff5a4f, #ffbd2e); }
.visual-premium { background: radial-gradient(circle at 28% 24%, rgba(255,255,255,.38), transparent 28%), linear-gradient(135deg, #17211d, #c89b2c); }
.visual-fresh { background: radial-gradient(circle at 28% 24%, rgba(255,255,255,.45), transparent 28%), linear-gradient(135deg, #00a86b, #00b8d9); }
.visual-market { background: radial-gradient(circle at 28% 24%, rgba(255,255,255,.45), transparent 28%), linear-gradient(135deg, #ff8a3d, #00a86b); }
.visual-size { background: radial-gradient(circle at 28% 24%, rgba(255,255,255,.45), transparent 28%), linear-gradient(135deg, #4f6bed, #00a86b); }
.visual-instagram { background: radial-gradient(circle at 28% 24%, rgba(255,255,255,.45), transparent 28%), linear-gradient(135deg, #f58529, #dd2a7b 48%, #8134af); }
.visual-reels { background: radial-gradient(circle at 28% 24%, rgba(255,255,255,.42), transparent 28%), linear-gradient(135deg, #405de6, #c13584 52%, #fd1d1d); }
.visual-tiktok { background: radial-gradient(circle at 28% 24%, rgba(255,255,255,.22), transparent 28%), linear-gradient(135deg, #010101, #25f4ee 52%, #fe2c55); }
.visual-facebook { background: radial-gradient(circle at 28% 24%, rgba(255,255,255,.4), transparent 28%), linear-gradient(135deg, #1877f2, #0d47a1); }
.visual-whatsapp { background: radial-gradient(circle at 28% 24%, rgba(255,255,255,.42), transparent 28%), linear-gradient(135deg, #25d366, #128c7e); }
.visual-linkedin { background: radial-gradient(circle at 28% 24%, rgba(255,255,255,.4), transparent 28%), linear-gradient(135deg, #0a66c2, #004182); }
.visual-pinterest { background: radial-gradient(circle at 28% 24%, rgba(255,255,255,.4), transparent 28%), linear-gradient(135deg, #e60023, #ad081b); }
.visual-default { background: radial-gradient(circle at 28% 24%, rgba(255,255,255,.45), transparent 28%), linear-gradient(135deg, #00a86b, #04744d); }

.choice-visual i {
  position: relative;
  z-index: 1;
}

.choice-card strong {
  font-size: 0.88rem;
  line-height: 1.16;
}

.choice-card small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.25;
}

.choice-card.is-active {
  color: var(--ink);
  background: #f4fff9;
  border-color: var(--accent);
  box-shadow: none;
}

.choice-card.is-active small {
  color: var(--muted);
}

.choice-card.is-active .choice-visual {
  outline: 3px solid rgba(0, 168, 107, 0.16);
  outline-offset: 0;
}

.choice-card.is-active::before {
  content: none;
}

.choice-slider.compact .choice-card {
  min-height: 124px;
  padding: 9px;
}

.choice-slider.compact .choice-visual {
  height: 68px;
  font-size: 1.45rem;
}

#templateSlider.choice-slider.compact .choice-card {
  min-height: 124px;
}

#templateSlider.choice-slider.compact .choice-visual {
  height: 68px;
}

.size-slider .choice-card {
  min-height: 144px;
}

.size-slider .choice-visual {
  height: 74px;
}

.size-grid .choice-card {
  min-height: 132px;
}

.size-grid .choice-visual {
  height: 68px;
  font-size: 1.55rem;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid #e1ebe5;
  border-radius: 8px;
  background: #fbfdfb;
  color: var(--ink);
  padding: 13px 14px;
  outline: none;
  box-shadow: none;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 20px,
    calc(100% - 13px) 20px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 38px;
}

textarea {
  resize: vertical;
  min-height: 104px;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: none;
  background: #fbfffd;
}

input::placeholder,
textarea::placeholder {
  color: #87968e;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(118px, 0.72fr);
  gap: 12px;
}

.file-drop {
  min-height: 92px;
  place-content: center;
  padding: 16px;
  text-align: center;
  border: 1.5px dashed #b8e7d3;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(233, 251, 243, 0.78), rgba(255, 255, 255, 0.95));
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.file-drop:hover {
  border-color: var(--accent);
  background: #f6fdfd;
}

.file-drop span {
  color: var(--accent-dark);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.file-drop small {
  color: var(--muted);
  font-weight: 650;
}

.file-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
  gap: 10px;
  padding-top: 4px;
}

button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 880;
  letter-spacing: 0;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

button span {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  font-size: 1rem;
  line-height: 1;
}

.primary {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: none;
}

.primary span {
  color: var(--accent-dark);
  background: linear-gradient(135deg, #fff, var(--ivory));
}

.primary:hover {
  box-shadow: none;
  transform: translateY(-1px);
}

.ghost {
  color: var(--accent-dark);
  background: #fff;
  border: 1px solid #cfeee0;
}

.ghost span {
  color: #fff;
  background: var(--rose);
}

.ghost:not(:disabled):hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.ghost:disabled {
  color: #96a3b2;
  background: #edf1f6;
  border-color: #e0e6ee;
  cursor: not-allowed;
}

.ghost:disabled span {
  background: #b8c3d0;
}

.stage {
  min-width: 0;
  padding: clamp(16px, 2.4vw, 28px);
}

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

.eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.stage h2 {
  margin-top: 5px;
  font-size: clamp(1.18rem, 2vw, 1.75rem);
  line-height: 1.15;
}

.quality-pill {
  flex: 0 0 auto;
  color: #253246;
  background: var(--accent-soft);
  border: 1px solid #cfeee0;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 880;
  font-size: 0.85rem;
  white-space: nowrap;
}

.canvas-wrap {
  display: grid;
  place-items: center;
  min-height: 320px;
}

canvas {
  width: min(100%, 560px);
  aspect-ratio: 1;
  height: auto;
  display: block;
  background: white;
  border-radius: 8px;
  box-shadow: none;
}

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

  .panel {
    position: static;
  }

  .stage {
    margin-bottom: 18px;
  }
}

@media (max-width: 640px) {
  body {
    background: #f6faf7;
  }

  .app-shell {
    padding: 10px;
  }

  .workspace {
    gap: 10px;
  }

  .panel,
  .stage {
    padding: 14px;
    border-radius: 8px;
    box-shadow: none;
  }

  .brand {
    gap: 12px;
    align-items: flex-start;
    padding-bottom: 14px;
    margin-bottom: 14px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .brand p {
    font-size: 0.86rem;
  }

  .form-grid,
  .form-section {
    gap: 14px;
  }

  .form-section {
    padding: 14px;
  }

  label {
    font-size: 0.86rem;
  }

  .field-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .field-head small {
    white-space: normal;
  }

  .choice-slider {
    grid-auto-columns: minmax(76%, 1fr);
    margin-right: -12px;
    padding-right: 12px;
  }

  .choice-slider.compact {
    grid-auto-columns: minmax(42%, 1fr);
  }

  .choice-group {
    padding: 0;
  }

  .choice-group-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .choice-group-head small {
    white-space: normal;
  }

  .choice-slider.size-slider {
    grid-auto-columns: minmax(68%, 1fr);
  }

  .size-grid {
    gap: 10px;
  }

  .size-grid .choice-card {
    min-height: 124px;
    padding: 9px;
  }

  .size-grid .choice-visual {
    height: 62px;
  }

  input,
  select,
  textarea {
    min-height: 48px;
    font-size: 16px;
    padding: 12px;
  }

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

  .actions {
    grid-template-columns: minmax(0, 1fr) minmax(104px, 0.72fr);
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin: 4px -4px -4px;
    padding: 10px 4px 15px;
    /*background: linear-gradient(180deg, rgba(245, 247, 251, 0), rgba(245, 247, 251, 0.96) 30%);*/
  }

  button {
    width: 100%;
    min-height: 48px;
    font-size: 0.92rem;
    gap: 6px;
  }

  button span {
    width: 22px;
    height: 22px;
  }

  .stage-top {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 12px;
  }

  .quality-pill {
    font-size: 0.8rem;
    padding: 7px 10px;
  }

  .canvas-wrap {
    min-height: auto;
  }

  canvas {
    width: 100%;
    box-shadow: none;
  }
}

@media (max-width: 380px) {
  .app-shell {
    padding: 8px;
  }

  .panel,
  .stage {
    padding: 12px;
  }

  .form-section {
    padding: 12px;
  }

  .actions {
    grid-template-columns: 1fr 0.72fr;
    gap: 8px;
  }

  button {
    font-size: 0.86rem;
  }
}
