/* Public-facing landing + docs. Reuses tokens from app.css. */

/* Legacy token aliases — this file was authored against an older naming
   scheme (`--text`, `--radius`, `--transition`, …) that never existed in
   app.css. Without these aliases the whole sheet silently falls back to
   browser defaults, which looks acceptable in dark mode (body inherits
   #000) but breaks light mode badly (invisible text/backgrounds). */
:root, [data-theme="dark"], [data-theme="light"] {
  --text:       var(--fg);
  --text-dim:   var(--fg-dim);
  --text-muted: var(--fg-muted);
  --radius:     var(--r);
  --radius-lg:  var(--r-lg);
  --transition: var(--t);
}

/* Body flips with theme — was hard-pinned to pure black. */
body.public { background: var(--bg); color: var(--fg); }
body.public .brand { cursor: default; }

/* ---------------- top bar ---------------- */
.p-topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center;
  /* Two flex children only: .brand and .p-cta. space-between
     pins one to each end of the row. Belt-and-braces with the
     margin-left:auto on .p-cta so any future stylesheet that
     overrides one falls back to the other. */
  justify-content: space-between;
  gap: 0;
  padding: 12px clamp(14px, 3vw, 32px);
  width: 100%; box-sizing: border-box;
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.p-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.p-nav a {
  padding: 8px 14px; border-radius: 999px;
  color: var(--text-muted); font-weight: 500; font-size: 13px;
  transition: background var(--transition), color var(--transition);
}
.p-nav a:hover { background: var(--surface); color: var(--text); }
/* The whole right-side cluster (nav + sign-in/up + theme) is pushed
   to the right edge of the topbar via margin-left: auto. */
.p-cta {
  display: flex; gap: 8px; align-items: center;
  margin-left: auto !important;
  margin-right: 0;
}

/* Hamburger trigger — hidden on desktop, shown on ≤900 px. */
.p-navtoggle {
  display: none; background: transparent; border: 0; cursor: pointer;
  padding: 8px; border-radius: 8px;
  transition: background .15s;
}
.p-navtoggle:hover { background: var(--surface); }
.p-navtoggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 4px 0; border-radius: 2px; transition: transform .2s, opacity .2s; }
.p-navtoggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.p-navtoggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.p-navtoggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---- Mobile (≤900 px) ----
   Hide the inline cluster, reveal the hamburger. Tapping the
   hamburger toggles .open on .p-cta which switches it from the
   inline row to a right-anchored dropdown panel below the
   topbar — same shape as the user-dashboard mobile dropdown. */
@media (max-width: 900px) {
  .p-navtoggle { display: block; }
  .p-cta {
    display: none;
    position: absolute;
    top: 100%; right: clamp(8px, 3vw, 16px); left: auto;
    flex-direction: column; gap: 0;
    width: min(280px, calc(100vw - 24px));
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
    padding: 6px;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    z-index: 50;
    margin: 0 !important;
  }
  .p-cta.open { display: flex; }
  .p-cta .p-nav {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }
  .p-cta .p-nav a,
  .p-cta .btn,
  .p-cta .theme-btn {
    width: 100%; box-sizing: border-box;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    text-align: left;
    background: transparent;
    border: 0;
    color: var(--text);
    justify-content: flex-start;
    display: flex; align-items: center; gap: 10px;
  }
  .p-cta .p-nav a:hover,
  .p-cta .btn:hover,
  .p-cta .theme-btn:hover { background: var(--surface); }
  .p-cta .btn.primary {
    color: var(--primary, #0077b6);
    font-weight: 600;
  }
}

/* ---------------- hero ---------------- */
.p-hero { position: relative; overflow: hidden; padding: clamp(48px, 10vw, 120px) clamp(16px, 4vw, 40px) clamp(40px, 8vw, 80px); }
.p-hero-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(55% 70% at 80% 0%,   rgba(226,59,59,.22), transparent 70%),
    radial-gradient(50% 60% at 10% 50%,  rgba(102,102,110,.18), transparent 70%),
    radial-gradient(40% 50% at 50% 100%, rgba(244,244,246,.08), transparent 70%);
  mask-image: linear-gradient(to bottom, #000 40%, transparent 100%);
}
.p-hero-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(24px, 5vw, 72px);
  align-items: center; max-width: 1200px; margin: 0 auto;
}
@media (max-width: 900px) { .p-hero-inner { grid-template-columns: 1fr; } }

