:root {
  --bg: #f6f8fb; --surface: #ffffff; --surface-2: #eef2f8; --ink: #121826; --muted: #5d6779;
  --line: #dde3ee; --accent: #2b59ff; --accent-ink: #ffffff; --accent-soft: #e6ecff;
  --ok: #0f8a5f; --err: #c42b2b; --radius: 16px;
  --shadow: 0 1px 2px rgba(18,24,38,.06), 0 10px 30px rgba(18,24,38,.08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1220; --surface: #161b2c; --surface-2: #1e2438; --ink: #eef1f8; --muted: #a2abc0; --line: #2b3350;
    --accent: #7c97ff; --accent-ink: #0e1220; --accent-soft: #212a4a; --ok: #4fd39d; --err: #ff7a7a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1220; --surface: #161b2c; --surface-2: #1e2438; --ink: #eef1f8; --muted: #a2abc0; --line: #2b3350;
  --accent: #7c97ff; --accent-ink: #0e1220; --accent-soft: #212a4a; --ok: #4fd39d; --err: #ff7a7a;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35); color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--accent); text-underline-offset: 2px; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 6px 18px; min-height: 58px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--ink); text-decoration: none; }
.brand svg { width: 26px; height: 26px; }
.nav { display: flex; gap: 4px 16px; flex-wrap: wrap; margin-left: auto; font-size: 15px; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }

.hero { padding: 30px 0 4px; text-align: center; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.12; margin: 0 0 10px; letter-spacing: -.02em; }
.lede { color: var(--muted); font-size: 18px; margin: 0 auto; max-width: 640px; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }

/* editor */
.editor { margin: 22px 0 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 18px; }
.drop { display: grid; place-items: center; text-align: center; gap: 10px; min-height: 260px; padding: 28px 16px; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface-2); cursor: pointer; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop strong { font-size: 20px; }
.drop p { margin: 0; color: var(--muted); font-size: 15px; }
.has-image .drop { display: none; }
.stage { display: none; }
.has-image .stage { display: block; }
.canvas-wrap { position: relative; margin: 0 auto; width: fit-content; max-width: 100%; border-radius: 12px; overflow: hidden; background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 20px 20px; touch-action: none; }
.canvas-wrap canvas { display: block; max-width: 100%; max-height: 70vh; width: auto; height: auto; }
.busy-overlay[hidden] { display: none; }
.canvas-wrap canvas[data-mask] { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.cursor { position: absolute; pointer-events: none; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.5); display: none; }
.busy-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10,14,25,.45); color: #fff; font-weight: 700; }
.busy-overlay span::before { content: ""; display: inline-block; width: 18px; height: 18px; margin-right: 10px; vertical-align: -3px; border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.toolbar label { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--muted); }
.toolbar input[type=range] { width: 140px; accent-color: var(--accent); }
.btn { font: inherit; font-weight: 700; min-height: 46px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-lg { font-size: 18px; min-height: 52px; padding: 12px 22px; }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.run-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.run-row .btn-primary { flex: 1 1 220px; }
.status { min-height: 24px; margin: 12px 0 0; font-size: 15px; color: var(--muted); }
.status[data-kind="error"] { color: var(--err); }
.status[data-kind="ok"] { color: var(--ok); }
.fine { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.turnstile { margin-top: 8px; }

/* content */
.content { margin-top: 36px; }
.content h2 { font-size: 26px; line-height: 1.25; margin: 40px 0 10px; letter-spacing: -.01em; }
.content h3 { font-size: 19px; margin: 22px 0 6px; }
.content p, .content li { max-width: 720px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; padding: 0; list-style: none; counter-reset: s; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; counter-increment: s; }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; margin-bottom: 6px; }
.faq details { border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; margin: 10px 0; background: var(--surface); max-width: 760px; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { margin: 8px 0 0; }
.related { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; padding: 0; list-style: none; }
.related a { display: block; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); font-weight: 700; }
.related a span { display: block; font-weight: 400; font-size: 14px; color: var(--muted); }

/* pricing */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 24px 0; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.plan.featured { border: 2px solid var(--accent); }
.plan h2 { margin: 0; font-size: 20px; }
.price { font-size: 38px; font-weight: 800; letter-spacing: -.02em; }
.price small { font-size: 15px; font-weight: 500; color: var(--muted); }
.plan ul { padding-left: 18px; margin: 0; flex: 1; }
.plan li { margin: 4px 0; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.legal h2 { font-size: 21px; margin-top: 28px; }

.site-footer { margin-top: 64px; border-top: 1px solid var(--line); padding: 28px 0 44px; color: var(--muted); font-size: 14px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 10px; }
.site-footer a { color: var(--muted); }

@media (max-width: 720px) {
  body { font-size: 16px; }
  .hero { padding-top: 18px; }
  .lede { font-size: 16px; }
  .editor { padding: 12px; border-radius: 18px; }
  .drop { min-height: 200px; }
  .nav { margin-left: 0; width: 100%; padding-bottom: 8px; font-size: 14px; }
}
