/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #f6f7fb;
  --bg-deep: #0c1424;
  --bg-deep-2: #131d33;
  --ink: #10151f;
  --ink-soft: #333a48;
  --muted: #5b6474;
  --muted-soft: #8891a1;
  --card: #ffffff;
  --border: #e3e6ed;
  --border-soft: #edeff4;
  --accent: #2148d1;
  --accent-ink: #17348f;
  --accent-soft: #e9edfc;
  --accent-soft-2: #dbe3fb;
  --ok: #147a4f;
  --ok-soft: #e4f6ee;
  --warn: #a15c00;
  --warn-soft: #fdf1de;
  --danger: #b3261e;
  --danger-soft: #fbe9e8;
  --demo: #a15c00;
  --demo-soft: #fdf1de;
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(16, 21, 31, .06);
  --shadow-md: 0 8px 24px rgba(16, 21, 31, .08);
  --shadow-lg: 0 24px 64px rgba(16, 21, 31, .16);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --container: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1119;
    --ink: #eef1f6;
    --ink-soft: #cfd5e1;
    --muted: #9aa3b5;
    --muted-soft: #778092;
    --card: #131a27;
    --border: #232c3d;
    --border-soft: #1b2333;
    --accent-soft: #17223f;
    --accent-soft-2: #1c2b52;
    --ok-soft: #103524;
    --warn-soft: #3a2a0c;
    --danger-soft: #3a1614;
    --demo-soft: #3a2a0c;
  }
}

/* =============================================================
   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(--ink);
  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: -.01em; font-family: var(--serif); font-weight: 600; }
ul, ol { padding-left: 1.2em; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--accent-soft-2); 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;
  padding: .6rem 1rem; background: var(--ink); color: #fff;
  z-index: 9999; border-radius: 8px; font-weight: 500;
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   3. Utilities
   ============================================================= */
.container { max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.gap-xs { gap: 8px; } .gap-sm { gap: 12px; } .gap-md { gap: 20px; } .gap-lg { gap: 32px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.section { padding: clamp(56px, 9vw, 108px) 0; }
.section-head { max-width: 640px; margin: 0 auto 44px; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--sans);
  font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); padding: 6px 14px; border-radius: 999px;
}
.section-head h2 { font-size: clamp(28px, 3.4vw, 40px); margin-top: 14px; }
.section-head p { color: var(--muted); margin-top: 14px; font-size: 17px; }

/* =============================================================
   4. Typography
   ============================================================= */
h1 { font-size: clamp(34px, 5.4vw, 58px); }
h2 { font-size: clamp(26px, 3vw, 36px); }
h3 { font-size: 20px; }

/* =============================================================
   5. Components
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px; font-weight: 600; font-size: 15px;
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out), background .2s var(--ease-out);
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-ink); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--border-soft); }
.btn-light { background: #fff; color: var(--accent-ink); }
.btn-light:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-danger-outline { border: 1px solid var(--danger); color: var(--danger); background: transparent; }
.btn-danger-outline:hover { background: var(--danger-soft); }
.btn-sm { padding: 9px 16px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

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

.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700;
  padding: 5px 11px; border-radius: 999px; letter-spacing: .01em;
}
.badge-demo { background: var(--demo-soft); color: var(--demo); border: 1px solid rgba(161,92,0,.25); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-muted { background: var(--border-soft); color: var(--muted); }

.demo-banner {
  background: var(--demo-soft); color: var(--demo); border-bottom: 1px solid rgba(161,92,0,.25);
  font-size: 13.5px; font-weight: 600; text-align: center; padding: 9px 16px;
}
.demo-banner strong { font-weight: 800; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.field input, .field select {
  padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--card); font-size: 15px; transition: border-color .15s;
}
.field input:focus, .field select:focus { border-color: var(--accent); }
.field .hint { font-size: 12.5px; color: var(--muted-soft); }
.form-card { max-width: 420px; margin: 0 auto; padding: 34px; }
.form-error { background: var(--danger-soft); color: var(--danger); font-size: 13.5px; padding: 10px 13px; border-radius: var(--radius-sm); margin-bottom: 16px; display: none; }
.form-error.is-visible { display: block; }

/* Toast */
#toasts { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; max-width: min(360px, calc(100vw - 40px)); }
.toast {
  background: var(--ink); color: #fff; padding: 13px 16px; border-radius: var(--radius-sm);
  font-size: 14px; box-shadow: var(--shadow-lg); animation: toastIn .25s var(--ease-out);
}
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10,14,22,.55); display: none;
  align-items: center; justify-content: center; z-index: 1000; padding: 20px;
}
.modal-backdrop.is-open { display: flex; }
.modal { background: var(--card); border-radius: var(--radius-lg); max-width: 480px; width: 100%; padding: 30px; box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto; }
.modal h3 { margin-bottom: 6px; }
.modal .modal-close { position: absolute; }
.modal-actions { display: flex; gap: 10px; margin-top: 22px; }

