/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #f7f5ef;
  --surface: #ffffff;
  --surface-2: #efe9db;
  --border: #e3ddcb;
  --text: #1c1712;
  --text-mu: #6b6153;
  --text-mu-2: #948a78;
  --accent: #ad8351;
  --accent-text: #8a642f;
  --accent-ink: #1a1409;
  --accent-soft: #f3ead9;
  --ok: #16814f;
  --ok-soft: #e4f7ee;
  --warn: #92400e;
  --warn-soft: #fef3e0;
  --danger: #b42318;
  --danger-soft: #fde8e6;
  --demo: #92400e;
  --demo-bg: #fff3d6;
  --demo-border: #f0c76a;
  --shadow-sm: 0 1px 2px rgba(20, 16, 8, .08);
  --shadow-md: 0 6px 20px rgba(20, 16, 8, .10);
  --shadow-lg: 0 20px 60px rgba(20, 16, 8, .16);
  --radius: 14px;
  --radius-sm: 8px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Manrope", var(--sans);
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --nav-h: 72px;

  /* Chrome — la marca: negro/carbón siempre, en cabeceras y pies, independiente del modo claro/oscuro */
  --chrome-bg: #100f14;
  --chrome-bg-2: #1b1810;
  --chrome-text: #f3ecd9;
  --chrome-text-mu: #a89a86;
  --chrome-border: #2c2820;
  --chrome-accent: #d2a24a;
  --chrome-accent-soft: rgba(210, 162, 74, .16);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15120c;
    --surface: #1e1a13;
    --surface-2: #272117;
    --border: #392f20;
    --text: #f3ecd9;
    --text-mu: #b3a68f;
    --text-mu-2: #8c8168;
    --accent: #d2a24a;
    --accent-text: #d2a24a;
    --accent-ink: #17130b;
    --accent-soft: #3a2f1a;
    --ok: #3ec98a;
    --ok-soft: #113325;
    --warn: #e2a640;
    --warn-soft: #332a10;
    --danger: #f0776c;
    --danger-soft: #3a1614;
    --demo: #f0c76a;
    --demo-bg: #332a10;
    --demo-border: #5c4a1a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-md: 0 6px 24px rgba(0, 0, 0, .35);
    --shadow-lg: 0 24px 70px rgba(0, 0, 0, .5);
  }
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
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; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.12; letter-spacing: -0.02em; font-family: var(--display); }
ul, ol { list-style: none; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* =============================================================
   3. Utilities
   ============================================================= */
.container { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 1.25rem; }
.container-narrow { width: 100%; max-width: 760px; 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, 8vw, 6.5rem); }
.section-tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent-text); margin-bottom: 1rem;
}
.center { text-align: center; }
.stack { display: flex; flex-direction: column; }
.muted { color: var(--text-mu); }

/* =============================================================
   4. Typography
   ============================================================= */
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 800; }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); font-weight: 700; }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--text-mu); max-width: 46ch; }
.center .lede { margin-inline: auto; }

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

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.4rem; border-radius: 999px; font-weight: 700; font-size: .95rem;
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out), background .18s var(--ease-out), opacity .18s;
  white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-outline { background: transparent; color: var(--accent-text); border: 1.5px solid var(--accent); }
