/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-alt: #f0f1f4;
  --ink: #12151c;
  --ink-soft: #363c48;
  --muted: #626a79;
  --border: #e1e4ea;
  --border-strong: #c7ccd6;
  --accent: #1d3fd6;
  --accent-dark: #142c9c;
  --accent-soft: #e8ecfd;
  --danger: #c22b2b;
  --danger-soft: #fbe9e9;
  --success: #16794a;
  --success-soft: #e5f5ec;
  --warn: #92600a;
  --warn-soft: #fbf0dc;
  --redact: #0b0d12;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(18, 21, 28, 0.06);
  --shadow: 0 8px 24px rgba(18, 21, 28, 0.08);
  --shadow-lg: 0 24px 64px rgba(18, 21, 28, 0.14);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --container: 1180px;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
[hidden] { display: none !important; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
input, select, textarea { font: inherit; color: inherit; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.12; letter-spacing: -0.01em; font-weight: 700; }
ul { list-style: none; padding: 0; }
::selection { background: var(--accent-soft); color: var(--accent-dark); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--ink); color: #fff;
  z-index: 9999; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   3. Utilities
   ============================================================= */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 1.25rem; }
.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;
}
.section { padding-block: clamp(3.5rem, 7vw, 6.5rem); }
.section-head { max-width: 640px; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head.center { margin-inline: auto; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .9rem;
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.muted { color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.row { display: flex; align-items: center; gap: .75rem; }
.divider { height: 1px; background: var(--border); border: 0; margin-block: 1.5rem; }

/* =============================================================
   4. Typography
   ============================================================= */
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.25rem; }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--muted); line-height: 1.65; }

/* =============================================================
   5. Components
   ============================================================= */

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.4rem; border-radius: var(--radius-sm); font-weight: 600; font-size: .95rem;
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out), background-color .18s var(--ease-out), color .18s var(--ease-out), border-color .18s var(--ease-out);
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--border-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-quiet { background: var(--surface-alt); color: var(--ink); }
.btn-quiet:hover { background: var(--border); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-lg { padding: 1rem 1.8rem; font-size: 1.02rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* --- Badges / pills --- */
.badge {
  display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem;
  border-radius: 999px; font-size: .78rem; font-weight: 700; letter-spacing: .01em;
}
.badge-demo { background: var(--warn-soft); color: var(--warn); border: 1px solid rgba(146,96,10,.25); }
.badge-ok { background: var(--success-soft); color: var(--success); }
.badge-accent { background: var(--accent-soft); color: var(--accent-dark); }
.badge-muted { background: var(--surface-alt); color: var(--muted); }

.credits-pill {
  display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .9rem;
  border-radius: 999px; background: var(--surface-alt); border: 1px solid var(--border);
  font-weight: 700; font-size: .92rem; font-variant-numeric: tabular-nums;
}
.credits-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.credits-pill.is-low { background: var(--danger-soft); color: var(--danger); border-color: rgba(194,43,43,.25); }
.credits-pill.is-low .dot { background: var(--danger); }

/* --- Cards --- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.75rem; box-shadow: var(--shadow-sm);
}

/* --- Forms --- */
.field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.1rem; }
.field label { font-size: .88rem; font-weight: 600; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  padding: .78rem .9rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); font-size: .98rem; transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field .hint { font-size: .82rem; color: var(--muted); }
.field .error-text { font-size: .82rem; color: var(--danger); display: none; }
.field.has-error input { border-color: var(--danger); }
.field.has-error .error-text { display: block; }
.form-card { max-width: 420px; width: 100%; }
.form-msg {
  padding: .85rem 1rem; border-radius: var(--radius-sm); font-size: .9rem; margin-bottom: 1.1rem; display: none;
}
.form-msg.is-visible { display: block; }
.form-msg.err { background: var(--danger-soft); color: var(--danger); }
.form-msg.ok { background: var(--success-soft); color: var(--success); }

/* --- Nav --- */
.nav {
  position: sticky; top: 0; z-index: 500; background: rgba(245,246,248,.88);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
@supports not (backdrop-filter: blur(10px)) { .nav { background: var(--bg); } }
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding-block: .9rem; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.08rem; letter-spacing: -.01em; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--ink);
  display: grid; place-items: center; flex: none;
}
.brand .mark svg { width: 16px; height: 16px; }
.nav-links { display: none; align-items: center; gap: 1.9rem; font-size: .92rem; font-weight: 600; color: var(--ink-soft); }
.nav-links a:hover { color: var(--accent); }
.nav-cta { display: flex; align-items: center; gap: .7rem; }
@media (min-width: 860px) { .nav-links { display: flex; } .nav-cta .btn-ghost.only-mobile { display: none; } }
.nav-burger { display: inline-flex; padding: .5rem; border-radius: 8px; }
.nav-burger svg { width: 22px; height: 22px; }
@media (min-width: 860px) { .nav-burger { display: none; } }
.nav-mobile { display: none; border-top: 1px solid var(--border); padding: 1rem 0 1.4rem; }
.nav-mobile.is-open { display: block; }
.nav-mobile a { display: block; padding: .6rem 0; font-weight: 600; }
@media (min-width: 860px) { .nav-mobile { display: none !important; } }

