/* ==========================================================================
   Carousel Studio Pro — stylesheet
   One light, type-led design system: warm paper background, one electric
   accent, generous spacing, and a two-column studio layout that collapses
   to a single column on phones.
   ========================================================================== */

:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-soft: #fbfaf7;
  --ink: #14171d;
  --ink-soft: #3d434e;
  --muted: #626a78;
  --line: #e4e2dc;
  --line-strong: #cfccc4;
  --brand: #2b4bff;
  --brand-dark: #1c34c9;
  --brand-soft: #eef1ff;
  --warm: #ff5a3c;
  --ok: #11875d;
  --danger: #c0392b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(20, 23, 29, 0.05);
  --shadow: 0 12px 32px rgba(20, 23, 29, 0.08);
  --shadow-lg: 0 24px 60px rgba(20, 23, 29, 0.12);
  --header-h: 68px;
  --font-body: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-width: 320px;
  -webkit-font-smoothing: antialiased;
}

body.modal-open { overflow: hidden; }

img, canvas, svg { max-width: 100%; }

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

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.12rem; letter-spacing: -0.01em; }
p { margin: 0 0 14px; }

.wrap { width: min(1240px, calc(100% - 48px)); margin-inline: auto; }
.legal-wrap { width: min(860px, calc(100% - 48px)); margin-inline: auto; }

.muted { color: var(--muted); }
.small { font-size: 13px; line-height: 1.55; }
.tiny { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(246, 245, 242, 0.86);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-size: 13px;
  flex: none;
}
.logo .pro {
  font-size: 10px;
  letter-spacing: 0.12em;
  background: var(--brand);
  color: #fff;
  padding: 3px 6px;
  border-radius: 5px;
  transform: translateY(-1px);
}

.nav {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-size: 14.5px;
  font-weight: 500;
}
.nav a { color: var(--ink-soft); }
.nav a:hover { color: var(--ink); text-decoration: none; }

.header-actions { display: flex; align-items: center; gap: 10px; }

.plan-badge {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  background: #fff;
}
.plan-badge.is-pro { background: var(--ink); border-color: var(--ink); color: #ffd60a; }

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(43, 75, 255, 0.35); outline-offset: 2px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(43, 75, 255, 0.24); }
.btn-primary:hover { background: var(--brand-dark); }

.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: #000; }

