:root {
  --bg: #0f1115;
  --surface: #161922;
  --surface-2: #1d2230;
  --border: #262c3a;
  --text: #e6e8ef;
  --text-dim: #9aa1b1;
  --accent: #5b8cff;
  --accent-2: #7aa4ff;
  --success: #4ade80;
  --danger: #f87171;
  --warn: #fbbf24;
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 10% -10%, #1b2440 0%, transparent 50%), var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 17, 21, 0.7);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.nav .brand { font-weight: 700; font-size: 18px; letter-spacing: 0.2px; }
.nav .brand span { color: var(--accent); }
.nav .links { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.nav .links a, .nav .links button {
  padding: 8px 14px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
}
.nav .links a:hover, .nav .links button:hover { color: var(--text); background: var(--surface); border-color: var(--border); text-decoration: none; }
.nav .links a.cta {
  background: var(--accent); color: white; border-color: var(--accent);
}
.nav .links a.cta:hover { background: var(--accent-2); border-color: var(--accent-2); }

.container { max-width: 980px; margin: 0 auto; padding: 32px 20px 80px; }
.container.narrow { max-width: 460px; }

h1 { font-size: 36px; line-height: 1.15; margin: 8px 0 12px; }
h2 { font-size: 22px; margin: 24px 0 12px; }
p.lead { color: var(--text-dim); font-size: 17px; margin: 0 0 28px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.card + .card { margin-top: 16px; }

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 56px 24px;
  text-align: center;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: var(--surface-2);
}
.dropzone .big { font-size: 18px; margin-bottom: 6px; }
.dropzone .small { color: var(--text-dim); font-size: 14px; }
.dropzone svg { width: 48px; height: 48px; opacity: 0.65; margin-bottom: 10px; }

.file-list { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.file-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 14px;
  align-items: center;
}
.file-item .name { font-weight: 500; word-break: break-all; }
.file-item .status {
  font-size: 13px; color: var(--text-dim); text-align: right; white-space: nowrap;
}
.file-item .status.done { color: var(--success); }
.file-item .status.error { color: var(--danger); }
.file-item .progress-wrap {
  grid-column: 1 / -1;
  height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden;
}
.file-item .progress-bar { height: 100%; width: 0%; background: var(--accent); transition: width 0.2s; }
.file-item .progress-bar.done { background: var(--success); }
.file-item .progress-bar.error { background: var(--danger); }
.file-item .actions { grid-column: 1 / -1; margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; }
.file-item .meta {
  grid-column: 1 / -1; font-size: 13px; color: var(--text-dim);
}
.file-item .meta strong { color: var(--text); }

.btn {
  display: inline-block;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: white;
  font: inherit;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}
.btn:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn.secondary:hover { background: var(--border); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn.small { padding: 6px 10px; font-size: 13px; }

.summary {
  margin-top: 18px;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: 10px;
  display: none;
  color: var(--text-dim);
}
.summary.show { display: block; }
.summary strong { color: var(--text); }

.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text-dim); }
.form input, .form select, .form textarea {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-color: var(--accent);
}
.form .error { color: var(--danger); font-size: 13px; min-height: 18px; }
.form .ok { color: var(--success); font-size: 13px; min-height: 18px; }

.pw-wrap { position: relative; display: flex; }
.pw-wrap input { flex: 1; padding-right: 60px; }
.pw-wrap .toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; color: var(--text-dim);
  cursor: pointer; padding: 6px 10px; font: inherit; font-size: 13px;
  border-radius: 6px;
}
.pw-wrap .toggle:hover { color: var(--text); background: var(--border); }

.muted { color: var(--text-dim); }
.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  word-break: break-all;
}

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) {
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  h1 { font-size: 28px; }
  .container { padding: 20px 14px 60px; }
  .nav { padding: 12px 14px; }
}

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; font-size: 14px; }
th { color: var(--text-dim); font-weight: 500; }
tr:hover td { background: rgba(255,255,255,0.02); }