/* --- App topbar --- */
.topbar {
  position: sticky; top: 0; z-index: 500; background: var(--surface); border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; padding-block: .85rem; gap: 1rem; }
.topbar-right { display: flex; align-items: center; gap: .8rem; }
.account-menu { position: relative; }
.account-btn {
  display: flex; align-items: center; gap: .5rem; padding: .45rem .6rem .45rem .45rem;
  border-radius: 999px; border: 1px solid var(--border);
}
.account-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark);
  display: grid; place-items: center; font-weight: 800; font-size: .82rem; flex: none;
}
.account-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 200px; padding: .5rem; display: none; z-index: 50;
}
.account-dropdown.is-open { display: block; }
.account-dropdown a, .account-dropdown button {
  display: flex; width: 100%; text-align: left; padding: .6rem .7rem; border-radius: 8px; font-size: .92rem; font-weight: 600;
}
.account-dropdown a:hover, .account-dropdown button:hover { background: var(--surface-alt); }

/* --- Modal / dialog --- */
dialog {
  border: 0; border-radius: var(--radius-lg); padding: 0; max-width: 480px; width: calc(100vw - 2rem);
  box-shadow: var(--shadow-lg); background: var(--surface);
}
dialog::backdrop { background: rgba(12, 14, 20, .55); backdrop-filter: blur(2px); }
.modal-body { padding: 1.9rem; }
.modal-close {
  position: absolute; top: 1rem; right: 1rem; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-alt);
}
.modal-close svg { width: 16px; height: 16px; }

/* --- Toasts (never alert()) --- */
.toast-stack {
  position: fixed; bottom: 1.25rem; right: 1.25rem; left: 1.25rem; z-index: 900;
  display: flex; flex-direction: column; align-items: flex-end; gap: .6rem; pointer-events: none;
}
.toast {
  pointer-events: auto; max-width: 380px; padding: .9rem 1.1rem; border-radius: var(--radius-sm);
  background: var(--ink); color: #fff; font-size: .9rem; box-shadow: var(--shadow-lg);
  display: flex; align-items: flex-start; gap: .6rem;
  animation: toastIn .25s var(--ease-out);
}
.toast.err { background: var(--danger); }
.toast.ok { background: var(--success); }
.toast.warn { background: var(--warn); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* --- Demo badge banner --- */
.demo-banner {
  background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid rgba(146,96,10,.25);
  font-size: .84rem; font-weight: 700; text-align: center; padding: .55rem 1rem;
}

/* =============================================================
   6. Sections — landing
   ============================================================= */

/* --- Hero --- */
.hero { padding-block: clamp(3rem, 8vw, 6rem) clamp(2.5rem, 6vw, 4rem); }
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.05fr .95fr; gap: 3.5rem; } }
.hero-title { max-width: 20ch; }
.hero-title .hl { color: var(--accent); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 1.7rem; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 1.4rem; margin-top: 1.6rem; font-size: .86rem; color: var(--muted); }
.hero-trust .row svg { width: 16px; height: 16px; color: var(--success); flex: none; }

