/* =============================================================
   Oscura — one stylesheet, sectioned.
   Sober on purpose: this product handles confidential documents.
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --ink: #0e1420;
  --ink-soft: #26303f;
  --muted: #5b6675;
  --faint: #8a94a3;
  --line: #e2e6ec;
  --line-strong: #ccd4de;
  --bg: #f6f8fa;
  --paper: #ffffff;
  --accent: #1e4fa3;
  --accent-ink: #163b7c;
  --accent-soft: #eaf1fb;
  --ok: #14705a;
  --ok-soft: #e6f4ef;
  --warn: #8a5a10;
  --warn-soft: #fdf3e2;
  --danger: #a32020;
  --danger-soft: #fbeceb;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Consolas, monospace;

  --radius: 12px;
  --radius-lg: 18px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --maxw: 1120px;

  --shadow-sm: 0 1px 2px rgba(14, 20, 32, .06), 0 1px 3px rgba(14, 20, 32, .04);
  --shadow-md: 0 4px 12px rgba(14, 20, 32, .07), 0 1px 3px rgba(14, 20, 32, .05);
  --shadow-lg: 0 18px 48px rgba(14, 20, 32, .12);

  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; 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;
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.15; letter-spacing: -.02em; font-weight: 650; }
h1 { font-size: clamp(2rem, 4.6vw, 3.25rem); letter-spacing: -.03em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.15rem); }
h3 { font-size: 1.15rem; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

/* =============================================================
   3. Utilities
   ============================================================= */
