/* PixelUp web — design tokens
   Layout: left-weighted hero (copy + upload card left, tall before/after right), 1120px container,
   dark single theme matching the iOS app. The blue→mint gradient appears once per screen. */
:root {
  --bg: #080809;
  --surface: #101117;
  --raised: #181a23;
  --fg: #f3f4f8;
  --muted: #9ea3b5;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --blue: #2336fc;
  --mint: #1ce39d;
  --grad: linear-gradient(100deg, #2336fc 0%, #1ce39d 100%);
  --display: "Outfit", "Segoe UI", system-ui, sans-serif;
  --body: "Figtree", "Segoe UI", system-ui, sans-serif;
  --radius: 14px;
  --container: 1120px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; text-wrap: balance; letter-spacing: -0.015em; }
h1 { font-size: clamp(38px, 5.4vw, 64px); font-weight: 700; }
h2 { font-size: clamp(28px, 3.6vw, 42px); font-weight: 600; }
h3 { font-size: 20px; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
section { padding-block: 88px; }
@media (max-width: 720px) { section { padding-block: 60px; } }
.section-head { max-width: 640px; display: grid; gap: 12px; margin-bottom: 40px; }
.section-head p { color: var(--muted); font-size: 18px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--display); font-weight: 600; font-size: 16px;
  padding: 14px 22px; border-radius: 12px; border: 1px solid transparent;
  cursor: pointer; white-space: nowrap; transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 28px rgba(35, 54, 252, 0.35); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--fg); }
.btn-dark { background: #fff; color: #0b0b0d; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* Nav */
.nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: rgba(8, 8, 9, 0.78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--bg); }
.nav-inner { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 21px; letter-spacing: -0.01em; }
.brand img { width: 32px; height: 32px; border-radius: 9px; }
.nav-links { display: flex; gap: 26px; margin-left: 8px; font-weight: 500; color: var(--muted); }
.nav-links a:hover { color: var(--fg); }
.nav-cta { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.nav-cta .btn { padding: 10px 16px; font-size: 15px; }
.nav-cta .nav-credits { padding: 8px 12px; font-size: 13px; color: var(--fg); border-color: rgba(28, 227, 157, 0.5); white-space: nowrap; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line-strong); color: var(--fg); border-radius: 10px; width: 42px; height: 42px; cursor: pointer; }
@media (max-width: 860px) {
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav.open .nav-links, .nav.open .nav-cta { display: flex; }
  .nav.open .nav-inner { flex-wrap: wrap; height: auto; padding-block: 14px 18px; }
  .nav.open .nav-links { width: 100%; flex-direction: column; gap: 14px; order: 3; margin: 6px 0 0; }
  .nav.open .nav-cta { width: 100%; order: 4; margin-left: 0; }
  .nav.open .nav-toggle { order: 2; }
}

/* Hero */
.hero { padding-block: 64px 80px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -20% auto; height: 80%; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 50% at 70% 30%, rgba(35, 54, 252, 0.28), transparent 70%),
              radial-gradient(40% 40% at 20% 10%, rgba(28, 227, 157, 0.12), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
@media (max-width: 920px) { .hero-grid { grid-template-columns: 1fr; gap: 36px; } }
.hero-copy { display: grid; gap: 22px; min-width: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--mint); }
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 12px var(--mint); }
.hero-copy .lede { font-size: 19px; color: var(--muted); max-width: 520px; }
.hero-copy h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.drop {
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: 26px; background: rgba(255, 255, 255, 0.025);
  display: grid; gap: 14px; justify-items: start; transition: border-color .15s, background .15s; position: relative;
}
.drop.over { border-color: var(--mint); background: rgba(28, 227, 157, 0.06); }
.drop-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.drop-row > span:not(.btn) { color: var(--muted); }
.drop small { color: var(--muted); font-size: 14px; }
.drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.drop .btn { position: relative; z-index: 1; pointer-events: none; }
.drop-state { display: none; align-items: center; gap: 10px; font-size: 15px; color: var(--mint); }
.drop.has-file .drop-state { display: flex; }