/* --- Before / after mock document --- */
.doc-compare { display: grid; grid-template-columns: 1fr; gap: 1.1rem; position: relative; }
@media (min-width: 640px) { .doc-compare { grid-template-columns: 1fr 1fr; } }
.doc-mock {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.2rem 1.2rem 1.4rem; position: relative; overflow: hidden;
}
.doc-mock-label {
  position: absolute; top: .7rem; right: .7rem; font-size: .68rem; font-weight: 800; letter-spacing: .05em;
  text-transform: uppercase; padding: .25rem .55rem; border-radius: 999px;
}
.doc-mock.before .doc-mock-label { background: var(--danger-soft); color: var(--danger); }
.doc-mock.after .doc-mock-label { background: var(--success-soft); color: var(--success); }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: .9rem; padding-bottom: .8rem; border-bottom: 1px dashed var(--border); }
.doc-head .doc-brand { font-weight: 800; font-size: .82rem; color: var(--ink-soft); }
.doc-head .doc-num { font-size: .68rem; color: var(--muted); font-family: var(--mono); }
.doc-line { height: 9px; border-radius: 3px; background: var(--surface-alt); margin-bottom: .55rem; }
.doc-line.w-90 { width: 90%; } .doc-line.w-75 { width: 75%; } .doc-line.w-60 { width: 60%; }
.doc-line.w-45 { width: 45%; } .doc-line.w-100 { width: 100%; }
.doc-field { display: flex; justify-content: space-between; gap: .6rem; margin-bottom: .55rem; font-size: .72rem; }
.doc-field .k { color: var(--muted); flex: none; }
.doc-field .v { font-weight: 600; color: var(--ink-soft); text-align: right; }
.doc-mock.after .doc-field .v.is-sensitive { position: relative; color: transparent; border-radius: 3px; }
.doc-mock.after .doc-field .v.is-sensitive::after {
  content: ""; position: absolute; inset: -1px -3px; background: var(--redact); border-radius: 3px;
}
.doc-mock.before .doc-field .v.is-sensitive { color: var(--ink-soft); }

/* --- Trust bar --- */
.trustbar { padding-block: 1.5rem; border-block: 1px solid var(--border); }
.trustbar-inner { display: flex; flex-wrap: wrap; gap: .8rem 2.4rem; align-items: center; justify-content: center; color: var(--muted); font-size: .86rem; font-weight: 600; }

/* --- Features grid --- */
.feature-grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .feature-grid { grid-template-columns: repeat(3, 1fr); } }
.feature-card { display: flex; flex-direction: column; gap: .8rem; }
.feature-icon {
  width: 42px; height: 42px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-dark);
  display: grid; place-items: center;
}
.feature-icon svg { width: 21px; height: 21px; }
.feature-card h3 { font-size: 1.05rem; }
.feature-card p { color: var(--muted); font-size: .93rem; }

