/* Site-wide stylesheet for the 4D-360-AI landings — light theme. */

:root {
  --fg: #1a1a1a;                /* near-black body text on white */
  --muted: #555555;
  --bg: #ffffff;
  --bg-soft: #f4f6f8;
  --bg-softer: #e9edf1;
  --accent: #1565c0;            /* blue for CTAs (white text on it) */
  --accent-soft: #1f4e79;       /* dark blue for headings (strong on white) */
  --accent-dim: #e3f0ff;
  --accent-hover: #0d47a1;
  --border: #d4d9de;
  --radius: 8px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--fg); background: var(--bg);
  /* One step larger base (16 → 18px) so all rem sizes scale up for
     readability (Walter 2026-06-04). */
  font-size: 112.5%;
  line-height: 1.55;
}
/* Header is fixed at the top — body padding compensates so content
   doesn't slide under it. */
body { padding-top: 65px; }
@media (max-width: 600px) { body { padding-top: 60px; } }

/* ── Header / footer ──────────────────────────────────────────────── */
/* Scoped to the direct body child so it doesn't match <header class="stage-head"> inside cards. */
body > header {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 1rem 2rem; border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
}
body > header .brand {
  font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em;
  color: var(--accent-soft); text-decoration: none;
  display: inline-flex; align-items: center; line-height: 0;
}
body > header .brand img { height: 32px; width: auto; display: block; }
@media (max-width: 600px) { body > header .brand img { height: 28px; } }
body > header nav { margin-left: auto; display: flex; gap: 1.5rem; align-items: center; }
body > header nav a {
  color: var(--muted); text-decoration: none; font-size: 0.95rem;
  padding: 0.35rem 0;
}
body > header nav a:hover { color: var(--fg); }

main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

footer {
  margin-top: 4rem; padding: 1.5rem 2rem;
  border-top: 1px solid var(--border); color: var(--muted);
  font-size: 0.9rem; text-align: center;
}
footer a { color: var(--muted); }

/* ── Component-page hero (used by ComponentLanding.astro) ────────── */
.hero h1 {
  font-size: 2.75rem; margin: 0 0 0.5rem; letter-spacing: -0.015em;
  color: var(--accent-soft);
}
.hero .subtitle { font-size: 1.25rem; color: var(--muted); margin: 0 0 1.5rem; font-style: italic; }
.hero .desc { font-size: 1.05rem; line-height: 1.55; max-width: 60ch; color: var(--fg); }
.price-card {
  background: var(--bg-soft); border-radius: var(--radius);
  padding: 1.25rem 1.5rem; margin: 2rem 0; max-width: 360px;
  border: 1px solid var(--border);
}
.price-card .row { display: flex; justify-content: space-between; margin: 0.25rem 0; }
.price-card .label { color: var(--muted); }
.price-card .amt { font-weight: 700; color: var(--fg); }
.cta-row { display: flex; gap: 1rem; align-items: center; margin-top: 2rem; flex-wrap: wrap; }
.cta {
  background: var(--accent); color: #fff; padding: 0.75rem 1.4rem;
  border-radius: var(--radius); text-decoration: none; font-weight: 600;
  transition: background 120ms ease;
}
.cta:hover { background: var(--accent-hover); }
.cta-secondary { color: var(--accent-soft); text-decoration: none; font-weight: 500; }
.cta-secondary:hover { color: var(--accent); }
section { margin-top: 3rem; }
section h2 { margin: 0 0 1rem; font-size: 1.4rem; letter-spacing: -0.01em; color: var(--accent-soft); }