/* =============================================================
   6. Sections — marketing (index)
   ============================================================= */
.nav {
  position: sticky; top: 0; z-index: 100; background: rgba(246,247,251,.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 18px; font-family: var(--sans); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 14px;
}
.nav-links { display: none; gap: 28px; font-size: 14.5px; font-weight: 500; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
@media (min-width: 960px) { .nav-links { display: flex; } }

.hero { padding: clamp(48px, 9vw, 96px) 0 clamp(30px, 6vw, 60px); background: linear-gradient(180deg, #eef1fb, var(--bg) 70%); }
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.05fr .95fr; gap: 56px; } }
.hero p.lead { font-size: 18px; color: var(--muted); margin-top: 18px; max-width: 46ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-trust { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 18px; font-size: 13.5px; color: var(--muted-soft); }
.hero-trust span { display: inline-flex; align-items: center; gap: 6px; }

/* Before / after visual */
.demo-doc-wrap { position: relative; }
.demo-doc-toggle { display: flex; gap: 6px; background: var(--border-soft); padding: 4px; border-radius: 999px; width: fit-content; margin: 0 auto 16px; }
.demo-doc-toggle button {
  padding: 8px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--muted);
}
.demo-doc-toggle button.is-active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.demo-doc {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 26px 28px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.85; color: #26303f; border: 1px solid var(--border);
  max-width: 420px; margin-inline: auto;
}
.demo-doc .dd-h { font-family: var(--sans); font-weight: 800; font-size: 14px; color: var(--ink); margin-bottom: 4px; }
.demo-doc .dd-sub { color: var(--muted-soft); font-size: 11px; margin-bottom: 16px; }
.demo-doc .dd-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--border-soft); }
.demo-doc .dd-label { color: var(--muted-soft); }
.demo-doc mark {
  background: transparent; color: inherit; padding: 1px 3px; border-radius: 3px; font-family: inherit;
  transition: background .2s, color .2s;
}
.demo-doc[data-mode="despues"] mark {
  background: #0c0f14; color: #0c0f14; border-radius: 2px; user-select: none;
}
.demo-doc-caption { text-align: center; margin-top: 14px; font-size: 13px; color: var(--muted); }

/* Steps */
.steps-grid { display: grid; gap: 20px; }
@media (min-width: 720px) { .steps-grid { grid-template-columns: repeat(3, 1fr); } }
.step-card { padding: 26px 24px; }
.step-num { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; display: grid; place-items: center; margin-bottom: 14px; font-family: var(--sans); }
.step-card h3 { font-size: 17px; margin-bottom: 8px; }
.step-card p { color: var(--muted); font-size: 14.5px; }

/* Time comparison */
.compare-grid { display: grid; gap: 14px; align-items: center; grid-template-columns: 1fr; max-width: 760px; margin: 0 auto; }
@media (min-width: 720px) { .compare-grid { grid-template-columns: 1fr auto 1fr; } }
.compare-card { padding: 28px 26px; text-align: center; }
.compare-card.is-highlight { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.compare-time { font-family: var(--serif); font-size: 40px; font-weight: 600; }
.compare-arrow { text-align: center; font-size: 26px; color: var(--muted-soft); transform: rotate(90deg); }
@media (min-width: 720px) { .compare-arrow { transform: none; } }

/* Sticky mobile CTA */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: var(--card); border-top: 1px solid var(--border);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgba(16,21,31,.08);
  transform: translateY(110%); transition: transform .3s var(--ease-out);
}
.sticky-cta.is-visible { transform: translateY(0); }
.sticky-cta .btn { width: 100%; }
@media (min-width: 960px) { .sticky-cta { display: none; } }