.p-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted); font-weight: 500; letter-spacing: .02em;
}
.p-chip-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 4px rgba(34,197,94,.18); animation: p-pulse 2.2s ease-in-out infinite;
}
@keyframes p-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,.35); }
  50%      { box-shadow: 0 0 0 8px rgba(34,197,94,0);  }
}

.p-hero h1 {
  font-size: clamp(34px, 6vw, 62px); line-height: 1.04;
  font-weight: 800; letter-spacing: -0.035em;
  margin: 18px 0 18px;
}
.p-hero h1 .grad {
  background: linear-gradient(135deg, #ff6b6b 0%, #e23b3b 40%, #9999a1 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.p-lede { font-size: clamp(15px, 1.5vw, 17px); color: var(--text-dim); max-width: 560px; line-height: 1.6; }

.p-hero-actions { display: flex; gap: 12px; margin: 24px 0 22px; flex-wrap: wrap; }
.btn.big { padding: 12px 22px; font-size: 14px; }
.btn.ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--border-2);
}
.btn.ghost:hover { background: var(--surface); }

.p-trust {
  display: flex; gap: clamp(16px, 4vw, 36px);
  padding-top: 18px; border-top: 1px dashed var(--border);
  flex-wrap: wrap;
}
.p-trust-item { display: flex; flex-direction: column; gap: 2px; }
.p-trust-item b { font-size: 20px; color: var(--text); font-weight: 700; letter-spacing: -0.01em; }
.p-trust-item span { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }

/* fake terminal card */
.p-hero-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.03) inset;
  overflow: hidden;
  transform: perspective(1200px) rotateY(-4deg) rotateX(2deg);
  transform-origin: left center;
}
@media (max-width: 900px) { .p-hero-card { transform: none; } }
.p-card-head {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px; background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.p-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); }
.p-dot:nth-child(1) { background: #ff5f56; }
.p-dot:nth-child(2) { background: #ffbd2e; }
.p-dot:nth-child(3) { background: #27c93f; }
.p-card-title { margin-left: 8px; font-size: 12px; color: var(--text-muted); }
.p-feed { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.p-feed-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--border);
  animation: p-slideIn .4s ease both;
}
.p-feed-row:nth-child(1) { animation-delay: .05s; }
.p-feed-row:nth-child(2) { animation-delay: .15s; }
.p-feed-row:nth-child(3) { animation-delay: .25s; }
.p-feed-row:nth-child(4) { animation-delay: .35s; }
.p-feed-row:nth-child(5) { animation-delay: .45s; }
@keyframes p-slideIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.p-card-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-top: 1px solid var(--border); background: var(--bg-2);
}
.p-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ok); font-weight: 600; text-transform: uppercase; letter-spacing: .1em; }
.p-live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); animation: p-pulse 2.2s ease-in-out infinite; }

/* ---------------- sections ---------------- */
.p-section { max-width: 1200px; margin: 0 auto; padding: clamp(48px, 8vw, 96px) clamp(16px, 4vw, 40px); }
.p-section-head { text-align: center; max-width: 720px; margin: 0 auto 40px; }
.p-section-head h2 {
  font-size: clamp(26px, 3.6vw, 40px); font-weight: 700; letter-spacing: -0.025em;
  margin: 10px 0;
}
.p-kicker {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--accent); background: var(--accent-soft); font-weight: 700;
}
.p-center { text-align: center; margin-top: 40px; }