/* ── Home-page hero ───────────────────────────────────────────────── */
.home-hero { text-align: center; margin: 0 0 3rem; }
.home-hero h1 {
  font-size: 3.5rem; margin: 0 0 0.5rem;
  letter-spacing: -0.025em; font-weight: 700;
  /* Subtle two-tone blue */
  background: linear-gradient(120deg, #9bb8d4 0%, #6cb6ff 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.home-hero .tagline {
  font-size: 1.25rem; color: var(--muted); font-style: italic;
  margin: 0 0 1.25rem;
}
.home-hero .lede {
  font-size: 1.1rem; max-width: 60ch; margin: 0 auto; color: var(--fg);
}

/* ── Pipeline (4 stage cards horizontal) ──────────────────────────── */
.pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 1.25rem;
  row-gap: 2rem;
  margin: 3rem auto;
  max-width: 1280px;
  width: 100%;
}
.stage {
  position: relative;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent-soft);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem 1.5rem;
  color: var(--fg);
  display: flex; flex-direction: column;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
  min-height: 360px;
}
.stage:hover {
  transform: translateY(-8px);
  background: var(--bg-softer);
  box-shadow: 0 14px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(108,182,255,0.15);
}
.stage-head {
  display: flex; flex-direction: column; align-items: center;
  margin-bottom: 1.25rem;
}
.stage-num {
  display: flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem;
  border-radius: 50%;
  background: var(--accent-soft); color: #fff;
  font-weight: 700; font-size: 1rem; line-height: 1;
  margin-bottom: 0.75rem;
}
.stage-name {
  margin: 0 0 0.25rem;
  font-size: 1.25rem; letter-spacing: -0.01em;
}
.stage-name a {
  color: var(--accent-soft); text-decoration: none;
}
.stage-name a:hover { color: var(--accent); }
.stage-tag {
  margin: 0; color: var(--muted); font-size: 0.9rem;
  font-style: italic;
}

.stage-section { margin-top: 1.1rem; }
.stage-section h3 {
  font-size: 0.95rem; letter-spacing: 0.18em;
  color: var(--accent-soft); margin: 0 0 0.45rem; font-weight: 700;
  text-transform: uppercase;
}
.stage-section ul {
  margin: 0; padding: 0; list-style: none;
  font-size: 0.92rem; line-height: 1.45;
  color: var(--fg);
}
.stage-section li { margin: 0; padding: 0; }

.stage-price {
  margin-top: auto; padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  display: flex; justify-content: center;
  gap: 0.5rem; align-items: baseline;
  font-weight: 600; font-size: 0.95rem;
  color: var(--accent-soft);
}
.stage-price .sep { color: var(--border); }

.stage-cta {
  display: inline-block;
  margin-top: 0.85rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  align-self: center;
  position: relative;
  z-index: 2;
  transition: background 120ms ease;
}
.stage-cta:hover { background: var(--accent-hover); }

/* ── Bundle card ──────────────────────────────────────────────────── */
.bundle { margin-top: 4rem; }
.bundle-card {
  background: var(--accent-dim);
  border-radius: var(--radius);
  padding: 2rem 2.5rem;
  text-align: center;
  border: 1px solid var(--border);
}
.bundle-card h2 { margin: 0 0 0.5rem; font-size: 1.5rem; color: var(--accent-soft); }
.bundle-price {
  font-size: 2rem; font-weight: 700; color: var(--accent-soft);
  margin: 0.25rem 0 0.5rem;
}
.bundle-price .bundle-sub {
  font-size: 1rem; font-weight: 400; color: var(--muted);
}
.bundle-detail { margin: 0.25rem 0; font-size: 1rem; color: var(--fg); }
.bundle-detail-muted { color: var(--muted); font-size: 0.9rem; margin-top: 0.25rem; }
.bundle .cta-row { justify-content: center; }

