/* ============================================================
   PDFtoMD — total black palette, electric-blue accent
   ============================================================ */
:root {
  --bg:           #000000;
  --surface:      #0a0a0b;
  --surface-2:    #101013;
  --surface-3:    #16161a;
  --border:       #1d1d22;
  --border-2:     #2a2a31;
  --border-glow:  #3a3a44;

  --text:         #f4f4f6;
  --text-muted:   #9a9aa6;
  --text-faint:   #5d5d68;

  --accent:       #2f7dff;
  --accent-bright:#4f93ff;
  --accent-dim:   #1d4fb0;
  --accent-aa:    #2563eb; /* 5.2:1 contrast with white text (WCAG AA) */
  --accent-glow:  rgba(47, 125, 255, 0.45);
  --accent-soft:  rgba(47, 125, 255, 0.12);

  --success:      #34d399;
  --radius:       14px;
  --radius-lg:    20px;
  --radius-pill:  999px;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  background: var(--bg);
}

::selection { background: var(--accent); color: #fff; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
button:disabled { cursor: not-allowed; }

.tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }

/* ---- faint grid texture overlay ---- */
.grid-tex {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 22%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 22%, #000 0%, transparent 72%);
}

/* ============================================================
   Shell
   ============================================================ */
.shell { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; padding: 0 24px 120px; transition: opacity .17s ease; }
.shell.lang-fading { opacity: 0; }

