/* =============================================================
   1. Tokens
   ============================================================= */
:root{
  --navy: #101c3a;
  --navy-2: #16224a;
  --blue: #2f5fe0;
  --blue-dark: #2148b8;
  --teal: #0ea89f;
  --bg: #f6f8fc;
  --card: #ffffff;
  --line: #e3e8f2;
  --ink: #101529;
  --ink-mut: #5b6478;
  --ink-soft: #8991a3;
  --amber: #f5a524;
  --amber-bg: #fff6e0;
  --red: #d64545;
  --red-bg: #fdecec;
  --green: #1f9d63;
  --green-bg: #e9f8f0;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 8px 30px -12px rgba(16, 28, 58, .18);
  --shadow-sm: 0 2px 10px -4px rgba(16, 28, 58, .14);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --container: 1160px;
}

/* =============================================================
   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; overflow-x:clip;
}
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.15; letter-spacing:-.01em; font-weight:700; }
ul{ list-style:none; padding:0; }
input,select,textarea{ font:inherit; color:inherit; }
::selection{ background:var(--blue); color:#fff; }
:focus-visible{ outline:2px solid var(--blue); outline-offset:2px; border-radius:6px; }

.skip-link{
  position:fixed; top:-100px; left:1rem; padding:.6rem 1rem; background:var(--navy); 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:0 auto; padding:0 24px; }
.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }
.stack{ display:flex; flex-direction:column; }
.center{ display:flex; align-items:center; justify-content:center; }
.badge{
  display:inline-flex; align-items:center; gap:6px; padding:5px 12px; border-radius:99px;
  font-size:12.5px; font-weight:700; letter-spacing:.02em;
}
.badge-demo{ background:var(--amber-bg); color:#92600a; border:1px solid #f0d4a0; }
.badge-soft{ background:#eef2ff; color:var(--blue-dark); }

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:13px 22px; border-radius:11px; font-weight:650; font-size:15px;
  transition:transform .15s var(--ease-out), box-shadow .15s var(--ease-out), background .15s var(--ease-out);
  white-space:nowrap;
}
.btn:active{ transform:translateY(1px); }
.btn-primary{ background:var(--blue); color:#fff; box-shadow:0 10px 24px -10px rgba(47,95,224,.55); }
.btn-primary:hover{ background:var(--blue-dark); }
.btn-dark{ background:var(--navy); color:#fff; }
.btn-dark:hover{ background:var(--navy-2); }
.btn-ghost{ background:transparent; color:var(--ink); border:1.5px solid var(--line); }
.btn-ghost:hover{ border-color:var(--blue); color:var(--blue); }
.btn-teal{ background:var(--teal); color:#fff; }
.btn-block{ width:100%; }
.btn-sm{ padding:9px 15px; font-size:13.5px; border-radius:9px; }
.btn-danger{ background:var(--red-bg); color:var(--red); }
.btn:disabled{ opacity:.5; cursor:not-allowed; }

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

/* =============================================================
   4. Site header / nav
   ============================================================= */
.site-header{
  position:sticky; top:0; z-index:100; background:rgba(246,248,252,.85); backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line);
}
.site-header .container{ display:flex; align-items:center; justify-content:space-between; height:72px; }
.logo{ display:flex; align-items:center; gap:9px; font-weight:800; font-size:19px; color:var(--navy); }
.logo .logo-mark{
  width:32px; height:32px; border-radius:9px; background:linear-gradient(135deg,var(--blue),var(--teal));
  display:grid; place-items:center; color:#fff; font-size:15px; font-weight:800;
}
.nav-links{ display:flex; align-items:center; gap:30px; }
.nav-links a{ font-size:14.5px; font-weight:600; color:var(--ink-mut); }
.nav-links a:hover{ color:var(--ink); }
.nav-actions{ display:flex; align-items:center; gap:12px; }
.nav-toggle{ display:none; }