/* features */
.p-feat-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}
.p-feat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 26px;
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}
.p-feat:hover {
  transform: translateY(-4px); border-color: var(--border-2);
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
}
.p-feat h3 { font-size: 17px; font-weight: 600; margin: 14px 0 8px; letter-spacing: -0.01em; }
.p-feat p  { font-size: 14px; color: var(--text-muted); line-height: 1.55; }
.p-feat-ico {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--surface-2); display: grid; place-items: center;
  position: relative;
}
.p-feat-ico::before {
  content: ''; width: 24px; height: 24px; background: var(--accent);
  -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; -webkit-mask-size: contain;
          mask-repeat: no-repeat;         mask-position: center;         mask-size: contain;
}
.p-feat-ico[data-ico=users]::before  { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/><circle cx='9' cy='7' r='4'/><path d='M22 21v-2a4 4 0 0 0-3-3.87'/><path d='M16 3.13a4 4 0 0 1 0 7.75'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/><circle cx='9' cy='7' r='4'/><path d='M22 21v-2a4 4 0 0 0-3-3.87'/><path d='M16 3.13a4 4 0 0 1 0 7.75'/></svg>"); }
.p-feat-ico[data-ico=eye]::before    { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8Z'/><circle cx='12' cy='12' r='3'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8Z'/><circle cx='12' cy='12' r='3'/></svg>"); }
.p-feat-ico[data-ico=heart]::before  { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78Z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78Z'/></svg>"); }
.p-feat-ico[data-ico=flag]::before   { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z'/><line x1='4' y1='22' x2='4' y2='15'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z'/><line x1='4' y1='22' x2='4' y2='15'/></svg>"); }
.p-feat-ico[data-ico=poll]::before   { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><line x1='18' y1='20' x2='18' y2='10'/><line x1='12' y1='20' x2='12' y2='4'/><line x1='6' y1='20' x2='6' y2='14'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><line x1='18' y1='20' x2='18' y2='10'/><line x1='12' y1='20' x2='12' y2='4'/><line x1='6' y1='20' x2='6' y2='14'/></svg>"); }
.p-feat-ico[data-ico=shield]::before { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/></svg>"); }

/* metrics strip */
.p-metrics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px; text-align: center;
  padding: clamp(32px, 5vw, 56px) clamp(16px, 4vw, 40px);
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg-2) 100%);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  max-width: none;
}
.p-metric { display: flex; flex-direction: column; gap: 4px; }
.p-metric b { font-size: clamp(26px, 3vw, 36px); font-weight: 800; letter-spacing: -0.03em; }
.p-metric span { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }

/* how it works */
.p-steps {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}
.p-step {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px 24px;
  position: relative;
}
.p-step-num {
  position: absolute; top: 24px; right: 24px;
  font-size: 36px; font-weight: 800; color: var(--surface-3);
  letter-spacing: -0.04em;
}
.p-step h3 { margin: 0 0 8px; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.p-step p  { color: var(--text-muted); font-size: 14px; line-height: 1.55; }

/* code block — theme-aware. Dark mode uses an almost-black bg with
   bright tokens; light mode uses a soft warm-white bg with darker
   tokens. The earlier hardcoded #050507 + undefined --alabaster
   broke light mode because the inherited fg became dark text on a
   dark bg, leaving only AA halos around each token. */
.p-code, .fs-code {
  background: #0e1116;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px; overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; line-height: 1.55;
  color: #e6e8eb;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
[data-theme="light"] .p-code,
[data-theme="light"] .fs-code {
  background: #f6f8fa;
  color: #24292f;
  border-color: #d0d7de;
  box-shadow: 0 2px 6px rgba(15,23,42,.06);
}

/* Syntax tokens: dark-mode defaults, light-mode overrides. */
.c-k { color: #ff6b6b; font-weight: 600; }
.c-s { color: #9cdcfe; }
.c-v { color: #f7ca88; }
.c-p { color: #b994e6; }
.c-m { color: #6c7a89; font-style: italic; }
[data-theme="light"] .c-k { color: #cf222e; }
[data-theme="light"] .c-s { color: #0a3069; }
[data-theme="light"] .c-v { color: #953800; }
[data-theme="light"] .c-p { color: #6639ba; }
[data-theme="light"] .c-m { color: #6e7781; }

.p-code-section .p-code { max-width: 860px; margin: 0 auto; }

/* CTA card */
.p-cta-big { padding: clamp(40px, 6vw, 80px) clamp(16px, 4vw, 40px); }
.p-cta-card {
  max-width: 720px; margin: 0 auto;
  padding: clamp(32px, 5vw, 60px);
  background: linear-gradient(135deg, rgba(226,59,59,.12) 0%, var(--surface) 60%);
  border: 1px solid var(--border-2); border-radius: var(--radius-lg);
  text-align: center;
}
.p-cta-card h2 { font-size: clamp(26px, 3.6vw, 40px); font-weight: 700; letter-spacing: -0.025em; margin-bottom: 10px; }
.p-cta-card p  { color: var(--text-dim); margin-bottom: 22px; }
.p-cta-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------------- footer ---------------- */
.p-footer {
  border-top: 1px solid var(--border); background: var(--bg-2);
  padding: 48px clamp(16px, 4vw, 40px) 24px;
}
.p-foot-cols {
  display: grid; gap: 28px;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  max-width: 1200px; margin: 0 auto;
}
@media (max-width: 720px) { .p-foot-cols { grid-template-columns: 1fr 1fr; } }
.p-foot-cols h4 {
  font-size: 12px; margin: 0 0 12px; color: var(--text);
  text-transform: uppercase; letter-spacing: .08em; font-weight: 600;
}
.p-foot-cols a { display: block; padding: 4px 0; color: var(--text-muted); font-size: 13px; }
.p-foot-cols a:hover { color: var(--text); }
.p-foot-cols .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: middle; margin-right: 6px; }
.p-foot-cols .dot.ok { background: var(--ok); box-shadow: 0 0 0 4px rgba(34,197,94,.18); }
.p-foot-base {
  max-width: 1200px; margin: 32px auto 0;
  padding-top: 18px; border-top: 1px solid var(--border);
  text-align: center;
}

/* ============ DOCS ============ */
.p-docs {
  display: grid; grid-template-columns: 240px 1fr;
  max-width: 1200px; margin: 0 auto;
  padding: clamp(24px, 5vw, 48px) clamp(16px, 4vw, 32px);
  gap: clamp(24px, 4vw, 48px);
}
@media (max-width: 900px) { .p-docs { grid-template-columns: 1fr; } }

.p-toc {
  position: sticky; top: 80px; align-self: start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 14px;
  display: flex; flex-direction: column; gap: 2px;
  max-height: calc(100vh - 100px); overflow-y: auto;
}
.p-toc h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin: 0 8px 8px; font-weight: 600; }
.p-toc h3.mt { margin-top: 14px; }
.p-toc a { padding: 6px 10px; border-radius: 6px; font-size: 13px; color: var(--text-dim); }
.p-toc a:hover { background: var(--surface-2); color: var(--text); }
@media (max-width: 900px) {
  .p-toc { position: static; max-height: none; }
}

.p-doc-header { margin-bottom: 28px; }
.p-doc-header h1 { font-size: clamp(28px, 3.5vw, 38px); font-weight: 700; letter-spacing: -0.025em; margin: 10px 0 8px; }

.p-doc-sec { margin-bottom: 40px; }
.p-doc-sec h2 {
  font-size: 20px; margin: 0 0 12px; font-weight: 600;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.p-doc-sec h3 { font-size: 14px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin: 18px 0 8px; font-weight: 600; }
.p-doc-sec p  { color: var(--text-dim); line-height: 1.65; }

.p-callout {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 10px 14px; border-radius: var(--radius);
  margin: 12px 0; font-size: 13px; color: var(--text-dim);
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.p-callout b { color: var(--text); }

.p-endpoint {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px 10px 6px 6px;
  margin-bottom: 10px;
}
.p-method {
  padding: 4px 10px; border-radius: 6px; font-weight: 700; font-size: 12px;
  letter-spacing: .06em;
}
.p-method.get  { background: rgba(34,197,94,.15); color: var(--ok); }
.p-method.post { background: rgba(226,59,59,.15); color: var(--accent); }
.p-endpoint code { background: transparent; padding: 0; color: var(--text); font-size: 14px; }

.p-table {
  width: 100%; border-collapse: collapse; margin-top: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.p-table th, .p-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; font-size: 13px; vertical-align: top; }
.p-table th { color: var(--text-muted); font-weight: 500; font-size: 11px; text-transform: lowercase; letter-spacing: .03em; background: var(--bg-2); }
.p-table tr:last-child td { border-bottom: 0; }

/* ============ PUBLIC /services CATALOG ============ */
.svc-hero {
  max-width: 1200px; margin: 0 auto;
  padding: clamp(40px, 6vw, 80px) clamp(16px, 3vw, 32px) clamp(22px, 3vw, 32px);
  text-align: center;
}
.svc-hero h1 {
  font-size: clamp(28px, 4vw, 44px); font-weight: 700;
  letter-spacing: -0.025em; margin: 8px 0 14px;
}
.svc-hero .p-lede { max-width: 620px; margin: 0 auto 18px; }
.svc-hero .svc-cta {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin-top: 14px;
}

.svc-toolbar {
  max-width: 1200px; margin: 0 auto 20px;
  padding: 0 clamp(16px, 3vw, 32px);
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.svc-toolbar input, .svc-toolbar select {
  padding: 10px 14px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--fg); font-size: 13px;
  transition: border-color var(--t), box-shadow var(--t);
}
.svc-toolbar input { flex: 1; min-width: 220px; }
.svc-toolbar input:focus, .svc-toolbar select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.svc-catalog {
  max-width: 1200px; margin: 0 auto 80px;
  padding: 0 clamp(16px, 3vw, 32px);
}
.svc-group {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); margin-bottom: 22px;
  overflow: hidden; box-shadow: var(--shadow-1);
}
.svc-group[hidden] { display: none; }
.svc-group-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}
.svc-group-head h2 {
  margin: 0; font-size: 15px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 10px;
}
.svc-group-head h2::before {
  content: ''; width: 3px; height: 14px; border-radius: 2px; background: var(--accent);
}
.svc-table-wrap { overflow-x: auto; }
.svc-table {
  width: 100%; border-collapse: collapse;
}
.svc-table th, .svc-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left; font-size: 13px; vertical-align: middle;
}
.svc-table th {
  color: var(--fg-muted); font-weight: 500; font-size: 11px;
  text-transform: lowercase; letter-spacing: .03em;
  background: var(--bg-2);
}
.svc-table tr:last-child td { border-bottom: 0; }
.svc-table tr:hover td { background: var(--surface-2); }
.svc-table .svc-name { color: var(--fg); font-weight: 500; min-width: 240px; }
.svc-table code {
  background: transparent; padding: 0;
  color: var(--fg-muted); font-size: 12px;
}
.svc-table .bdg { font-weight: 500; }

/* ============ PUBLIC API REFERENCE ============ */
.fs-api {
  display: grid; grid-template-columns: 240px 1fr;
  max-width: 1200px; margin: 0 auto;
  padding: clamp(24px, 5vw, 48px) clamp(16px, 4vw, 32px);
  gap: clamp(24px, 4vw, 48px);
}
@media (max-width: 900px) { .fs-api { grid-template-columns: 1fr; } }

.fs-toc {
  position: sticky; top: 80px; align-self: start;
  max-height: calc(100vh - 100px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 10px;
  display: flex; flex-direction: column; gap: 1px;
}
.fs-toc-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); padding: 4px 10px 10px; font-weight: 600;
}
.fs-toc a {
  padding: 7px 10px; border-radius: 6px;
  font-size: 13px; color: var(--text-muted);
  border-left: 2px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.fs-toc a:hover { background: var(--surface-2); color: var(--text); }
.fs-toc a.active {
  background: var(--accent-soft); color: var(--text);
  border-left-color: var(--accent);
}
@media (max-width: 900px) {
  .fs-toc { position: static; max-height: none; }
}

.fs-header h1 {
  font-size: clamp(26px, 3.4vw, 36px); font-weight: 700;
  letter-spacing: -0.025em; margin: 0 0 6px;
}
.fs-header { margin-bottom: 28px; }

.fs-sec { margin-bottom: 40px; scroll-margin-top: 80px; }
.fs-sec h3 {
  font-size: 20px; font-weight: 600; margin: 0 0 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
  letter-spacing: -0.01em;
}
.fs-sec h4.fs-sub {
  font-size: 15px; font-weight: 600; margin: 20px 0 10px;
  color: var(--text);
  display: inline-block;
  padding: 4px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  letter-spacing: .01em;
}
.fs-sec p { color: var(--text-dim); line-height: 1.65; font-size: 14px; }
.fs-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); margin: 16px 0 6px !important; font-weight: 600;
}
.fs-label.muted.small { text-transform: none; letter-spacing: 0; font-weight: 400; }

/* info table at top */
.fs-info {
  width: 100%; border-collapse: collapse;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.fs-info td {
  padding: 10px 14px; font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.fs-info tr:last-child td { border-bottom: 0; }
.fs-info td:first-child {
  color: var(--fg-muted); width: 32%;
  text-transform: uppercase; font-size: 11px; letter-spacing: .06em; font-weight: 600;
  /* surface-2 lifts both themes: faint on dark, soft grey on white. */
  background: var(--surface-2);
}
.fs-info td:last-child { color: var(--fg); }

/* parameters table */
.fs-params {
  width: 100%; border-collapse: collapse;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  margin-bottom: 10px;
}
.fs-params th, .fs-params td {
  padding: 9px 14px; text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px; vertical-align: top;
}
.fs-params th {
  background: var(--surface-2); color: var(--fg-muted);
  font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: .06em;
}
.fs-params td:first-child {
  width: 32%; color: var(--text); font-weight: 500;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px;
}
.fs-params td:last-child { color: var(--text-dim); }
.fs-params tr:last-child td { border-bottom: 0; }
.fs-params tr.opt td:first-child { color: var(--text-muted); }
.opt-tag {
  display: inline-block; padding: 0 6px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-muted);
  font-size: 10px; text-transform: uppercase; letter-spacing: .04em;
  font-family: inherit; margin-left: 6px; vertical-align: 1px;
}

/* .fs-code is styled by the unified .p-code/.fs-code rule earlier in
   this file (theme-aware bg + tokens). The old standalone block here
   hard-coded #050507 and an undefined --alabaster colour, which made
   the API page's response examples illegible in light mode. */
