:root {
  color-scheme: light;

  /* Surfaces */
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #fbfbfc;
  --surface-muted: #f1f2f4;

  /* Text */
  --ink: #0f1115;
  --ink-soft: #3b414a;
  --muted: #6b7280;
  --faint: #9aa0a8;

  /* Lines */
  --line: #e8e9ec;
  --line-strong: #d7d9de;

  /* Accent (used sparingly: focus, links, active) */
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --brand-soft: #eef3ff;

  /* Primary action (near-black) */
  --primary: #14161a;
  --primary-hover: #000000;

  /* States */
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --ok: #15803d;
  --ok-soft: #f0fdf4;

  /* KakaoTalk chat backdrop */
  --kakao-bg: #a9bdd0;

  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 8px;

  --shadow-sm: 0 1px 2px rgba(15, 17, 21, 0.05);
  --shadow-md: 0 6px 24px rgba(15, 17, 21, 0.07);

  --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100svh;
  color: var(--ink);
  background: var(--bg);
  font-family: "Pretendard Variable", Pretendard, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font: inherit;
}

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

a {
  color: var(--brand);
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

.app-shell {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 clamp(16px, 4vw, 40px);
  background: rgba(246, 247, 249, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(12px);
}

.brand {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: #fff;
  background: var(--primary);
  font-size: 14px;
  font-weight: 700;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.topbar-link {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition: border-color 140ms ease, background 140ms ease;
}

.topbar-link:hover {
  border-color: #c2c5cc;
  background: var(--surface-muted);
}

.workspace-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
}

.topbar__status {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}

.topbar__status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--faint);
}

.topbar__status[data-state="ok"] {
  color: var(--ok);
  border-color: #cdebd6;
  background: var(--ok-soft);
}

.topbar__status[data-state="ok"]::before {
  background: var(--ok);
}

.topbar__status[data-state="error"] {
  color: var(--danger);
  border-color: #f6cccc;
  background: var(--danger-soft);
}

.topbar__status[data-state="error"]::before {
  background: var(--danger);
}

/* Workspace */
.workspace {
  min-width: 0;
  padding: clamp(24px, 4vw, 40px) clamp(16px, 4vw, 40px) 64px;
}

.page-header {
  max-width: 1100px;
  display: grid;
  gap: 6px;
  margin: 0 auto clamp(20px, 3vw, 28px);
}

.eyebrow {
  display: none;
}

.page-lead {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 16px;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 17px;
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: -0.01em;
}

/* Layout grid: mobile = preview on top, then editor */
.wizard-grid {
  max-width: 1100px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
  margin: 0 auto;
}

.editor {
  order: 2;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* Stepper */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 16px clamp(18px, 3vw, 24px);
  list-style: none;
  border-bottom: 1px solid var(--line);
}

.stepper__item {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--faint);
  font-size: 13px;
  font-weight: 550;
}

.stepper__item:not(:last-child) {
  flex: 1;
}

.stepper__item:not(:last-child)::after {
  content: "";
  flex: 1;
  height: 1px;
  margin: 0 14px;
  background: var(--line-strong);
}

.stepper__item[data-state="active"] {
  color: var(--ink);
  font-weight: 650;
}

.stepper__item[data-state="done"] {
  color: var(--ink-soft);
  cursor: pointer;
}

.stepper__dot {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--faint);
  background: var(--surface);
  font-size: 12px;
  font-weight: 650;
  transition: all 160ms ease;
}

.stepper__item[data-state="active"] .stepper__dot {
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
}

.stepper__item[data-state="done"] .stepper__dot {
  border-color: var(--ink-soft);
  color: transparent;
  background: var(--surface);
  position: relative;
}

.stepper__item[data-state="done"] .stepper__dot::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 9px;
  margin-top: -1px;
  border: solid var(--ink);
  border-width: 0 1.6px 1.6px 0;
  transform: rotate(45deg);
}

.stepper__label {
  white-space: nowrap;
}

/* Form / steps */
.share-form {
  display: grid;
}

.wizard-step {
  display: grid;
  gap: 20px;
  padding: clamp(22px, 3vw, 30px) clamp(18px, 3vw, 26px);
  animation: stepIn 260ms ease both;
}

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