/* Sectors */
.sector-grid { display: grid; gap: 18px; }
@media (min-width: 720px) { .sector-grid { grid-template-columns: repeat(3, 1fr); } }
.sector-card { padding: 24px; }
.sector-card h3 { font-size: 16.5px; margin-bottom: 8px; }
.sector-card p { color: var(--muted); font-size: 14px; }

/* Trust / real redaction explainer */
.trust-block { display: grid; gap: 34px; align-items: center; }
@media (min-width: 960px) { .trust-block { grid-template-columns: 1fr 1fr; } }
.trust-list { display: flex; flex-direction: column; gap: 16px; margin-top: 22px; }
.trust-item { display: flex; gap: 14px; }
.trust-item .ic { width: 30px; height: 30px; flex: none; border-radius: 8px; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; }
.trust-item h4 { font-size: 15px; margin-bottom: 3px; }
.trust-item p { font-size: 13.8px; color: var(--muted); }
.trust-panel { background: var(--bg-deep); color: #dfe4ee; border-radius: var(--radius-lg); padding: 30px; }
.trust-panel h4 { color: #fff; font-size: 15px; margin-bottom: 10px; }
.trust-panel p { font-size: 13.8px; color: #b7c0d1; margin-bottom: 14px; }
.trust-panel code { font-family: var(--mono); font-size: 12px; background: #182338; padding: 2px 6px; border-radius: 5px; color: #9fd6ff; }

/* Pricing */
.pricing-grid { display: grid; gap: 20px; }
@media (min-width: 860px) { .pricing-grid { grid-template-columns: repeat(3, 1fr); align-items: stretch; } }
.plan-card { padding: 30px 26px; 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-md); }
.plan-featured-tag {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; padding: 5px 14px; border-radius: 999px;
}
.plan-name { font-size: 15px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.plan-price { font-family: var(--serif); font-size: 42px; margin-top: 10px; }
.plan-price span { font-size: 15px; font-family: var(--sans); color: var(--muted); font-weight: 500; }
.plan-credits { margin-top: 6px; font-size: 14px; color: var(--accent-ink); font-weight: 700; }
.plan-desc { margin-top: 10px; font-size: 13.8px; color: var(--muted); min-height: 40px; }
.plan-list { list-style: none; padding: 0; margin: 20px 0 24px; display: flex; flex-direction: column; gap: 10px; }
.plan-list li { display: flex; gap: 9px; font-size: 13.8px; color: var(--ink-soft); }
.plan-list li svg { flex: none; margin-top: 2px; color: var(--ok); }
.plan-card .btn { margin-top: auto; }
.pricing-note { text-align: center; margin-top: 26px; font-size: 13.5px; color: var(--muted-soft); }

/* FAQ */
.faq-list { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.faq-q { width: 100%; text-align: left; padding: 18px 20px; display: flex; justify-content: space-between; gap: 16px; align-items: center; font-weight: 600; font-size: 15px; }
.faq-q .chev { transition: transform .25s var(--ease-out); flex: none; color: var(--muted); }
.faq-item.is-open .faq-q .chev { transform: rotate(180deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s var(--ease-out); }
.faq-a-inner { padding: 0 20px 20px; color: var(--muted); font-size: 14.3px; }

/* Final CTA */
.cta-band { background: var(--bg-deep); color: #fff; border-radius: var(--radius-lg); padding: clamp(36px, 6vw, 64px); text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #b7c0d1; margin-top: 12px; max-width: 46ch; margin-inline: auto; }
.cta-band .hero-cta { justify-content: center; margin-top: 26px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border-soft); padding: 44px 0 30px; }
.footer-grid { display: grid; gap: 32px; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-grid p { color: var(--muted); font-size: 13.8px; margin-top: 10px; max-width: 34ch; }
.footer-col h5 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-soft); margin-bottom: 12px; }
.footer-col ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 9px; font-size: 14px; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--border-soft); display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; font-size: 12.8px; color: var(--muted-soft); }

/* =============================================================
   7. App shell (app.html / cuenta.html)
   ============================================================= */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.app-top {
  background: var(--card); border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; gap: 14px; flex-wrap: wrap;
}
.app-top .brand { font-size: 16px; }
.app-top-actions { display: flex; align-items: center; gap: 12px; }
.credits-pill {
  display: inline-flex; align-items: center; gap: 7px; background: var(--accent-soft); color: var(--accent-ink);
  font-weight: 700; font-size: 13.5px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--accent-soft-2);
}
.credits-pill.is-low { background: var(--warn-soft); color: var(--warn); border-color: rgba(161,92,0,.25); }
.credits-pill .n { font-variant-numeric: tabular-nums; transition: transform .25s var(--ease-out); }
.user-menu { position: relative; }
.user-menu-btn { display: flex; align-items: center; gap: 8px; padding: 7px 10px 7px 7px; border-radius: 999px; border: 1px solid var(--border); font-size: 13.5px; font-weight: 600; }
.user-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.user-menu-list { position: absolute; right: 0; top: calc(100% + 8px); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); min-width: 190px; padding: 6px; display: none; z-index: 50; }
.user-menu.is-open .user-menu-list { display: block; }
.user-menu-list a, .user-menu-list button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 7px; font-size: 14px; }
.user-menu-list a:hover, .user-menu-list button:hover { background: var(--border-soft); }

