/* ============================================================================
   PDF to Markdown – v2 portal design system (EP-024 / EP-026 "Precision Workbench")
   Single source of truth for tokens, base styles and reusable components.
   Header/footer match the accepted ep026-prototype (taken as-is; only links differ).
   Component markup for header/topbar/footer lives in site.js.
   ========================================================================== */

/* ---- 1. Design tokens --------------------------------------------------- */
:root {
  --graphite: #0f1419;
  --graphite-2: #17222d;
  --slate: #334155;
  --stone: #64748b;
  --line: #d7dee8;
  --soft-line: #e8eef5;
  --surface: #ffffff;
  --canvas: #f6f8fa;
  --off-white: #f8fafc;
  --teal: #14b8a6;
  --teal-2: #0f9f9a;
  --teal-soft: #ddf7f3;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --warning: #f59e0b;
  --warning-soft: #fef3c7;
  --error: #ef4444;
  --error-soft: #fee2e2;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 18px 48px rgba(15, 20, 25, 0.10);
  --shadow-sm: 0 6px 18px rgba(15, 20, 25, 0.06);

  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Prototype uses a wide 1480px shell; keep it for parity with header/footer. */
  --wrap: min(1480px, calc(100vw - 48px));
  --compact-h: 58px;
}

/* ---- 2. Base ------------------------------------------------------------ */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--compact-h) + 12px); }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--graphite);
  background: var(--canvas);
  line-height: 1.5;
  padding-bottom: 56px; /* room for the fixed sticky-footer */
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal-2); }
button, input, select { font: inherit; }
img { max-width: 100%; }
h1, h2, h3 { letter-spacing: -0.01em; }
code { font-family: var(--mono); font-size: 0.92em; }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: #fff; color: var(--graphite);
  padding: 10px 16px; border-radius: 0 0 var(--radius) 0; font-weight: 700;
}
.skip-link:focus { left: 0; }

.icon-sm { width: 18px; height: 18px; flex: 0 0 auto; }

/* ---- 3. Layout helpers -------------------------------------------------- */
.wrap { width: var(--wrap); margin: 0 auto; }

section.band { padding: 64px 0; }
section.band.tint {
  background: var(--surface);
  border-top: 1px solid var(--soft-line);
  border-bottom: 1px solid var(--soft-line);
}