.btn-outline:hover { background: var(--accent-soft); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { filter: brightness(0.95); }
.btn-block { width: 100%; }
.btn-sm { padding: .5rem .9rem; font-size: .85rem; }
.btn[aria-busy="true"] { position: relative; color: transparent !important; }
.btn[aria-busy="true"]::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent; color: var(--accent-ink);
  animation: spin .7s linear infinite;
}
.btn-ghost[aria-busy="true"]::after, .btn-outline[aria-busy="true"]::after { color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

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

/* --- Nav (chrome de marca: siempre oscuro, no sigue el modo claro/oscuro) --- */
.nav {
  position: sticky; top: 0; z-index: 100; height: var(--nav-h);
  display: flex; align-items: center; background: color-mix(in srgb, var(--chrome-bg) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--chrome-border);
  color: var(--chrome-text);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.brand { display: flex; align-items: center; gap: .6rem; }
.brand-logo { height: 34px; width: auto; flex-shrink: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--chrome-accent); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 1rem; flex-shrink: 0;
}
.nav-links { display: none; align-items: center; gap: 1.8rem; font-weight: 600; font-size: .92rem; }
.nav-links a:hover { color: var(--chrome-accent); }
.nav-cta { display: flex; align-items: center; gap: .75rem; }
.nav-burger { display: inline-flex; padding: .5rem; color: var(--chrome-text); }
.nav-burger svg { width: 22px; height: 22px; }
@media (min-width: 960px) {
  .nav-links { display: flex; }
  .nav-burger { display: none; }
}

.mobile-menu {
  position: fixed; inset: var(--nav-h) 0 0 0; background: var(--chrome-bg); color: var(--chrome-text); z-index: 99;
  display: none; flex-direction: column; padding: 1.5rem; gap: 1.25rem; overflow-y: auto;
}
.mobile-menu.is-open { display: flex; }
.mobile-menu a { font-size: 1.15rem; font-weight: 700; }
@media (min-width: 960px) { .mobile-menu { display: none !important; } }

/* --- Credits pill --- */
.credits-pill {
  display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .9rem;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent-text);
  font-weight: 700; font-size: .88rem; white-space: nowrap;
}
.credits-pill .num { transition: transform .3s var(--ease-out); display: inline-block; }
.credits-pill.is-bumping .num { animation: bump .4s var(--ease-out); }
@keyframes bump { 30% { transform: scale(1.3); } }
.credits-pill.is-low { background: var(--warn-soft); color: var(--warn); }
.app-topbar .credits-pill { background: var(--chrome-accent-soft); color: var(--chrome-accent); }
.app-topbar .credits-pill.is-low { background: rgba(224, 122, 44, .18); color: #e0a24a; }

/* --- Demo badge --- */
.demo-badge {
  display: inline-flex; align-items: center; gap: .5rem; padding: .55rem 1rem;
  border-radius: 10px; background: var(--demo-bg); color: var(--demo);
  border: 1px solid var(--demo-border); font-size: .85rem; font-weight: 700;
}
.demo-badge svg { width: 16px; height: 16px; flex-shrink: 0; }

/* --- Badges (types) --- */
.tag {
  display: inline-flex; align-items: center; padding: .25rem .6rem; border-radius: 999px;
  font-size: .74rem; font-weight: 700; background: var(--surface-2); color: var(--text-mu);
  white-space: nowrap;
}
.tag-accent { background: var(--accent-soft); color: var(--accent-text); }

/* --- Forms --- */
.field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.1rem; }
.field label { font-weight: 600; font-size: .88rem; }
.field input, .field select {
  padding: .8rem .95rem; border-radius: 10px; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text); font-size: .96rem;
  transition: border-color .15s;
}
.field input:focus, .field select:focus { border-color: var(--accent); }
.field-error { color: var(--danger); font-size: .82rem; }
.form-card { max-width: 420px; margin-inline: auto; padding: clamp(1.5rem, 4vw, 2.5rem); }
.auth-logo-panel {
  max-width: 420px; margin: 0 auto 1.5rem; background: var(--chrome-bg);
  border-radius: var(--radius); padding: 1.75rem; display: flex; justify-content: center;
}
.auth-logo-panel img { width: 100%; max-width: 300px; height: auto; }
.form-note { font-size: .85rem; color: var(--text-mu); text-align: center; margin-top: 1rem; }

/* --- Toggle switch --- */
.switch { position: relative; display: inline-flex; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-track {
  position: absolute; inset: 0; background: var(--border); border-radius: 999px; transition: background .18s;
}
.switch-track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm); transition: transform .18s var(--ease-out);
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- Toast --- */
.toast-host { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: .6rem; align-items: center; width: min(92vw, 460px); }
.toast {
  width: 100%; padding: .85rem 1.1rem; border-radius: 12px; background: var(--text); color: var(--bg);
  box-shadow: var(--shadow-lg); font-size: .9rem; font-weight: 600;
  animation: toast-in .25s var(--ease-out);
}
.toast.is-error { background: var(--danger); color: #fff; }
.toast.is-ok { background: var(--ok); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* --- Modal --- */
dialog.modal {
  border: none; border-radius: var(--radius); padding: 0; width: min(92vw, 480px);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
dialog.modal::backdrop { background: rgba(10, 12, 20, .55); backdrop-filter: blur(2px); }
.modal-body { padding: clamp(1.5rem, 4vw, 2rem); }
.modal-actions { display: flex; gap: .75rem; margin-top: 1.5rem; flex-wrap: wrap; }
.modal-close { position: absolute; top: 1rem; right: 1rem; padding: .4rem; }

/* =============================================================
   6. Sections — Landing
   ============================================================= */
.hero { padding-block: clamp(3rem, 9vw, 6rem) clamp(2rem, 6vw, 3rem); position: relative; overflow: clip; }
.hero-grid { display: grid; gap: 3rem; align-items: center; }
.hero-badges { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.5rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 2rem; }
.hero-trust { margin-top: 1.75rem; font-size: .85rem; color: var(--text-mu-2); }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.05fr .95fr; } }

/* --- Before/After demo --- */
.demo-panel { padding: 1rem; }
.demo-doc {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 1.5rem 1.5rem 1.75rem; font-family: var(--mono); font-size: .82rem; line-height: 1.9;
  box-shadow: var(--shadow-md);
}
.demo-doc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; font-family: var(--sans); }
.demo-doc-head .tag { font-family: var(--sans); }
.doc-line { display: flex; flex-wrap: wrap; gap: .35em; align-items: baseline; }
.doc-static { color: var(--text-mu-2); }
.redact {
  background: var(--accent-soft); color: var(--accent-text); border-radius: 4px; padding: 0 .35em;
  transition: background .3s var(--ease-out), color .3s var(--ease-out);
  position: relative;
}
.demo-doc.is-redacted .redact {
  background: #14151a; color: #14151a;
}
.demo-toggle-row { display: flex; align-items: center; justify-content: center; gap: .75rem; margin-top: 1.25rem; font-size: .85rem; font-weight: 600; color: var(--text-mu); }