/* ---- top bar / logo ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 76px;
}
.logo { display: flex; align-items: center; gap: 11px; }
.pdftomd-logo { display: block; line-height: 0; }
.pdftomd-logo svg { height: 56px; width: auto; display: block; }
.pdftomd-logo text { font-family: "JetBrains Mono", ui-monospace, monospace; font-weight: 700; }
@keyframes pm-innerfade {
  0%   { opacity: 0; transform: translateY(-5px); }
  28%  { opacity: 1; transform: translateY(0); }
  62%  { opacity: .7; transform: translateY(3px); }
  100% { opacity: 0; transform: translateY(8px); }
}
@keyframes pm-cascade {
  0%   { opacity: 0; transform: translateY(-10px); }
  28%  { opacity: 1; transform: translateY(0); }
  62%  { opacity: .75; transform: translateY(6px); }
  100% { opacity: 0; transform: translateY(16px); }
}
.pdftomd-logo .c0 text, .pdftomd-logo .c1 text {
  animation: pm-innerfade calc(3.2s * var(--dmul, 1)) cubic-bezier(.4,0,.6,1) infinite;
  animation-delay: calc(3.2s * var(--dly, 0));
  transform-box: fill-box; transform-origin: 50% 50%;
}
.pdftomd-logo .r1 text, .pdftomd-logo .r2 text, .pdftomd-logo .r3 text {
  animation: pm-cascade calc(3.2s * var(--dmul, 1)) cubic-bezier(.4,0,.6,1) infinite;
  animation-delay: calc(3.2s * var(--dly, 0));
  transform-box: fill-box; transform-origin: 50% 50%;
}
.pdftomd-logo .c0 text:nth-of-type(1) { --dmul: 1.03; --dly: .02; }
.pdftomd-logo .c0 text:nth-of-type(2) { --dmul: .95;  --dly: .08; }
.pdftomd-logo .c0 text:nth-of-type(3) { --dmul: 1.09; --dly: .05; }
.pdftomd-logo .c0 text:nth-of-type(4) { --dmul: .98;  --dly: .11; }
.pdftomd-logo .c1 text:nth-of-type(1) { --dmul: 1.06; --dly: .14; }
.pdftomd-logo .c1 text:nth-of-type(2) { --dmul: .93;  --dly: .1; }
.pdftomd-logo .c1 text:nth-of-type(3) { --dmul: 1.0;  --dly: .17; }
.pdftomd-logo .c1 text:nth-of-type(4) { --dmul: 1.12; --dly: .12; }
.pdftomd-logo .r1 text:nth-of-type(1) { --dmul: .94;  --dly: .18; }
.pdftomd-logo .r1 text:nth-of-type(2) { --dmul: 1.08; --dly: .24; }
.pdftomd-logo .r1 text:nth-of-type(3) { --dmul: 1.0;  --dly: .2; }
.pdftomd-logo .r2 text:nth-of-type(1) { --dmul: 1.05; --dly: .33; }
.pdftomd-logo .r2 text:nth-of-type(2) { --dmul: .96;  --dly: .29; }
.pdftomd-logo .r2 text:nth-of-type(3) { --dmul: 1.11; --dly: .37; }
.pdftomd-logo .r3 text:nth-of-type(1) { --dmul: 1.02; --dly: .45; }
.pdftomd-logo .r3 text:nth-of-type(2) { --dmul: 1.07; --dly: .5; }
.pdftomd-logo .r3 text:nth-of-type(3) { --dmul: .95;  --dly: .41; }
.logo-glyph {
  position: relative; width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(160deg, var(--surface-3), #050506);
  border: 1px solid var(--border-2);
  box-shadow: 0 0 0 1px rgba(47,125,255,0.12), 0 6px 18px rgba(0,0,0,0.6);
}
.logo-glyph svg { width: 18px; height: 18px; }
.logo-glyph img { width: 24px; height: 24px; display: block; }
.logo-word { font-weight: 700; font-size: 16px; letter-spacing: -0.03em; white-space: nowrap; }
.logo-word .arrow { color: var(--accent); margin: 0 1px; }
.logo-word .md { color: var(--accent); }
.topbar-link {
  font-size: 13px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: var(--radius-pill); border: 1px solid var(--border);
  background: var(--surface); transition: all .15s ease;
}
.topbar-link:hover { color: var(--text); border-color: var(--border-2); }
.topbar-link svg { width: 15px; height: 15px; }
.topbar-link .count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 11px; font-weight: 600;
  display: grid; place-items: center; background: var(--accent); color: #fff;
}

/* ---- plan status (signed-in) ---- */
.plan-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
  padding: 7px 12px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); max-width: 200px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.plan-chip.paid {
  color: var(--accent-bright);
  border-color: rgba(47,125,255,0.35);
  background: rgba(47,125,255,0.08);
  box-shadow: 0 0 0 1px rgba(47,125,255,0.08);
}
.plan-chip-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--text-faint);
}
.plan-chip.paid .plan-chip-dot {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.plan-status {
  margin: 14px auto 0;
  max-width: 520px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  color: var(--text-muted);
}
.plan-status.paid {
  border-color: rgba(47,125,255,0.35);
  background: rgba(47,125,255,0.06);
  color: var(--text);
}
.plan-status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-faint);
}
.plan-status.paid .plan-status-dot {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.plan-status-name { font-weight: 700; color: var(--text); }
.plan-status.paid .plan-status-name { color: var(--accent-bright); }
.plan-status-sep { color: var(--text-faint); }
.plan-status-usage { color: var(--text-muted); }

.plan.current {
  border-color: rgba(47,125,255,0.45) !important;
  box-shadow: 0 0 0 1px rgba(47,125,255,0.2), 0 16px 40px -28px var(--accent-glow);
}
.plan-badge.current {
  background: var(--accent);
  color: #fff;
}
.plan-cta.current {
  background: rgba(47,125,255,0.12);
  color: var(--accent-bright);
  border: 1px solid rgba(47,125,255,0.35);
  cursor: default;
}
.plan-cta.current:hover { filter: none; }

@media (max-width: 640px) {
  .plan-chip { max-width: 120px; font-size: 11px; padding: 6px 10px; }
  .plan-status { font-size: 12px; }
}

/* ============================================================
   Hero / Converter
   ============================================================ */
.hero { text-align: center; padding: 40px 0 30px; }
.kicker {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .04em;
  color: var(--text-muted); padding: 6px 13px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: rgba(255,255,255,0.015); margin-bottom: 22px;
}
.kicker .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.hero h1 {
  font-size: clamp(40px, 6vw, 66px); line-height: 0.98; font-weight: 700;
  letter-spacing: -0.035em;
}
.hero h1 .grad {
  background: linear-gradient(180deg, #fff 0%, #8f8f9c 130%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero h1 .md { color: var(--accent); -webkit-text-fill-color: var(--accent); }
.hero p { margin: 18px auto 0; max-width: 460px; color: var(--text-muted); font-size: 16px; line-height: 1.5; }

.analytics-consent {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 45;
  width: min(500px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 16px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  background: rgba(10,10,11,0.96);
  box-shadow: 0 18px 60px rgba(0,0,0,0.5);
  backdrop-filter: blur(16px);
}
.analytics-consent[hidden] { display: none; }
.analytics-consent-header { display: flex; align-items: flex-start; gap: 12px; }
.analytics-consent-title { font-size: 15px; line-height: 1.3; }
.analytics-consent-close {
  margin: -5px -5px -5px auto;
  padding: 6px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.analytics-consent-close[hidden] { display: none; }
.analytics-consent-body,
.analytics-consent-status,
.analytics-consent-error,
.analytics-consent-details p {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.5;
}
.analytics-consent-status { color: var(--text-muted); }
.analytics-consent-error { color: #fecaca; }
.analytics-consent-details { margin-top: 8px; }
.analytics-consent-details summary {
  width: max-content;
  color: var(--text-muted);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.analytics-consent-privacy {
  display: inline-block;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.analytics-consent-actions { display: flex; gap: 8px; margin-top: 14px; }
.analytics-consent-choice {
  flex: 1;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border-2);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  transition: border-color .15s ease, background .15s ease;
}
.analytics-consent-choice:hover { border-color: var(--border-glow); background: var(--surface-3); }
.analytics-consent-choice:focus-visible,
.analytics-consent-close:focus-visible,
.analytics-consent-privacy:focus-visible,
.analytics-settings:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 3px; }

/* ---- converter card ---- */
.converter {
  position: relative;
  margin: 34px auto 0; max-width: 620px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 30px 70px -30px rgba(0,0,0,0.9),
    0 0 60px -6px rgba(47,125,255,0.45),
    0 0 130px 10px rgba(47,125,255,0.22);
  animation: cardPulse 6.5s ease-in-out infinite;
}
@keyframes cardPulse {
  0%, 100% {
    box-shadow:
      0 1px 0 rgba(255,255,255,0.04) inset,
      0 30px 70px -30px rgba(0,0,0,0.9),
      0 0 50px -8px rgba(47,125,255,0.34),
      0 0 110px 6px rgba(47,125,255,0.16);
  }
  50% {
    box-shadow:
      0 1px 0 rgba(255,255,255,0.05) inset,
      0 30px 70px -30px rgba(0,0,0,0.9),
      0 0 70px -4px rgba(74,147,255,0.60),
      0 0 160px 18px rgba(47,125,255,0.30);
  }
}

/* soft, breathing electric-blue glow field behind the card (Gemini-style) */
.converter::before {
  content: ""; position: absolute; z-index: -1;
  left: 50%; top: 54%; transform: translate(-50%, -50%);
  width: 190%; height: 300%;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(74,147,255,0.55) 0%,
    rgba(60,135,255,0.40) 34%,
    rgba(47,125,255,0.20) 54%,
    rgba(47,125,255,0.07) 72%,
    transparent 88%
  );
  filter: blur(30px);
  pointer-events: none;
  animation: glowBreathe 6.5s ease-in-out infinite;
}
@keyframes glowBreathe {
  0%, 100% { transform: translate(-50%, -50%) scale(0.9);  opacity: 0.78; }
  50%      { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .converter::before { animation: none; }
}

/* drop row */
.drop {
  position: relative; display: flex; align-items: center; gap: 14px;
  min-height: 78px; padding: 16px 18px;
  border: 1.5px dashed var(--border-2); border-radius: var(--radius);
  background: var(--surface); transition: all .18s ease; text-align: left;
}
.drop.empty { cursor: pointer; }
.drop.empty:hover { border-color: var(--border-glow); background: var(--surface-3); }
.drop.dragging {
  border-color: var(--accent); background: var(--accent-soft);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.drop.has-file { border-style: solid; }
.drop-ic {
  flex: none; width: 46px; height: 46px; border-radius: 11px; display: grid; place-items: center;
  background: var(--surface-3); border: 1px solid var(--border-2); color: var(--text-muted);
}
.drop.has-file .drop-ic { color: var(--accent); border-color: var(--accent-dim); background: var(--accent-soft); }
.drop-ic svg { width: 22px; height: 22px; }
.drop-body { flex: 1; min-width: 0; }
.drop-title { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drop-sub {
  margin-top: 3px; font-size: 12.5px; color: var(--text-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.drop-sub .sep { margin: 0 7px; opacity: .5; }
.drop-x {
  flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  color: var(--text-faint); transition: all .15s ease;
}
.drop-x:hover { color: var(--text); background: var(--surface-3); }
.drop-x svg { width: 16px; height: 16px; }

/* progress */
.progress { margin-top: 14px; }
.progress-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12.5px; color: var(--text-muted); margin-bottom: 8px;
}
.progress-head .pct { color: var(--accent-bright); font-weight: 600; }
.bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent-bright));
  box-shadow: 0 0 12px var(--accent-glow); transition: width .2s ease;
}

/* done banner */
.done-note {
  margin-top: 14px; display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: var(--radius);
  background: rgba(52,211,153,0.08); border: 1px solid rgba(52,211,153,0.22);
  color: #b6f0d8; font-size: 13px;
}
.done-note svg { width: 16px; height: 16px; color: var(--success); flex: none; }
.done-note .mono { color: #d7f7e9; }

.warn-note,
.err-note {
  margin-top: 12px;
  padding: 11px 14px;
  border-radius: var(--radius);
  font-size: 12.5px;
  line-height: 1.45;
}
.warn-note {
  background: rgba(47,125,255,0.10);
  border: 1px solid rgba(79,147,255,0.24);
  color: #cfe0ff;
}
.err-note {
  background: rgba(248,113,113,0.10);
  border: 1px solid rgba(248,113,113,0.25);
  color: #fecaca;
}

/* button row */
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.btn-row.with-copy { grid-template-columns: 1fr 1fr 1fr; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 50px; border-radius: var(--radius); font-size: 14.5px; font-weight: 600;
  transition: all .15s ease; border: 1px solid transparent;
}
.btn svg { width: 17px; height: 17px; }
.btn:active:not(:disabled) { transform: translateY(1px); }

.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 24px -8px var(--accent-glow), 0 0 0 1px rgba(47,125,255,0.4) inset; }
.btn-primary:hover:not(:disabled) { background: var(--accent-bright); }

.btn-ghost { background: var(--surface-3); color: var(--text); border-color: var(--border-2); }
.btn-ghost:hover:not(:disabled) { border-color: var(--border-glow); background: #1a1a1f; }

.btn:disabled { background: var(--surface-2); color: var(--text-faint); border-color: var(--border); box-shadow: none; }

.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.view-downloads {
  margin: 16px auto 0; display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 40px; font-size: 13px; color: var(--text-muted);
  border-radius: var(--radius); transition: color .15s ease;
}
.view-downloads:hover { color: var(--text); }
.view-downloads:disabled { color: var(--text-faint); opacity: .55; }
.view-downloads svg { width: 15px; height: 15px; }

/* account gate */
.auth-overlay {
  position: fixed; inset: 0; z-index: 60; padding: 20px;
  display: grid; place-items: center;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(10px);
  animation: fade .2s ease;
}
.auth-modal {
  width: min(440px, 100%);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 22px;
  text-align: left;
  box-shadow: 0 28px 80px -35px var(--accent-glow), 0 24px 80px rgba(0,0,0,0.75);
}
.auth-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  margin-bottom: 18px;
}
.auth-head h3 { font-size: 20px; line-height: 1.15; letter-spacing: -0.02em; }
.auth-head p { margin-top: 8px; color: var(--text-muted); font-size: 13.5px; line-height: 1.45; }
.auth-head button {
  flex: none; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
  color: var(--text-muted);
}
.auth-head button:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.auth-head button svg { width: 17px; height: 17px; }
.auth-field { display: grid; gap: 7px; margin-top: 12px; }
.auth-field span { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.auth-field input {
  width: 100%; height: 46px; border-radius: var(--radius); border: 1px solid var(--border-2);
  background: var(--surface); color: var(--text); padding: 0 13px; outline: none; font: inherit;
}
.auth-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.auth-hint { margin-top: 12px; color: var(--text-faint); font-size: 12.5px; line-height: 1.45; }
.auth-error { margin-top: 12px; }
.auth-submit { width: 100%; margin-top: 16px; }

/* card footer: view-downloads */
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.lang-toggle {
  position: relative;
  flex: none; display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius-pill);
}
.lang-toggle button {
  position: relative; z-index: 1; flex: 1 1 0; min-width: 46px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 13px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600; color: var(--text-muted); transition: color .2s ease;
}
.lang-toggle button:hover { color: var(--text); }
.lang-toggle button.active { color: #fff; }
.lang-toggle .lang-pill {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 4px);
  background: var(--accent-aa); border-radius: var(--radius-pill);
  box-shadow: 0 4px 14px -6px var(--accent-glow); z-index: 0;
  transition: transform .25s cubic-bezier(.4,.0,.2,1);
}

@media (max-width: 520px) {
  .shell { padding-inline: 16px; }
  .topbar {
    height: auto;
    min-height: 76px;
    padding: 16px 0 8px;
    gap: 12px;
    flex-wrap: wrap;
  }
  .logo { flex: 1 1 auto; min-width: 0; }
  .topbar-actions {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }
  .topbar-link { min-width: 0; }
}

/* ============================================================
   Pricing
   ============================================================ */
.pricing { margin-top: 96px; }
.section-head { text-align: center; margin-bottom: 30px; }
.section-head h2 { font-size: 30px; font-weight: 700; letter-spacing: -0.025em; }
.section-head p { margin-top: 10px; color: var(--text-muted); font-size: 15px; }

.toggle {
  position: relative;
  display: inline-flex; padding: 4px; gap: 4px; margin: 22px auto 0;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius-pill);
}
.toggle button {
  position: relative; flex: 1 1 0; white-space: nowrap; padding: 9px 22px; border-radius: var(--radius-pill);
  font-size: 13.5px; font-weight: 600; color: var(--text-muted); transition: color .2s ease;
}
.toggle button.active { color: #fff; }
.toggle .pill {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 6px); border-radius: var(--radius-pill);
  background: var(--accent-aa); box-shadow: 0 6px 18px -6px var(--accent-glow); z-index: 0;
  transition: transform .28s cubic-bezier(.4,.0,.2,1);
}
.toggle button span { position: relative; z-index: 1; }

.plan-grid { display: grid; gap: 16px; margin-top: 34px; }
.plan-grid.cols-2 { grid-template-columns: repeat(2, 1fr); max-width: 720px; margin-left: auto; margin-right: auto; }
.plan-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

.plan {
  position: relative; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px;
  transition: border-color .2s ease, transform .2s ease;
}
.plan:hover { border-color: var(--border-2); transform: translateY(-3px); }
.plan.feat { border-color: transparent; box-shadow: 0 24px 60px -30px var(--accent-glow); }
.plan.feat::before {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius-lg); pointer-events: none; z-index: 0;
  background: radial-gradient(420px 160px at 50% 0%, var(--accent-soft), transparent 70%);
}

/* rotating electric-blue light around the recommended card */
@property --bdr-angle {
  syntax: "<angle>"; initial-value: 0deg; inherits: false;
}
.plan.feat::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  border-radius: var(--radius-lg); padding: 1.5px;
  background:
    conic-gradient(from var(--bdr-angle),
      rgba(47,125,255,0.28) 0deg,
      rgba(47,125,255,0.28) 200deg,
      var(--accent-bright) 270deg,
      #bcd6ff 300deg,
      var(--accent-bright) 330deg,
      rgba(47,125,255,0.28) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  filter: drop-shadow(0 0 6px rgba(47,125,255,0.55));
  animation: bdrRotate 4s linear infinite;
}
@keyframes bdrRotate { to { --bdr-angle: 360deg; } }
@media (prefers-reduced-motion: reduce) {
  .plan.feat::after { animation: none; }
}
/* keep card content & badge above the moving ring */
.plan.feat > * { position: relative; z-index: 2; }
.plan.feat .plan-badge {
  position: absolute; top: 0; right: 0; left: auto; bottom: auto; transform: none;
  z-index: 3;
  width: 50%;                 /* occupies the right half of the top */
  height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-top-right-radius: var(--radius-lg);
  border-top-left-radius: 0;
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: 0;
}
.plan-badge {
  position: absolute; top: 0; right: 0;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  background: var(--accent); color: #fff;
  box-shadow: 0 6px 18px -8px var(--accent-glow);
}
.plan-name { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.plan.feat .plan-name { color: var(--accent-bright); }
.plan-price { display: flex; align-items: baseline; gap: 6px; margin-top: 14px; }
.plan-price .cur { font-size: 18px; font-weight: 600; color: var(--text-muted); }
.plan-price .amt { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; }
.plan-price .per { font-size: 13px; color: var(--text-faint); }
.plan-tag { margin-top: 10px; font-size: 13px; color: var(--text-muted); min-height: 18px; }
.plan-divider { height: 1px; background: var(--border); margin: 20px 0; }
.plan-feats { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.plan-feat { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--text); }
.plan-feat svg { width: 16px; height: 16px; color: var(--accent); flex: none; margin-top: 1px; }
.plan-feat .k { color: var(--text-muted); }
.plan-feat .v { font-weight: 600; }
.plan-cta {
  margin-top: 22px; height: 46px; border-radius: var(--radius); font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: all .15s ease;
}
.plan-cta.solid { background: var(--accent); color: #fff; box-shadow: 0 8px 24px -10px var(--accent-glow); }
.plan-cta.solid:hover { background: var(--accent-bright); }
.plan-cta.outline { background: var(--surface-3); color: var(--text); border: 1px solid var(--border-2); }
.plan-cta.outline:hover { border-color: var(--border-glow); }

/* ============================================================
   Downloads drawer
   ============================================================ */
.overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,0.6);
  display: flex; justify-content: flex-end; animation: fade .2s ease;
}
@keyframes fade { from { opacity: 0; } }
.drawer {
  width: min(440px, 100%); height: 100%; background: var(--surface);
  border-left: 1px solid var(--border-2); padding: 24px; display: flex; flex-direction: column;
  animation: slide .28s cubic-bezier(.4,0,.2,1);
}
@keyframes slide { from { transform: translateX(40px); opacity: .4; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.drawer-head h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.drawer-head button { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--text-muted); }
.drawer-head button:hover { background: var(--surface-3); color: var(--text); }
.drawer-head button svg { width: 18px; height: 18px; }
.drawer-sub { font-size: 13px; color: var(--text-faint); margin-bottom: 18px; }
.dl-list { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; flex: 1; }
.dl-item {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
}
.dl-item .ic { width: 38px; height: 38px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-dim); }
.dl-item .ic svg { width: 18px; height: 18px; }
.dl-item .meta { flex: 1; min-width: 0; }
.dl-item .meta .nm { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-item .meta .dt { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.dl-item .re { width: 34px; height: 34px; flex: none; border-radius: 8px; display: grid; place-items: center; color: var(--text-muted); border: 1px solid var(--border-2); }
.dl-item .re:hover { color: var(--text); background: var(--surface-3); }
.dl-item .re svg { width: 16px; height: 16px; }
.dl-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--text-faint); gap: 14px; }
.dl-empty svg { width: 38px; height: 38px; opacity: .5; }
.dl-empty p { font-size: 13.5px; max-width: 220px; line-height: 1.5; }

/* footer */
.foot { margin-top: 90px; text-align: center; color: var(--text-muted); font-size: 12.5px; }
.analytics-settings {
  color: inherit;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.analytics-settings:hover { color: var(--text); }

/* optional product diagnostics notice */
.privacy-page {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 12px;
}
.privacy-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 46px;
}
.privacy-nav .logo-word { color: var(--text); text-decoration: none; }
.privacy-nav > a:last-child,
.privacy-notice a,
.privacy-foot a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.privacy-nav > a:last-child:hover,
.privacy-notice a:hover,
.privacy-foot a:hover { color: var(--text); }
.privacy-notice {
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(13,13,15,0.92);
  box-shadow: 0 30px 80px -40px rgba(0,0,0,0.9);
}
.privacy-eyebrow {
  color: var(--accent-bright);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.privacy-notice h1 {
  margin-top: 10px;
  font-size: clamp(34px, 6vw, 52px);
  line-height: 1.02;
  letter-spacing: -.035em;
}
.privacy-lead {
  margin-top: 18px;
  color: var(--text-muted);
  font-size: 17px;
  line-height: 1.65;
}
.privacy-notice h2 {
  margin-top: 34px;
  color: var(--text);
  font-size: 17px;
}
.privacy-notice h2 + p,
.privacy-notice h2 + ul,
.privacy-notice p + p { margin-top: 10px; }
.privacy-notice p,
.privacy-notice li {
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.7;
}
.privacy-notice ul { padding-left: 22px; }
.privacy-notice li + li { margin-top: 6px; }
.privacy-notice strong { color: var(--text); }
.privacy-foot { margin: 28px 0 40px; }

@media (max-width: 720px) {
  .plan-grid.cols-3 { grid-template-columns: 1fr; }
  .plan-grid.cols-2 { grid-template-columns: 1fr; }
  .btn-row { grid-template-columns: 1fr; }
  .btn-row.with-copy { grid-template-columns: 1fr; }
  .analytics-consent-actions { flex-direction: column; }
}

/* ---- post-Gumroad return banner ---- */
.paid-banner {
  margin: 8px auto 18px;
  max-width: 720px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(47,125,255,0.35);
  background: rgba(47,125,255,0.08);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.paid-banner.ok {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.08);
}
.paid-banner-title {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 15px; color: var(--text);
}
.paid-banner-title svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.paid-banner.ok .paid-banner-title svg { color: #4ade80; }
.paid-banner-body {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
  max-width: 44ch;
}
.paid-banner-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
}
@media (max-width: 640px) {
  .paid-banner { padding: 14px; }
}