@media (max-width:840px){
  .nav-links{
    position:fixed; inset:72px 0 0 0; background:var(--bg); flex-direction:column; align-items:flex-start;
    padding:28px 24px; gap:22px; transform:translateY(-8px); opacity:0; pointer-events:none;
    transition:opacity .2s var(--ease-out), transform .2s var(--ease-out);
  }
  .nav-links.is-open{ opacity:1; pointer-events:auto; transform:none; }
  .nav-links a{ font-size:17px; }
  .nav-toggle{
    display:grid; place-items:center; width:40px; height:40px; border-radius:9px;
  }
  .nav-toggle svg{ width:22px; height:22px; }
  .nav-actions .btn-ghost{ display:none; }
}

/* =============================================================
   5. Hero + before/after
   ============================================================= */
.hero{ padding:64px 0 40px; }
.hero-grid{ display:grid; grid-template-columns:1.05fr .95fr; gap:56px; align-items:center; }
@media (max-width:960px){ .hero-grid{ grid-template-columns:1fr; gap:40px; } }

.hero h1{ font-size:clamp(2.1rem, 4vw, 3.1rem); color:var(--navy); margin-bottom:18px; }
.hero .lead{ font-size:18px; color:var(--ink-mut); max-width:52ch; margin-bottom:28px; }
.hero-ctas{ display:flex; gap:14px; flex-wrap:wrap; margin-bottom:22px; }
.hero-trust{ display:flex; gap:18px; flex-wrap:wrap; font-size:13.5px; color:var(--ink-soft); }
.hero-trust span{ display:inline-flex; align-items:center; gap:6px; }

/* before/after visual */
.compare{
  background:var(--card); border:1px solid var(--line); border-radius:18px; box-shadow:var(--shadow);
  padding:18px; position:relative;
}
.compare-label{
  position:absolute; top:-12px; left:18px; background:var(--navy); color:#fff; font-size:11.5px;
  font-weight:700; letter-spacing:.04em; text-transform:uppercase; padding:4px 10px; border-radius:99px;
}
.compare-grid{ display:grid; grid-template-columns:1fr auto 1fr; gap:14px; align-items:center; }
@media (max-width:640px){ .compare-grid{ grid-template-columns:1fr; } .compare-arrow{ transform:rotate(90deg); margin:0 auto; } }
.compare-arrow{ color:var(--teal); }
.compare-col{ min-width:0; }
.compare-col-title{ font-size:11.5px; font-weight:700; color:var(--ink-soft); text-transform:uppercase; letter-spacing:.05em; margin-bottom:8px; }