/* ── Coming Soon (public splash on 4d-360.com + www) ─────────────── */
.coming-soon {
  max-width: 720px;
  margin: 6rem auto 4rem;
  text-align: center;
  padding: 0 1rem;
}
.coming-soon h1 {
  font-size: 4rem; margin: 0 0 0.5rem;
  letter-spacing: -0.025em; font-weight: 700;
  background: linear-gradient(120deg, #9bb8d4 0%, #6cb6ff 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.cs-tagline { font-size: 1.2rem; color: var(--muted); font-style: italic; margin: 0 0 2rem; }
.cs-lede { font-size: 1.05rem; line-height: 1.6; max-width: 60ch; margin: 0 auto 2.5rem; color: var(--fg); }
.cs-cta-line { font-size: 1rem; margin: 0 0 0.75rem; color: var(--fg); font-weight: 500; }
#cs-form {
  display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap;
  max-width: 480px; margin: 0 auto;
}
#cs-form input[type="email"] {
  flex: 1; min-width: 16rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: 1rem;
  background: var(--bg-soft); color: var(--fg);
}
#cs-form input[type="email"]::placeholder { color: var(--muted); }
#cs-form button {
  background: var(--accent); color: #fff; border: 0;
  padding: 0.65rem 1.4rem; border-radius: var(--radius);
  font-weight: 600; font-size: 1rem; cursor: pointer;
}
#cs-form button:hover { background: var(--accent-hover); }
#cs-msg { margin: 1rem 0 0; min-height: 1.25rem; font-size: 0.95rem; }
#cs-msg.ok  { color: #7cc878; }
#cs-msg.err { color: #e07070; }
@media (max-width: 600px) {
  .coming-soon { margin-top: 3rem; }
  .coming-soon h1 { font-size: 3rem; }
}

/* ── Waitlist form (component pages) ──────────────────────────────── */
.waitlist {
  background: var(--bg-soft); padding: 2rem 2rem;
  border-radius: var(--radius); max-width: 560px;
  border: 1px solid var(--border);
}
.waitlist label {
  display: block; margin: 1rem 0 0.25rem;
  font-size: 0.95rem; font-weight: 500;
}
.waitlist label .optional { color: var(--muted); font-weight: 400; }
.waitlist input, .waitlist textarea {
  width: 100%; padding: 0.55rem 0.75rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: 1rem;
  background: var(--bg); color: var(--fg);
}
.waitlist input::placeholder, .waitlist textarea::placeholder { color: var(--muted); }
.waitlist textarea { resize: vertical; }
.waitlist button {
  margin-top: 1rem; background: var(--accent); color: #fff; border: 0;
  padding: 0.7rem 1.4rem; border-radius: var(--radius);
  font-weight: 600; font-size: 1rem; cursor: pointer;
}
.waitlist button:hover { background: var(--accent-hover); }
.waitlist #waitlist-msg { margin: 0.75rem 0 0; min-height: 1.25rem; font-size: 0.95rem; }
.waitlist #waitlist-msg.ok { color: #7cc878; }
.waitlist #waitlist-msg.err { color: #e07070; }