.btn-outline { border-color: var(--line-strong); background: #fff; }
.btn-outline:hover { border-color: var(--ink); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: rgba(20, 23, 29, 0.05); }

.btn-small { padding: 7px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-full { width: 100%; }
.btn-lg { padding: 14px 22px; font-size: 15.5px; border-radius: 12px; }
.btn.is-pro-feature { position: relative; }

.icon-btn {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.icon-btn:hover { border-color: var(--ink); color: var(--ink); }
.icon-btn[disabled] { opacity: 0.35; cursor: not-allowed; }

/* ----------------------------------------------------------------- hero */
.hero { padding: 46px 0 26px; }
.hero-inner { max-width: 900px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 16px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: currentColor;
  display: inline-block;
}
.hero h1 { max-width: 16ch; }
.hero .lede {
  font-size: clamp(1rem, 1.6vw, 1.16rem);
  color: var(--ink-soft);
  max-width: 62ch;
  margin: 18px 0 24px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 22px;
  font-size: 13px;
  color: var(--muted);
}
.hero-facts span { display: inline-flex; align-items: center; gap: 6px; }
.hero-facts span::before { content: "✓"; color: var(--brand); font-weight: 800; }

/* --------------------------------------------------------------- studio */
.studio {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  gap: 30px;
  align-items: start;
  padding: 12px 0 40px;
  scroll-margin-top: 84px;
}

.panel { display: grid; gap: 14px; min-width: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  min-width: 0;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.card-num {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.card-head h2 {
  font-size: 14px;
  margin: 0;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  font-weight: 800;
}
.card-head .card-hint { margin-left: auto; font-size: 11.5px; color: var(--muted); }

/* fields */
.field { display: grid; gap: 6px; margin-bottom: 12px; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.field > label,
.field-label {
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.field .hint { font-size: 12px; color: var(--muted); line-height: 1.5; }

input[type="text"], input[type="url"], input[type="email"], input[type="password"], textarea, select {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { resize: vertical; min-height: 84px; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(43, 75, 255, 0.16);
}
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% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}
input[type="color"] {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 38px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 6px; }
input[type="file"] {
  width: 100%;
  font-size: 12.5px;
  color: var(--muted);
  padding: 8px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  cursor: pointer;
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.switch-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--brand);
  cursor: pointer;
  flex: none;
}

/* templates */
.tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tpl-btn {
  text-align: left;
  padding: 10px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.tpl-btn strong { display: block; font-size: 13px; letter-spacing: -0.01em; }
.tpl-btn span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.tpl-btn:hover { border-color: var(--ink); }
.tpl-btn.is-active { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }

/* ratio segmented control */
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.seg button {
  padding: 9px 4px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-soft);
  line-height: 1.25;
}
.seg button small { display: block; font-size: 10.5px; font-weight: 500; color: var(--muted); margin-top: 1px; }
.seg button.is-active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.seg button:hover { border-color: var(--ink); }

/* theme grid */
.theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.theme-card {
  position: relative;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  font-family: inherit;
  text-align: left;
}
.theme-card:hover { border-color: var(--ink); }
.theme-card.is-active { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(43, 75, 255, 0.25); }
.theme-swatch {
  display: block;
  height: 46px;
  position: relative;
  border-bottom: 1px solid var(--line);
}
.theme-dot {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
}
.theme-name {
  display: block;
  padding: 7px 8px 8px;
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.2;
  min-height: 38px;
}
.theme-lock {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: var(--ink);
  color: #ffd60a;
  padding: 2px 5px;
  border-radius: 4px;
}
.theme-lock:empty { display: none; }
.theme-card.is-locked .theme-swatch::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(246, 245, 242, 0.22);
}
.theme-card.is-locked:hover { border-color: var(--brand); }

/* presets */
.preset-list { display: grid; gap: 6px; margin-top: 10px; }
.preset-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
  font-size: 13px;
  min-width: 0;
}
.preset-row strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.preset-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }

/* slide list */
.slide-list { display: grid; gap: 6px; max-height: 340px; overflow-y: auto; padding-right: 2px; }
.slide-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  min-width: 0;
}
.slide-row.is-active { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.slide-row-thumb {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  flex: none;
  line-height: 0;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--line);
}
.slide-row-canvas { display: block; width: 44px; height: auto; }
.slide-row-info { min-width: 0; flex: 1; display: grid; }
.slide-row-info strong {
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slide-row-info span { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slide-row-actions { display: flex; gap: 3px; flex: none; }
.slide-row-actions .icon-btn { width: 24px; height: 24px; font-size: 11.5px; border-color: transparent; background: transparent; }
.slide-row-actions .icon-btn:hover { background: var(--surface-soft); border-color: var(--line-strong); }

/* --------------------------------------------------------------- stage */
.stage { position: sticky; top: calc(var(--header-h) + 18px); min-width: 0; }
.stage-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.stage-bar .meta { margin-left: auto; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stage-bar .icon-btn { width: 30px; height: 30px; }

.canvas-shell {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
  max-width: 620px;
  margin-inline: auto;
}
.canvas-wrap { position: relative; border-radius: 10px; overflow: hidden; background: #fff; }
#preview-canvas { display: block; width: 100%; height: auto; }

.busy {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(2px);
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
  text-align: center;
  padding: 20px;
}
.busy[hidden] { display: none; }
.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
  margin: 0 auto 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.slide-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 2px 8px;
  max-width: 620px;
  margin-inline: auto;
  scrollbar-width: thin;
}
.slide-chip {
  flex: none;
  width: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 4px;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
}
.slide-chip-canvas { display: block; width: 100%; height: auto; border-radius: 4px; }
.slide-chip-label {
  display: block;
  font-size: 9.5px;
  color: var(--muted);
  margin-top: 3px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slide-chip.is-active { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.slide-chip.is-active .slide-chip-label { color: var(--brand); font-weight: 700; }

.stage-hint { max-width: 620px; margin: 6px auto 0; font-size: 12px; color: var(--muted); text-align: center; }

/* -------------------------------------------------------------- sections */
.section { padding: 54px 0; }
.section-head { max-width: 720px; margin-bottom: 26px; }
.section-head p { color: var(--muted); margin: 8px 0 0; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.step-num {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--brand);
  margin-bottom: 12px;
}
.step h3 { margin-bottom: 6px; }
.step p { margin: 0; font-size: 14px; color: var(--muted); }

.audience { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.audience div {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: var(--surface-soft);
  font-size: 13.5px;
}
.audience strong { display: block; margin-bottom: 3px; font-size: 13.5px; }
.audience span { color: var(--muted); font-size: 12.5px; }

/* ---------------------------------------------------------------- pricing */
.pricing { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.price-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px;
  min-width: 0;
}
.price-card.is-pro {
  border-color: var(--ink);
  box-shadow: var(--shadow);
  position: relative;
}
.price-tag {
  position: absolute;
  top: -11px;
  left: 26px;
  background: var(--ink);
  color: #ffd60a;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 4px 8px;
  border-radius: 6px;
}
.price-card h3 { font-size: 18px; margin-bottom: 4px; }
.price-line { display: flex; align-items: baseline; gap: 8px; margin: 12px 0 4px; }
.price-line .amount { font-family: var(--font-head); font-size: 42px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.price-line .period { color: var(--muted); font-size: 13.5px; }
.price-note { font-size: 12.5px; color: var(--muted); margin-bottom: 16px; }
.price-options { display: grid; gap: 8px; margin: 16px 0 12px; }
.price-options .btn {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 11px 16px;
  text-align: left;
}
.price-options .btn .tiny { font-weight: 500; }
.modal .price-options .btn { align-items: stretch; text-align: center; }
.price-option {
  display: grid;
  gap: 1px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface-soft);
}
.price-option strong { font-size: 13.5px; }
.price-option span { font-size: 12px; color: var(--muted); }
.feature-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; font-size: 14px; }
.feature-list li { display: flex; gap: 9px; align-items: flex-start; }
.feature-list li::before { content: "✓"; color: var(--brand); font-weight: 800; flex: none; }
.feature-list li.off { color: var(--muted); }
.feature-list li.off::before { content: "—"; color: var(--line-strong); }
.price-card .btn { margin-top: 18px; }
.pricing-foot { margin-top: 14px; font-size: 12.5px; color: var(--muted); }

/* -------------------------------------------------------------------- faq */
.faq { display: grid; gap: 8px; max-width: 860px; }
details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
}
details[open] { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
summary {
  cursor: pointer;
  font-weight: 650;
  font-size: 15px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 19px; color: var(--muted); font-weight: 400; line-height: 1; }
details[open] summary::after { content: "–"; }
details p { margin: 10px 0 0; color: var(--ink-soft); font-size: 14px; }

/* ----------------------------------------------------------------- footer */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 30px;
  padding: 36px 0 44px;
  font-size: 13.5px;
  color: var(--muted);
}
.footer-grid { display: flex; flex-wrap: wrap; gap: 24px 48px; justify-content: space-between; }
.footer-brand { max-width: 320px; }
.footer-brand .logo { margin-bottom: 10px; }
.footer-links { display: grid; grid-auto-flow: column; grid-template-rows: repeat(4, auto); grid-template-columns: repeat(2, minmax(120px, auto)); gap: 6px 36px; }
.footer-links a { color: var(--ink-soft); font-size: 13.5px; }
.footer-bottom {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

/* ------------------------------------------------------------------ ads */
.ad-slot {
  display: block;
  min-height: 90px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.015), rgba(0, 0, 0, 0.015) 8px, transparent 8px, transparent 16px);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: grid;
  place-items: center;
  margin: 26px 0;
}
.ad-slot[hidden] { display: none; }

/* ---------------------------------------------------------------- modals */
/* Native <dialog> in the top layer: always paints above the sticky header,
   the frosted backdrop-filter layer and anything else on the page. */
dialog.modal {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 20px;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow-y: auto;
  display: none;
  place-items: center;
  z-index: 100;
}
dialog.modal[open] { display: grid; }
dialog.modal::backdrop { background: transparent; }

/* The dim layer is a fixed body pseudo-element: it reliably covers the whole
   viewport (including the sticky header) in every engine, while the dialog in
   the top layer guarantees the card paints above everything. */
body.modal-open::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 22, 0.55);
  z-index: 90;
  pointer-events: none;
}

/* hidden must beat the display rules of components */
[hidden] { display: none !important; }
.modal-card {
  width: min(480px, 100%);
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 26px;
  position: relative;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.modal-card h2 { font-size: 1.45rem; margin-bottom: 6px; }
.modal-card p { color: var(--muted); font-size: 14px; }
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { background: var(--surface-soft); color: var(--ink); }
.modal .price-options { margin: 16px 0; }
.modal .btn { width: 100%; }
.modal-foot { margin-top: 14px; font-size: 12.5px; color: var(--muted); text-align: center; }
.modal-foot a { font-weight: 600; }
.form-msg { font-size: 13px; min-height: 20px; margin: 10px 0 14px; }
.form-msg.is-info { color: var(--muted); }
.form-msg.is-ok { color: var(--ok); font-weight: 600; }
.form-msg.is-error { color: var(--danger); font-weight: 600; }

/* ----------------------------------------------------------------- toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 16px);
  z-index: 120;
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  max-width: min(560px, calc(100% - 32px));
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  text-align: center;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* --------------------------------------------------------- static pages */
.page-hero { padding: 56px 0 22px; }
.page-hero h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
.page-hero p { color: var(--muted); max-width: 65ch; }
.prose { padding: 10px 0 60px; }
.prose h2 { font-size: 1.3rem; margin-top: 34px; }
.prose h3 { font-size: 1.02rem; margin-top: 22px; }
.prose p, .prose li { color: var(--ink-soft); font-size: 15px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 16px; }
.prose li { margin-bottom: 6px; }
.prose table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 9px 11px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-soft); font-weight: 700; }
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: rgba(20, 23, 29, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
}
.callout {
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
  padding: 14px 16px;
  border-radius: 0 10px 10px 0;
  font-size: 14px;
  margin: 18px 0;
}
.callout p:last-child { margin: 0; }
.contact-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: start; }
.contact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.copy-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.copy-row input { font-family: ui-monospace, monospace; font-size: 13px; }
.error-page { min-height: 62vh; display: grid; place-content: center; text-align: center; padding: 60px 20px; }
.error-page .code {
  font-family: var(--font-head);
  font-size: clamp(4rem, 14vw, 8rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
  margin: 0;
  color: var(--brand);
}
.error-page p { color: var(--muted); max-width: 46ch; margin: 10px auto 22px; }
.error-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1080px) {
  .studio { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 22px; }
  .audience { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .nav { display: none; }
  .studio { grid-template-columns: 1fr; }
  .stage { position: static; order: -1; }
  .canvas-shell { max-width: 460px; }
  .slide-strip { max-width: 460px; }
  .stage-hint { max-width: 460px; }
  .steps { grid-template-columns: 1fr; }
  .pricing { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .price-card.is-pro { order: -1; }
}

@media (max-width: 640px) {
  .wrap, .legal-wrap { width: calc(100% - 32px); }
  .header-inner { gap: 10px; min-height: 60px; }
  .logo { font-size: 15.5px; }
  .logo .pro { display: none; }
  .header-actions .btn { padding: 8px 11px; font-size: 12.5px; }
  .plan-badge { font-size: 9.5px; padding: 3px 6px; }
  .hero { padding: 30px 0 18px; }
  .hero h1 { max-width: 100%; }
  .section { padding: 38px 0; }
  .card { padding: 15px; border-radius: 13px; }
  .canvas-shell { padding: 9px; border-radius: 14px; }
  .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-row { grid-template-columns: 1fr; }
  .footer-grid { gap: 22px; }
  .footer-links { grid-template-columns: 1fr 1fr; }
  .slide-row-actions .icon-btn { width: 26px; height: 26px; }
  .price-line .amount { font-size: 36px; }
  .modal-card { padding: 20px; }
  .slide-list { max-height: none; }
}

@media (max-width: 380px) {
  .seg button small { display: none; }
  .theme-grid { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