.wrap { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 2 * var(--gutter), 760px); margin-inline: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 9999;
  padding: .6rem 1rem; background: var(--ink); color: #fff; border-radius: 8px;
}
.skip-link:focus { top: 1rem; }
.eyebrow {
  font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .75rem;
}
.lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--muted); }
.small { font-size: .875rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.stack > * + * { margin-top: 1rem; }

/* =============================================================
   4. Buttons & form controls
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.4rem; border-radius: 10px; font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background .2s var(--ease-out), border-color .2s var(--ease-out),
              color .2s var(--ease-out), transform .15s var(--ease-out);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-ink); }
.btn-ghost { background: var(--paper); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover:not(:disabled) { border-color: var(--ink); }
.btn-quiet { background: transparent; color: var(--muted); padding: .5rem .75rem; }
.btn-quiet:hover:not(:disabled) { color: var(--ink); }
.btn-danger { background: var(--paper); color: var(--danger); border-color: #eccfcd; }
.btn-danger:hover:not(:disabled) { background: var(--danger-soft); }
.btn-lg { padding: .95rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; }

.field { display: block; margin-bottom: 1rem; }
.field > span { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .35rem; }
.field input, .field select {
  width: 100%; padding: .7rem .85rem; border: 1px solid var(--line-strong);
  border-radius: 10px; background: var(--paper);
  transition: border-color .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hint { font-size: .8rem; color: var(--faint); margin-top: .3rem; }

/* =============================================================
   5. Notices (never alert() — messages belong in the page)
   ============================================================= */
.notice {
  padding: .8rem 1rem; border-radius: 10px; font-size: .9rem;
  border: 1px solid var(--line); background: var(--paper); margin-bottom: 1rem;
}
.notice-error { background: var(--danger-soft); border-color: #eccfcd; color: #7d1d1d; }
.notice-ok { background: var(--ok-soft); border-color: #c9e5db; color: #0d5544; }
.notice-warn { background: var(--warn-soft); border-color: #efdcbb; color: #6f4708; }
.notice-info { background: var(--accent-soft); border-color: #cfe0f6; color: var(--accent-ink); }

.toast-area {
  position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%);
  z-index: 200; display: grid; gap: .5rem; width: min(92vw, 460px);
}
.toast {
  padding: .8rem 1rem; border-radius: 10px; font-size: .9rem; color: #fff;
  background: var(--ink); box-shadow: var(--shadow-lg);
  animation: toast-in .3s var(--ease-out);
}
.toast-error { background: #8c1c1c; }
.toast-ok { background: #0d5544; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* =============================================================
   6. Demo badge — the payments are simulated and must say so
   ============================================================= */
.demo-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--warn-soft); color: var(--warn); border: 1px solid #efdcbb;
  padding: .45rem .8rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
}
.demo-bar {
  background: #2b2110; color: #f3d9a5; text-align: center;
  padding: .55rem 1rem; font-size: .82rem; font-weight: 500;
}
.demo-bar strong { color: #ffdf9e; }

/* =============================================================
   7. Site header & footer
   ============================================================= */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 1.5rem; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; letter-spacing: -.02em; color: var(--ink); font-size: 1.1rem; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; flex: none; }
.site-nav { display: none; gap: 1.5rem; margin-left: auto; font-size: .92rem; }
.site-nav a { color: var(--muted); font-weight: 500; }
.site-nav a:hover { color: var(--ink); text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.site-nav + .header-actions { margin-left: 0; }
@media (min-width: 960px) { .site-nav { display: flex; } }

.lang-switch { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; font-size: .8rem; }
.lang-switch a, .lang-switch button { padding: .3rem .6rem; color: var(--muted); font-weight: 600; }
.lang-switch a:hover, .lang-switch button:hover { background: var(--bg); text-decoration: none; }
.lang-switch [aria-current="true"] { background: var(--ink); color: #fff; }

.site-footer { border-top: 1px solid var(--line); background: var(--paper); padding: 3rem 0 2.5rem; margin-top: 4rem; }
.site-footer .cols { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .site-footer .cols { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin-bottom: .75rem; }
.site-footer ul { list-style: none; padding: 0; display: grid; gap: .5rem; font-size: .9rem; }
.site-footer a { color: var(--muted); }
.footer-legal { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: .82rem; color: var(--faint); display: grid; gap: .5rem; }

/* =============================================================
   8. Landing sections
   ============================================================= */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4rem); }
.hero-grid { display: grid; gap: 3rem; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.05fr .95fr; gap: 4rem; } }
.hero h1 { margin-bottom: 1.1rem; }
.hero .lead { margin-bottom: 1.75rem; max-width: 34ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.hero-note { margin-top: 1rem; font-size: .85rem; color: var(--faint); }
.trust-row { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); display: grid; gap: .6rem; font-size: .875rem; color: var(--muted); }
.trust-row li { list-style: none; display: flex; gap: .55rem; align-items: flex-start; }
.trust-row svg { flex: none; margin-top: .25rem; color: var(--ok); }

/* The before/after sample */
.sample { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden; }
.sample-head { display: flex; border-bottom: 1px solid var(--line); background: #fbfcfd; }
.sample-head button {
  flex: 1; padding: .75rem .5rem; font-size: .85rem; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent;
}
.sample-head button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); background: var(--paper); }
.sample-body { padding: 1.5rem clamp(1rem, 3vw, 1.75rem); font-size: .8rem; line-height: 1.75; }
.doc-line { display: flex; gap: .5rem; }
.doc-label { color: var(--faint); min-width: 8.5em; flex: none; }
.doc-value { font-family: var(--mono); font-size: .78rem; color: var(--ink-soft); }
.doc-title { font-weight: 700; font-size: .95rem; letter-spacing: .02em; margin-bottom: .25rem; }
.doc-rule { height: 1px; background: var(--line); margin: 1rem 0; }
/* An empty bar on purpose. The sample on the homepage must not carry the
   text it claims to be hiding: on a redaction product that is the one bug
   nobody forgives. */
.redacted {
  display: inline-block; background: var(--ink); border-radius: 2px;
  height: 1.05em; vertical-align: -.18em; user-select: none;
}
.sample-foot { border-top: 1px solid var(--line); padding: .85rem 1.25rem; font-size: .8rem; color: var(--faint); background: #fbfcfd; }

.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section-head { max-width: 58ch; margin-bottom: 2.5rem; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head p { margin-top: .75rem; }
.section-alt { background: var(--paper); border-block: 1px solid var(--line); }

.grid-3 { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.card h3 { margin-bottom: .5rem; }
.card p { color: var(--muted); font-size: .93rem; }
.card-icon {
  width: 38px; height: 38px; border-radius: 9px; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; margin-bottom: 1rem;
}

.steps { counter-reset: step; display: grid; gap: 1.75rem; }
@media (min-width: 960px) { .steps { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; } }
.step { position: relative; padding-top: 2.75rem; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 0; left: 0; width: 34px; height: 34px; border-radius: 50%;
  background: var(--ink); color: #fff; display: grid; place-items: center;
  font-size: .9rem; font-weight: 700;
}
.step h3 { margin-bottom: .4rem; }
.step p { color: var(--muted); font-size: .93rem; }

.audience { display: grid; gap: 1.25rem; }
@media (min-width: 720px) { .audience { grid-template-columns: repeat(3, 1fr); } }
.audience .card { border-left: 3px solid var(--accent); }

/* =============================================================
   9. Pricing
   ============================================================= */
.plans { display: grid; gap: 1.25rem; align-items: start; }
@media (min-width: 860px) { .plans { grid-template-columns: repeat(3, 1fr); } }
.plan {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.75rem; display: flex; flex-direction: column; height: 100%;
}
.plan-featured { border-color: var(--accent); box-shadow: var(--shadow-md); position: relative; }
.plan-tag {
  position: absolute; top: -.75rem; left: 1.75rem; background: var(--accent); color: #fff;
  font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: .25rem .7rem; border-radius: 999px;
}
.plan h3 { font-size: 1.05rem; }
.plan-price { display: flex; align-items: baseline; gap: .35rem; margin: .75rem 0 .25rem; }
.plan-price b { font-size: 2.4rem; font-weight: 700; letter-spacing: -.03em; }
.plan-price span { color: var(--muted); font-size: .9rem; }
.plan-credits { font-size: .9rem; color: var(--accent-ink); font-weight: 600; margin-bottom: 1.25rem; }
.plan ul { list-style: none; padding: 0; display: grid; gap: .6rem; font-size: .9rem; color: var(--muted); margin-bottom: 1.5rem; }
.plan li { display: flex; gap: .55rem; align-items: flex-start; }
.plan li svg { flex: none; margin-top: .3rem; color: var(--ok); }
.plan .btn { margin-top: auto; }
.pricing-note { margin-top: 1.5rem; font-size: .85rem; color: var(--muted); }

.faq { display: grid; gap: .75rem; }
.faq details {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem;
}
.faq summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-weight: 400; font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq p { margin-top: .75rem; color: var(--muted); font-size: .93rem; }

.cta-band { background: var(--ink); color: #fff; border-radius: var(--radius-lg); padding: clamp(2rem, 5vw, 3.25rem); text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #aab4c2; margin: .75rem auto 1.75rem; max-width: 48ch; }

/* =============================================================
   10. Auth pages
   ============================================================= */
.auth-page { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.auth-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.5rem); box-shadow: var(--shadow-md);
  width: min(100% - 2rem, 420px); margin: clamp(2rem, 6vw, 4rem) auto;
}
.auth-card h1 { font-size: 1.5rem; margin-bottom: .4rem; }
.auth-card .lead { font-size: .95rem; margin-bottom: 1.5rem; }
.auth-tabs { display: flex; gap: .25rem; background: var(--bg); padding: .25rem; border-radius: 10px; margin-bottom: 1.5rem; }
.auth-tabs button { flex: 1; padding: .5rem; border-radius: 8px; font-size: .9rem; font-weight: 600; color: var(--muted); }
.auth-tabs button[aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm); }

/* =============================================================
   11. App shell
   ============================================================= */
.app-body { background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
.app-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 100; }
.app-header .wrap { display: flex; align-items: center; gap: 1rem; height: 60px; }
.credit-pill {
  display: inline-flex; align-items: center; gap: .45rem; margin-left: auto;
  background: var(--accent-soft); color: var(--accent-ink); border: 1px solid #cfe0f6;
  padding: .35rem .8rem; border-radius: 999px; font-size: .85rem; font-weight: 700;
  transition: background .3s var(--ease-out);
}
.credit-pill.flash { background: #fde9c8; border-color: #f0d3a1; color: var(--warn); }
.credit-pill.empty { background: var(--danger-soft); border-color: #eccfcd; color: var(--danger); }
.app-menu { position: relative; }
.app-menu-btn {
  width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff;
  font-size: .8rem; font-weight: 700; display: grid; place-items: center;
}
.app-menu-list {
  position: absolute; right: 0; top: calc(100% + .5rem); background: var(--paper);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg);
  min-width: 190px; padding: .35rem; display: grid; gap: .1rem; z-index: 20;
}
.app-menu-list a, .app-menu-list button {
  display: block; width: 100%; text-align: left; padding: .5rem .7rem; border-radius: 7px;
  font-size: .9rem; color: var(--ink);
}
.app-menu-list a:hover, .app-menu-list button:hover { background: var(--bg); text-decoration: none; }
.app-menu-email { padding: .5rem .7rem; font-size: .78rem; color: var(--faint); border-bottom: 1px solid var(--line); margin-bottom: .25rem; word-break: break-all; }

.app-main { flex: 1; padding: clamp(1.25rem, 3vw, 2rem) 0 3rem; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.1rem, 3vw, 1.6rem); }
.panel + .panel { margin-top: 1.25rem; }
.panel-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.panel-head h2 { font-size: 1.1rem; }
.panel-head .spacer { margin-left: auto; }

/* Dropzone */
.dropzone {
  border: 2px dashed var(--line-strong); border-radius: var(--radius-lg);
  padding: clamp(2rem, 6vw, 3.5rem) 1.5rem; text-align: center; background: var(--paper);
  transition: border-color .2s var(--ease-out), background .2s var(--ease-out);
  cursor: pointer;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone svg { margin: 0 auto 1rem; color: var(--faint); }
.dropzone h2 { font-size: 1.15rem; margin-bottom: .4rem; }
.dropzone p { color: var(--muted); font-size: .9rem; }

/* Working / progress */
.progress-track { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 1rem 0 .6rem; }
.progress-bar { height: 100%; background: var(--accent); width: 0; transition: width .35s var(--ease-out); }
.progress-label { font-size: .88rem; color: var(--muted); }

/* Two-column workspace: page viewer + detections list */
.workspace { display: grid; gap: 1.25rem; align-items: start; }
@media (min-width: 1024px) { .workspace { grid-template-columns: minmax(0, 1fr) 340px; } }

.viewer { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.viewer-bar { display: flex; align-items: center; gap: .5rem; padding: .6rem .85rem; border-bottom: 1px solid var(--line); background: #fbfcfd; flex-wrap: wrap; }
.viewer-bar .pageno { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.viewer-bar .spacer { margin-left: auto; }
.iconbtn {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--paper); display: grid; place-items: center; color: var(--ink-soft);
}
.iconbtn:hover:not(:disabled) { border-color: var(--ink); }
.iconbtn:disabled { opacity: .4; cursor: not-allowed; }
.toggle-manual {
  display: inline-flex; align-items: center; gap: .45rem; font-size: .83rem; font-weight: 600;
  padding: .35rem .7rem; border-radius: 8px; border: 1px solid var(--line-strong); color: var(--muted);
}
.toggle-manual[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.stage { position: relative; background: #eef1f4; padding: 1rem; display: grid; place-items: center; overflow: auto; max-height: 72vh; }
.stage-inner { position: relative; line-height: 0; box-shadow: var(--shadow-md); }
.stage-inner canvas { max-width: 100%; height: auto; }
.overlay { position: absolute; inset: 0; }
.overlay.drawing { cursor: crosshair; }
.box {
  position: absolute; background: var(--ink); border-radius: 1px;
  outline: 1px solid rgba(255, 255, 255, .35); outline-offset: -1px;
}
.box.off { background: transparent; border: 1.5px dashed #b0392f; }
.box.highlight { box-shadow: 0 0 0 3px #f0a500; }
.box.manual { background: #0e1420; outline-color: rgba(240, 165, 0, .8); }
.drawing-rect { position: absolute; background: rgba(14, 20, 32, .45); border: 1.5px solid var(--ink); }

/* Detections list */
.detections { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.detections-head { padding: .85rem 1rem; border-bottom: 1px solid var(--line); background: #fbfcfd; display: flex; align-items: center; gap: .5rem; }
.detections-head h2 { font-size: .95rem; }
.detections-head .count { margin-left: auto; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.detections-actions { display: flex; gap: .4rem; padding: .6rem 1rem; border-bottom: 1px solid var(--line); }
.detections-actions button { font-size: .8rem; padding: .35rem .6rem; border-radius: 7px; border: 1px solid var(--line-strong); color: var(--muted); }
.detections-actions button:hover { color: var(--ink); border-color: var(--ink); }
.det-list { list-style: none; padding: 0; margin: 0; max-height: 52vh; overflow-y: auto; }
.det-item { display: flex; gap: .65rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line); align-items: flex-start; }
.det-item:last-child { border-bottom: 0; }
.det-item.is-off { background: #fcfcfd; }
.det-item.is-off .det-text { text-decoration: line-through; color: var(--faint); }
.det-item input[type="checkbox"] { margin-top: .3rem; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.det-body { min-width: 0; flex: 1; }
.det-text { font-family: var(--mono); font-size: .8rem; word-break: break-word; color: var(--ink); }
.det-meta { display: flex; align-items: center; gap: .4rem; margin-top: .2rem; flex-wrap: wrap; }
.det-type {
  font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: var(--accent-soft); color: var(--accent-ink); padding: .1rem .4rem; border-radius: 4px;
}
.det-type.manual { background: #fdf3e2; color: var(--warn); }
.det-type.missing { background: var(--danger-soft); color: var(--danger); }
.det-page { font-size: .72rem; color: var(--faint); }
.det-del { color: var(--faint); font-size: 1rem; line-height: 1; padding: .2rem .35rem; border-radius: 5px; }
.det-del:hover { color: var(--danger); background: var(--danger-soft); }
.det-empty { padding: 2rem 1rem; text-align: center; color: var(--faint); font-size: .9rem; }

.export-bar { padding: 1rem; border-top: 1px solid var(--line); background: #fbfcfd; display: grid; gap: .6rem; }

/* =============================================================
   12. Account page
   ============================================================= */
.acct-grid { display: grid; gap: 1.25rem; }
@media (min-width: 900px) { .acct-grid { grid-template-columns: 1fr 1fr; } }
.stat { display: flex; align-items: baseline; gap: .5rem; }
.stat b { font-size: 2.2rem; font-weight: 700; letter-spacing: -.03em; }
.stat span { color: var(--muted); font-size: .9rem; }
.meter { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin: .85rem 0 .5rem; }
.meter-fill { height: 100%; background: var(--accent); border-radius: 999px; }
.kv { display: grid; gap: .6rem; font-size: .9rem; margin-top: 1rem; }
.kv div { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: .6rem; border-bottom: 1px solid var(--line); }
.kv div:last-child { border-bottom: 0; padding-bottom: 0; }
.kv dt { color: var(--muted); }
.kv dd { font-weight: 600; text-align: right; }
.history { list-style: none; padding: 0; margin: 0; max-height: 340px; overflow-y: auto; font-size: .88rem; }
.history li { display: flex; gap: 1rem; justify-content: space-between; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.history li:last-child { border-bottom: 0; }
.history time { color: var(--faint); font-size: .8rem; white-space: nowrap; }

/* =============================================================
   13. Modal (upgrade / simulated checkout)
   ============================================================= */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(14, 20, 32, .55); z-index: 300;
  display: grid; place-items: center; padding: 1rem; animation: fade .2s var(--ease-out);
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--paper); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: min(100%, 560px); max-height: 92vh; overflow-y: auto;
}
.modal-head { padding: 1.5rem 1.5rem 0; }
.modal-head h2 { font-size: 1.25rem; }
.modal-head p { color: var(--muted); font-size: .93rem; margin-top: .4rem; }
.modal-body { padding: 1.25rem 1.5rem 1.5rem; }
.modal-foot { padding: 1rem 1.5rem 1.5rem; display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; }
.plan-choice { display: grid; gap: .6rem; margin: 1.25rem 0; }
.plan-option {
  display: flex; align-items: center; gap: .8rem; padding: .9rem 1rem;
  border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer;
}
.plan-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.plan-option input { accent-color: var(--accent); width: 16px; height: 16px; }
.plan-option .po-name { font-weight: 650; }
.plan-option .po-credits { font-size: .82rem; color: var(--muted); }
.plan-option .po-price { margin-left: auto; font-weight: 700; }
.fake-card {
  background: var(--bg); border: 1px dashed var(--line-strong); border-radius: 10px;
  padding: 1rem; font-family: var(--mono); font-size: .85rem; color: var(--faint);
  display: grid; gap: .5rem;
}
.fake-card div { display: flex; justify-content: space-between; }

/* =============================================================
   14. Legal / long-form pages
   ============================================================= */
.legal { padding: clamp(2rem, 6vw, 4rem) 0; }
.legal h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: .5rem; }
.legal .updated { color: var(--faint); font-size: .85rem; margin-bottom: 2.5rem; }
.legal h2 { font-size: 1.2rem; margin: 2.25rem 0 .75rem; }
.legal p, .legal li { color: var(--ink-soft); font-size: .95rem; }
.legal p + p { margin-top: .85rem; }
.legal ul, .legal ol { margin: .85rem 0 0 1.25rem; display: grid; gap: .45rem; }
.legal table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: .9rem; }
.legal th, .legal td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal th { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; }

/* =============================================================
   15. Reduced motion
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .toast { animation: none; }
  .modal-backdrop { animation: none; }
  .progress-bar { transition: none; }
}

/* =============================================================
   16. Before / after sample pair (works with JS disabled)
   ============================================================= */
.sample-pair { display: grid; gap: 1rem; }
@media (min-width: 620px) { .sample-pair { grid-template-columns: 1fr 1fr; } }
.sample-tag {
  display: inline-flex; align-items: center; gap: .4rem; font-size: .72rem; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase; padding: .25rem .6rem; border-radius: 999px;
}
.sample-tag.before { background: var(--danger-soft); color: var(--danger); }
.sample-tag.after { background: var(--ok-soft); color: var(--ok); }
.sample-head-simple { padding: .8rem 1.25rem; border-bottom: 1px solid var(--line); background: #fbfcfd; }

/* =============================================================
   17. The final check — the person approves and answers for it
   ============================================================= */
.review-head { max-width: 62ch; margin: 0 auto 1.75rem; text-align: center; }
.review-head h1 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin-bottom: .6rem; }
.review-head .lead { font-size: 1rem; }
.review-count {
  display: inline-block; margin-top: 1rem; padding: .45rem .9rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink); font-size: .88rem; font-weight: 600;
}
.review-head [data-review-notes] { margin-top: 1rem; text-align: left; }
.review-head [data-review-notes] .notice { margin-bottom: .5rem; }

.review-grid { display: grid; gap: 1.25rem; align-items: start; }
@media (min-width: 1024px) { .review-grid { grid-template-columns: minmax(0, 1fr) 340px; } }

.review-viewer { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.review-stage { background: #eef1f4; padding: 1.25rem; display: grid; place-items: center; max-height: 78vh; overflow: auto; }
.review-stage img { max-width: 100%; height: auto; box-shadow: var(--shadow-md); background: #fff; }
.review-exact { margin: 0; padding: .7rem .85rem; border-top: 1px solid var(--line); background: #fbfcfd; }

.review-checklist { list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; gap: .6rem; font-size: .88rem; color: var(--muted); }
.review-checklist li { display: flex; gap: .55rem; align-items: flex-start; }
.review-checklist li::before {
  content: ""; flex: none; margin-top: .45rem; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}

.approve-box {
  display: flex; gap: .7rem; align-items: flex-start; padding: .9rem 1rem; margin-bottom: 1rem;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg);
  font-size: .88rem; line-height: 1.5; cursor: pointer;
  transition: border-color .2s var(--ease-out), background .2s var(--ease-out);
}
.approve-box:has(input:checked) { border-color: var(--ok); background: var(--ok-soft); color: #0d5544; }
.approve-box input { flex: none; margin-top: .15rem; width: 17px; height: 17px; accent-color: var(--ok); }

/* =============================================================
   18. AI disclosure — stated plainly, never buried
   ============================================================= */
.ai-note {
  display: flex; gap: .6rem; align-items: flex-start;
  padding: .8rem 1rem; border-radius: 10px; margin-bottom: 1.25rem;
  background: var(--accent-soft); border: 1px solid #cfe0f6; color: var(--accent-ink);
  font-size: .85rem; line-height: 1.55;
}
.ai-note svg { flex: none; margin-top: .15rem; }
.ai-note strong { font-weight: 700; }

/* Redaction style picker */
.style-picker { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--muted); }
.style-picker select {
  padding: .3rem .5rem; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--paper); font-size: .8rem; font-weight: 600; color: var(--ink);
}