/* --- How it works --- */
.steps { display: grid; gap: 1.5rem; grid-template-columns: 1fr; counter-reset: step; }
@media (min-width: 780px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.step { position: relative; padding-top: 2.6rem; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 0; left: 0; width: 2.1rem; height: 2.1rem; border-radius: 8px;
  background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .95rem;
}
.step h3 { font-size: 1rem; margin-bottom: .35rem; }
.step p { color: var(--muted); font-size: .9rem; }

/* --- Real redaction callout --- */
.callout {
  background: var(--ink); color: #fff; border-radius: var(--radius-lg); padding: clamp(1.8rem, 4vw, 3rem);
  display: grid; gap: 1.6rem;
}
@media (min-width: 860px) { .callout { grid-template-columns: 1fr 1fr; align-items: center; } }
.callout h2 { color: #fff; }
.callout p { color: rgba(255,255,255,.72); }
.callout ul { display: flex; flex-direction: column; gap: .6rem; margin-top: 1rem; }
.callout li { display: flex; gap: .6rem; font-size: .93rem; color: rgba(255,255,255,.88); }
.callout li svg { width: 18px; height: 18px; color: #6fe3a6; flex: none; margin-top: .1rem; }
.callout-panel { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius); padding: 1.3rem; font-family: var(--mono); font-size: .82rem; line-height: 1.75; color: rgba(255,255,255,.85); }
.callout-panel .line-ok { color: #6fe3a6; }
.callout-panel .line-no { color: #ff8e8e; }

/* --- Testimonials --- */
.testi-grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 780px) { .testi-grid { grid-template-columns: repeat(3, 1fr); } }
.testi { display: flex; flex-direction: column; gap: 1rem; }
.testi p { font-size: .95rem; color: var(--ink-soft); }
.testi-who { display: flex; align-items: center; gap: .7rem; }
.testi-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--surface-alt); display: grid; place-items: center; font-weight: 800; font-size: .82rem; color: var(--ink-soft); }
.testi-who .name { font-weight: 700; font-size: .88rem; }
.testi-who .role { font-size: .8rem; color: var(--muted); }

/* --- Pricing --- */
.pricing-grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 780px) { .pricing-grid { grid-template-columns: repeat(3, 1fr); } }
.plan-card { display: flex; flex-direction: column; position: relative; }
.plan-card.is-featured { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.plan-badge {
  position: absolute; top: -13px; left: 1.75rem; background: var(--accent); color: #fff;
  font-size: .72rem; font-weight: 800; padding: .3rem .7rem; border-radius: 999px; letter-spacing: .02em;
}
.plan-name { font-size: .95rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.plan-price { display: flex; align-items: baseline; gap: .35rem; margin-block: .6rem 1.1rem; }
.plan-price .amount { font-size: 2.4rem; font-weight: 800; letter-spacing: -.02em; }
.plan-price .period { color: var(--muted); font-size: .9rem; }
.plan-credits { font-weight: 700; font-size: .92rem; margin-bottom: 1.2rem; display: flex; align-items: center; gap: .4rem; }
.plan-credits svg { width: 16px; height: 16px; color: var(--accent); }
.plan-features { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1.5rem; flex: 1; }
.plan-features li { display: flex; gap: .55rem; font-size: .89rem; color: var(--ink-soft); }
.plan-features li svg { width: 16px; height: 16px; color: var(--success); flex: none; margin-top: .15rem; }
.pricing-note { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 1.75rem; }
.pricing-note a { color: var(--accent); font-weight: 600; }

/* --- FAQ --- */
.faq-list { max-width: 780px; margin-inline: auto; display: flex; flex-direction: column; gap: .7rem; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.faq-q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 1.3rem; font-weight: 700; text-align: left; font-size: .97rem;
}
.faq-q svg { width: 18px; height: 18px; flex: none; transition: transform .2s var(--ease-out); color: var(--muted); }
.faq-item[open] .faq-q svg { transform: rotate(45deg); }
.faq-a { padding: 0 1.3rem 1.2rem; color: var(--muted); font-size: .92rem; line-height: 1.65; }

/* --- CTA band --- */
.cta-band { text-align: center; background: var(--accent-soft); border-radius: var(--radius-lg); padding: clamp(2.2rem, 5vw, 3.5rem); }
.cta-band h2 { margin-bottom: .7rem; }
.cta-band .btn { margin-top: 1.3rem; }

/* --- Footer --- */
.footer { border-top: 1px solid var(--border); padding-block: 2.8rem 2.2rem; margin-top: 2rem; }
.footer-grid { display: grid; gap: 2.2rem; grid-template-columns: 1fr; }
@media (min-width: 780px) { .footer-grid { grid-template-columns: 1.4fr repeat(3, 1fr); } }
.footer-brand p { color: var(--muted); font-size: .88rem; margin-top: .8rem; max-width: 30ch; }
.footer-col h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: .9rem; }
.footer-col ul { display: flex; flex-direction: column; gap: .55rem; }
.footer-col a { font-size: .9rem; color: var(--ink-soft); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: space-between; align-items: center; margin-top: 2.4rem; padding-top: 1.6rem; border-top: 1px solid var(--border); font-size: .82rem; color: var(--muted); }

/* =============================================================
   7. App shell
   ============================================================= */
.app-main { padding-block: 1.6rem 3rem; }
.app-shell { display: grid; gap: 1.5rem; }
@media (min-width: 980px) { .app-shell { grid-template-columns: 1fr 320px; align-items: start; } }

.tool-card { padding: 1.5rem; }
.tool-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.tool-head h1 { font-size: 1.3rem; }
.tool-head p { color: var(--muted); font-size: .9rem; margin-top: .3rem; }

.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: clamp(2rem, 5vw, 3.2rem) 1.5rem;
  text-align: center; transition: border-color .18s var(--ease-out), background-color .18s var(--ease-out);
  display: flex; flex-direction: column; align-items: center; gap: .9rem;
}
.dropzone.is-dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--surface-alt); display: grid; place-items: center; color: var(--accent); }
.dropzone-icon svg { width: 26px; height: 26px; }
.dropzone p { color: var(--muted); font-size: .9rem; }
.dropzone .hint { font-size: .8rem; }