.section-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.section-fields {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.field {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.field > span,
.field > label > span,
.field-label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.field small,
.turnstile-copy small {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.field-help {
  margin: -2px 0 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.field > label {
  display: block;
}

/* Inputs */
input,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: var(--surface);
  outline: 0;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input {
  min-height: 46px;
  padding: 0 13px;
}

textarea {
  min-height: 112px;
  resize: vertical;
  padding: 11px 13px;
  line-height: 1.5;
}

input:hover,
textarea:hover {
  border-color: #c2c5cc;
}

input:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

::placeholder {
  color: #a3a8b0;
}

/* Slug control */
.slug-control {
  min-height: 46px;
  display: grid;
  grid-template-columns: auto minmax(110px, 1fr);
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.slug-control:hover {
  border-color: #c2c5cc;
}

.slug-control:focus-within {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.slug-control > span {
  height: 100%;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.slug-control input {
  min-width: 0;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-weight: 550;
}

.slug-control input:focus {
  box-shadow: none;
}

.slug-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.slug-actions #slugHint {
  flex: 1 1 180px;
}

#slugHint[data-state="error"] {
  color: var(--danger);
}

#slugHint[data-state="ok"] {
  color: var(--ok);
}

.chip-button {
  flex: 0 0 auto;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.chip-button:hover {
  border-color: #c2c5cc;
  background: var(--surface-muted);
}

.chip-button:focus-visible {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
  outline: 0;
}

/* File input */
.file-field {
  cursor: pointer;
}

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

.file-control {
  min-height: 46px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 6px 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.file-control > span {
  color: var(--muted);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-control strong {
  min-width: 56px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: #fff;
  background: var(--primary);
  font-size: 13px;
  font-weight: 600;
}

.file-field:hover .file-control {
  border-color: #c2c5cc;
}

.file-input:focus + .file-control {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

/* Turnstile */
.turnstile-panel {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  transition: background 160ms ease, border-color 160ms ease;
}

.turnstile-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.turnstile-widget-wrap {
  width: min(100%, 300px);
  min-height: 65px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
}

.turnstile-widget {
  max-width: 100%;
}

.turnstile-panel[data-state="verified"] {
  border-color: #cdebd6;
  background: var(--ok-soft);
}

.turnstile-panel[data-state="verified"] .turnstile-copy small {
  color: var(--ok);
}

.turnstile-panel[data-state="missing"],
.turnstile-panel[data-state="error"],
.turnstile-panel[data-state="expired"] {
  border-color: #f6cccc;
  background: var(--danger-soft);
}

.turnstile-panel[data-state="missing"],
.turnstile-panel[data-state="error"] {
  grid-template-columns: 1fr;
}

.turnstile-panel[data-state="missing"] .turnstile-widget-wrap,
.turnstile-panel[data-state="error"] .turnstile-widget-wrap {
  display: none;
}

.turnstile-panel[data-state="missing"] .turnstile-copy small,
.turnstile-panel[data-state="error"] .turnstile-copy small,
.turnstile-panel[data-state="expired"] .turnstile-copy small {
  color: var(--danger);
}

/* Wizard nav */
.wizard-nav {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 16px clamp(18px, 3vw, 26px) 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.primary-button,
.ghost-button {
  min-height: 44px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: background 140ms ease, border-color 140ms ease, opacity 140ms ease, box-shadow 140ms ease;
}

.primary-button {
  min-width: 116px;
  border: 1px solid var(--primary);
  padding: 0 20px;
  color: #fff;
  background: var(--primary);
}

.primary-button:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.primary-button:focus-visible,
.ghost-button:focus-visible {
  outline: 0;
  box-shadow: var(--focus-ring);
}

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

.ghost-button {
  border: 1px solid var(--line-strong);
  padding: 0 16px;
  color: var(--ink);
  background: var(--surface);
}

.ghost-button:hover {
  border-color: #c2c5cc;
  background: var(--surface-muted);
}

.form-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

.form-status[data-state="error"] {
  color: var(--danger);
}

.form-status[data-state="ok"] {
  color: var(--ok);
}

/* Preview panel */
.preview-shell {
  order: 1;
  position: sticky;
  top: 68px;
  z-index: 20;
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.preview-header h2 {
  color: var(--ink);
}

.preview-header__right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.preview-tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  color: #3b2f00;
  background: #fee500; /* KakaoTalk yellow */
  font-size: 12px;
  font-weight: 700;
}

.preview-toggle {
  display: none; /* desktop: always-open, no toggle */
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.preview-toggle__icon {
  width: 7px;
  height: 7px;
  margin-top: -3px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(-135deg); /* expanded: chevron up */
  transition: transform 160ms ease;
}

.preview-shell[data-collapsed="true"] .preview-toggle__icon {
  margin-top: 1px;
  transform: rotate(45deg); /* collapsed: chevron down */
}

.chip-button__icon {
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2l1.8 5.4L19 9l-5.2 1.6L12 16l-1.8-5.4L5 9l5.2-1.6z'/><path d='M18 14l.9 2.6L21 17.5l-2.1.9L18 21l-.9-2.6L15 17.5l2.1-.9z'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2l1.8 5.4L19 9l-5.2 1.6L12 16l-1.8-5.4L5 9l5.2-1.6z'/><path d='M18 14l.9 2.6L21 17.5l-2.1.9L18 21l-.9-2.6L15 17.5l2.1-.9z'/></svg>") center / contain no-repeat;
  opacity: 0.7;
}

.phone-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 18px;
  border-radius: var(--radius-md);
  background: var(--kakao-bg);
}

.talk-row {
  width: 100%;
  display: flex;
  justify-content: flex-start;
}

.talk-card {
  width: min(100%, 320px);
  overflow: hidden;
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 2px 6px rgba(20, 30, 45, 0.18);
}

.thumb {
  aspect-ratio: 1.91 / 1;
  display: grid;
  place-items: center;
  color: #aeb2b8;
  background: #eceef1;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.thumb[data-image="true"] {
  background-size: cover;
  background-position: center;
}

.thumb[data-image="true"] span {
  display: none;
}

.talk-copy {
  display: grid;
  gap: 6px;
  padding: 13px 14px 14px;
}

.talk-copy strong {
  min-height: 20px;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.talk-copy p {
  min-height: 36px;
  margin: 0;
  color: #5b6168;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.talk-copy span {
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid #f0f1f3;
  color: #9aa0a8;
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* Result */
.result {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border: 1px solid #cdebd6;
  border-radius: var(--radius-md);
  background: var(--ok-soft);
  animation: reveal 200ms ease both;
}

.result > span {
  grid-column: 1 / -1;
  color: var(--ok);
  font-size: 12px;
  font-weight: 650;
}

.result a {
  color: var(--ink);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.result .ghost-button {
  min-width: 64px;
  min-height: 38px;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 17, 21, 0.45);
  backdrop-filter: blur(2px);
  animation: fade 160ms ease both;
}

.modal__card {
  position: relative;
  width: min(100%, 400px);
  display: grid;
  gap: 12px;
  padding: 24px 22px 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(15, 17, 21, 0.28);
  text-align: center;
  animation: pop 180ms cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.modal__icon {
  justify-self: center;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 999px;
}

.modal__icon::after {
  content: "";
  display: block;
}

.modal[data-variant="success"] .modal__icon {
  background: var(--ok-soft);
}

.modal[data-variant="success"] .modal__icon::after {
  width: 13px;
  height: 22px;
  margin-top: -4px;
  border: solid var(--ok);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.modal[data-variant="error"] .modal__icon {
  background: var(--danger-soft);
}

.modal[data-variant="error"] .modal__icon::after {
  width: 3px;
  height: 22px;
  border-radius: 3px;
  background: var(--danger);
  box-shadow: 0 0 0 0 var(--danger);
  position: relative;
}

.modal[data-variant="error"] .modal__icon {
  font-size: 26px;
  font-weight: 700;
  color: var(--danger);
}

.modal[data-variant="error"] .modal__icon::after {
  content: "!";
  width: auto;
  height: auto;
  background: none;
  border: 0;
}

.modal__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.modal__message {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.modal__link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-top: 2px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  text-align: left;
}

.modal__link a {
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.modal__link .ghost-button {
  min-width: 60px;
  min-height: 38px;
}

.modal__actions {
  margin-top: 6px;
}

.modal__actions .primary-button {
  width: 100%;
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

  .modal__link .ghost-button {
    width: 100%;
  }
}

/* Utility */
.bot-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.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;
}

@keyframes stepIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Desktop: side-by-side, preview on the right */
@media (min-width: 1041px) {
  .wizard-grid {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 380px);
  }

  .editor {
    order: 1;
  }

  .preview-shell {
    order: 2;
    top: 80px;
  }

  .phone-preview {
    min-height: 380px;
  }
}

/* Tablet / small */
@media (max-width: 1040px) {
  .preview-shell {
    gap: 12px;
    padding: 14px;
  }

  .phone-preview {
    padding: 18px 16px;
  }
}

@media (max-width: 720px) {
  .topbar {
    min-height: 52px;
    padding: 0 14px;
  }

  .workspace-label {
    display: none;
  }

  .preview-shell {
    top: 56px;
    gap: 0;
  }

  /* Collapsed: slim sticky bar that never blocks the form */
  .preview-shell[data-collapsed="true"] .preview-body {
    display: none;
  }

  /* Expanded: let it scroll away naturally instead of pinning over inputs */
  .preview-shell[data-collapsed="false"] {
    position: static;
    gap: 12px;
  }

  .preview-toggle {
    display: inline-flex;
  }

  .talk-card {
    width: min(100%, 300px);
  }

  /* Compact stepper: keep numbers + connectors, show only the active label */
  .stepper {
    padding: 14px 16px;
  }

  .stepper__item:not(:last-child)::after {
    margin: 0 8px;
  }

  .stepper__item:not([data-state="active"]) .stepper__label {
    display: none;
  }

  input,
  textarea,
  .slug-control,
  .file-control {
    font-size: 16px; /* avoid iOS zoom */
  }

  .slug-control {
    grid-template-columns: 1fr;
  }

  .slug-control > span {
    min-height: 34px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .turnstile-panel {
    grid-template-columns: 1fr;
  }

  .turnstile-widget-wrap {
    width: 100%;
    justify-content: flex-start;
  }

  .wizard-nav {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .form-status {
    grid-column: 1 / -1;
    order: -1;
  }

  .ghost-button#backButton {
    order: 1;
  }

  .primary-button {
    order: 2;
    width: 100%;
    min-height: 50px;
  }

  #backButton[hidden] + .form-status + .primary-button {
    grid-column: 1 / -1;
  }

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

  .result .ghost-button {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .workspace {
    padding-left: 12px;
    padding-right: 12px;
  }

  .brand span:last-child {
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