/* --- How it works --- */
.steps { display: grid; gap: 1.25rem; margin-top: 2.5rem; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.step { padding: 1.5rem; }
.step-num {
  width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text);
  display: grid; place-items: center; font-weight: 800; margin-bottom: 1rem; font-family: var(--display);
}
.step h3 { margin-bottom: .4rem; }
.step p { color: var(--text-mu); font-size: .92rem; }

/* --- Audience / logos --- */
.audience-grid { display: grid; gap: 1rem; margin-top: 2.5rem; }
@media (min-width: 720px) { .audience-grid { grid-template-columns: repeat(3, 1fr); } }
.audience-card { padding: 1.6rem; }
.audience-card svg { width: 26px; height: 26px; color: var(--accent); margin-bottom: .9rem; }
.audience-card h3 { margin-bottom: .4rem; font-size: 1.05rem; }
.audience-card p { font-size: .9rem; color: var(--text-mu); }

/* --- Detection types strip --- */
.types-strip { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 2rem; }

/* --- Pricing --- */
.pricing-grid { display: grid; gap: 1.25rem; margin-top: 2.5rem; align-items: stretch; }
@media (min-width: 640px) { .pricing-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .pricing-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1360px) { .pricing-grid { grid-template-columns: repeat(5, 1fr); } }
.plan-seats { display: flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--text-mu); margin: -.6rem 0 1.1rem; }
.plan-seats svg { width: 15px; height: 15px; color: var(--accent-text); flex-shrink: 0; }
.plan-card { padding: 1.9rem; display: flex; flex-direction: column; position: relative; }
.plan-card.is-highlight { border-color: var(--accent); box-shadow: var(--shadow-lg); }
.plan-flag {
  position: absolute; top: -13px; left: 1.9rem; background: var(--accent); color: var(--accent-ink);
  font-size: .72rem; font-weight: 800; padding: .3rem .7rem; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .04em;
}
.plan-name { font-weight: 800; font-size: 1.1rem; margin-bottom: .3rem; }
.plan-price { display: flex; align-items: baseline; gap: .3rem; margin: .4rem 0 .2rem; }
.plan-price .amount { font-size: 2.4rem; font-weight: 800; font-family: var(--display); }
.plan-price .period { color: var(--text-mu); font-size: .9rem; }
.plan-credits { color: var(--text-mu); font-size: .88rem; margin-bottom: 1.4rem; }
.plan-features { display: flex; flex-direction: column; gap: .65rem; margin-bottom: 1.6rem; flex: 1; }
.plan-features li { display: flex; gap: .6rem; font-size: .9rem; align-items: flex-start; }
.plan-features svg { width: 18px; height: 18px; color: var(--ok); flex-shrink: 0; margin-top: .15rem; }
.pricing-note { text-align: center; color: var(--text-mu); font-size: .85rem; margin-top: 1.75rem; }