/* ── Video sections (per-component, alternating tone) ────────────── */
.video-section {
  margin: 2rem 0;
  padding: 3rem 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.video-section.dark {
  background: var(--bg-soft);
  color: var(--fg);
}
.video-section.light {
  background: #f5f6f7;
  color: #111;
  border-color: #d7d9dc;
}
.video-section.light a { color: #1f4e79; }
.video-section.light a:hover { color: #2a6ba7; }
.video-section.light .cta-secondary { color: #1f4e79; }
.video-section.light h2 { color: #1f4e79; }
.video-section.dark h2 { color: var(--accent-soft); }

.video-section-inner {
  max-width: 1100px; margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 2.5rem;
  align-items: center;
}
.video-section:nth-of-type(even) .video-section-inner {
  /* Visually unused (we alternate dark/light below), but keeps a hook. */
}
/* Swap text/video order on alternating sections so the page feels less monotonous */
.video-section.light .video-section-inner {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
}
.video-section.light .video-section-text { order: 2; }
.video-section.light .video-section-video { order: 1; }

.video-section-text h2 {
  margin: 0 0 0.75rem;
  font-size: 1.8rem; letter-spacing: -0.015em;
}
.video-section-text p {
  margin: 0 0 1.25rem;
  font-size: 1.2rem; line-height: 1.5;
  max-width: 38ch;
}

.video-frame {
  position: relative;
  width: 100%; aspect-ratio: 16 / 9;
  border-radius: var(--radius); overflow: hidden;
  background: #000;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}
.video-frame iframe,
.video-frame video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; border: 0;
  object-fit: contain;            /* letterbox the redacted MP4s (1280x720, 16:9) */
  background: #000;
}
/* Mask a centre-top watermark burned into the source video.
   Soft-edged ellipse: hard at the centre, feathered at the edges, so it
   reads more as a darkened vignette than a censor strip.
   CSS can't actually content-aware-inpaint across a cross-origin iframe;
   for a clean removal, run ffmpeg `delogo` on the source file and
   re-upload. */
.video-redact {
  position: absolute;
  top: 2%;
  left: 50%;
  transform: translateX(-50%);
  width: 22%;
  height: 6%;
  background: radial-gradient(
    ellipse 70% 80% at center,
    #0a0a0a 0%,
    #0a0a0a 50%,
    rgba(10, 10, 10, 0.85) 75%,
    rgba(10, 10, 10, 0) 100%
  );
  pointer-events: none;
  z-index: 2;
}

.video-placeholder {
  width: 100%; aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background: rgba(108,182,255,0.04);
  display: flex; align-items: center; justify-content: center;
}

/* Stacked-image slot — used in place of the video frame when a section
   has multiple "before / after" stills instead of a clip. */
.video-image-stack {
  display: flex; flex-direction: column;
  gap: 0.75rem;
}
.video-image-stack img {
  width: 100%; height: auto; display: block;
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  background: #000;
}
.video-section.light .video-placeholder {
  border-color: #c4c7cc;
  background: rgba(31,78,121,0.04);
}
.video-placeholder-label {
  color: var(--muted);
  font-size: 1rem; font-style: italic;
}
.video-section.light .video-placeholder-label { color: #6c7077; }

@media (max-width: 800px) {
  .video-section { padding: 2rem 1.25rem; }
  .video-section-inner,
  .video-section.light .video-section-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .video-section.light .video-section-text { order: 1; }
  .video-section.light .video-section-video { order: 2; }
}

/* ── Legal pages (privacy + terms) ────────────────────────────────── */
.legal {
  max-width: 760px;
  margin: 3rem auto 5rem;
  line-height: 1.65;
  color: var(--fg);
}
.legal h1 {
  font-size: 2.5rem; margin: 0 0 0.25rem;
  letter-spacing: -0.02em; color: var(--accent-soft);
}
.legal h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.35rem; color: var(--accent-soft);
}
.legal h3 {
  margin: 1.5rem 0 0.4rem;
  font-size: 1.05rem; color: var(--fg);
  font-weight: 600;
}
.legal p, .legal ul, .legal ol { margin: 0.75rem 0; }
.legal ul, .legal ol { padding-left: 1.5rem; }
.legal li { margin: 0.25rem 0; }
.legal a { color: var(--accent); }
.legal a:hover { color: var(--accent-hover); }
.legal-meta {
  color: var(--muted); font-style: italic; margin: 0 0 1.5rem;
}
.legal-back {
  margin-top: 3rem; padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
}
.legal-table {
  width: 100%; border-collapse: collapse; margin: 1rem 0;
  font-size: 0.92rem;
}
.legal-table th, .legal-table td {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top; text-align: left;
}
.legal-table th { color: var(--accent-soft); font-weight: 600; }
.legal-table code { font-size: 0.9em; color: var(--muted); }

.legal-links {
  margin: 0.4rem 0 0; font-size: 0.85rem;
}
.legal-links a { color: var(--muted); margin: 0 0.15rem; }
.legal-links a:hover { color: var(--fg); }

.footer-address {
  margin: 0.6rem 0 0;
  font-style: normal;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--muted);
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; }
}
@media (max-width: 600px) {
  .pipeline { grid-template-columns: 1fr; }
  body > header { padding: 0.75rem 1rem; flex-wrap: wrap; }
  body > header nav { gap: 1rem; }
  main { padding: 1.5rem 1rem 3rem; }
  .home-hero h1 { font-size: 2.5rem; }
  .bundle-card { padding: 1.5rem; }
  .bundle-price { font-size: 1.6rem; }
}

/* ── SaaS performance table (coming-soon + index) ──────────────────── */
.perf-table-wrap {
  margin: 1.25rem auto 0;
  max-width: 760px;
  overflow-x: auto;
}
.perf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.perf-table th, .perf-table td {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--border);
  text-align: right;
  vertical-align: middle;
}
.perf-table th:first-child, .perf-table td:first-child {
  text-align: left;
}
.perf-table thead th {
  font-family: system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-soft);
  border-bottom-width: 2px;
}
.perf-table tbody tr:hover { background: rgba(0, 0, 0, 0.03); }

/* vs-LiDAR comparison: highlight the 4D-360 (last) column + footnote */
.vs-lidar-table th:last-child,
.vs-lidar-table td:last-child { background: rgba(31, 95, 214, 0.08); }
.vs-lidar-table th:last-child { color: var(--accent, #1f5fd6); }
.overview-foot {
  max-width: 760px;
  margin: 1rem auto 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted, #777);
}

/* ── Hero demo block (restored from legacy 4d-360.live) ───────────── */
.hero-demo {
  max-width: 980px;
  margin: 0 auto 2.5rem;
  padding: 2rem 1rem 0;
  text-align: center;
}
.hero-demo-title {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0.5rem 0 0.75rem;
}
/* Byline / tagline under the headline — smaller than the title, heavier than
   the descriptive sub. */
.hero-demo-byline {
  font-size: clamp(1.4rem, 3.2vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 600;
  margin: 0 0 1.25rem;
  color: var(--text, #1a1a1a);
}
.hero-demo-accent { color: var(--accent, #1f5fd6); }
.hero-demo-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}
.hero-demo-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.hero-demo-sub {
  max-width: 760px;
  margin: 1.25rem auto 0;
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--muted, #555);
}

/* ── videos.4d-360.com — channel catalog + admin ──────────────────── */
.videos-hero {
  max-width: 900px; margin: 0 auto 2.5rem; text-align: center;
}
.videos-hero h1 {
  margin: 0.5rem 0 0.6rem;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
}
.videos-hero .lede {
  margin: 0 auto; max-width: 60ch; color: var(--muted);
}
.videos-loading, .videos-error {
  text-align: center; color: var(--muted); margin: 1.5rem 0;
}
.videos-error { color: #ff8b8b; }
.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}
.videos-grid .card {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.videos-grid .card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(0,0,0,0.5);
  border-color: #3a3a3a;
}
.videos-grid .thumb {
  position: relative; display: block; aspect-ratio: 16 / 9;
  background: #000; overflow: hidden; cursor: pointer;
}
.videos-grid .thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.videos-grid .thumb-placeholder {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; color: var(--muted); background: #111;
}
.videos-grid .play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0); transition: background 180ms ease;
}
.videos-grid .card:hover .play { background: rgba(0,0,0,0.25); }
.videos-grid .play svg {
  width: 64px; height: 64px; opacity: 0.85;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6));
}
.videos-grid .duration {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(0,0,0,0.85); color: #fff; font-size: 0.78rem;
  padding: 2px 6px; border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.videos-grid .meta { padding: 0.9rem 1rem 1.1rem; }
.videos-grid .meta h3 {
  margin: 0 0 0.25rem; font-size: 1.05rem; letter-spacing: -0.01em;
  color: var(--fg);
}
.videos-grid .meta p {
  margin: 0 0 0.5rem; color: var(--muted);
  font-size: 0.88rem; line-height: 1.5;
}
.videos-grid .meta p:last-child { margin-bottom: 0; }

.player-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.92);
  display: none; align-items: center; justify-content: center;
  z-index: 50; padding: 2rem;
}
.player-overlay.open { display: flex; }
.player-box {
  position: relative; width: 100%; max-width: 1080px; aspect-ratio: 16 / 9;
  background: #000; border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}
.player-box video {
  width: 100%; height: 100%; display: block;
}
.player-close {
  position: absolute; top: -2.4rem; right: 0;
  background: transparent; border: 0;
  color: #fff; font-size: 1.5rem; cursor: pointer;
  padding: 0.3rem 0.6rem;
}
.player-close:hover { color: var(--accent); }

/* Primary close affordance: pill button anchored top-left of the overlay
   so it doesn't sit on top of the video controls. Reads "← Back to
   channel" to make the destination explicit. */
.player-back {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 60;
  display: none;             /* shown only while the overlay is open */
  align-items: center; gap: 0.4rem;
  padding: 0.55rem 1rem;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.player-overlay.open ~ .player-back,
.player-overlay.open .player-back { display: inline-flex; }
.player-back:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.32);
}
.player-back:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.player-back span { font-size: 1.1em; line-height: 1; }

/* AI visual-intelligence quote block (shared: catalog + apex) */
.ai-quote {
  margin: 0.85rem 0;
  padding: 0.65rem 0.85rem;
  background: rgba(108, 182, 255, 0.06);
  border-left: 3px solid var(--accent-soft);
  border-radius: 0 4px 4px 0;
}
.ai-quote .ai-label {
  display: inline-block;
  font-size: 0.7rem; letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-soft); font-weight: 700;
  margin-bottom: 0.3rem;
}
.ai-quote p {
  margin: 0; color: var(--fg);
  font-size: 0.82rem; line-height: 1.5;
  font-style: italic;
}
.source-meta {
  font-size: 0.78rem; color: var(--muted);
  margin-top: 0.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Admin UI */
.admin-section { max-width: 720px; margin: 0 auto 2rem; }
.admin-section h2 {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.25rem; color: var(--accent-soft);
}
.admin-form {
  display: flex; flex-direction: column; gap: 0.75rem;
  background: var(--bg-soft);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem;
}
.admin-form label {
  display: flex; flex-direction: column; gap: 0.3rem;
  font-size: 0.85rem; color: var(--muted);
}
.admin-form input[type=text], .admin-form input:not([type=file]), .admin-form textarea {
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 0.45rem 0.6rem; font-size: 0.95rem;
  font-family: inherit;
}
.admin-form textarea { resize: vertical; min-height: 4rem; }
.admin-form input[type=file] {
  background: transparent; color: var(--fg);
  border: 1px dashed var(--border); border-radius: 4px;
  padding: 0.4rem; font-size: 0.85rem;
}
.admin-form button {
  align-self: flex-start;
  padding: 0.55rem 1.1rem;
  background: var(--accent); color: #fff;
  border: 0; border-radius: 4px;
  font-weight: 600; cursor: pointer;
}
.admin-form button:hover { background: var(--accent-hover); }
.admin-form button.danger {
  background: #6b1f1f; color: #ffdada;
}
.admin-form button.danger:hover { background: #8b2929; }
.admin-form .admin-form-row {
  display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap;
}
.admin-status[data-kind="ok"]      { color: #4ee08b; }
.admin-status[data-kind="err"]     { color: #ff8b8b; }
.admin-status[data-kind="pending"] { color: var(--muted); }
.admin-list {
  display: flex; flex-direction: column; gap: 0.6rem;
}
.admin-row {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.admin-row summary {
  cursor: pointer; padding: 0.65rem 0.85rem;
  display: flex; gap: 0.8rem; align-items: baseline;
}
.admin-row summary .dur {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem; color: var(--muted); min-width: 3rem;
}
.admin-row summary .slug {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem; color: var(--muted); margin-left: auto;
}
.admin-row[open] summary { border-bottom: 1px solid var(--border); }
.admin-row .admin-form { border: 0; border-radius: 0; }

/* ── Industries section: tabs ─────────────────────────────────────── */
.industry-tabs {
  display: flex; flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin: 1.5rem auto 1.5rem;
  padding: 4px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  width: fit-content;
  max-width: 100%;
}
.industry-tab {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.005em;
  padding: 0.55rem 1.25rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
  white-space: nowrap;
}
.industry-tab:hover { color: var(--fg); }
.industry-tab.is-active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(108, 182, 255, 0.25);
}
.industry-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Only the active panel is visible -- swap is animated for a small touch
   of polish. The [hidden] attribute set by the script removes the panel
   from the layout entirely; the .is-active class fades the new one in. */
.industry { display: none; }
.industry.is-active { display: block; animation: industry-in 220ms ease-out both; }
@keyframes industry-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Mobile: tabs scroll horizontally if they overflow */
@media (max-width: 600px) {
  .industry-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    width: 100%;
    justify-content: flex-start;
    border-radius: 12px;
  }
  .industry-tab { padding: 0.5rem 1rem; font-size: 0.88rem; }
}