.tab-bar { display: flex; gap: 4px; margin-bottom: 18px; flex-wrap: wrap; }
.tab-bar button {
  background: transparent; color: var(--text-dim); padding: 8px 14px;
  border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font: inherit;
}
.tab-bar button.active { color: var(--text); background: var(--surface-2); border-color: var(--accent); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px;
  background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border);
}
.pill.ok { color: var(--success); border-color: rgba(74, 222, 128, 0.35); }
.pill.warn { color: var(--warn); border-color: rgba(251, 191, 36, 0.35); }
.pill.bad { color: var(--danger); border-color: rgba(248, 113, 113, 0.35); }

/* ====================================================================
   THEME: "Oscilloscope" — scoped to body.theme-osc so other pages keep
   their existing palette until they're individually migrated.
   ==================================================================== */
body.theme-osc {
  --bg:         #0c0d10;
  --surface:    #14161b;
  --surface-2:  #1c1f26;
  --border:     #2a2e38;
  --text:       #e8e9ec;
  --text-dim:   #8b919e;
  --accent:     #00d68f;  /* signal green, ~10.3:1 on bg */
  --accent-2:   #34e3a3;  /* hover */
  --warn:       #ffd166;  /* caution, ~13.7:1 on bg */
  --danger:     #ff6b3a;  /* alarm, ~6.9:1 on bg */
  --success:    #00d68f;  /* alias of accent so existing rules pick it up */

  font-family: 'IBM Plex Sans', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: 'ss01', 'ss02';
  background: radial-gradient(1200px 600px at 10% -10%, #102030 0%, transparent 50%), var(--bg);
}

/* Numeric / receipt-feel surfaces use the matching mono so columns align */
body.theme-osc .stat-num,
body.theme-osc .lp-stat-value,
body.theme-osc .lp-plan-price,
body.theme-osc .code,
body.theme-osc code,
body.theme-osc .lp-compare-label {
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* Headings tighten + auto-balance per Vercel typography rules */
body.theme-osc h1,
body.theme-osc h2,
body.theme-osc h3 {
  letter-spacing: -0.02em;
  text-wrap: balance;
}
body.theme-osc p { text-wrap: pretty; }

/* CTA on signal green needs dark text for contrast (~14:1 on #00d68f) */
body.theme-osc .btn {
  color: #0c0d10;
  font-weight: 600;
  letter-spacing: -0.005em;
}
body.theme-osc .btn.secondary { color: var(--text); }

/* Sticky-bottom save row visual update */
body.theme-osc .adm-save-row { background: var(--surface-2); }

/* "armed" eyebrow above the headline */
body.theme-osc .lp-eyebrow {
  color: var(--accent);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.16em;
}
body.theme-osc .lp-eyebrow::before {
  content: ''; display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); margin-right: 10px;
  vertical-align: 1px;
  box-shadow: 0 0 12px var(--accent);
  animation: osc-arm 2.4s ease-in-out infinite;
}
@keyframes osc-arm { 0%,100% { opacity: 1 } 50% { opacity: 0.35 } }
@media (prefers-reduced-motion: reduce) {
  body.theme-osc .lp-eyebrow::before { animation: none; }
}

/* Faint graph-paper texture in the hero (transform-only, no layout cost) */
body.theme-osc .lp-hero {
  background-image:
    linear-gradient(rgba(0,214,143,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,214,143,0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
}

/* --- Admin: reusable stat blocks (replace inline font/color styles) --- */
.stat-num {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.stat-num.compact { font-size: 22px; }
.stat-num.success { color: var(--success); }
.stat-num.dim     { color: var(--text-dim); }
.stat-num.bad     { color: var(--danger); }
.stat-sub { color: var(--text-dim); font-size: 12px; margin-top: 6px; }
.stat-refreshed { margin-left: auto; font-size: 12px; }
.stat-ledger { margin-top: 6px; }

/* Sub-section heading used inside admin Settings to group related fields */
.adm-subhead {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.adm-card-stack > .card + .card { margin-top: 12px; }

.adm-save-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  position: sticky; bottom: 0;
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
}
.adm-save-row .ok, .adm-save-row .error { margin: 0; }

/* Make any wide data table scroll horizontally on narrow screens
   instead of breaking the layout. */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* --- Skip link + focus rings (a11y) ----------------------------------- */
.skip-link {
  position: absolute; top: -100px; left: 12px;
  background: var(--accent); color: white;
  padding: 10px 14px; border-radius: 8px;
  font-weight: 600; z-index: 1000;
  transition: top 150ms ease-out;
}
.skip-link:focus { top: 12px; text-decoration: none; }

.btn:focus-visible, .nav .links a:focus-visible, .nav .links button:focus-visible,
.dropzone:focus-visible, .lp-compare-handle:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 3px;
}

/* --- Landing page hero ------------------------------------------------ */
.lp-hero {
  padding: 72px 20px 20px;
  text-align: center;
}
.lp-hero-inner { max-width: 760px; margin: 0 auto; }
.lp-eyebrow {
  display: inline-block;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 14px;
}
.lp-hero h1 {
  font-size: clamp(34px, 5.5vw, 54px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
}
.lp-h1-accent { color: var(--accent); }
.lp-sub {
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0 auto 28px;
  max-width: 640px;
}
.lp-cta-row {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  margin: 0 0 18px;
}
.lp-cta-primary { padding: 13px 22px; font-size: 16px; }
.lp-cta-row .btn.secondary { padding: 13px 22px; font-size: 16px; }
.lp-trust {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0;
}

.lp-section-h { font-size: clamp(22px, 2.5vw, 28px); margin-top: 8px; }
.lp-section-sub {
  color: var(--text-dim);
  max-width: 640px;
  margin: -4px 0 24px;
  font-size: 16px;
  line-height: 1.6;
}

.lp-problem .lp-section-sub { max-width: 760px; }

/* --- Benefits grid ---------------------------------------------------- */
.lp-benefits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.lp-benefit { display: flex; flex-direction: column; gap: 10px; }
.lp-benefit-icon { width: 32px; height: 32px; color: var(--accent); }
.lp-benefit h3 { font-size: 17px; margin: 0; }
.lp-benefit p { color: var(--text-dim); margin: 0; font-size: 15px; line-height: 1.6; }
@media (max-width: 720px) {
  .lp-benefits { grid-template-columns: 1fr; }
}

/* --- Before/after compare slider -------------------------------------- */
.lp-compare-section { padding-top: 8px; }
.lp-compare {
  position: relative;
  width: 100%;
  aspect-ratio: 1200 / 800;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  user-select: none;
  touch-action: none;
}
.lp-compare-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  pointer-events: none;
}
.lp-compare-above {
  clip-path: inset(0 calc(100% - var(--ssim-pos, 50%)) 0 0);
}
.lp-compare-handle {
  position: absolute; top: 0; bottom: 0;
  left: var(--ssim-pos, 50%);
  width: 56px;
  margin-left: -28px;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: ew-resize;
  display: flex; align-items: center; justify-content: center;
}
.lp-compare-handle-line {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 3px;
  margin-left: -1.5px;
  background: white;
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.45);
}
.lp-compare-handle-knob {
  position: relative; z-index: 1;
  width: 44px; height: 44px;
  background: white; color: #161922;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.lp-compare-handle-knob svg { width: 14px; height: 14px; }
.lp-compare-label {
  position: absolute;
  bottom: 12px;
  background: rgba(15, 17, 21, 0.72);
  backdrop-filter: blur(6px);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 8px;
  pointer-events: none;
}
.lp-compare-label-left  { left: 12px; }
.lp-compare-label-right { right: 12px; }

/* --- WordPress callout ----------------------------------------------- */
.lp-wp-card {
  display: flex; align-items: center; gap: 24px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
}
.lp-wp-body { flex: 1; min-width: 0; }
.lp-wp-body p { color: var(--text-dim); margin: 0 0 14px; }
.lp-wp-mark { flex: 0 0 96px; opacity: 0.85; }
@media (max-width: 720px) {
  .lp-wp-card { flex-direction: column; align-items: flex-start; }
}

/* --- Live stats ------------------------------------------------------- */
.lp-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 14px;
}
.lp-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 22px;
  text-align: center;
}
.lp-stat-value {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.lp-stat-label {
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 14px;
}
@media (max-width: 720px) {
  .lp-stats { grid-template-columns: 1fr; }
}

/* --- Plans ------------------------------------------------------------ */
.lp-plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: stretch;
}
.lp-plan {
  display: flex; flex-direction: column;
  position: relative;
}
.lp-plan h3 { margin: 6px 0 4px; font-size: 20px; }
.lp-plan-price {
  font-size: 28px; font-weight: 700; margin: 4px 0 14px;
  font-variant-numeric: tabular-nums;
}
.lp-plan-price-unit { font-size: 14px; font-weight: 500; color: var(--text-dim); }
.lp-plan-features { list-style: none; padding: 0; margin: 0 0 18px; color: var(--text-dim); font-size: 14px; }
.lp-plan-features li {
  position: relative; padding: 6px 0 6px 22px; line-height: 1.5;
}
.lp-plan-features li::before {
  content: ""; position: absolute; left: 4px; top: 13px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}
.lp-plan .btn { margin-top: auto; }
.lp-plan-tag {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 999px;
  background: rgba(74, 222, 128, 0.15); color: var(--success);
  margin-bottom: 6px;
}
.lp-plan-tag-soon { background: rgba(91, 140, 255, 0.15); color: var(--accent-2); }
.lp-plan-current { border-color: rgba(91, 140, 255, 0.45); }
.lp-plan-future { opacity: 0.92; }
@media (max-width: 720px) {
  .lp-plans { grid-template-columns: 1fr; }
}

/* --- Footer ----------------------------------------------------------- */
.lp-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 28px 20px;
}
.lp-footer-inner {
  max-width: 980px; margin: 0 auto;
  display: flex; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  font-size: 14px;
}
.lp-footer nav { display: flex; gap: 18px; flex-wrap: wrap; align-self: flex-end; }
.lp-footer nav a { color: var(--text-dim); }
.lp-footer nav a:hover { color: var(--text); }
.lp-footer-tag { margin: 6px 0 0; font-size: 13px; }