.app-main { flex: 1; padding: 26px 20px 60px; }
.app-container { max-width: 1040px; margin: 0 auto; }
.app-header { margin-bottom: 22px; }
.app-header h1 { font-size: 24px; }
.app-header p { color: var(--muted); font-size: 14.5px; margin-top: 6px; }

.limits-note {
  background: var(--accent-soft); color: var(--accent-ink); border-radius: var(--radius-sm);
  padding: 12px 15px; font-size: 13px; margin-bottom: 20px; line-height: 1.55;
}

/* Dropzone / tool states */
.tool-card { padding: 0; overflow: hidden; }
.dropzone {
  padding: 52px 24px; text-align: center; border: 2px dashed var(--border); border-radius: var(--radius);
  margin: 22px; transition: border-color .2s, background .2s; cursor: pointer;
}
.dropzone.is-drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .dz-icon { width: 50px; height: 50px; margin: 0 auto 16px; color: var(--accent); }
.dropzone h3 { font-size: 16.5px; margin-bottom: 6px; }
.dropzone p { color: var(--muted); font-size: 13.8px; }
.dropzone .dz-file-name { font-size: 13.5px; color: var(--muted-soft); margin-top: 10px; }

[data-tool-state="idle"] .tool-progress,
[data-tool-state="idle"] .tool-workspace,
[data-tool-state="idle"] .tool-error { display: none; }
[data-tool-state="working"] .dropzone,
[data-tool-state="working"] .tool-workspace,
[data-tool-state="working"] .tool-error { display: none; }
[data-tool-state="done"] .dropzone,
[data-tool-state="done"] .tool-progress,
[data-tool-state="done"] .tool-error { display: none; }
[data-tool-state="error"] .tool-progress,
[data-tool-state="error"] .tool-workspace { display: none; }

.tool-progress { padding: 50px 24px; text-align: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 0 auto 18px; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-bar { max-width: 320px; margin: 16px auto 0; height: 6px; border-radius: 999px; background: var(--border-soft); overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--accent); width: 0%; transition: width .3s var(--ease-out); }
.progress-label { font-size: 13px; color: var(--muted); margin-top: 10px; }

.tool-error { padding: 40px 24px; text-align: center; }
.tool-error p { color: var(--danger); margin: 10px 0 18px; }

.tool-workspace { display: grid; gap: 0; }
@media (min-width: 960px) { .tool-workspace { grid-template-columns: 1.25fr .9fr; } }
.viewer-pane { padding: 20px; border-bottom: 1px solid var(--border-soft); }
@media (min-width: 960px) { .viewer-pane { border-bottom: none; border-right: 1px solid var(--border-soft); } }
.viewer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.page-nav { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.page-nav button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); display: grid; place-items: center; }
.page-nav button[disabled] { opacity: .4; }
/* align-items:flex-start is load-bearing: without it flexbox's default
   "stretch" forces .canvas-stack (and the overlay that mirrors its size) to
   the wrap's cross-axis height, shorter than a tall page's actual canvas —
   every detection box then gets positioned against the wrong (shorter)
   reference height and lands above where it should. */