[data-tool-state] .tool-stage { display: none; }
[data-tool-state="idle"] .stage-idle { display: block; }
[data-tool-state="reading"] .stage-reading { display: block; }
[data-tool-state="reviewing"] .stage-reviewing { display: block; }
[data-tool-state="working"] .stage-working { display: block; }
[data-tool-state="done"] .stage-done { display: block; }
[data-tool-state="error"] .stage-error { display: block; }

.stage-center { text-align: center; padding: 3rem 1rem; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.spinner {
  width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--border);
  border-top-color: var(--accent); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-track { width: 100%; max-width: 320px; height: 8px; border-radius: 999px; background: var(--surface-alt); overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s var(--ease-out); width: 0%; }

.cost-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  background: var(--accent-soft); border: 1px solid rgba(29,63,214,.18); border-radius: var(--radius-sm);
  padding: .9rem 1.1rem; margin-bottom: 1.1rem; font-size: .9rem;
}
.cost-banner strong { color: var(--accent-dark); }

.viewer-wrap { display: grid; gap: 1.1rem; }
@media (min-width: 720px) { .viewer-wrap { grid-template-columns: 1fr 300px; align-items: start; } }
.viewer-stage {
  background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; display: flex; flex-direction: column; align-items: center; gap: .8rem; max-height: 78vh; overflow: auto;
}
.viewer-page { position: relative; box-shadow: var(--shadow); background: #fff; line-height: 0; }
.viewer-page canvas { display: block; max-width: 100%; height: auto; }
.viewer-page .redact-box {
  position: absolute; background: var(--redact); cursor: pointer; transition: opacity .12s var(--ease-out);
}
.viewer-page .redact-box.is-off { background: transparent; outline: 2px dashed rgba(194,43,43,.75); }
.viewer-page .redact-box.is-manual { outline: 2px solid var(--accent); }
.viewer-pager { display: flex; align-items: center; gap: .7rem; font-size: .85rem; color: var(--muted); }

.detect-panel { display: flex; flex-direction: column; gap: .9rem; }
.detect-panel h2 { font-size: .95rem; }
.detect-tools { display: flex; gap: .5rem; flex-wrap: wrap; }
.detect-list { display: flex; flex-direction: column; gap: .5rem; max-height: 48vh; overflow: auto; padding-right: .2rem; }
.detect-item {
  display: flex; align-items: flex-start; gap: .6rem; padding: .65rem .7rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: .84rem;
}
.detect-item.is-off { opacity: .5; }
.detect-item.is-unplaced { border-color: rgba(194,43,43,.4); background: var(--danger-soft); }
.detect-item .type-badge {
  flex: none; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .02em;
  padding: .18rem .45rem; border-radius: 5px; background: var(--surface-alt); color: var(--ink-soft);
}
.detect-item .txt { flex: 1; word-break: break-word; font-family: var(--mono); font-size: .78rem; }
.detect-item .toggle { flex: none; }
.detect-item .del { flex: none; color: var(--muted); }
.switch {
  position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--border-strong); flex: none;
  transition: background-color .16s var(--ease-out);
}
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .16s var(--ease-out); box-shadow: var(--shadow-sm); }
.switch.is-on { background: var(--accent); }
.switch.is-on::after { transform: translateX(16px); }