/* the fake invoice mock */
.mock-invoice{
  background:#fdfdfb; border:1px solid #e4e2d8; border-radius:8px; padding:16px; font-size:11px;
  color:#2a2a26; aspect-ratio:3/4; overflow:hidden; box-shadow:inset 0 0 0 1px #fff;
  transform:rotate(-1.2deg);
}
.mock-invoice .mi-head{ display:flex; justify-content:space-between; align-items:flex-start; border-bottom:2px solid #2a2a26; padding-bottom:8px; margin-bottom:10px; }
.mock-invoice .mi-brand{ font-weight:800; font-size:13px; letter-spacing:.02em; }
.mock-invoice .mi-sub{ color:#6b6a5f; font-size:9.5px; margin-top:2px; }
.mock-invoice .mi-meta{ text-align:right; font-size:9.5px; color:#6b6a5f; line-height:1.5; }
.mock-invoice .mi-meta b{ color:#2a2a26; }
.mock-invoice table{ width:100%; border-collapse:collapse; font-size:9.5px; margin-bottom:10px; }
.mock-invoice th{ text-align:left; border-bottom:1px solid #cfcdbf; padding:4px 2px; color:#6b6a5f; font-weight:700; }
.mock-invoice td{ padding:4px 2px; border-bottom:1px solid #ece9db; }
.mock-invoice .mi-totales{ margin-left:auto; width:60%; font-size:10px; }
.mock-invoice .mi-totales div{ display:flex; justify-content:space-between; padding:2px 0; }
.mock-invoice .mi-totales .tot{ font-weight:800; border-top:1.5px solid #2a2a26; margin-top:3px; padding-top:5px; }

/* the fake excel table */
.mock-excel{ border:1px solid #d6dceb; border-radius:8px; overflow:hidden; background:#fff; }
.mock-excel table{ width:100%; border-collapse:collapse; font-size:10.5px; }
.mock-excel th{
  background:var(--green); color:#fff; text-align:left; padding:7px 8px; font-weight:700; white-space:nowrap;
}
.mock-excel td{ padding:7px 8px; border-bottom:1px solid #eef1f8; border-right:1px solid #eef1f8; white-space:nowrap; color:var(--ink); }
.mock-excel tr:last-child td{ border-bottom:none; }
.mock-excel td.num{ text-align:right; font-variant-numeric:tabular-nums; }

/* =============================================================
   6. Sections
   ============================================================= */
.section{ padding:76px 0; }
.section-head{ max-width:640px; margin:0 auto 44px; text-align:center; }
.section-head h2{ font-size:clamp(1.6rem,3vw,2.2rem); color:var(--navy); margin-bottom:12px; }
.section-head p{ color:var(--ink-mut); font-size:16.5px; }
.eyebrow{ display:block; font-size:13px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; color:var(--blue); margin-bottom:10px; }

.steps{ display:grid; grid-template-columns:repeat(3,1fr); gap:26px; }
@media (max-width:820px){ .steps{ grid-template-columns:1fr; } }
.step-card{ padding:28px; }
.step-num{
  width:34px; height:34px; border-radius:10px; background:var(--navy); color:#fff; font-weight:800;
  display:grid; place-items:center; margin-bottom:16px; font-size:15px;
}
.step-card h3{ font-size:17px; margin-bottom:8px; }
.step-card p{ color:var(--ink-mut); font-size:14.5px; }

.perks{ display:grid; grid-template-columns:repeat(4,1fr); gap:22px; }
@media (max-width:960px){ .perks{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:560px){ .perks{ grid-template-columns:1fr; } }
.perk{ padding:24px; }
.perk-icon{ width:38px; height:38px; border-radius:10px; background:#eef2ff; color:var(--blue); display:grid; place-items:center; margin-bottom:14px; }
.perk h3{ font-size:15.5px; margin-bottom:6px; }
.perk p{ font-size:13.8px; color:var(--ink-mut); }

.section-alt{ background:var(--navy); color:#fff; }
.section-alt .section-head h2{ color:#fff; }
.section-alt .section-head p{ color:#b7c1e0; }

/* =============================================================
   7. Pricing
   ============================================================= */
.pricing-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:24px; align-items:stretch; }
@media (max-width:900px){ .pricing-grid{ grid-template-columns:1fr; max-width:420px; margin:0 auto; } }
.plan-card{ padding:30px; display:flex; flex-direction:column; position:relative; }
.plan-card.is-featured{ border:2px solid var(--blue); box-shadow:0 20px 44px -18px rgba(47,95,224,.35); transform:translateY(-6px); }
.plan-pop{
  position:absolute; top:-13px; left:50%; transform:translateX(-50%); background:var(--blue); color:#fff;
  font-size:11.5px; font-weight:700; padding:5px 13px; border-radius:99px; letter-spacing:.02em;
}
.plan-name{ font-size:16px; font-weight:700; color:var(--ink-mut); margin-bottom:6px; }
.plan-price{ display:flex; align-items:baseline; gap:6px; margin-bottom:6px; }
.plan-price .num{ font-size:40px; font-weight:800; color:var(--navy); letter-spacing:-.02em; }
.plan-price .per{ color:var(--ink-soft); font-size:14px; }
.plan-desc{ color:var(--ink-mut); font-size:13.8px; margin-bottom:20px; }
.plan-credits{ font-weight:700; color:var(--teal); font-size:14px; margin-bottom:18px; }
.plan-feats{ display:flex; flex-direction:column; gap:11px; margin-bottom:26px; flex:1; }
.plan-feats li{ display:flex; gap:9px; font-size:14px; color:var(--ink); align-items:flex-start; }
.plan-feats svg{ flex:none; width:17px; height:17px; color:var(--teal); margin-top:2px; }

.demo-note{
  display:flex; align-items:center; gap:10px; justify-content:center; margin-top:30px; color:#92600a;
  background:var(--amber-bg); border:1px solid #f0d4a0; padding:12px 18px; border-radius:12px; font-size:13.8px;
  max-width:640px; margin-left:auto; margin-right:auto; text-align:center;
}

/* =============================================================
   8. FAQ
   ============================================================= */
.faq-list{ max-width:760px; margin:0 auto; display:flex; flex-direction:column; gap:12px; }
.faq-item{ border:1px solid var(--line); border-radius:12px; background:var(--card); overflow:hidden; }
.faq-q{
  width:100%; display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:18px 20px; font-weight:650; font-size:15px; text-align:left;
}
.faq-q svg{ flex:none; transition:transform .2s var(--ease-out); color:var(--ink-soft); }
.faq-item.is-open .faq-q svg{ transform:rotate(45deg); }
.faq-a{ max-height:0; overflow:hidden; transition:max-height .25s var(--ease-out); }
.faq-item.is-open .faq-a{ max-height:240px; }
.faq-a p{ padding:0 20px 18px; color:var(--ink-mut); font-size:14.3px; }

/* =============================================================
   9. CTA band
   ============================================================= */
.cta-band{
  background:linear-gradient(135deg,var(--navy),#1a2f66); color:#fff; border-radius:22px; padding:56px 40px;
  text-align:center; margin:0 24px;
}
.cta-band h2{ font-size:clamp(1.5rem,3vw,2rem); margin-bottom:12px; }
.cta-band p{ color:#c2cbea; margin-bottom:26px; }

/* =============================================================
   10. Footer
   ============================================================= */
.site-footer{ border-top:1px solid var(--line); padding:48px 0 30px; margin-top:40px; }
.footer-grid{ display:grid; grid-template-columns:1.4fr repeat(3,1fr); gap:32px; margin-bottom:32px; }
@media (max-width:760px){ .footer-grid{ grid-template-columns:1fr 1fr; } }
.footer-col h4{ font-size:13px; color:var(--ink-soft); text-transform:uppercase; letter-spacing:.05em; margin-bottom:14px; }
.footer-col ul{ display:flex; flex-direction:column; gap:9px; }
.footer-col a{ font-size:14px; color:var(--ink-mut); }
.footer-col a:hover{ color:var(--blue); }
.footer-bottom{ display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px; font-size:13px; color:var(--ink-soft); border-top:1px solid var(--line); padding-top:22px; }

/* =============================================================
   11. Auth / Checkout modals
   ============================================================= */
.modal-backdrop{
  position:fixed; inset:0; background:rgba(16,21,41,.55); display:none; align-items:center; justify-content:center;
  padding:20px; z-index:1000;
}
.modal-backdrop.is-open{ display:flex; }
.modal{
  background:#fff; border-radius:18px; max-width:440px; width:100%; padding:30px; position:relative;
  box-shadow:0 30px 70px -20px rgba(16,21,41,.4); max-height:90vh; overflow-y:auto;
}
.modal-wide{ max-width:520px; }
.modal-close{
  position:absolute; top:16px; right:16px; width:32px; height:32px; border-radius:9px; display:grid; place-items:center;
  color:var(--ink-soft);
}
.modal-close:hover{ background:var(--bg); color:var(--ink); }
.modal h3{ font-size:20px; margin-bottom:6px; color:var(--navy); }
.modal .modal-sub{ color:var(--ink-mut); font-size:14px; margin-bottom:22px; }
.field{ margin-bottom:16px; }
.field label{ display:block; font-size:13px; font-weight:650; color:var(--ink-mut); margin-bottom:6px; }
.field input{
  width:100%; padding:11px 13px; border:1.5px solid var(--line); border-radius:10px; font-size:14.5px;
  transition:border-color .15s;
}
.field input:focus{ border-color:var(--blue); outline:none; }
.field-error{ color:var(--red); font-size:12.5px; margin-top:5px; display:none; }
.form-msg{ font-size:13.5px; padding:10px 13px; border-radius:9px; margin-bottom:16px; display:none; }
.form-msg.is-error{ display:block; background:var(--red-bg); color:var(--red); }
.form-msg.is-ok{ display:block; background:var(--green-bg); color:var(--green); }
.modal-switch{ text-align:center; font-size:13.5px; color:var(--ink-mut); margin-top:16px; }
.modal-switch button{ color:var(--blue); font-weight:650; }

.checkout-summary{ background:var(--bg); border-radius:12px; padding:16px 18px; margin-bottom:18px; }
.checkout-summary .row{ display:flex; justify-content:space-between; font-size:14px; padding:4px 0; }
.checkout-summary .row.tot{ font-weight:700; border-top:1px solid var(--line); margin-top:6px; padding-top:10px; }
.fake-card{
  border:1.5px solid var(--line); border-radius:12px; padding:14px 16px; margin-bottom:18px; background:#fafbfe;
  font-family:ui-monospace,monospace; font-size:14.5px; letter-spacing:.04em; color:var(--ink-soft);
  display:flex; align-items:center; justify-content:space-between;
}
.demo-flag{
  display:flex; gap:9px; align-items:flex-start; background:var(--amber-bg); border:1px solid #f0d4a0; color:#92600a;
  padding:11px 14px; border-radius:10px; font-size:13px; margin-bottom:18px;
}
.demo-flag svg{ flex:none; width:16px; height:16px; margin-top:1px; }

/* =============================================================
   12. App shell (app.html / cuenta.html)
   ============================================================= */
body.app-body{ background:var(--bg); }
.app-header{
  position:sticky; top:0; z-index:90; background:#fff; border-bottom:1px solid var(--line);
  height:64px; display:flex; align-items:center;
}
.app-header .container{ display:flex; align-items:center; justify-content:space-between; }
.credits-pill{
  display:inline-flex; align-items:center; gap:8px; background:#eef2ff; color:var(--blue-dark); font-weight:700;
  padding:8px 14px; border-radius:99px; font-size:14px; transition:transform .2s var(--ease-out);
}
.credits-pill.bump{ transform:scale(1.08); }
.credits-pill .lightning{ color:var(--amber); }
.app-header-right{ display:flex; align-items:center; gap:14px; }
.account-menu{ position:relative; }
.account-btn{
  display:flex; align-items:center; gap:9px; padding:6px 12px 6px 6px; border-radius:99px; border:1px solid var(--line);
}
.avatar{ width:30px; height:30px; border-radius:50%; background:var(--navy); color:#fff; display:grid; place-items:center; font-weight:700; font-size:13px; }
.account-dropdown{
  position:absolute; right:0; top:calc(100% + 10px); background:#fff; border:1px solid var(--line); border-radius:12px;
  box-shadow:var(--shadow); min-width:190px; padding:8px; display:none; flex-direction:column; gap:2px;
}
.account-dropdown.is-open{ display:flex; }
.account-dropdown a, .account-dropdown button{
  display:block; width:100%; text-align:left; padding:9px 12px; border-radius:8px; font-size:14px;
}
.account-dropdown a:hover, .account-dropdown button:hover{ background:var(--bg); }

.app-main{ padding:36px 0 80px; }
.app-title-row{ display:flex; align-items:flex-end; justify-content:space-between; margin-bottom:24px; flex-wrap:wrap; gap:12px; }
.app-title-row h1{ font-size:24px; color:var(--navy); }
.app-title-row p{ color:var(--ink-mut); font-size:14.5px; margin-top:4px; }

.dropzone{
  border:2px dashed var(--line); border-radius:16px; padding:44px 24px; text-align:center; background:#fff;
  transition:border-color .15s, background .15s; cursor:pointer;
}
.dropzone[data-drag="over"]{ border-color:var(--blue); background:#f2f6ff; }
.dropzone-icon{ width:52px; height:52px; margin:0 auto 14px; border-radius:14px; background:#eef2ff; color:var(--blue); display:grid; place-items:center; }
.dropzone h3{ font-size:16.5px; margin-bottom:6px; }
.dropzone p{ color:var(--ink-mut); font-size:13.8px; margin-bottom:16px; }

.queue{ margin-top:22px; display:flex; flex-direction:column; gap:10px; }
.queue-item{ display:flex; align-items:center; gap:12px; padding:12px 14px; background:#fff; border:1px solid var(--line); border-radius:12px; }
.queue-thumb{ width:40px; height:40px; border-radius:8px; object-fit:cover; background:var(--bg); flex:none; }
.queue-info{ flex:1; min-width:0; }
.queue-name{ font-size:13.8px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.queue-status{ font-size:12.3px; color:var(--ink-soft); margin-top:2px; }
.queue-status.err{ color:var(--red); }
.queue-status.ok{ color:var(--green); }
.qstate{ width:20px; height:20px; flex:none; }
.spinner{ width:16px; height:16px; border:2px solid var(--line); border-top-color:var(--blue); border-radius:50%; animation:spin .7s linear infinite; }
@keyframes spin{ to{ transform:rotate(360deg); } }

.confirm-bar{
  display:flex; align-items:center; justify-content:space-between; gap:16px; background:var(--navy); color:#fff;
  padding:16px 20px; border-radius:14px; margin-top:18px; flex-wrap:wrap;
}
.confirm-bar strong{ font-size:15px; }
.confirm-bar span{ color:#b7c1e0; font-size:13.5px; }

.results-toolbar{ display:flex; align-items:center; justify-content:space-between; gap:14px; margin:34px 0 14px; flex-wrap:wrap; }
.results-toolbar h2{ font-size:18px; color:var(--navy); }
.toolbar-actions{ display:flex; gap:10px; flex-wrap:wrap; }

.table-wrap{ background:#fff; border:1px solid var(--line); border-radius:14px; overflow:auto; box-shadow:var(--shadow-sm); }
table.results{ width:100%; border-collapse:collapse; font-size:13.6px; min-width:920px; }
table.results th{
  background:#f8f9fd; text-align:left; padding:11px 12px; font-weight:700; color:var(--ink-mut); white-space:nowrap;
  border-bottom:1px solid var(--line); position:sticky; top:0;
}
table.results td{ padding:9px 12px; border-bottom:1px solid #f0f2f8; white-space:nowrap; }
table.results tr:last-child td{ border-bottom:none; }
table.results td.num{ text-align:right; font-variant-numeric:tabular-nums; }
table.results td[contenteditable="true"]{ cursor:text; border-radius:6px; }
table.results td[contenteditable="true"]:hover{ background:#f6f8fd; }
table.results td[contenteditable="true"]:focus{ outline:2px solid var(--blue); outline-offset:-2px; background:#fff; }
td.low-conf{ background:var(--amber-bg); }
td.mismatch{ background:var(--red-bg); }
.row-view{ padding:6px 10px !important; border-radius:8px; color:var(--blue); font-weight:650; font-size:12.8px; white-space:nowrap; }
.row-del{ color:var(--ink-soft); padding:6px !important; }
.row-del:hover{ color:var(--red); }
tfoot td{ font-weight:700; background:#f8f9fd; }

.empty-state{ text-align:center; padding:50px 20px; color:var(--ink-soft); }

/* compare drawer */
.drawer-backdrop{ position:fixed; inset:0; background:rgba(16,21,41,.5); display:none; z-index:1000; }
.drawer-backdrop.is-open{ display:block; }
.drawer{
  position:fixed; top:0; right:0; bottom:0; width:min(760px,100%); background:#fff; z-index:1001;
  transform:translateX(100%); transition:transform .25s var(--ease-out); display:flex; flex-direction:column;
}
.drawer.is-open{ transform:none; }
.drawer-head{ display:flex; align-items:center; justify-content:space-between; padding:18px 22px; border-bottom:1px solid var(--line); }
.drawer-head h3{ font-size:16px; }
.drawer-body{ flex:1; overflow-y:auto; padding:22px; display:grid; grid-template-columns:1fr 1fr; gap:24px; }
@media (max-width:720px){ .drawer-body{ grid-template-columns:1fr; } }
.drawer-preview{ background:var(--bg); border-radius:12px; overflow:hidden; display:flex; align-items:center; justify-content:center; min-height:260px; }
.drawer-preview img{ width:100%; height:100%; object-fit:contain; }
.drawer-fields .field{ margin-bottom:14px; }
.drawer-fields input{ width:100%; padding:10px 12px; border:1.5px solid var(--line); border-radius:9px; font-size:14px; }
.drawer-fields input.low-conf{ border-color:var(--amber); background:var(--amber-bg); }
.conf-note{ font-size:12px; color:var(--ink-soft); margin-top:4px; }

/* toasts */
.toast-wrap{ position:fixed; bottom:22px; right:22px; z-index:1200; display:flex; flex-direction:column; gap:10px; max-width:360px; }
.toast{
  background:var(--navy); color:#fff; padding:13px 16px; border-radius:11px; font-size:13.8px; box-shadow:var(--shadow);
  display:flex; align-items:flex-start; gap:10px; animation:toast-in .2s var(--ease-out);
}
.toast.err{ background:var(--red); }
.toast.ok{ background:var(--green); }
@keyframes toast-in{ from{ opacity:0; transform:translateY(8px); } to{ opacity:1; transform:none; } }

/* account page */
.acct-grid{ display:grid; grid-template-columns:340px 1fr; gap:24px; align-items:start; }
@media (max-width:860px){ .acct-grid{ grid-template-columns:1fr; } }
.acct-card{ padding:24px; }
.acct-plan-name{ font-size:20px; font-weight:800; color:var(--navy); margin-bottom:4px; }
.acct-credit-num{ font-size:38px; font-weight:800; color:var(--blue); margin:14px 0 4px; }
.acct-row{ display:flex; justify-content:space-between; font-size:13.8px; padding:9px 0; border-top:1px solid var(--line); color:var(--ink-mut); }
.hist-table{ width:100%; border-collapse:collapse; font-size:13.6px; }
.hist-table th{ text-align:left; color:var(--ink-soft); font-weight:700; padding:10px 12px; border-bottom:1px solid var(--line); }
.hist-table td{ padding:10px 12px; border-bottom:1px solid #f0f2f8; }

/* =============================================================
   13. Legal pages
   ============================================================= */
.legal{ padding:60px 0 90px; max-width:760px; margin:0 auto; }
.legal h1{ font-size:28px; color:var(--navy); margin-bottom:8px; }
.legal .updated{ color:var(--ink-soft); font-size:13.5px; margin-bottom:36px; }
.legal h2{ font-size:18px; color:var(--navy); margin:32px 0 10px; }
.legal p, .legal li{ color:var(--ink-mut); font-size:15px; margin-bottom:10px; }
.legal ul{ list-style:disc; padding-left:22px; }
.legal ul li{ margin-bottom:6px; }

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