.canvas-wrap { position: relative; background: var(--border-soft); border-radius: var(--radius-sm); overflow: auto; max-height: 640px; display: flex; justify-content: center; align-items: flex-start; padding: 14px; }
.canvas-stack { position: relative; line-height: 0; }
.canvas-stack canvas { border-radius: 4px; box-shadow: var(--shadow-sm); background: #fff; }
.box-overlay { position: absolute; inset: 0; }
.det-box {
  position: absolute; background: rgba(15, 18, 24, .94); border-radius: 1px;
  transition: opacity .15s;
}
.det-box.is-off { background: transparent; outline: 2px dashed rgba(211, 40, 40, .55); }
.det-box.is-manual { outline: 1px solid rgba(255,255,255,.35); }
.det-box.is-missing { display: none; }

.manual-toggle-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

.detections-pane { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.det-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.det-list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; padding-right: 2px; }
.det-item { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.det-item.is-inactive { opacity: .5; }
.det-item.is-missing { border-color: rgba(161,92,0,.4); background: var(--warn-soft); }
.det-toggle { position: relative; width: 36px; height: 21px; border-radius: 999px; background: var(--border); flex: none; margin-top: 2px; transition: background .2s; }
.det-toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease-out); }
.det-toggle.is-on { background: var(--accent); }
.det-toggle.is-on::after { transform: translateX(15px); }
.det-body { flex: 1; min-width: 0; }
.det-type { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--accent-ink); }
.det-text { font-size: 13.8px; color: var(--ink-soft); word-break: break-word; margin-top: 2px; }
.det-meta { font-size: 11.5px; color: var(--muted-soft); margin-top: 3px; }
.det-del { flex: none; color: var(--muted-soft); }
.det-del:hover { color: var(--danger); }
.det-empty { text-align: center; color: var(--muted-soft); font-size: 13.5px; padding: 30px 10px; }

.honesty-note {
  background: var(--warn-soft); color: var(--warn); border-radius: var(--radius-sm); padding: 13px 14px;
  font-size: 13px; line-height: 1.55;
}

.workspace-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 4px; }

/* Account page */
.acc-grid { display: grid; gap: 20px; }
@media (min-width: 860px) { .acc-grid { grid-template-columns: 1fr 1fr; } }
.acc-card { padding: 24px; }
.acc-card h3 { font-size: 15px; margin-bottom: 14px; }
.acc-plan-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.acc-plan-name { font-size: 22px; font-family: var(--serif); }
.acc-progress { height: 8px; border-radius: 999px; background: var(--border-soft); overflow: hidden; margin: 14px 0 8px; }
.acc-progress-fill { height: 100%; background: var(--accent); }
.acc-meta { font-size: 13px; color: var(--muted); }
table.hist { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.hist th { text-align: left; color: var(--muted-soft); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .02em; padding: 8px 6px; border-bottom: 1px solid var(--border-soft); }
table.hist td { padding: 9px 6px; border-bottom: 1px solid var(--border-soft); }
table.hist tbody tr:last-child td { border-bottom: none; }
.plan-mini-grid { display: grid; gap: 10px; margin-top: 16px; }
@media (min-width: 640px) { .plan-mini-grid { grid-template-columns: repeat(3, 1fr); } }
.plan-mini { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; text-align: center; }
.plan-mini.is-current { border-color: var(--accent); background: var(--accent-soft); }
.plan-mini strong { display: block; font-size: 15px; margin-bottom: 3px; }
.plan-mini span { font-size: 12.5px; color: var(--muted); }

/* Checkout modal fake card */
.fake-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; background: var(--border-soft); margin: 16px 0; font-family: var(--mono); font-size: 14px; letter-spacing: .04em; color: var(--muted); }

/* =============================================================
   8. Responsive helpers already inline via min-width media queries
   ============================================================= */

/* =============================================================
   9. Reduced motion
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spinner { animation-duration: 1.4s; }
}