.trust { display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--muted); font-size: 15px; }
.trust span { display: inline-flex; gap: 8px; align-items: center; }
.trust svg { width: 16px; height: 16px; color: var(--mint); }
.trust b { color: var(--fg); font-weight: 600; }

/* Chip (shared) */
.chip { border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 500; background: none; color: var(--fg); cursor: pointer; font-family: var(--body); }
.chip[aria-pressed="true"] { background: var(--grad); border-color: transparent; color: #fff; }

/* Tool chips inside the upload box */
.drop .tool-select { position: relative; z-index: 2; display: flex; gap: 8px; flex-wrap: wrap; }
.drop .chip { padding: 6px 12px; font-size: 13px; background: var(--surface); }
.drop .chip[aria-pressed="true"] { background: var(--grad); border-color: transparent; color: #fff; }

/* Before / after slider */
.ba {
  position: relative; width: 100%; border-radius: 18px; overflow: hidden; background: var(--surface);
  aspect-ratio: var(--ratio, 3 / 4); user-select: none; -webkit-user-select: none; touch-action: pan-y;
  border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba .before { clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0); }
.ba .before.demo-blur { filter: blur(4px) saturate(0.85); }
.ba .handle {
  position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 2px; background: #fff; transform: translateX(-50%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.ba .handle::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; border-radius: 50%; transform: translate(-50%, -50%);
  background: var(--grad); border: 3px solid #fff; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}
.ba .handle::before {
  content: "◀ ▶"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1;
  color: #fff; font-size: 10px; letter-spacing: 2px; font-family: var(--body); font-weight: 700;
}
.ba .label {
  position: absolute; top: 14px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; background: rgba(0, 0, 0, 0.55); color: #fff; backdrop-filter: blur(6px); font-family: var(--display);
}
.ba .label.l { left: 14px; } .ba .label.r { right: 14px; }
.ba .label.r { background: rgba(28, 227, 157, 0.9); color: #04140d; }
.ba input[type="range"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.ba .caption { position: absolute; left: 14px; right: 14px; bottom: 12px; font-size: 13px; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.7); }
.hero .ba { width: 100%; max-width: 520px; margin-left: auto; }
@media (max-width: 920px) { .hero .ba { max-width: 100%; margin: 0; --ratio: 4 / 5; } }

/* Tool tiles */
.tools-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
@media (max-width: 1000px) { .tools-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .tools-grid { grid-template-columns: repeat(2, 1fr); } }
.tool {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 18px; min-width: 0;
  display: grid; gap: 12px; align-content: start; transition: border-color .15s, transform .15s; position: relative;
}
.tool:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.tool .icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: rgba(35, 54, 252, 0.18); color: var(--mint); }
.tool .icon svg { width: 22px; height: 22px; }
.tool h3 { font-size: 17px; }
.tool p { color: var(--muted); font-size: 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); font-family: var(--display); }
.pill.mint { border-color: rgba(28, 227, 157, 0.5); color: var(--mint); }
.tool .pill { position: absolute; top: 14px; right: 14px; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: step; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.step { display: grid; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); counter-increment: step; }
.step::before { content: "Step " counter(step); font-family: var(--display); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mint); font-weight: 600; }
.step p { color: var(--muted); }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .gallery { grid-template-columns: 1fr; } .gallery .ba { max-width: 480px; } }
.gallery figure { margin: 0; display: grid; gap: 12px; min-width: 0; }
.gallery .ba { --ratio: 4 / 5; box-shadow: none; }
.gallery figcaption { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 14px; }
.gallery figcaption b { color: var(--fg); font-weight: 600; }

/* Benefit rows (tool pages) */
.benefit { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; padding-block: 48px; border-top: 1px solid var(--line); }
.benefit:first-of-type { border-top: 0; }
.benefit.flip .benefit-media { order: -1; }
@media (max-width: 860px) { .benefit { grid-template-columns: 1fr; gap: 28px; } .benefit.flip .benefit-media { order: 0; } .benefit .ba { --ratio: 4 / 5; } }
.benefit-copy { display: grid; gap: 14px; max-width: 480px; min-width: 0; }
.benefit-copy p { color: var(--muted); font-size: 17px; }
.benefit-copy ul { margin: 4px 0 0; padding-left: 0; list-style: none; display: grid; gap: 8px; color: var(--muted); }
.benefit-copy li { display: flex; gap: 10px; align-items: flex-start; }
.benefit-copy li svg { width: 18px; height: 18px; flex: none; color: var(--mint); margin-top: 3px; }
.benefit-media .ba { --ratio: 4 / 5; box-shadow: none; }

