:root {
  --bg: #fafafb;
  --bg-alt: #f3f4f6;
  --fg: #1a1a2e;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #667eea;
  --primary-dark: #5568d3;
  --accent: #764ba2;
  --radius: 8px;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.55;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }

/* Topbar */
.topbar {
  position: relative;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex; justify-content: space-between; align-items: center;
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px 32px;
}
.topbar .brand { font-weight: 700; font-size: 20px; color: var(--fg); }
.topbar nav a { margin-left: 24px; color: var(--fg); font-size: 14px; }
.topbar nav a:hover { color: var(--primary); text-decoration: none; }
.topbar nav a.nav-cta {
  background: var(--primary); color: #fff;
  padding: 8px 14px; border-radius: 6px;
}
.topbar nav a.nav-cta:hover { background: var(--primary-dark); }

/* Hamburger — only shown on narrow viewports (see media query below) */
.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 6px; width: 40px; height: 40px;
  flex-direction: column; justify-content: center; gap: 5px;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--fg); border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

main { max-width: var(--max); margin: 0 auto; padding: 0 32px; }

/* Hero — single unified layout with subtle full-width tinted bg.
   ::before extends bg edge-to-edge while content stays max-width centered. */
.hero {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px;
  align-items: center;
  padding: 80px 0 72px;
  position: relative;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0; bottom: 0;
  left: calc(50% - 50vw);
  width: 100vw;
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 60%, #faf5ff 100%);
}
.hero h1 {
  font-size: 44px; line-height: 1.15; margin: 0 0 20px;
  letter-spacing: -0.015em;
}
.hero .lede { font-size: 18px; color: #374151; margin: 0 0 28px; max-width: 560px; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-block; padding: 12px 20px; border-radius: 6px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; transition: background .15s, border-color .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }
.btn-secondary { background: #fff; color: var(--fg); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

/* Hero visual: aspect-ratio on the wrapper, video fills it 100% × 100%
   with object-fit: cover. Same pattern as .customer-visual / .next-visual. */
.hero-visual {
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(102, 126, 234, 0.25);
  overflow: hidden;
  background: linear-gradient(135deg, #667eea, #764ba2); /* shows during poster load */
}
.hero-frame {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Aspect ratio lives on the wrapper — img fills 100% — most reliable
   across browsers (HTML width/height attrs on img can otherwise override
   img-level aspect-ratio CSS). */
.customer-visual {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(102, 126, 234, 0.25);
  overflow: hidden;
}
.customer-frame {
  width: 100%;
  height: 100%;
  object-fit: cover;     /* longer dimension overflows the square, image stays undistorted */
  display: block;
}

/* Embed snippet */
.embed { padding: 56px 0; border-top: 1px solid var(--border); }
.embed h2 { font-size: 28px; margin: 0 0 6px; }
.embed .muted { margin: 0 0 24px; }
.embed pre {
  background: #1a1a2e; color: #e5e7eb;
  padding: 24px; border-radius: var(--radius);
  overflow-x: auto; font-size: 13px; line-height: 1.6;
  margin: 0;
}
.embed code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.embed-cta { text-align: center; margin: 24px 0 0; }

/* Hand-rolled syntax tokens (no highlighter dep). */
.embed .tk-tag { color: #7ee787; }
.embed .tk-att { color: #79c0ff; }
.embed .tk-str { color: #a5d6ff; }
.embed .tk-pun { color: #8b949e; }
.embed .tk-fn  { color: #d2a8ff; }
.embed .tk-obj { color: #ffa657; }
.embed .tk-key { color: #79c0ff; }

/* Cards */
.cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  padding: 56px 0;
  border-top: 1px solid var(--border);
}
.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px;
}
.card h3 { margin: 0 0 10px; font-size: 18px; }
.card p { margin: 0; color: #374151; font-size: 15px; }
.card code {
  background: var(--bg-alt); padding: 1px 6px; border-radius: 4px;
}

/* SEGMENTATION — three audience cards under the hero. */
.segmentation { padding: 64px 0 56px; }
.segmentation > h2 {
  font-size: 28px; margin: 0 0 32px; text-align: center;
  letter-spacing: -0.005em;
}
.segments {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.segment {
  display: flex; flex-direction: column;
  padding: 28px 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.segment:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.07);
  text-decoration: none;
}
.segment-eyebrow {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: #fff;
  margin-bottom: 12px;
  align-self: flex-start;
}
.segment-sales       .segment-eyebrow { background: var(--primary); }
.segment-planning    .segment-eyebrow { background: #059669; }
.segment-integration .segment-eyebrow { background: var(--accent); }
.segment-sales:hover       { border-color: var(--primary); }
.segment-planning:hover    { border-color: #059669; }
.segment-integration:hover { border-color: var(--accent); }
.segment h3 { margin: 0 0 8px; font-size: 18px; line-height: 1.3; }
.segment p {
  margin: 0 0 16px; color: #374151;
  font-size: 14.5px; line-height: 1.55; flex: 1;
}
.segment-arrow { font-weight: 600; font-size: 14px; color: var(--primary); }
.segment-planning    .segment-arrow { color: #059669; }
.segment-integration .segment-arrow { color: var(--accent); }

/* USE-CASE sections — 2-col, alternating direction. */
.use-case {
  display: grid; grid-template-columns: 1fr 1fr; gap: 56px;
  align-items: center;
  padding: 72px 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: 80px;
}
.use-case h2 {
  font-size: 30px; margin: 0 0 16px;
  letter-spacing: -0.01em; line-height: 1.2;
}
.use-case .use-case-copy > p {
  font-size: 16.5px; color: #374151;
  margin: 0 0 22px; line-height: 1.6;
}
.use-case-planning .use-case-copy   { order: 2; }
.use-case-planning .use-case-visual { order: 1; }
.use-case-visual {
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.10);
  background: linear-gradient(135deg, #eef2ff, #f5f3ff);
}
.use-case-frame {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

.benefits { list-style: none; padding: 0; margin: 0 0 26px; }
.benefits li {
  position: relative;
  padding: 4px 0 4px 26px;
  color: #374151; font-size: 15px; line-height: 1.55;
}
.benefits li::before {
  content: "✓";
  position: absolute; left: 0; top: 4px;
  color: var(--primary); font-weight: 700;
}
.use-case-planning    .benefits li::before { color: #059669; }
.use-case-integration .benefits li::before { color: var(--accent); }

/* FINAL CTA — centered, soft tinted bg full-width. */
.final-cta {
  padding: 72px 0 64px;
  text-align: center;
  position: relative;
  isolation: isolate;
}
.final-cta::before {
  content: "";
  position: absolute; z-index: -1;
  top: 0; bottom: 0;
  left: calc(50% - 50vw);
  width: 100vw;
  background: linear-gradient(135deg, #eef2ff 0%, #faf5ff 100%);
}
.final-cta h2 {
  font-size: 30px; margin: 0 0 12px; letter-spacing: -0.005em;
}
.final-cta p {
  font-size: 17px; color: #374151;
  margin: 0 auto 24px; max-width: 540px;
}
.final-cta .btn { font-size: 16px; padding: 14px 28px; }

/* No-code section — dashboard mode pitch (between dual hero and cards). */
.no-code {
  padding: 48px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}
.no-code h2 {
  font-size: 26px; line-height: 1.25; margin: 8px auto 14px;
  letter-spacing: -0.005em; max-width: 720px;
}
.no-code p {
  font-size: 16px; color: #374151; margin: 0 auto 18px; max-width: 680px;
  line-height: 1.6;
}
.no-code-cta { margin-top: 22px; }

/* Capabilities grid — common to all audiences, mixed-vocabulary copy. */
.capabilities {
  padding: 56px 0;
  border-top: 1px solid var(--border);
}
.capabilities h2 {
  font-size: 28px; margin: 0 0 28px;
  letter-spacing: -0.005em;
}
.capabilities-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.capability {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px;
}
.capability-icon { font-size: 28px; line-height: 1; margin-bottom: 12px; }
.capability h3 {
  margin: 0 0 8px; font-size: 16px; font-weight: 600;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.capability p { margin: 0; color: #374151; font-size: 14.5px; line-height: 1.55; }
.capability-soon {
  display: inline-block;
  padding: 2px 8px; border-radius: 999px;
  background: var(--bg-alt); color: var(--muted);
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
}
/* Capabilities CTA — soft panel with tinted bg to draw the eye, since
   this is the "we build whatever you need" message that should pop. */
.capabilities-cta {
  margin: 36px auto 0;
  padding: 22px 28px;
  max-width: 560px;
  border-radius: 12px;
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
  border: 1px solid #e0e7ff;
  text-align: center;
}
.capabilities-cta a {
  color: var(--primary);
  font-size: 16.5px;
  font-weight: 700;
}
.capabilities-cta a:hover { color: var(--primary-dark); text-decoration: underline; }

/* Customer */
.customer {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px;
  align-items: center;
  padding: 56px 0;
  border-top: 1px solid var(--border);
}
.customer h2 { font-size: 26px; margin: 8px 0 12px; }
.customer p { color: #374151; margin: 0 0 24px; }
.eyebrow {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.eyebrow-sales       { background: var(--primary); }
.eyebrow-planning    { background: #059669; }
.eyebrow-integration { background: var(--accent); }
.eyebrow-no-code     { background: #1a1a2e; }
.eyebrow-customer    { background: #ea580c; }

/* Use cases */
.usecases { padding: 56px 0; border-top: 1px solid var(--border); }
.usecases h2 { font-size: 26px; margin: 0 0 20px; }
.usecases ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.usecases li {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; font-size: 15px; color: #374151;
}

/* Pricing */
.pricing { padding: 56px 0; border-top: 1px solid var(--border); }
.pricing-card {
  max-width: 640px; margin: 0 auto;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 36px; text-align: center;
}
.pricing-card h2 { font-size: 32px; margin: 8px 0 12px; color: var(--primary); }
.pricing-card p { color: #374151; margin: 0 0 16px; }
.pricing-card .cta-row { justify-content: center; margin-top: 8px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Footer */
footer {
  margin-top: 64px;
  padding: 40px 32px 24px;
  background: #fff;
  border-top: 1px solid var(--border);
}
.footer-inner {
  max-width: var(--max); margin: 0 auto;
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 32px; flex-wrap: wrap;
}
.footer-inner strong { font-size: 16px; }
.footer-inner p { margin: 4px 0 0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-nav a { color: var(--fg); font-size: 14px; }
.footer-nav a:hover { color: var(--primary); text-decoration: none; }
.footer-credit {
  max-width: var(--max); margin: 24px auto 0;
  border-top: 1px solid var(--border); padding-top: 16px;
}

/* Responsive */
@media (max-width: 880px) {
  .hero, .customer, .use-case { grid-template-columns: 1fr; gap: 32px; padding: 48px 0; }
  .hero { padding: 56px 0; }
  .hero h1 { font-size: 30px; }
  .use-case h2 { font-size: 24px; }
  .use-case-planning .use-case-copy   { order: 1; }
  .use-case-planning .use-case-visual { order: 2; }
  .no-code h2 { font-size: 22px; }
  .cards { grid-template-columns: 1fr; }
  .segments { grid-template-columns: 1fr; }
  .capabilities-grid { grid-template-columns: 1fr; }
  .topbar-inner { padding: 14px 20px; }
  .topbar nav a { margin-left: 14px; font-size: 13px; }
  main { padding: 0 20px; }
}

/* ───────── Docs ───────── */

.topbar nav a.active { color: var(--primary); }

.docs-layout {
  max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: 240px 1fr; gap: 48px;
  padding: 32px 32px 64px;
}

.docs-toc {
  position: sticky; top: 24px; align-self: start;
  font-size: 14px;
}
.docs-toc h3 {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); margin: 0 0 12px;
}
.docs-toc h4 {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); margin: 28px 0 10px;
}
.docs-toc nav { display: flex; flex-direction: column; gap: 2px; }
.docs-toc nav a {
  color: var(--fg); padding: 6px 10px; border-radius: 5px;
  border-left: 2px solid transparent;
}
.docs-toc nav a:hover { background: var(--bg-alt); text-decoration: none; }
.docs-toc nav a.active {
  color: var(--primary); font-weight: 600;
  border-left-color: var(--primary); background: var(--bg-alt);
}
.docs-toc-sub a { font-size: 13px; padding-left: 14px !important; }

.docs-content {
  max-width: 760px;
  font-size: 15px; line-height: 1.65;
}
.docs-content h1 { font-size: 36px; margin: 0 0 12px; letter-spacing: -0.01em; }
.docs-content h2 {
  font-size: 24px; margin: 48px 0 14px;
  padding-top: 16px; border-top: 1px solid var(--border);
}
.docs-content h2:first-of-type { border-top: none; padding-top: 0; }
.docs-content h3 {
  font-size: 17px; margin: 28px 0 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
}
.docs-content h3 code { background: none; padding: 0; font-size: inherit; }
.docs-content .lede { font-size: 17px; color: #374151; margin: 0 0 16px; }
.docs-content p { margin: 0 0 14px; color: #374151; }
.docs-content ul { margin: 0 0 14px; padding-left: 22px; color: #374151; }
.docs-content li { margin: 4px 0; }
.docs-content code {
  background: var(--bg-alt);
  padding: 1px 6px; border-radius: 4px;
  font-size: 0.92em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.docs-content pre {
  background: #1a1a2e; color: #e5e7eb;
  padding: 18px 20px; border-radius: var(--radius);
  overflow-x: auto; font-size: 13px; line-height: 1.6;
  margin: 0 0 18px;
}
.docs-content pre code { background: none; padding: 0; font-size: 13px; color: inherit; }
.docs-content .tk-tag { color: #7ee787; }
.docs-content .tk-att { color: #79c0ff; }
.docs-content .tk-str { color: #a5d6ff; }
.docs-content .tk-pun { color: #8b949e; }
.docs-content .tk-fn  { color: #d2a8ff; }
.docs-content .tk-obj { color: #ffa657; }
.docs-content .tk-key { color: #79c0ff; }
.docs-content .tk-kwd { color: #ff7b72; }
.docs-content .tk-com { color: #8b949e; font-style: italic; }

/* Docs cards (on the index) */
.docs-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin: 16px 0 8px;
}
.docs-card {
  display: block; padding: 20px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--fg);
}
.docs-card:hover {
  border-color: var(--primary); text-decoration: none;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.08);
}
.docs-card h3 {
  margin: 0 0 6px; font-family: inherit; font-size: 16px; font-weight: 700;
  color: var(--primary);
}
.docs-card p { margin: 0; font-size: 14px; }

/* API table */
.api-table {
  width: 100%; border-collapse: collapse;
  margin: 8px 0 18px;
  font-size: 14px;
}
.api-table th, .api-table td {
  text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.api-table th {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); font-weight: 600; background: var(--bg-alt);
}
.api-table td:nth-child(1), .api-table td:nth-child(2) { white-space: nowrap; }
.api-table td:nth-child(3) { white-space: nowrap; color: var(--muted); }
.api-table code {
  background: var(--bg-alt); padding: 1px 6px; border-radius: 4px;
  font-size: 12.5px;
}

@media (max-width: 880px) {
  .docs-layout { grid-template-columns: 1fr; gap: 24px; padding: 20px; }
  .docs-toc { position: static; }
  .docs-toc-sub { display: none; }
  .docs-cards { grid-template-columns: 1fr; }
  .docs-content h1 { font-size: 28px; }
}

/* ───────── Legal page ───────── */

.legal-container {
  max-width: 720px; margin: 0 auto;
  padding: 48px 32px 64px;
  font-size: 15px; line-height: 1.65;
}
.legal-container h1 {
  font-size: 36px; margin: 0 0 8px; letter-spacing: -0.01em;
}
.legal-container .legal-update {
  color: var(--muted); font-size: 14px; margin: 0 0 32px;
}
.legal-section { margin-bottom: 32px; }
.legal-section h2 {
  font-size: 20px; margin: 0 0 10px;
  padding-top: 16px; border-top: 1px solid var(--border);
}
.legal-section:first-of-type h2 { border-top: none; padding-top: 0; }
.legal-section p { color: #374151; margin: 0 0 12px; }
.legal-section a { color: var(--primary); }

@media (max-width: 880px) {
  .legal-container { padding: 32px 20px 48px; }
  .legal-container h1 { font-size: 28px; }
}

/* Mobile nav — hamburger collapses links into a dropdown panel */
@media (max-width: 700px) {
  .nav-toggle { display: flex; }
  .topbar nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    padding: 8px 20px 16px;
    z-index: 10;
  }
  .topbar nav.open { display: flex; }
  .topbar nav a {
    margin: 0;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
  }
  .topbar nav a:last-child { border-bottom: none; }
  .topbar nav a.nav-cta {
    margin-top: 12px;
    text-align: center;
    border-radius: 6px;
  }
}

/* ───────── Demo page ───────── */

.demo-main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 64px 32px;
}
.demo-header { margin-bottom: 36px; }
.demo-header h1 {
  font-size: 36px; line-height: 1.15; margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.demo-header .lede {
  font-size: 17px; color: #374151;
  margin: 0; max-width: 640px; line-height: 1.55;
}

.demo-banner {
  margin: 0 0 20px;
  padding: 14px 18px;
  background: #fef3c7;
  border-left: 3px solid #f59e0b;
  border-radius: 6px;
  color: #78350f;
  font-size: 14px;
  line-height: 1.5;
}
.demo-banner strong { font-weight: 600; }

.demo-mobile-notice {
  display: none;
  margin: 0 0 24px;
  padding: 12px 16px;
  background: var(--bg-alt);
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
@media (max-width: 880px) {
  .demo-mobile-notice { display: block; }
}

.demo-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.demo-card {
  display: block;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  text-decoration: none;
  color: var(--fg);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.demo-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border-color: var(--primary);
  text-decoration: none;
}
.demo-card-thumb {
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, #eef2ff, #f5f3ff);
  margin-bottom: 14px;
}
.demo-card-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.demo-card h3 {
  font-size: 17px; margin: 0 0 4px; line-height: 1.3;
}
.demo-card-context {
  display: inline-block;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* The viewer mounts as a fixed overlay over the picker on every viewport.
   The host element is the backdrop; clicking it (margin around the slot)
   closes the viewer — the click-out handler is wired in the demo script. */
.demo-viewer-host[hidden] { display: none !important; }
.demo-viewer-host:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  margin: 0;
}
/* The bar wrapper carries no layout — the back button positions itself
   directly against the host so it can float as an overlay. */
.demo-viewer-host:not([hidden]) .demo-viewer-bar { display: contents; }
.demo-viewer-host:not([hidden]) .demo-viewer-label { display: none; }
.demo-back-btn {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  padding: 8px 16px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  color: var(--fg);
  transition: border-color .15s, color .15s, background .15s;
}
.demo-back-btn:hover { border-color: var(--primary); color: var(--primary); }
.demo-viewer-host:not([hidden]) .demo-back-btn {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 101;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.demo-viewer-slot {
  width: 100%;
  height: 100%;
  max-width: 1200px;
  max-height: min(800px, calc(100vh - 64px));
  background: linear-gradient(135deg, #1a1a2e, #2d2d44);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
}
/* Lock body scroll while the viewer is open — desktop and mobile alike. */
body.demo-page:has(.demo-viewer-host:not([hidden])) { overflow: hidden; }
.demo-error {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px; text-align: center; padding: 24px;
}
.demo-error button {
  margin-left: 12px; padding: 6px 14px; border-radius: 6px;
  border: 1px solid #fff; background: transparent; color: #fff;
  font: inherit; font-size: 13px; cursor: pointer;
}
.demo-error button:hover { background: rgba(255,255,255,0.1); }

.demo-foot {
  margin: 32px 0 0; text-align: center;
  font-size: 15px; color: var(--muted);
}
.demo-foot a {
  color: var(--primary); font-weight: 600;
}

@media (max-width: 700px) {
  .demo-main { padding: 32px 16px; }
  .demo-picker { grid-template-columns: 1fr; }
  .demo-header h1 { font-size: 28px; }

  /* On mobile the overlay goes edge-to-edge: drop the desktop margin,
     hide the topbar, swap the dim backdrop for solid black, and let the
     slot fill the viewport with no rounded corners or drop shadow. */
  body.demo-page:has(.demo-viewer-host:not([hidden])) .topbar { display: none; }
  .demo-viewer-host:not([hidden]) {
    padding: 0;
    background: #000;
  }
  .demo-viewer-host:not([hidden]) .demo-back-btn {
    top: max(12px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
  }
  .demo-viewer-host:not([hidden]) .demo-viewer-slot {
    max-width: none;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
  }
}