/* Vercel rules: kill iOS double-tap zoom delay on interactive surfaces */
.btn, .lp-compare-handle, .dropzone, .nav .links a, .nav .links button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Page utility classes (replaces ad-hoc inline styles) ---- */
.card-h         { margin-top: 0; }
.button-row     { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.align-start    { align-self: flex-start; }
.form-hint      { font-size: 13px; display: inline-block; }
.login-aside    { font-size: 13px; margin: 4px 0 0; }
.dash-doc-link  { margin: 14px 0 0; }

.spaced-list { line-height: 1.8; padding-left: 1.25em; }
.spaced-list li { margin-bottom: 4px; }

.verify-h { margin-top: 0; }

.wp-download {
  display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
}
.wp-download-mark { flex-shrink: 0; }
.wp-download-info { flex: 1; min-width: 240px; }
.wp-download-name { font-size: 18px; font-weight: 600; }
.wp-download-ver  { font-weight: 400; }

.examples-h3 { margin-top: 18px; }

pre.code { margin: 0; white-space: pre; overflow-x: auto; }
pre.code:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; }

/* Visually hidden but available to screen readers */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Sticky nav clears below in-page anchor jumps */
section[id], h1[id], h2[id], h3[id] { scroll-margin-top: 80px; }

/* Safe-area padding for notched devices (Vercel rule) */
.nav, .lp-hero, .lp-footer {
  padding-left:  max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}

/* --- Reduced motion respect ------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .stat-live-dot { animation: none; }
}

.stat-live-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; font-size: 14px;
}
.stat-live-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--success);
  animation: ssim-pulse 2s infinite;
}
@keyframes ssim-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