.manual-hint { font-size: .82rem; color: var(--muted); background: var(--surface-alt); border-radius: var(--radius-sm); padding: .7rem .8rem; }

.result-summary { display: flex; flex-direction: column; align-items: center; gap: .6rem; text-align: center; padding: 1.5rem 0; }
.icon-ok { width: 56px; height: 56px; border-radius: 50%; background: var(--success-soft); color: var(--success); display: grid; place-items: center; flex: none; }
.icon-ok svg { width: 28px; height: 28px; }
.verify-list { display: flex; flex-direction: column; gap: .5rem; text-align: left; margin-top: .6rem; font-size: .86rem; }
.verify-list .row svg { width: 16px; height: 16px; color: var(--success); flex: none; }

.side-card { display: flex; flex-direction: column; gap: 1rem; }
.side-card h3 { font-size: .92rem; }
.side-list { display: flex; flex-direction: column; gap: .7rem; font-size: .86rem; }
.side-list .row { justify-content: space-between; color: var(--muted); }
.side-list .row strong { color: var(--ink); }

.limit-note { font-size: .78rem; color: var(--muted); line-height: 1.55; background: var(--surface-alt); padding: .8rem; border-radius: var(--radius-sm); }

/* =============================================================
   8. Cuenta page
   ============================================================= */
.account-grid { display: grid; gap: 1.4rem; }
@media (min-width: 900px) { .account-grid { grid-template-columns: 1.3fr .9fr; } }
.usage-bar-track { width: 100%; height: 10px; border-radius: 999px; background: var(--surface-alt); overflow: hidden; margin-top: .6rem; }
.usage-bar-fill { height: 100%; border-radius: 999px; background: var(--accent); }
.history-table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.history-table th { text-align: left; color: var(--muted); font-weight: 600; padding: .6rem .4rem; border-bottom: 1px solid var(--border); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
.history-table td { padding: .7rem .4rem; border-bottom: 1px solid var(--border); }
.history-empty { text-align: center; padding: 2rem 1rem; color: var(--muted); font-size: .9rem; }

/* =============================================================
   9. Auth pages
   ============================================================= */
.auth-page { min-height: 100svh; display: grid; place-items: center; padding: 2rem 1.25rem; }
.auth-wrap { width: 100%; max-width: 420px; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 1.6rem; }
.auth-card { padding: 2rem 1.9rem; }
.auth-card h1 { font-size: 1.35rem; text-align: center; margin-bottom: .4rem; }
.auth-card .lede { text-align: center; font-size: .92rem; margin-bottom: 1.6rem; }
.auth-switch { text-align: center; margin-top: 1.3rem; font-size: .9rem; color: var(--muted); }
.auth-switch a { color: var(--accent); font-weight: 700; }

/* =============================================================
   10. Legal pages
   ============================================================= */
.legal-page .container { max-width: 780px; }
.legal-page h1 { margin-bottom: .5rem; }
.legal-page .updated { color: var(--muted); font-size: .88rem; margin-bottom: 2.2rem; }
.legal-page h2 { font-size: 1.15rem; margin-top: 2.2rem; margin-bottom: .7rem; }
.legal-page p, .legal-page li { color: var(--ink-soft); font-size: .95rem; line-height: 1.75; margin-bottom: .8rem; }
.legal-page ul { list-style: disc; padding-left: 1.3rem; }
.legal-page ul li { margin-bottom: .4rem; }

/* =============================================================
   11. Responsive tweaks
   ============================================================= */
@media (max-width: 539px) {
  .hero-actions .btn { flex: 1 1 auto; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
