:root {
  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-2: #f1f5f9;
  --ink: #0f172a;
  --ink-soft: #475569;
  --ink-faint: #94a3b8;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --brand: #4f46e5;
  --brand-deep: #4338ca;
  --brand-soft: #eef2ff;
  --ok: #059669;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 10px;
  --radius-lg: 16px;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.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;
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 24px; }
.logo { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.logo span { color: var(--brand); }
.nav-links { display: flex; gap: 28px; font-size: 14px; color: var(--ink-soft); }
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  font-size: 14px; font-weight: 500; padding: 8px 16px;
  background: var(--ink); color: #fff; border-radius: 8px;
}
.nav-cta:hover { background: var(--brand-deep); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius);
  font-size: 15px; font-weight: 500; border: 1px solid transparent;
  transition: background .15s, border-color .15s, transform .1s, opacity .15s;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-deep); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); background: #fff; }
.btn-ghost:hover:not(:disabled) { border-color: var(--ink); }
.btn-sm { padding: 8px 14px; font-size: 13px; }

/* ---------- hero ---------- */
.hero { padding: 72px 0 56px; text-align: center; }
.eyebrow {
  display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--brand);
  background: var(--brand-soft); padding: 6px 12px; border-radius: 999px; margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(34px, 5vw, 54px); font-weight: 700; letter-spacing: -0.03em;
  line-height: 1.1; margin-bottom: 18px;
}
.hero .lede {
  font-size: 18px; color: var(--ink-soft); max-width: 56ch; margin: 0 auto 30px;
}
.hero .btn-group { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.trust { margin-top: 26px; font-size: 13px; color: var(--ink-faint); }
.trust strong { color: var(--ok); font-weight: 600; }

/* ---------- tool ---------- */
.tool { padding: 24px 0 72px; }

.dropzone {
  border: 2px dashed var(--line-strong); border-radius: var(--radius-lg);
  background: var(--surface); padding: 56px 24px; text-align: center;
  transition: border-color .15s, background .15s;
  cursor: pointer;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--brand); background: var(--brand-soft); }