.section-head { max-width: 760px; margin-bottom: 34px; }
.eyebrow {
  color: var(--teal-2); font-size: 11px; font-weight: 850;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.section-head h2 { margin: 10px 0 0; font-size: clamp(26px, 3vw, 34px); line-height: 1.1; }
.section-head p { margin: 12px 0 0; color: var(--stone); font-size: 16px; }

/* ---- 4. Buttons & chips ------------------------------------------------- */
.btn {
  height: 46px; padding: 0 20px;
  border-radius: var(--radius); border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  color: var(--graphite); background: var(--surface);
  font-weight: 650; font-size: 15px; text-decoration: none; cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: #f1f5f9; }
.btn svg { width: 18px; height: 18px; }
.btn.primary {
  border-color: transparent; color: #06211f;
  background: linear-gradient(135deg, #24d3c7, var(--teal-2));
  box-shadow: 0 14px 34px rgba(20, 184, 166, 0.24);
}
.btn.primary:hover { filter: brightness(1.05); background: linear-gradient(135deg, #24d3c7, var(--teal-2)); }
.btn.ghost { background: transparent; border-color: var(--line); }

.chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 750; white-space: nowrap;
}
.chip.teal { color: #0f766e; background: var(--teal-soft); }
.chip.ready { color: #15803d; background: var(--success-soft); }
.chip.processing { color: #075985; background: #e0f2fe; }
.chip.queued { color: #475569; background: #e8eef5; }
.chip.failed { color: #b91c1c; background: var(--error-soft); }
.chip.warn { color: #92400e; background: var(--warning-soft); }
/* chips on the dark flow card */
.flow .chip.queued { color: #cbd5e1; background: rgba(148,163,184,.18); }
.flow .chip.processing { color: #7dd3fc; background: rgba(2,132,199,.22); }
.flow .chip.ready { color: #86efac; background: rgba(22,163,74,.22); }

.tag-soon {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  color: var(--stone); background: var(--soft-line); padding: 2px 8px; border-radius: 999px;
}

/* ---- 5. Header: in-hero topbar + scroll compact-header (from prototype) -- */
/* Compact header – fixed, slides in once the hero scrolls out of view. */
.compact-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  border-bottom: 1px solid rgba(51, 65, 85, 0.88);
  background: linear-gradient(180deg, rgba(17,26,35,.96), rgba(15,20,25,.94));
  color: var(--off-white); backdrop-filter: blur(16px);
  opacity: 0; pointer-events: none; transform: translateY(-100%);
  transition: transform 180ms ease, opacity 180ms ease;
}
body.compact-header-visible .compact-header { opacity: 1; pointer-events: auto; transform: translateY(0); }
.compact-header-inner {
  width: var(--wrap); height: var(--compact-h); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
}
.compact-brand {
  display: inline-flex; align-items: center; gap: 10px; min-width: 0;
  color: #f8fafc; text-decoration: none; font-weight: 850; white-space: nowrap;
}
.compact-brand svg { width: 32px; height: 32px; flex: 0 0 auto; }
.compact-nav {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0;
  color: #cbd5e1; font-size: 13px; font-weight: 650;
}
.compact-nav a { color: inherit; text-decoration: none; padding: 8px 9px; border-radius: 999px; white-space: nowrap; }
.compact-nav a:hover { color: #f8fafc; background: rgba(248,250,252,.08); }
.compact-nav a[aria-current="page"] { color: #f8fafc; background: rgba(20,184,166,.16); }
.compact-actions { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.compact-actions .upgrade-link { height: 30px; }

/* In-hero topbar: brand (left) + account/tier control (right). */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: nowrap; }
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; color: inherit; text-decoration: none; }
.mark { width: 42px; height: 42px; flex: 0 0 auto; }
.brand-name { font-size: 18px; font-weight: 800; white-space: nowrap; }
/* Minimal header for focused lifecycle pages (welcome/uninstall). */
.doc-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.doc-header .wrap { padding-top: 16px; padding-bottom: 16px; }
.doc-header .brand-name { color: var(--graphite); }
/* Welcome screenshots + uninstall feedback form (focused lifecycle pages). */
.doc-shot { display: block; width: 100%; max-width: 100%; height: auto; margin: 14px 0 4px; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.feedback { max-width: 620px; }
.feedback > h2 { margin: 0 0 4px; font-size: 19px; }
.feedback .fb-sub { margin: 0 0 16px; color: var(--stone); font-size: 14px; }
.fb-reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.fb-reasons label { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--slate); cursor: pointer; }
.fb-reasons input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--teal); flex: 0 0 auto; }
.fb-other { display: none; width: 100%; margin-top: 12px; }
.fb-other.visible { display: block; }
.fb-label { display: block; margin: 16px 0 6px; font-size: 13px; font-weight: 600; color: var(--stone); }
.feedback input[type="text"], .feedback textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; font: inherit; font-size: 14px; color: var(--slate); background: var(--surface); resize: vertical; }
.feedback input[type="text"]:focus, .feedback textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.fb-success > h2 { margin: 0 0 6px; font-size: 19px; }
.fb-success p { color: var(--stone); font-size: 14px; margin: 0 0 14px; }

/* ---- Web converter (EP-026-T6) ---------------------------------------------- */
.converter { max-width: 880px; margin: 0 auto; display: grid; gap: 22px; }
.conv-input { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: stretch; }
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius-lg); background: var(--surface); padding: 28px 20px; text-align: center; display: grid; gap: 8px; place-content: center; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.dropzone:hover, .dropzone:focus-visible { border-color: var(--teal); outline: none; }
.dropzone.drag { border-color: var(--teal); background: var(--teal-soft); }
.dropzone.busy { opacity: .6; pointer-events: none; }
.dz-icon svg { width: 36px; height: 36px; color: var(--teal); }
.dz-title { margin: 0; font-size: 15px; font-weight: 650; color: var(--slate); }
.dz-hint { margin: 0; font-size: 12.5px; color: var(--stone); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--teal-2); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }
.conv-or { display: grid; place-items: center; color: var(--stone); font-size: 13px; font-weight: 700; position: relative; }
.conv-url { display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.conv-url input { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 13px; font: inherit; font-size: 14px; background: var(--surface); color: var(--slate); }
.conv-url input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.conv-url .btn { justify-content: center; }
.conv-settings { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 10px 14px; }
.conv-settings > summary { cursor: pointer; font-size: 13.5px; font-weight: 700; color: var(--teal-2); list-style: none; }
.conv-settings > summary::-webkit-details-marker { display: none; }
.conv-settings-body { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; margin-top: 12px; }
.cs-field { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--slate); font-weight: 600; }
.cs-field select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font: inherit; font-size: 13px; background: var(--surface); color: var(--slate); }
.cs-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--slate); cursor: pointer; }
.cs-check input { width: 16px; height: 16px; accent-color: var(--teal); }
.conv-error { display: block; border: 1px solid var(--error-soft); background: var(--error-soft); color: #b91c1c; border-radius: var(--radius); padding: 10px 14px; font-size: 13.5px; }
.conv-jobs-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.conv-jobs-head h2 { margin: 0; font-size: 18px; }
.conv-slots { color: var(--stone); font-size: 13px; font-weight: 700; }
.jobs { display: grid; gap: 10px; }
.jobs-empty { color: var(--stone); font-size: 14px; margin: 0; padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.job { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 12px 14px; box-shadow: var(--shadow-sm); }
.job-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.job-name { font-weight: 650; font-size: 14px; color: var(--slate); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.job-err { color: #b91c1c; font-size: 12.5px; }
.job-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.job-actions .btn { height: 30px; padding: 0 12px; font-size: 12.5px; }
.conv-foot { color: var(--stone); font-size: 12.5px; margin: 14px 0 0; }
@media (max-width: 720px) {
  .conv-input { grid-template-columns: 1fr; }
  .conv-or { padding: 2px 0; }
}

.tier-control {
  display: flex; align-items: center; gap: 10px; min-height: 40px;
  padding: 4px 6px 4px 12px; border: 1px solid #334155; border-radius: 999px;
  background: rgba(15,20,25,.35); box-shadow: inset 0 0 0 1px rgba(248,250,252,.02);
}
.tier-control .meta { display: inline-flex; align-items: center; gap: 6px; color: #cbd5e1; white-space: nowrap; font-size: 13px; font-weight: 650; }
.tier-control .meta svg { width: 16px; height: 16px; }
.tier-control .quiet { color: #94a3b8; font-size: 12px; font-weight: 700; }
.tier-separator { width: 1px; height: 18px; background: #334155; }
.upgrade-link {
  height: 28px; padding: 0 12px; border: 1px solid rgba(20,184,166,.55); border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #c8fff8; background: rgba(20,184,166,.12); font-weight: 800; font-size: 12px;
  text-decoration: none; white-space: nowrap; cursor: pointer;
}
.upgrade-link:hover { background: rgba(20,184,166,.2); color: #eafffd; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  color: #e2e8f0; background: linear-gradient(135deg, #475569, #17222d); border: 1px solid #475569;
  font-size: 13px; font-weight: 850; flex: 0 0 auto;
}
.avatar svg { width: 18px; height: 18px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.avatar:has(img) { overflow: hidden; }
/* Live account control (EP-024-T11): Sign in action + avatar dropdown. */
.signin-link { height: 30px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--teal); color: #fff; font-weight: 800; font-size: 12.5px; text-decoration: none; white-space: nowrap; cursor: pointer; }
.signin-link:hover { background: var(--teal-2); color: #fff; }
.account { position: relative; display: inline-flex; align-items: center; }
.account-btn { display: inline-flex; align-items: center; gap: 4px; background: transparent; border: 0; padding: 0; cursor: pointer; color: inherit; }
.account-menu { position: absolute; top: calc(100% + 12px); right: 0; min-width: 224px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 8px; z-index: 80; display: grid; gap: 2px; }
.account-menu[hidden] { display: none; }
.account-menu-head { display: grid; gap: 2px; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.account-menu-head .am-name { font-weight: 750; font-size: 13.5px; color: var(--graphite); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu-head .am-tier { font-size: 12px; color: var(--stone); }
.account-menu a, .account-menu button { display: block; width: 100%; text-align: left; background: transparent; border: 0; padding: 8px 10px; border-radius: 8px; font: inherit; font-size: 13.5px; color: var(--slate); text-decoration: none; cursor: pointer; }
.account-menu a:hover, .account-menu button:hover { background: var(--teal-soft); color: var(--graphite); }
.account-menu .am-logout { color: #b91c1c; }
.account-menu .am-logout:hover { background: var(--error-soft); color: #b91c1c; }

/* Tier badge: one glyph, color encodes the level (set via data-tier on .plan-tier).
   Values tuned to read on the dark header; reuse the same data-tier in the web app
   so the authenticated state recolors the badge with no markup change. */
.plan-tier .tier-badge { width: 14px; height: 14px; flex: 0 0 auto; color: var(--tier-color, var(--stone)); }
.plan-tier[data-tier="free"]       { --tier-color: #aab6c6; }
.plan-tier[data-tier="builder"]    { --tier-color: #2dd4bf; }
.plan-tier[data-tier="pro"]        { --tier-color: #fbbf24; }
.plan-tier[data-tier="business"]   { --tier-color: #93c5fd; }
.plan-tier[data-tier="enterprise"] { --tier-color: #c084fc; }

/* ---- 6. Hero + flow card ----------------------------------------------- */
.hero {
  background:
    linear-gradient(115deg, rgba(20,184,166,.16), transparent 30%),
    linear-gradient(180deg, #111a23 0%, var(--graphite) 100%);
  color: var(--off-white); border-bottom: 1px solid #263442;
}
.hero-inner { width: var(--wrap); margin: 0 auto; padding: 40px 0 34px; display: grid; gap: 28px; align-content: start; }
.hero-grid { display: grid; grid-template-columns: minmax(600px, .95fr) minmax(640px, 1.05fr); gap: 24px; align-items: center; }
.hero-copy h1 { margin: 0; font-size: clamp(36px, 3vw, 44px); line-height: 1.02; max-width: 720px; text-wrap: balance; }
.hero-copy .lede { margin: 18px 0 0; color: #cbd5e1; font-size: 22px; line-height: 1.35; max-width: 660px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero .btn:not(.primary):not(.light) { color: var(--off-white); border-color: #334155; background: rgba(255,255,255,.06); }
.hero .btn:not(.primary):not(.light):hover { background: rgba(255,255,255,.12); }

/* Install CTA logic (from prototype). The head detection script sets
   html.no-extension-install on browsers/devices where a Chrome extension can't be
   installed (Firefox/Safari/mobile); there we hide "Add to Chrome" (.install-cta)
   and surface the API/MCP CTA (.secondary-api) instead. On narrow viewports the
   secondary CTA is dropped to keep the row from wrapping (see media queries). */
html.no-extension-install .cta-row .btn.install-cta { display: none; }
html.no-extension-install .cta-row .btn.secondary-api { display: inline-flex; }

/* Right-hand conversion flow – no card backing, large icons with drop shadow. */
.flow { display: flex; align-items: flex-start; justify-content: flex-end; gap: 8px; min-width: 0; }
.flow-step {
  width: 100px; min-width: 92px; min-height: 122px;
  display: grid; justify-items: center; align-content: start;
  grid-template-rows: 74px 24px 16px; gap: 5px; text-align: center;
}
.flow-icon { width: 74px; height: 74px; display: grid; place-items: center; color: #dbe7f1; filter: drop-shadow(0 18px 22px rgba(0,0,0,.22)); }
.flow-icon svg { width: 100%; height: 100%; overflow: hidden; }
.flow-step strong, .flow-step > .chip { height: 24px; display: inline-flex; align-items: center; justify-content: center; margin: 0; }
.flow-step strong { font-size: 14px; font-weight: 700; }
.flow-step small { color: #94a3b8; font-size: 11.5px; font-weight: 500; line-height: 16px; height: 16px; white-space: nowrap; }
.flow-arrow { width: 46px; height: 24px; flex: 0 0 46px; margin-top: 25px; opacity: .95; }

/* ---- 7. Cards / grids --------------------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }

.entry-card {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); padding: 22px; display: grid; gap: 10px;
  align-content: start; box-shadow: var(--shadow-sm);
}
.entry-card .badge-icon {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px;
  background: var(--teal-soft); color: var(--teal-2);
}
.entry-card .badge-icon svg { width: 22px; height: 22px; }
.entry-card h3 { margin: 4px 0 0; font-size: 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.entry-card p { margin: 0; color: var(--stone); font-size: 14px; }
.card-link {
  margin-top: 4px; font-size: 14px; font-weight: 700; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.card-link svg { width: 16px; height: 16px; }

/* signal (image + text) */
.signal { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 40px; align-items: center; }
.signal img { width: 100%; height: auto; border-radius: var(--radius-lg); border: 1px solid var(--line); box-shadow: var(--shadow); display: block; }
.signal h2 { margin: 10px 0 0; font-size: clamp(24px, 2.6vw, 30px); }
.signal p { color: var(--stone); font-size: 16px; }
.signal ul { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.signal li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--slate); font-weight: 550; }
.signal li svg { width: 20px; height: 20px; color: var(--teal); flex: 0 0 auto; margin-top: 1px; }

/* workflow */
.workflow { display: grid; grid-template-columns: minmax(0,.92fr) minmax(0,1.08fr); gap: 32px; align-items: start; }
.steps { display: grid; gap: 14px; }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: start; }
.step .num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--graphite); color: #fff; font-weight: 800; font-size: 14px; }
.step h3 { margin: 4px 0 2px; font-size: 16px; }
.step p { margin: 0; color: var(--stone); font-size: 14px; }
.step-meta { margin-top: 7px; font-family: var(--mono); font-size: 12px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.step-meta .rest { color: var(--slate); }
.step-meta .mcp { color: var(--teal-2); }
.workflow-paths { display: flex; gap: 8px; margin-bottom: 18px; }
.workflow-paths .pill {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 700; color: var(--slate);
}
.workflow-paths .pill svg { width: 15px; height: 15px; color: var(--teal-2); }

/* quality */
.quality { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.quality-item { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 18px; box-shadow: var(--shadow-sm); }
.quality-item h3 { margin: 0 0 6px; font-size: 16px; display: flex; align-items: center; gap: 9px; }
.quality-item h3 svg { width: 20px; height: 20px; color: var(--teal); }
.quality-item p { margin: 0; color: var(--stone); font-size: 14px; }

/* duo / panel cards */
.duo { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; }
.panel-card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); padding: 24px; box-shadow: var(--shadow-sm); }
.panel-card h3 { margin: 0 0 14px; font-size: 19px; }
.panel-card p { color: var(--stone); font-size: 14px; }
.panel-card ul { margin: 0; padding-left: 18px; color: var(--slate); font-size: 14px; line-height: 1.7; }
.stat-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--soft-line); font-size: 14.5px; color: var(--slate); font-weight: 600; }
.stat-row:last-child { border-bottom: 0; }
.stat-row b { color: var(--graphite); font-weight: 800; }
.access-row { display: flex; gap: 13px; padding: 13px 0; border-bottom: 1px solid var(--soft-line); }
.access-row:last-child { border-bottom: 0; }
.access-row .ic { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 9px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal-2); }
.access-row .ic svg { width: 19px; height: 19px; }
.access-row .tx { font-size: 14px; color: var(--stone); line-height: 1.45; }
.access-row .tx b { color: var(--graphite); font-weight: 800; }

/* ---- 8. Code blocks ----------------------------------------------------- */
.code-sample {
  margin: 0; border: 1px solid #223040; border-radius: var(--radius-lg);
  background: #101821; color: #d6e2ef; padding: 18px; overflow: auto;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.65; box-shadow: var(--shadow);
}
.code-sample .c-key { color: #7dd3fc; }
.code-sample .c-str { color: #86efac; }
.code-sample .c-cmt { color: #64748b; }

/* ---- 9. Pricing -------------------------------------------------------- */
.pricing { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.plan { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); padding: 22px; display: grid; gap: 8px; align-content: start; box-shadow: var(--shadow-sm); }
.plan.featured { border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal), var(--shadow-sm); }
.plan .plan-name { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.plan .price { font-size: 30px; font-weight: 850; line-height: 1; }
.plan .price span { font-size: 14px; font-weight: 650; color: var(--stone); }
.plan .plan-note { color: var(--stone); font-size: 13.5px; min-height: 20px; }
.plan ul { margin: 8px 0 0; padding-left: 18px; color: var(--slate); font-size: 13.5px; line-height: 1.7; }
.plan ul em { font-style: normal; color: var(--stone); font-size: .92em; }
.plan .plan-cta { margin-top: 14px; width: 100%; justify-content: center; }
/* Billing interval toggle + price amount/note (EP-024-T3). .amt restores the big
   price size that the generic `.plan .price span` rule would otherwise shrink. */
.billing-toggle-wrap { text-align: center; margin-bottom: 24px; }
.billing-toggle { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-sm); }
.bt-opt { border: 0; background: transparent; cursor: pointer; padding: 8px 18px; border-radius: 999px; font: inherit; font-size: 14px; font-weight: 650; color: var(--stone); display: inline-flex; align-items: center; gap: 8px; transition: background .15s ease, color .15s ease; }
.bt-opt.is-active { background: var(--graphite); color: #fff; }
.bt-save { font-size: 11px; font-weight: 700; color: #0f766e; background: var(--teal-soft); padding: 2px 8px; border-radius: 999px; }
.plan .price .amt { font-size: inherit; font-weight: inherit; color: inherit; }
.plan .bill-note { color: var(--stone); font-size: 12.5px; margin-top: 2px; }
/* Expandable full feature list inside a plan card (EP-024-T3). */
.plan-more { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.plan-more > summary { cursor: pointer; list-style: none; font-size: 13.5px; font-weight: 700; color: var(--teal-2); display: flex; align-items: center; justify-content: space-between; gap: 8px; user-select: none; padding: 7px 2px; border-radius: 8px; }
.plan-more > summary:hover { color: var(--teal); }
.plan-more > summary::-webkit-details-marker { display: none; }
.plan-more > summary::after { content: "▾"; font-size: 16px; line-height: 1; transition: transform .2s ease; }
.plan-more[open] > summary::after { transform: rotate(180deg); }
.plan-detail { margin-top: 8px; }
.plan-detail .stat-row { font-size: 12px; padding: 4px 0; }
.plan-detail .rl-head { margin: 12px 0 2px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--stone); }
.pricing-foot { margin-top: 22px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pricing-foot small { color: var(--stone); font-size: 13px; }
.pricing-notes { margin-top: 16px; display: grid; gap: 10px; max-width: 860px; }
.pricing-notes p { margin: 0; color: var(--stone); font-size: 13px; line-height: 1.6; }
.pricing-notes strong { color: var(--slate); }

/* ---- 10. Dark strip (developer CTA) ------------------------------------ */
.dark-strip {
  border: 1px solid #2f3c4a; border-radius: var(--radius-lg);
  background: linear-gradient(125deg, rgba(20,184,166,.16), transparent 40%), var(--graphite);
  color: #f8fafc; padding: 30px;
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 24px; align-items: center;
}
.dark-strip h2 { margin: 0; font-size: clamp(22px, 2.4vw, 28px); }
.dark-strip p { margin: 8px 0 0; color: #cbd5e1; font-size: 15px; max-width: 560px; }
.dark-links { display: flex; flex-wrap: wrap; gap: 10px; }
.dark-links a {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px;
  border-radius: var(--radius); border: 1px solid rgba(203,213,225,.28);
  background: rgba(255,255,255,.06); color: #f8fafc; text-decoration: none; font-weight: 650; font-size: 14px; white-space: nowrap;
}
.dark-links a:hover { background: rgba(255,255,255,.12); }
.dark-links a svg { width: 16px; height: 16px; color: var(--teal); }

/* ---- 11. FAQ (accordion) ----------------------------------------------- */
.faq { columns: 2; column-gap: 18px; }
.faq details { break-inside: avoid; margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 0 18px; box-shadow: var(--shadow-sm); }
.faq summary { list-style: none; cursor: pointer; padding: 16px 0; font-weight: 700; font-size: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { width: 20px; height: 20px; color: var(--stone); transition: transform .18s ease; flex: 0 0 auto; }
.faq details[open] summary svg { transform: rotate(180deg); }
.faq details p { margin: 0; padding: 0 0 18px; color: var(--stone); font-size: 14.5px; }

/* ---- 12. Cross-promo ---------------------------------------------------- */
.crosspromo h2 { font-size: 20px; margin: 0 0 18px; }
.rec-cards { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.rec-card { display: block; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease; }
.rec-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.rec-card img { width: 100%; height: auto; display: block; border-bottom: 1px solid var(--soft-line); }
.rec-card-body { padding: 14px 16px; }
.rec-card-title { font-weight: 800; font-size: 15px; }
.rec-card-desc { color: var(--stone); font-size: 13px; margin-top: 5px; }

/* ---- 13. Reference / content pages (docs, legal, billing) -------------- */
/* Documentation layout: sticky table-of-contents + readable content column,
   so long legal/reference pages fill the width instead of hugging the left. */
.doc { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; align-items: start; }
.doc-toc { position: sticky; top: 96px; display: grid; gap: 9px; align-content: start; }
.doc-toc .toc-title { text-transform: uppercase; letter-spacing: .06em; font-size: 11px; font-weight: 700; color: var(--stone); }
.doc-toc a { color: var(--stone); text-decoration: none; font-size: 13.5px; line-height: 1.4; border-left: 2px solid transparent; padding-left: 12px; margin-left: -14px; transition: color .12s ease, border-color .12s ease; }
.doc-toc a:hover { color: var(--graphite); }
.doc-toc a.active { color: var(--teal-2); border-color: var(--teal); font-weight: 600; }
.doc .prose { max-width: 760px; }
@media (max-width: 900px) {
  .doc { grid-template-columns: 1fr; gap: 24px; }
  .doc-toc { position: static; }
}
.prose { max-width: 760px; }
.prose h1 { font-size: clamp(28px, 3.4vw, 38px); margin: 0 0 8px; }
.prose h2 { font-size: 22px; margin: 30px 0 10px; }
.prose h3 { font-size: 17px; margin: 22px 0 8px; }
.prose p, .prose li { color: var(--slate); font-size: 15.5px; line-height: 1.65; }
.prose ul { padding-left: 20px; }
.callout {
  border: 1px solid var(--line); border-left: 3px solid var(--teal);
  border-radius: var(--radius); padding: 14px 16px; background: var(--off-white); margin: 16px 0;
}
.callout p { margin: 0; }
.endpoint-row {
  display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 10px 12px;
  border: 1px solid var(--soft-line); border-radius: var(--radius); background: var(--off-white);
}
.endpoint-row strong { display: block; font-size: 13.5px; }
.endpoint-row small { display: block; margin-top: 3px; color: var(--stone); font-size: 12px; }
.method {
  min-width: 56px; padding: 5px 8px; border-radius: 6px; color: #063f3a; background: var(--teal-soft);
  font-family: var(--mono); font-size: 11px; font-weight: 850; text-align: center;
}

/* ---- 14. Footer: light card + fixed sticky mini-footer (from prototype) - */
.footer-shell { width: var(--wrap); margin: 0 auto; padding: 0 0 28px; }

.site-footer {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: #fff; box-shadow: var(--shadow); overflow: hidden;
}
.footer-main {
  display: grid; grid-template-columns: minmax(260px, 1.1fr) repeat(3, minmax(170px, .8fr));
  gap: 22px; padding: 22px 24px;
}
.footer-brand { display: grid; gap: 10px; align-content: start; }
.footer-brand-line { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 850; }
.footer-brand-line svg { width: 34px; height: 34px; flex: 0 0 auto; }
.footer-brand p { margin: 0; max-width: 320px; color: var(--stone); font-size: 12.5px; line-height: 1.5; font-weight: 500; }
.footer-col { display: grid; align-content: start; gap: 8px; }
.footer-col h3 { margin: 0 0 2px; color: var(--graphite); font-size: 12px; font-weight: 850; text-transform: uppercase; }
.footer-col a { color: var(--stone); text-decoration: none; font-size: 13px; font-weight: 550; white-space: nowrap; }
.footer-col a:hover { color: var(--teal-2); }
.footer-bottom {
  min-height: 42px; padding: 10px 24px; border-top: 1px solid var(--soft-line);
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  color: var(--stone); font-size: 12px; font-weight: 650; background: #fbfcfe;
}
.footer-bottom nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.footer-bottom a { color: inherit; text-decoration: none; white-space: nowrap; }
.footer-bottom a:hover { color: var(--teal-2); }

.sticky-footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; min-height: 48px;
  border-top: 1px solid rgba(215,222,232,.92); background: rgba(248,250,252,.92);
  backdrop-filter: blur(14px); color: var(--slate);
  transform: translateY(0); transition: transform 160ms ease, opacity 160ms ease;
}
body.full-footer-visible .sticky-footer { opacity: 0; pointer-events: none; transform: translateY(100%); }
.sticky-footer-inner {
  width: var(--wrap); min-height: 48px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  font-size: 12px; font-weight: 650;
}
.sticky-footer .mini-brand { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: var(--slate); white-space: nowrap; }
.sticky-footer .mini-brand svg { width: 22px; height: 22px; flex: 0 0 auto; }
.sticky-footer nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.sticky-footer a { color: inherit; text-decoration: none; white-space: nowrap; }
.sticky-footer a:hover { color: var(--teal-2); }

/* ---- 15. Responsive ----------------------------------------------------- */
@media (max-width: 1320px) {
  .hero-grid { grid-template-columns: minmax(470px, .9fr) minmax(560px, 1.1fr); gap: 16px; }
  .flow { gap: 4px; }
  .flow-step { width: 90px; min-width: 84px; }
  .flow-icon { width: 68px; height: 68px; }
  .flow-arrow { width: 36px; flex-basis: 36px; }
}
@media (max-width: 1240px) {
  /* Tight desktop: drop the tertiary API/MCP CTA so the row keeps one line
     (overridden when html.no-extension-install needs to surface it). */
  .cta-row .btn.secondary-api { display: none; }
}
@media (max-width: 1180px) {
  .workspace, .prototype-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1040px) {
  .hero-grid { grid-template-columns: 1fr; }
  .flow { display: none; }
}
@media (max-width: 940px) {
  .signal, .workflow, .duo, .dark-strip { grid-template-columns: 1fr; }
  .cards, .quality { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .pricing { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .rec-cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .footer-main { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .tier-control .plan-slots,
  .tier-control .plan-max,
  .tier-control .plan-capacity-separator,
  .tier-control .plan-tier-separator { display: none; }
}
@media (max-width: 720px) {
  .faq { columns: 1; }
  .hero-inner { padding: 18px 0 36px; gap: 22px; }
  /* Mobile: no Chrome install – swap to the API/MCP CTA. */
  .cta-row .btn.install-cta { display: none; }
  .cta-row .btn.secondary-api { display: inline-flex; }
  .compact-header-inner { height: 52px; gap: 10px; }
  .compact-brand span { display: none; }
  .compact-nav { margin-right: auto; gap: 2px; font-size: 12px; }
  .compact-nav a { padding: 7px 6px; }
  .compact-nav .optional { display: none; }
  .compact-actions { gap: 6px; }
  .sticky-footer .mini-brand,
  .sticky-footer .mini-support { display: none; }
  .sticky-footer-inner { justify-content: center; }
  .footer-main { padding: 22px 18px; }
  .footer-bottom { align-items: flex-start; flex-direction: column; padding: 14px 18px; }
}
@media (max-width: 560px) {
  .cards, .quality, .pricing, .rec-cards, .footer-main { grid-template-columns: 1fr; }
  /* Compact mobile header */
  .hero-inner { padding: 14px 0 30px; gap: 18px; }
  .topbar { gap: 10px; }
  .mark { width: 32px; height: 32px; }
  .brand-name { font-size: 16px; }
  .tier-control { gap: 7px; min-height: 36px; padding: 3px 6px 3px 10px; }
  .upgrade-link { height: 28px; padding: 0 11px; font-size: 11.5px; }
  .avatar { width: 28px; height: 28px; }
  /* Action buttons on one line (smaller, like the prototype) instead of stacking */
  .cta-row { gap: 8px; margin-top: 22px; }
  .cta-row .btn { height: 42px; padding: 0 14px; font-size: 14px; }
  .cta-row .btn svg { width: 16px; height: 16px; }
}
@media (max-width: 520px) {
  .brand-name { font-size: 15px; }
  .tier-control .plan-tier { display: none; }
  .cta-row .btn { padding: 0 11px; font-size: 13.5px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