/* App band */
.app-band {
  position: relative; border-radius: 24px; overflow: hidden; padding: 56px; background: var(--surface); border: 1px solid var(--line);
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center;
}
.app-band::before { content: ""; position: absolute; inset: 0; background: radial-gradient(50% 70% at 100% 50%, rgba(35, 54, 252, 0.35), transparent 70%); pointer-events: none; }
.app-band > * { position: relative; }
@media (max-width: 860px) { .app-band { grid-template-columns: 1fr; padding: 32px 24px; } }
.app-copy { display: grid; gap: 18px; min-width: 0; }
.app-copy h2 { font-size: clamp(26px, 3.4vw, 38px); }
.app-copy .only { display: grid; gap: 8px; color: var(--muted); padding-left: 0; list-style: none; margin: 0; }
.app-copy .only li { display: flex; gap: 10px; align-items: center; }
.app-copy .only svg { width: 18px; height: 18px; color: var(--mint); flex: none; }
.store-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.appstore { display: inline-flex; align-items: center; gap: 10px; background: #000; color: #fff; border: 1px solid #3a3a3a; border-radius: 10px; padding: 8px 14px 8px 12px; line-height: 1.1; }
.appstore svg { width: 26px; height: 26px; }
.appstore small { display: block; font-size: 10px; letter-spacing: 0.02em; }
.appstore b { font-family: var(--display); font-size: 18px; font-weight: 600; }
.app-visual { display: grid; justify-items: center; }
.phone { width: min(300px, 80vw); border-radius: 36px; border: 6px solid #1c1d26; overflow: hidden; background: #000; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.phone .ba { border-radius: 0; border: 0; box-shadow: none; --ratio: 9 / 19.5; }
.app-icon-row { display: flex; align-items: center; gap: 12px; }
.app-icon-row img { width: 56px; height: 56px; border-radius: 14px; }
.app-icon-row small { color: var(--muted); display: block; }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch; }
@media (max-width: 860px) { .plans { grid-template-columns: 1fr; } }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 24px; display: grid; gap: 16px; align-content: start; min-width: 0; position: relative; }
.plan.featured { border-color: transparent; background: linear-gradient(var(--raised), var(--raised)) padding-box, var(--grad) border-box; }
.plan .name { font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.plan .price { font-family: var(--display); font-size: 44px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.plan .price small { font-size: 16px; font-weight: 500; color: var(--muted); }
.plan .credits { color: var(--muted); font-size: 15px; }
.plan ul { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 8px; color: var(--muted); font-size: 15px; }
.plan li { display: flex; gap: 10px; align-items: flex-start; }
.plan li svg { width: 16px; height: 16px; color: var(--mint); flex: none; margin-top: 4px; }
.plan .btn { margin-top: auto; }
.plans-note { margin-top: 18px; color: var(--muted); font-size: 14px; display: flex; gap: 10px 22px; flex-wrap: wrap; }

/* FAQ */
.faq { display: grid; gap: 0; max-width: 760px; }
.faq details { border-top: 1px solid var(--line); padding: 4px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 18px 0; font-family: var(--display); font-weight: 600; font-size: 18px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; color: var(--muted); flex: none; transition: transform .15s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); padding-bottom: 20px; max-width: 640px; }

/* Related tools strip */
.related { display: flex; flex-wrap: wrap; gap: 10px; }
.related a { border: 1px solid var(--line-strong); border-radius: 999px; padding: 9px 16px; font-size: 15px; font-weight: 500; color: var(--fg); }
.related a:hover { border-color: var(--mint); }

/* Final CTA */
.cta-final { text-align: center; display: grid; gap: 18px; justify-items: center; }
.cta-final p { color: var(--muted); max-width: 520px; }

/* Footer */
footer { border-top: 1px solid var(--line); padding-block: 48px 40px; color: var(--muted); font-size: 14px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
.foot-grid h4 { font-family: var(--display); color: var(--fg); font-size: 14px; margin: 0 0 12px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot-grid a:hover { color: var(--fg); }
.foot-bottom { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--raised); border: 1px solid var(--line-strong); color: var(--fg); padding: 12px 18px; border-radius: 12px; font-size: 15px; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 80; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

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

/* ===== Result page ===== */
.demo-bar { background: rgba(28, 227, 157, 0.08); border-bottom: 1px solid rgba(28, 227, 157, 0.25); color: var(--muted); font-size: 14px; }
.demo-bar .container { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding-block: 8px; flex-wrap: wrap; }
.demo-bar b { color: var(--mint); font-weight: 600; }
.demo-bar button { background: none; border: 1px solid var(--line-strong); color: var(--fg); border-radius: 8px; padding: 5px 10px; font: inherit; font-size: 13px; cursor: pointer; }

.result { padding-block: 32px 72px; }
.result-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.result-head h1 { font-size: clamp(26px, 3.2vw, 34px); }
.result-head .tool-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.chip { border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 500; background: none; color: var(--fg); cursor: pointer; font-family: var(--body); }
.chip[aria-pressed="true"] { background: var(--grad); border-color: transparent; color: #fff; }
.result-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.75fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .result-grid { grid-template-columns: 1fr; } }
.result .ba { --ratio: 4 / 5; max-width: 100%; }
@media (min-width: 901px) { .result .ba { --ratio: 824 / 1000; } }
.ba .wm { position: absolute; right: 14px; bottom: 14px; padding: 6px 10px; border-radius: 8px; background: rgba(0,0,0,.55); color: #fff; font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: .02em; backdrop-filter: blur(6px); display: flex; gap: 6px; align-items: center; }
.ba .wm img { width: 16px; height: 16px; border-radius: 4px; }
.result-meta { display: flex; gap: 10px 20px; flex-wrap: wrap; color: var(--muted); font-size: 14px; margin-top: 12px; }
.result-meta b { color: var(--fg); font-weight: 600; }

.rail { display: grid; gap: 16px; min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: grid; gap: 14px; min-width: 0; }
.card.hd { border-color: transparent; background: linear-gradient(var(--raised), var(--raised)) padding-box, var(--grad) border-box; }
.card h2 { font-size: 20px; }
.card .sub { color: var(--muted); font-size: 15px; }
.sizes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sizes label { position: relative; border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 8px; text-align: center; cursor: pointer; display: grid; gap: 2px; }
.sizes input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.sizes b { font-family: var(--display); font-size: 16px; }
.sizes small { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.sizes label:has(input:checked) { border-color: var(--mint); background: rgba(28, 227, 157, 0.08); }
.sizes label:has(input:focus-visible) { outline: 2px solid var(--mint); outline-offset: 2px; }
.balance { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.balance b { color: var(--fg); font-variant-numeric: tabular-nums; }
.balance a { color: var(--mint); }
.card .btn { width: 100%; }
.card.app { grid-template-columns: 1fr auto; align-items: center; }
.card.app .qr { width: 96px; height: 96px; background: #fff; border-radius: 10px; padding: 6px; }
.card.app .qr img { width: 100%; height: 100%; }
.card.app .copy { display: grid; gap: 8px; min-width: 0; }
.card.app .copy p { color: var(--muted); font-size: 14px; }
.card.app .appstore { justify-self: start; }
@media (max-width: 420px) { .card.app { grid-template-columns: 1fr; } .card.app .qr { display: none; } }
.rail.ios .card.app { order: -1; }
.secondary { display: flex; gap: 8px; flex-wrap: wrap; }
.secondary .btn { width: auto; padding: 10px 14px; font-size: 14px; flex: 1 1 auto; }

/* Modals */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.modal.open { display: flex; }
.dialog { background: var(--raised); border: 1px solid var(--line-strong); border-radius: 20px; width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 28px; display: grid; gap: 16px; position: relative; }
.dialog.wide { max-width: 760px; }
.dialog h2 { font-size: 24px; }
.dialog .sub { color: var(--muted); font-size: 15px; }
.dialog .close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-strong); background: none; color: var(--fg); font-size: 18px; cursor: pointer; }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; color: var(--muted); }
.field input { font: inherit; font-size: 16px; padding: 13px 14px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg); width: 100%; }
.field input:focus { outline: 2px solid var(--mint); outline-offset: 1px; border-color: transparent; }
.field .err { color: #ff8a8a; font-size: 13px; display: none; }
.field.invalid .err { display: block; }
.field.invalid input { border-color: #ff8a8a; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.google { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; }
.google svg { width: 18px; height: 18px; }
.fine { font-size: 13px; color: var(--muted); }
.fine a { color: var(--fg); text-decoration: underline; }
.code-input { letter-spacing: .4em; font-family: var(--display); font-size: 22px !important; text-align: center; }
.step-hidden { display: none !important; }

.tabs { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; gap: 2px; justify-self: start; }
.tabs button { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 500; padding: 7px 16px; border-radius: 999px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--fg); color: var(--bg); }
.plan-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 640px) { .plan-pick { grid-template-columns: 1fr; } }
.plan-pick label { position: relative; border: 1px solid var(--line-strong); border-radius: 12px; padding: 16px; display: grid; gap: 6px; cursor: pointer; min-width: 0; }
.plan-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.plan-pick label:has(input:checked) { border-color: transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; }
.plan-pick label:has(input:focus-visible) { outline: 2px solid var(--mint); outline-offset: 2px; }
.plan-pick .n { font-family: var(--display); font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.plan-pick .p { font-family: var(--display); font-size: 28px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.plan-pick .p small { font-size: 13px; font-weight: 500; color: var(--muted); }
.plan-pick .c { color: var(--muted); font-size: 13px; }
.plan-pick.packs { grid-template-columns: repeat(2, 1fr); }
.checkout-note { display: flex; gap: 8px 18px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.checkout-note span { display: inline-flex; gap: 6px; align-items: center; }
.checkout-note svg { width: 14px; height: 14px; color: var(--mint); }

/* ===== Erase editor ===== */
.editor { padding-block: 28px 64px; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.7fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .editor-grid { grid-template-columns: 1fr; } }
.stage { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; display: grid; place-items: center; min-height: 320px; }
.stage canvas { display: block; max-width: 100%; height: auto; touch-action: none; cursor: crosshair; }
.stage #maskCanvas { position: absolute; inset: 0; margin: auto; pointer-events: none; opacity: .6; }
.stage .cursor { position: absolute; border: 2px solid #fff; border-radius: 50%; pointer-events: none; transform: translate(-50%, -50%); box-shadow: 0 0 0 1px rgba(0,0,0,.4); display: none; mix-blend-mode: difference; }
.stage.processing::after { content: ""; position: absolute; inset: 0; background: rgba(8,8,9,.55); backdrop-filter: blur(3px); }
.stage .busy { position: absolute; inset: 0; display: none; place-items: center; z-index: 2; color: #fff; font-family: var(--display); font-weight: 600; font-size: 18px; text-align: center; padding: 20px; }
.stage.processing .busy { display: grid; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); border-top-color: var(--mint); animation: spin .9s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.toolbar .grow { flex: 1 1 200px; display: grid; gap: 4px; }
.toolbar label { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; }
.toolbar input[type="range"] { width: 100%; accent-color: var(--mint); }
.toolbar .btn { padding: 10px 14px; font-size: 14px; }
.tips { display: grid; gap: 8px; color: var(--muted); font-size: 14px; padding-left: 0; list-style: none; margin: 0; }
.tips li { display: flex; gap: 10px; align-items: flex-start; }
.tips svg { width: 16px; height: 16px; color: var(--mint); flex: none; margin-top: 3px; }
.mode { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.mode button { border: 0; background: none; color: var(--muted); font: inherit; font-size: 14px; font-weight: 500; padding: 9px 14px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.mode button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.mode svg { width: 16px; height: 16px; }

/* ===== Legal / support pages ===== */
.legal { padding-block: 48px 80px; }
.legal .doc { max-width: 760px; }
.legal h1 { font-size: clamp(30px, 4vw, 44px); margin-bottom: 8px; }
.legal .updated { color: var(--muted); font-size: 14px; margin-bottom: 36px; }
.legal h2 { font-size: 22px; margin-top: 40px; margin-bottom: 10px; }
.legal h3 { font-size: 17px; margin-top: 22px; margin-bottom: 6px; }
.legal p, .legal li { color: var(--muted); font-size: 16px; }
.legal p { margin: 0 0 12px; }
.legal ul { margin: 0 0 14px; padding-left: 22px; }
.legal li { margin: 4px 0; }
.legal strong { color: var(--fg); font-weight: 600; }
.legal a { color: var(--mint); }
.legal .toc { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.legal .toc a { border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--fg); }
.legal table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 10px 0 18px; }
.legal th, .legal td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--muted); }
.legal th { color: var(--fg); font-family: var(--display); font-weight: 600; font-size: 14px; }
.legal .tbl { overflow-x: auto; }
.contact-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: grid; gap: 10px; margin: 24px 0; }
.contact-card b { font-family: var(--display); font-size: 18px; }
.contact-card .email { font-family: var(--display); font-size: 20px; color: var(--fg); word-break: break-all; }

/* ===== Live upload states ===== */
.drop .turnstile { position: relative; z-index: 2; width: 100%; min-height: 0; } /* above the invisible file input that covers the box */
.drop .busy-text { position: relative; z-index: 2; }
.drop .turnstile:empty { display: none; }
.drop .busy-text { display: none; color: var(--mint); font-weight: 600; align-items: center; gap: 10px; }
.drop.busy .busy-text { display: flex; }
.drop.busy .busy-text::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(28,227,157,.3); border-top-color: var(--mint); animation: spin .9s linear infinite; }
.drop.busy .drop-row { opacity: .4; pointer-events: none; }
.ba .ba-busy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(8,8,9,.72); backdrop-filter: blur(4px); color: #fff; text-align: center; padding: 20px; z-index: 3; font-family: var(--display); }
.ba .ba-busy small { color: var(--muted); font-family: var(--body); font-weight: 400; }
.ba .ba-busy .btn { margin-top: 6px; }
.card .turnstile:empty { display: none; }

/* ===== Account page ===== */
.account { padding-block: 40px 72px; }
.account h1 { font-size: clamp(28px, 3.6vw, 40px); }
.signed-out { display: grid; gap: 14px; justify-items: start; max-width: 520px; }
.acct-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.acct-balance { display: grid; gap: 2px; text-align: right; }
.acct-balance b { font-family: var(--display); font-size: 32px; line-height: 1; font-variant-numeric: tabular-nums; }
.acct-balance small { color: var(--mint); font-size: 13px; }
.acct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .acct-grid { grid-template-columns: 1fr; } .acct-balance { text-align: left; } }
.plan-status { display: grid; gap: 12px; font-size: 15px; }
.plan-status .row, .account .row { display: flex; gap: 10px; flex-wrap: wrap; }
.plan-status .btn, .account .row .btn { padding: 9px 14px; font-size: 14px; }
.section-title { font-size: 22px; margin: 40px 0 8px; }
.packs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
@media (max-width: 760px) { .packs { grid-template-columns: 1fr; } }
.plan button.btn { width: 100%; margin-top: auto; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.photos .photo { margin: 0; display: grid; gap: 6px; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.photos figcaption { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.photos figcaption a { color: var(--mint); }
.account table { width: 100%; border-collapse: collapse; font-size: 15px; }
.account th, .account td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--muted); }
.account th { color: var(--fg); font-family: var(--display); font-weight: 600; font-size: 14px; }
.btn.danger { border-color: rgba(255, 110, 110, .5); color: #ff8a8a; }

.account .as-h1 { font-size: clamp(28px, 3.6vw, 40px); font-weight: 700; }