.dropzone h2 { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.dropzone p { color: var(--ink-soft); font-size: 14px; margin-bottom: 18px; }
.dropzone .hint { font-size: 12px; color: var(--ink-faint); margin-top: 14px; }

.status-bar {
  display: none; align-items: center; gap: 12px;
  background: var(--surface-2); border-radius: var(--radius);
  padding: 12px 16px; margin-top: 16px; font-size: 14px;
}
.status-bar.active { display: flex; }
.spinner {
  width: 16px; height: 16px; border: 2px solid var(--line-strong);
  border-top-color: var(--brand); border-radius: 50%;
  animation: spin .7s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.workspace { display: none; margin-top: 24px; }
.workspace.active { display: block; }

.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 18px;
}
.toolbar .group { display: flex; align-items: center; gap: 8px; }
.toolbar .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.toolbar label { font-size: 13px; color: var(--ink-soft); font-weight: 500; }
.toolbar .spacer { flex: 1; }

.seg { display: inline-flex; background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; padding: 2px; }
.seg button {
  border: none; background: none; padding: 7px 13px; font-size: 13px; font-weight: 500;
  color: var(--ink-soft); border-radius: 6px;
}
.seg button.on { background: var(--ink); color: #fff; }

.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel {
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--surface);
}
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fff;
}
.panel-head .title { font-size: 13px; font-weight: 600; }
.panel-head .note { font-size: 12px; color: var(--ink-faint); }
.panel-body {
  position: relative; background:
    linear-gradient(45deg, #eef1f5 25%, transparent 25%) -8px 0/16px 16px,
    linear-gradient(-45deg, #eef1f5 25%, transparent 25%) -8px 0/16px 16px,
    linear-gradient(45deg, transparent 75%, #eef1f5 75%) 0 0/16px 16px,
    linear-gradient(-45deg, transparent 75%, #eef1f5 75%) 0 0/16px 16px,
    #f8fafc;
  min-height: 320px; display: flex; align-items: center; justify-content: center; padding: 12px;
}
.panel-body canvas { max-width: 100%; height: auto; border-radius: 4px; box-shadow: 0 1px 3px rgba(15,23,42,.12); }

#stageWrap { position: relative; display: inline-block; line-height: 0; }
#overlay { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }

.helper {
  margin-top: 14px; font-size: 13px; color: var(--ink-soft);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 16px;
}
.helper b { color: var(--ink); font-weight: 600; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* ---------- credits + paywall ---------- */
.credit-row {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px; font-size: 13px;
}
.credit-badge {
  display: inline-flex; align-items: center;
  padding: 5px 11px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand);
  font-weight: 600; font-size: 13px;
}
.credit-badge.empty { background: #fef2f2; color: var(--danger); }
.link-btn {
  border: none; background: none; padding: 0;
  color: var(--brand); font-size: 13px; font-weight: 500;
  text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--brand-deep); }

.paywall {
  position: fixed; inset: 0; z-index: 200;
  display: none; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, .55); padding: 20px;
}
.paywall.open { display: flex; }
.paywall-card {
  position: relative; width: 100%; max-width: 420px;
  background: #fff; border-radius: var(--radius-lg);
  padding: 28px 26px 24px;
}
.paywall-card h2 { font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.pw-reason { font-size: 14px; color: var(--ink-soft); margin-bottom: 4px; }
.pw-balance { font-size: 14px; color: var(--ink-soft); margin-bottom: 18px; }
.pw-close {
  position: absolute; top: 14px; right: 16px;
  border: none; background: none; font-size: 24px; line-height: 1;
  color: var(--ink-faint); padding: 4px;
}
.pw-close:hover { color: var(--ink); }
.pw-pack {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 16px 18px; margin-bottom: 16px;
}
.pw-pack-main {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 4px;
}
.pw-pack-n { font-size: 17px; font-weight: 600; }
.pw-pack-price { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.pw-pack-note { font-size: 13px; color: var(--ink-soft); }
.pw-buy { width: 100%; }
.pw-buy:disabled { opacity: .6; cursor: not-allowed; }

/* Status line under the buy button: success, warning and error variants. */
.pw-note {
  margin: 10px 0 0;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: .875rem;
  line-height: 1.45;
  border: 1px solid transparent;
}
.pw-note.ok {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}
.pw-note.warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}
.pw-note.err {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}
.pw-facts {
  list-style: none; margin: 16px 0 12px; padding: 0;
  font-size: 13px; color: var(--ink-soft);
}
.pw-facts li { padding-left: 16px; position: relative; margin-bottom: 6px; }
.pw-facts li::before {
  content: ''; position: absolute; left: 2px; top: 9px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--ink-faint);
}
.pw-later { display: block; margin: 0 auto; color: var(--ink-soft); }

/* ---------- pricing ---------- */
.price-card {
  max-width: 440px; border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 28px 26px; background: #fff;
}
.price-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 4px;
}
.price-n { font-size: 18px; font-weight: 600; }
.price-amount { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; }
.price-per { font-size: 14px; color: var(--ink-soft); margin-bottom: 18px; }
.price-list {
  list-style: none; padding: 0; margin: 0 0 22px;
  font-size: 14px; color: var(--ink-soft);
}
.price-list li { position: relative; padding-left: 20px; margin-bottom: 8px; }
.price-list li::before {
  content: ''; position: absolute; left: 3px; top: 8px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--ok);
}

/* ---------- sections ---------- */
.section { padding: 72px 0; border-top: 1px solid var(--line); }
.section h2 {
  font-size: clamp(26px, 3.2vw, 36px); font-weight: 700; letter-spacing: -0.02em;
  margin-bottom: 14px; line-height: 1.2;
}
.section .sub { color: var(--ink-soft); max-width: 60ch; margin-bottom: 40px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }

.feature {
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px;
  background: #fff;
}
.feature .ico {
  width: 36px; height: 36px; border-radius: 9px; background: var(--brand-soft);
  color: var(--brand); display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700; margin-bottom: 14px;
}
.feature h3 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.feature p { font-size: 14px; color: var(--ink-soft); }

.steps { counter-reset: s; display: grid; gap: 14px; }
.step {
  display: flex; gap: 16px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
}
.step::before {
  counter-increment: s; content: counter(s);
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.step h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.step p { font-size: 14px; color: var(--ink-soft); }

.faq { display: grid; gap: 12px; max-width: 780px; }
.faq details {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; background: #fff;
}
.faq summary { font-weight: 600; font-size: 15px; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; float: right; color: var(--ink-faint); font-weight: 400; }
.faq details[open] summary::after { content: '−'; }
.faq details p { margin-top: 10px; font-size: 14px; color: var(--ink-soft); }

.cta-band {
  background: var(--ink); color: #fff; border-radius: var(--radius-lg);
  padding: 48px 32px; text-align: center;
}
.cta-band h2 { color: #fff; margin-bottom: 10px; }
.cta-band p { color: #cbd5e1; margin-bottom: 24px; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line); padding: 44px 0 36px;
  font-size: 14px; color: var(--ink-soft);
}
.footer-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a:hover { color: var(--ink); }
.footer-note { margin-top: 18px; font-size: 13px; color: var(--ink-faint); }

/* ---------- language switcher ---------- */
.nav-right { display: flex; align-items: center; gap: 12px; }
.lang { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 6px;
  list-style: none; cursor: pointer; user-select: none;
  font-size: 13px; font-weight: 500; color: var(--ink-soft);
  padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: #fff;
}
.lang-btn::-webkit-details-marker { display: none; }
.lang-btn:hover { color: var(--ink); border-color: var(--ink); }
.lang-ico { width: 16px; height: 16px; flex-shrink: 0; }
.lang-chev { width: 14px; height: 14px; flex-shrink: 0; transition: transform .15s; }
.lang[open] .lang-chev { transform: rotate(180deg); }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 80;
  list-style: none; margin: 0; padding: 6px;
  min-width: 172px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
}
.lang-menu li { margin: 0; }
.lang-menu a {
  display: block; padding: 8px 10px; border-radius: 6px;
  font-size: 13px; color: var(--ink-soft); white-space: nowrap;
}
.lang-menu a:hover { background: var(--surface-2); color: var(--ink); }
.lang-menu a.on { color: var(--brand); font-weight: 600; background: var(--brand-soft); }
.footer-legal { display: block; margin-top: 8px; font-size: 12px; color: var(--ink-faint); }

/* ---------- legal ---------- */
.legal { padding: 56px 0 80px; max-width: 760px; }
.legal h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.legal .updated { font-size: 13px; color: var(--ink-faint); margin-bottom: 32px; }
.legal h2 { font-size: 19px; font-weight: 600; margin: 28px 0 10px; }
.legal p, .legal li { font-size: 15px; color: var(--ink-soft); margin-bottom: 10px; }
.legal ul { padding-left: 20px; }

@media (max-width: 860px) {
  .panels { grid-template-columns: 1fr; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .lang-cur { display: none; }
  .nav-right { gap: 8px; }
  .hero { padding: 48px 0 36px; }
  .section { padding: 56px 0; }
}