/* --- FAQ --- */
.faq-list { max-width: 760px; margin: 2.5rem auto 0; display: flex; flex-direction: column; gap: .75rem; }
.faq-item { padding: 0; overflow: hidden; }
.faq-item summary {
  list-style: none; cursor: pointer; padding: 1.15rem 1.4rem; font-weight: 700; font-size: .98rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .chev { width: 18px; height: 18px; flex-shrink: 0; transition: transform .2s var(--ease-out); color: var(--text-mu); }
.faq-item[open] summary .chev { transform: rotate(180deg); }
.faq-item .faq-body { padding: 0 1.4rem 1.3rem; color: var(--text-mu); font-size: .92rem; }
.faq-item .faq-note { margin-top: .6rem; font-size: .84rem; color: var(--text-mu-2); font-style: italic; }

/* --- CTA band --- */
.cta-band { text-align: center; padding: clamp(3rem, 7vw, 5rem) 1.5rem; border-radius: 24px; background: var(--accent); color: var(--accent-ink); }
.cta-band h2 { color: var(--accent-ink); }
.cta-band p { color: color-mix(in srgb, var(--accent-ink) 75%, transparent); margin-top: .75rem; }
.cta-band .btn-primary { background: var(--chrome-bg); color: var(--chrome-accent); margin-top: 1.75rem; }

/* --- Footer (chrome de marca: siempre oscuro) --- */
footer.site-footer {
  background: var(--chrome-bg); color: var(--chrome-text-mu);
  border-top: 1px solid var(--chrome-border); padding-block: 2.5rem; margin-top: 2rem;
}
footer.site-footer .brand { color: var(--chrome-text); }
footer.site-footer p { color: var(--chrome-text-mu); }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.25rem 2rem; font-size: .88rem; color: var(--chrome-text-mu); }
.footer-links a:hover { color: var(--chrome-accent); }
.footer-bottom { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--chrome-border); font-size: .8rem; color: var(--chrome-text-mu); display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }

/* =============================================================
   7. App shell (app.html / cuenta.html)
   ============================================================= */
.app-body { background: var(--surface-2); min-height: 100vh; }
.app-topbar {
  height: var(--nav-h); display: flex; align-items: center; background: var(--chrome-bg);
  color: var(--chrome-text);
  border-bottom: 1px solid var(--chrome-border); position: sticky; top: 0; z-index: 50;
}
.app-topbar-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 1rem; }
.app-topbar-right { display: flex; align-items: center; gap: .75rem; }
.account-menu { position: relative; }
.account-btn {
  width: 38px; height: 38px; border-radius: 50%; background: var(--chrome-accent-soft); color: var(--chrome-accent);
  display: grid; place-items: center; font-weight: 800; font-size: .95rem;
}
.account-dropdown {
  position: absolute; top: 48px; right: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg); min-width: 200px; padding: .5rem; display: none; z-index: 60;
}
.account-dropdown.is-open { display: block; }
.account-dropdown a, .account-dropdown button {
  display: block; width: 100%; text-align: left; padding: .65rem .8rem; border-radius: 8px; font-size: .9rem; font-weight: 600;
}
.account-dropdown a:hover, .account-dropdown button:hover { background: var(--surface-2); }

.app-main { padding-block: 2rem clamp(2rem, 6vw, 4rem); }
.app-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.75rem; }

/* --- Dropzone --- */
.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: clamp(2.5rem, 7vw, 4rem) 1.5rem;
  text-align: center; background: var(--surface); transition: border-color .18s, background .18s;
}
.dropzone.is-drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone svg { width: 46px; height: 46px; color: var(--accent); margin: 0 auto 1rem; }
.dropzone h3 { margin-bottom: .3rem; }
.dropzone p { color: var(--text-mu); font-size: .9rem; margin-bottom: 1.4rem; }
.dropzone-limits { margin-top: 1.25rem; font-size: .78rem; color: var(--text-mu-2); }

/* --- Processing state --- */
.process-card { padding: 1.5rem; margin-bottom: 1.25rem; }
.process-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.process-file { display: flex; align-items: center; gap: .8rem; font-weight: 700; }
.process-file svg { width: 28px; height: 28px; color: var(--accent); flex-shrink: 0; }
.progress-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 1rem; }
.progress-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s var(--ease-out); }
.process-status { margin-top: .6rem; font-size: .85rem; color: var(--text-mu); }

/* --- Cost confirm --- */
.cost-banner {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1.1rem 1.4rem; margin-bottom: 1.25rem; border-radius: 12px; background: var(--accent-soft);
}
.cost-banner strong { color: var(--accent-text); font-size: 1.1rem; }
.cost-banner.is-blocked { background: var(--danger-soft); }
.cost-banner.is-blocked strong { color: var(--danger); }

/* --- Workspace: viewer + detections --- */
.workspace { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 1024px) { .workspace { grid-template-columns: 1.3fr .9fr; } }

.viewer { padding: 1.25rem; }
.viewer-toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.viewer-pages { display: flex; flex-direction: column; gap: 1.5rem; max-height: 76vh; overflow-y: auto; padding-right: .3rem; }
.page-wrap { position: relative; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.page-wrap canvas { display: block; width: 100%; height: auto; }
.page-wrap .box {
  position: absolute; background: #000; cursor: pointer;
  transition: opacity .15s;
}
.page-wrap .box.is-off { background: transparent; border: 2px dashed rgba(173,131,81,.65); }
.page-badge {
  position: absolute; top: .5rem; left: .5rem; background: rgba(10,12,20,.72); color: #fff;
  font-size: .72rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px;
}
.page-status {
  position: absolute; inset: 0; background: rgba(246,247,251,.85); display: flex; align-items: center;
  justify-content: center; gap: .6rem; font-size: .85rem; font-weight: 700; color: var(--text-mu);
}
.spinner {
  width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--border);
  border-top-color: var(--accent); animation: spin .7s linear infinite;
}

.manual-hint {
  position: absolute; inset: 0; cursor: crosshair;
}

/* --- Detections panel --- */
.detections-panel { padding: 1.25rem; max-height: 82vh; overflow-y: auto; }
.detections-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .9rem; gap: .6rem; flex-wrap: wrap; }
.detections-count { font-size: .85rem; color: var(--text-mu); }
.detection-group { margin-bottom: 1.1rem; }
.detection-group-title { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--text-mu-2); margin-bottom: .5rem; }
.detection-row {
  display: flex; align-items: center; gap: .75rem; padding: .7rem .6rem; border-radius: 10px;
}
.detection-row:hover { background: var(--surface-2); }
.detection-info { flex: 1; min-width: 0; }
.detection-text { font-size: .86rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detection-meta { display: flex; gap: .4rem; align-items: center; margin-top: .2rem; }
.detection-row.is-missing .detection-text { color: var(--warn); }
.detection-delete { color: var(--text-mu-2); padding: .3rem; flex-shrink: 0; }
.detection-delete:hover { color: var(--danger); }
.detections-empty { text-align: center; padding: 2rem 1rem; color: var(--text-mu); font-size: .9rem; }

.manual-toolbar { display: flex; gap: .6rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }

.download-bar {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center;
  margin-top: 1.5rem; padding: 1.25rem 1.4rem; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border);
}
.download-bar .note { font-size: .82rem; color: var(--text-mu); max-width: 46ch; }

/* --- Account page --- */
.account-grid { display: grid; gap: 1.5rem; }
@media (min-width: 960px) { .account-grid { grid-template-columns: 1fr 1.3fr; } }
.plan-summary { padding: 1.75rem; }
.plan-summary-row { display: flex; justify-content: space-between; align-items: center; padding: .7rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.plan-summary-row:last-of-type { border-bottom: none; }
.plan-summary-row .lbl { color: var(--text-mu); }
.plan-summary-row .val { font-weight: 700; }
.history-table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.history-table th { text-align: left; color: var(--text-mu); font-weight: 700; 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-table tr:last-child td { border-bottom: none; }
.history-empty { padding: 2rem; text-align: center; color: var(--text-mu); }
.table-scroll { overflow-x: auto; }

.trust-note { display: flex; gap: 1rem; align-items: flex-start; padding: 1.25rem 1.5rem; margin-top: 1.5rem; }
.trust-note svg { width: 22px; height: 22px; color: var(--ok); flex-shrink: 0; margin-top: .15rem; }
.trust-note strong { display: block; margin-bottom: .3rem; }
.trust-note p { font-size: .88rem; color: var(--text-mu); }
.trust-note a { color: var(--accent-text); font-weight: 600; }
.trust-note a:hover { text-decoration: underline; }

/* =============================================================
   8. Legal pages
   ============================================================= */
.legal-body h2 { margin-top: 2.2rem; margin-bottom: .7rem; font-size: 1.25rem; }
.legal-body p, .legal-body li { color: var(--text-mu); margin-bottom: .8rem; font-size: .95rem; }
.legal-body li { list-style: disc; margin-left: 1.3rem; }
.legal-updated { color: var(--text-mu-2); font-size: .85rem; margin-bottom: 2rem; }

/* =============================================================
   9. Effects
   ============================================================= */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* =============================================================
   10. Responsive helpers
   ============================================================= */
@media (max-width: 539px) {
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; }
}
