/*
  explainer.dk – site styles on top of Basecoat (https://basecoatui.com).
  Basecoat's CDN bundle ships Tailwind's base + Basecoat components, but no layout utilities,
  so layout lives here. Everything uses Basecoat's design tokens (--background, --border, ...).
  Styles are placed in Basecoat's cascade layers so Basecoat components keep working.
*/

:root {
  --font-sans: "Geist", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --brand: oklch(0.51 0.23 277);
  --brand-2: oklch(0.62 0.13 215);
  --brand-soft: oklch(0.955 0.025 277);
  --primary: var(--brand);
  --primary-foreground: oklch(0.985 0 0);
  --ring: oklch(0.65 0.17 277);
  --success: oklch(0.52 0.13 155);
  --success-soft: oklch(0.95 0.05 155);
  --warning: oklch(0.72 0.16 65);
  --warning-soft: oklch(0.96 0.05 85);
  --warning-foreground: oklch(0.48 0.12 55);
}

.dark {
  --brand: oklch(0.68 0.17 277);
  --brand-2: oklch(0.72 0.12 215);
  --brand-soft: oklch(0.3 0.07 277);
  --primary: var(--brand);
  --primary-foreground: oklch(0.16 0.03 277);
  --ring: oklch(0.6 0.15 277);
  --success: oklch(0.75 0.14 155);
  --success-soft: oklch(0.3 0.06 155);
  --warning: oklch(0.78 0.15 70);
  --warning-soft: oklch(0.32 0.06 70);
  --warning-foreground: oklch(0.85 0.12 75);
}

@layer base {
  html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
  body {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
  }
  main { flex: 1; }
  h1, h2, h3 { letter-spacing: -0.02em; text-wrap: balance; }
  p { text-wrap: pretty; }
  [x-cloak] { display: none !important; }
}

@layer components {
  /* ---------- Layout ---------- */
  .container { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: 1rem; }
  .container-narrow { max-width: 50rem; }
  @media (min-width: 640px) { .container { padding-inline: 1.5rem; } }

  .stack { display: flex; flex-direction: column; gap: var(--gap, 1rem); }
  .row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, 0.75rem); }
  .row-between { justify-content: space-between; }
  .row-nowrap { flex-wrap: nowrap; }
  .grow { flex: 1; min-width: 0; }
  .grid-2, .grid-3, .grid-4 { display: grid; gap: var(--gap, 1.5rem); grid-template-columns: minmax(0, 1fr); }
  @media (min-width: 768px) {
    .grid-2, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  }
  @media (min-width: 1024px) { .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
  .split { display: grid; gap: 1.5rem; }
  @media (min-width: 1024px) { .split { grid-template-columns: minmax(0, 1fr) 21rem; align-items: start; } }

  .mt-1 { margin-top: 0.25rem; } .mt-2 { margin-top: 0.5rem; } .mt-3 { margin-top: 0.75rem; }
  .mt-4 { margin-top: 1rem; } .mt-6 { margin-top: 1.5rem; } .mt-8 { margin-top: 2rem; } .mt-12 { margin-top: 3rem; }
  .mb-2 { margin-bottom: 0.5rem; } .mb-4 { margin-bottom: 1rem; } .mb-6 { margin-bottom: 1.5rem; }
  .w-full { width: 100%; }
  .text-center { text-align: center; }
  .text-sm { font-size: 0.875rem; }
  .text-xs { font-size: 0.75rem; }
  .font-medium { font-weight: 500; }
  .font-semibold { font-weight: 600; }
  .muted { color: var(--muted-foreground); }
  .faint { opacity: 0.75; }
  .nowrap { white-space: nowrap; }
  .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pre-line { white-space: pre-line; }
  .link { color: var(--brand); font-weight: 500; text-underline-offset: 3px; }
  .link:hover { text-decoration: underline; }

  /* ---------- Typography ---------- */
  .display { font-size: clamp(2.25rem, 4.2vw + 1rem, 3.75rem); line-height: 1.05; font-weight: 700; letter-spacing: -0.04em; }
  .h2 { font-size: clamp(1.75rem, 2vw + 1rem, 2.5rem); line-height: 1.15; font-weight: 700; letter-spacing: -0.03em; }
  .h3 { font-size: 1.125rem; line-height: 1.4; font-weight: 600; }
  .page-title { font-size: clamp(1.625rem, 1.5vw + 1rem, 2.125rem); line-height: 1.2; font-weight: 700; letter-spacing: -0.03em; }
  .lead { font-size: 1.125rem; line-height: 1.7; color: var(--muted-foreground); }
  @media (min-width: 768px) { .lead { font-size: 1.1875rem; } }
  .eyebrow { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; font-weight: 600; color: var(--brand); }
  .gradient-text {
    background: linear-gradient(95deg, var(--brand), var(--brand-2));
    -webkit-background-clip: text; background-clip: text; color: transparent;
  }

  /* ---------- Header & footer ---------- */
  .site-header {
    position: sticky; top: 0; z-index: 40;
    background: color-mix(in oklab, var(--background) 85%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
  }
  .header-inner { position: relative; display: flex; align-items: center; gap: 0.75rem; height: 4rem; }
  .brand { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.125rem; letter-spacing: -0.03em; }
  .brand-logo { width: 1.75rem; height: 1.75rem; }
  .brand-logo-full { display: block; width: auto; height: 3.25rem; }
  .brand-tld { color: var(--brand); }
  .main-nav { display: flex; gap: 0.125rem; margin-left: 1.25rem; }
  .main-nav a { padding: 0.5rem 0.75rem; border-radius: 0.5rem; font-size: 0.875rem; font-weight: 500; color: var(--muted-foreground); }
  .main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--foreground); background: var(--accent); }
  .header-actions { margin-left: auto; display: flex; align-items: center; gap: 0.375rem; }
  .menu-toggle, .nav-account { display: none !important; }
  @media (max-width: 767px) {
    .main-nav {
      display: none; position: absolute; top: 4rem; left: -1rem; right: -1rem; margin: 0;
      flex-direction: column; padding: 0.5rem 1rem 1rem; background: var(--background);
      border-bottom: 1px solid var(--border); box-shadow: 0 16px 24px -16px rgb(0 0 0 / 0.2);
    }
    .main-nav.is-open { display: flex; }
    .main-nav a { padding: 0.75rem 0; font-size: 1rem; border-radius: 0; }
    .main-nav a:hover { background: none; }
    .menu-toggle { display: inline-flex !important; }
    .nav-account { display: block !important; }
    .desktop-only { display: none !important; }
  }

  .site-footer { border-top: 1px solid var(--border); padding-block: 2.5rem; margin-top: 5rem; font-size: 0.875rem; color: var(--muted-foreground); }
  .footer-inner { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; align-items: center; }
  .footer-links { display: flex; flex-wrap: wrap; gap: 1.25rem; }
  .footer-links a:hover { color: var(--foreground); }

  .flash { margin-top: 1.25rem; }

  /* ---------- Landing page ---------- */
  .section { padding-block: 4.5rem; }
  @media (min-width: 768px) { .section { padding-block: 6rem; } }
  .section-tinted { background: color-mix(in oklab, var(--muted) 70%, transparent); border-block: 1px solid var(--border); }
  .section-header { max-width: 42rem; margin-bottom: 3rem; }
  .section-header.centered { margin-inline: auto; text-align: center; }

  .hero { position: relative; isolation: isolate; overflow: hidden; padding-block: 3.5rem 5rem; }
  @media (min-width: 1024px) { .hero { padding-block: 5.5rem 7rem; } }
  .hero::before {
    content: ""; position: absolute; z-index: -1; inset: -12rem -20% 0 -20%;
    -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
    mask-image: linear-gradient(to bottom, #000 55%, transparent);
    background:
      radial-gradient(40% 50% at 30% 40%, color-mix(in oklab, var(--brand) 22%, transparent), transparent 70%),
      radial-gradient(35% 45% at 75% 35%, color-mix(in oklab, var(--brand-2) 20%, transparent), transparent 70%);
  }

  .hero-video { max-width: 60rem; margin-inline: auto; box-shadow: 0 24px 64px -24px rgb(0 0 0 / 0.35); }

  /* Example videos: one card per example, swiped or scrolled (scroll-snap) or picked with the arrows and buttons.
     The next card peeks in at the edge, dimmed, so the row reads as a carousel. */
  .carousel-stage { position: relative; }
  .carousel-track {
    position: relative; display: flex; gap: 1rem; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scrollbar-width: none;
  }
  .carousel-track::-webkit-scrollbar { display: none; }
  .carousel-slide {
    flex: 0 0 calc(100% - 2.5rem); min-width: 0; scroll-snap-align: start; scroll-snap-stop: always;
    transition: opacity 0.3s;
  }
  @media (min-width: 768px) { .carousel-slide { flex-basis: calc(100% - 5rem); } }
  .carousel-slide:not(.is-active) { opacity: 0.45; cursor: pointer; }
  .carousel-slide:not(.is-active) > * { pointer-events: none; }
  /* Arrows on the cards' edges; on phones the cards are swiped. */
  .carousel-arrow {
    position: absolute; top: 50%; z-index: 1; display: none; place-items: center; width: 2.75rem; height: 2.75rem;
    border-radius: 999px; border: 1px solid var(--border); background: var(--background); color: var(--foreground);
    box-shadow: 0 6px 20px rgb(0 0 0 / 0.14); cursor: pointer; transform: translateY(-50%); transition: opacity 0.2s, transform 0.2s;
  }
  .carousel-arrow[data-side="prev"] { left: -1rem; }
  .carousel-arrow[data-side="next"] { right: -1rem; }
  .carousel-arrow:hover { transform: translateY(-50%) scale(1.08); }
  .carousel-arrow:disabled { opacity: 0; pointer-events: none; }
  @media (min-width: 768px) { .carousel-arrow { display: grid; } }
  .example {
    display: grid; gap: 1.5rem 3rem; align-items: center; padding: 1rem;
    border: 1px solid var(--border); border-radius: 1.25rem; background: var(--card);
  }
  @media (min-width: 768px) { .example { padding: 1.5rem; } }
  @media (min-width: 1024px) { .example { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); } }
  .example-link { display: inline-flex; align-items: center; gap: 0.375rem; align-self: flex-start; }
  .check-list-inline { display: flex; flex-wrap: wrap; gap: 0.75rem 1.75rem; }

  /* ---------- Video & timeline ---------- */
  .video-frame { position: relative; border-radius: 1rem; overflow: hidden; background: #000; border: 1px solid var(--border); }
  .video-frame video { display: block; width: 100%; max-height: 72vh; background: #000; }
  /* The frame takes the video's shape, centred, so what lies on top of the video (the webcam) lines up with it. */
  .video-frame[data-format="Square"] { width: min(100%, 72vh); margin-inline: auto; }
  .video-frame[data-format="Portrait"] { width: min(100%, calc(72vh * 9 / 16)); margin-inline: auto; }
  .timeline { position: relative; height: 1.25rem; }
  .timeline-track, .timeline-progress {
    position: absolute; top: 50%; height: 0.3125rem; transform: translateY(-50%); border-radius: 999px;
  }
  .timeline-track { left: 0; right: 0; background: var(--muted); }
  .timeline-progress { left: 0; background: var(--brand); }
  .timeline-marker {
    position: absolute; top: 50%; width: 0.875rem; height: 0.875rem; padding: 0; border-radius: 999px; cursor: pointer;
    background: var(--warning); border: 2px solid var(--background); transform: translate(-50%, -50%);
    transition: transform 0.15s;
  }
  .timeline-marker:hover { transform: translate(-50%, -50%) scale(1.3); }
  .timestamp {
    display: inline-flex; align-items: center; justify-content: center; min-width: 3rem;
    font-variant-numeric: tabular-nums; font-weight: 600; font-size: 0.75rem; line-height: 1.5;
    padding: 0.125rem 0.5rem; border-radius: 999px; border: 0; cursor: pointer;
    background: var(--brand-soft); color: var(--brand); white-space: nowrap;
  }
  button.timestamp:hover { background: var(--brand); color: var(--primary-foreground); }

  /* ---------- Steps & features ---------- */
  .steps { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
  @media (min-width: 640px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (min-width: 1024px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  .step { padding: 1.5rem; border-radius: 1rem; border: 1px solid var(--border); background: var(--card); }
  .step h3 { font-weight: 600; margin-bottom: 0.375rem; }
  .step p { font-size: 0.875rem; line-height: 1.6; color: var(--muted-foreground); }
  .step-number, .icon-tile {
    display: grid; place-items: center; width: 2.5rem; height: 2.5rem; flex: none; border-radius: 0.75rem;
    background: var(--brand-soft); color: var(--brand); font-weight: 700;
  }
  .step-number { margin-bottom: 1rem; }
  .feature { display: flex; gap: 1rem; }
  .feature h3 { font-weight: 600; margin-bottom: 0.25rem; }
  .feature p { font-size: 0.9375rem; line-height: 1.6; color: var(--muted-foreground); }

  .faq details { border-bottom: 1px solid var(--border); padding-block: 1.125rem; }
  .faq summary { display: flex; justify-content: space-between; gap: 1rem; cursor: pointer; list-style: none; font-weight: 600; }
  .faq summary::-webkit-details-marker { display: none; }
  .faq summary::after { content: "+"; color: var(--muted-foreground); font-size: 1.25rem; line-height: 1; font-weight: 400; }
  .faq details[open] summary::after { content: "–"; }
  .faq details p { margin-top: 0.625rem; color: var(--muted-foreground); line-height: 1.65; }

  .cta-band {
    border-radius: 1.5rem; padding: 3rem 1.5rem; text-align: center; color: #fff;
    background: radial-gradient(120% 140% at 0% 0%, #4338ca, #0e7490 75%);
  }
  .cta-band p { color: rgb(255 255 255 / 0.85); }
  .cta-band .btn[data-variant="secondary"] { background: #fff; color: #1e1b4b; }

  /* ---------- Pricing ---------- */
  .price { font-size: 3rem; line-height: 1; font-weight: 700; letter-spacing: -0.04em; }
  .price small { font-size: 1rem; font-weight: 500; letter-spacing: 0; color: var(--muted-foreground); }
  .price-list td:last-child, .price-list th:last-child { text-align: right; }
  .check-list { display: grid; gap: 0.625rem; font-size: 0.9375rem; }
  .check-list li { display: flex; gap: 0.625rem; align-items: flex-start; }
  .check-list svg { flex: none; margin-top: 0.1875rem; color: var(--brand); }
  .card-fill > section { flex: 1; }
  .card.highlight { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), 0 24px 48px -24px color-mix(in oklab, var(--brand) 55%, transparent); }

  /* ---------- Pages ---------- */
  .page-header { padding-block: 2.5rem 1.75rem; }
  .back-link { display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.875rem; color: var(--muted-foreground); margin-bottom: 0.75rem; }
  .back-link:hover { color: var(--foreground); }

  .status {
    display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.1875rem 0.625rem; border-radius: 999px;
    font-size: 0.75rem; font-weight: 600; white-space: nowrap; background: var(--muted); color: var(--muted-foreground);
  }
  .status::before { content: ""; width: 0.375rem; height: 0.375rem; border-radius: 999px; background: currentColor; }
  .status[data-tone="info"] { background: var(--brand-soft); color: var(--brand); }
  .status[data-tone="warning"] { background: var(--warning-soft); color: var(--warning-foreground); }
  .status[data-tone="success"] { background: var(--success-soft); color: var(--success); }
  .status[data-tone="danger"] { background: color-mix(in oklab, var(--destructive) 14%, transparent); color: var(--destructive); }

  .tracker { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; }
  .tracker-step { display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.75rem; line-height: 1.3; color: var(--muted-foreground); }
  .tracker-step::before { content: ""; height: 0.3125rem; border-radius: 999px; background: var(--muted); }
  .tracker-step[data-state="done"] { color: var(--foreground); }
  .tracker-step[data-state="done"]::before { background: var(--brand); }
  .tracker-step[data-state="current"] { color: var(--foreground); font-weight: 600; }
  .tracker-step[data-state="current"]::before { background: linear-gradient(90deg, var(--brand) 0 50%, color-mix(in oklab, var(--brand) 30%, var(--muted)) 50%); }
  @media (max-width: 520px) { .tracker-step:not([data-state="current"]) span { display: none; } }

  .order-card {
    display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; border-radius: 0.875rem;
    border: 1px solid var(--border); background: var(--card); transition: border-color 0.15s, box-shadow 0.15s;
  }
  .order-card:hover { border-color: color-mix(in oklab, var(--brand) 40%, var(--border)); box-shadow: 0 10px 24px -16px rgb(0 0 0 / 0.3); }
  .thumb {
    display: grid; place-items: center; width: 3rem; height: 3rem; flex: none; overflow: hidden;
    border-radius: 0.75rem; background: var(--brand-soft); color: var(--brand);
  }
  .thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

  .dl { display: grid; gap: 1rem; }
  .dl dt { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted-foreground); }
  .dl dd { margin-top: 0.1875rem; font-size: 0.875rem; overflow-wrap: anywhere; }
  .bullets { display: grid; gap: 0.375rem; padding-left: 1.125rem; list-style: disc; font-size: 0.875rem; }
  .bullets li::marker { color: var(--brand); }
  .file-list { display: grid; gap: 0.5rem; }
  .file-chip {
    display: flex; align-items: center; gap: 0.625rem; min-width: 0; padding: 0.5rem 0.75rem;
    border: 1px solid var(--border); border-radius: 0.625rem; font-size: 0.875rem; background: var(--card);
  }
  a.file-chip:hover { border-color: var(--brand); }
  .file-chip .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .file-chip svg { flex: none; color: var(--muted-foreground); }
  .file-chip a.name:hover { color: var(--brand); }
  .file-chip .logo-thumb { width: 1.5rem; height: 1.5rem; flex: none; object-fit: contain; border-radius: 0.25rem; background: #fff; }
  .recording-item { display: grid; gap: 0.375rem; }

  /* ---------- Forms ---------- */
  .option-cards { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
  /* Four choices read better as two rows of two than as three and one. */
  @media (min-width: 640px) { .option-cards[data-columns="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (min-width: 640px) { .option-cards[data-columns="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  .length-options { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); }
  @media (min-width: 640px) { .length-options { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
  .length-options .option-card { padding: 0.625rem 0.75rem; }
  /* A small outline of the video's shape, on a line of the same height for all three. */
  .format-shape { display: flex; align-items: center; height: 2.5rem; margin-bottom: 0.25rem; }
  .format-shape::before { content: ""; display: block; height: 100%; aspect-ratio: 1; border: 2px solid var(--brand); border-radius: 0.25rem; }
  .format-shape[data-format="Landscape"]::before { aspect-ratio: 16 / 9; }
  .format-shape[data-format="Portrait"]::before { aspect-ratio: 9 / 16; }
  .option-card {
    position: relative; display: flex; flex-direction: column; gap: 0.25rem; padding: 0.875rem 1rem; cursor: pointer;
    border: 1px solid var(--border); border-radius: 0.75rem; background: var(--card); transition: border-color 0.15s, background 0.15s;
  }
  .option-card:hover { border-color: color-mix(in oklab, var(--brand) 45%, var(--border)); }
  .option-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
  .option-card:has(input:focus-visible) { outline: 2px solid var(--ring); outline-offset: 2px; }
  .option-card input { position: absolute; opacity: 0; pointer-events: none; }
  .option-card .title { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 0.9375rem; }
  .option-card .title svg { color: var(--brand); }
  .option-card .desc { font-size: 0.8125rem; line-height: 1.45; color: var(--muted-foreground); }

  .dropzone {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.375rem;
    padding: 1.5rem 1rem; border: 1.5px dashed var(--border); border-radius: 0.75rem; text-align: center; cursor: pointer;
    font-size: 0.875rem; color: var(--muted-foreground); transition: border-color 0.15s, background 0.15s;
  }
  .dropzone:hover, .dropzone.is-dragging { border-color: var(--brand); background: var(--brand-soft); color: var(--foreground); }
  .dropzone strong { color: var(--foreground); font-weight: 600; }
  .dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
  .logo-preview { width: 4.5rem; height: 4.5rem; object-fit: contain; padding: 0.375rem; border-radius: 0.75rem; border: 1px solid var(--border); background: #fff; }

  .points { display: grid; gap: 0.5rem; }
  .point-row { display: flex; align-items: center; gap: 0.5rem; }
  .point-bullet { width: 0.5rem; height: 0.5rem; flex: none; border-radius: 999px; background: var(--brand); }
  .chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
  .chip {
    display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.375rem 0.75rem; border-radius: 999px; cursor: pointer;
    border: 1px dashed var(--border); background: var(--background); font-size: 0.8125rem; color: var(--muted-foreground);
  }
  .chip:hover { border-color: var(--brand); border-style: solid; color: var(--brand); }

  /* A long dialog scrolls inside, so its close button is always in view. */
  .dialog > .dialog-wide { display: flex; flex-direction: column; max-width: 48rem; width: 100%; max-height: calc(100dvh - 2rem); }
  .dialog-wide > section { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
  .guide-body { display: grid; gap: 1rem; font-size: 0.875rem; line-height: 1.6; }
  .guide-body h4 { font-weight: 600; display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.25rem; }
  .guide-body ol, .guide-body ul { padding-left: 1.25rem; display: grid; gap: 0.25rem; }
  .guide-body ol { list-style: decimal; }
  .guide-body ul { list-style: disc; }
  .guide-body .kbd { font-size: 0.75rem; }

  .form-footer {
    position: sticky; bottom: 0; z-index: 10; margin-top: 1.5rem; padding-block: 1rem;
    background: color-mix(in oklab, var(--background) 88%, transparent); backdrop-filter: blur(8px);
    border-top: 1px solid var(--border);
  }

  .overlay {
    position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1rem;
    background: color-mix(in oklab, var(--background) 75%, transparent); backdrop-filter: blur(4px);
  }
  .overlay .card { width: min(26rem, 100%); }

  /* ---------- Review ---------- */
  .review-grid { display: grid; gap: 1.5rem; }
  @media (min-width: 1024px) { .review-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; } }
  .correction-list { display: grid; gap: 0.5rem; }
  .correction {
    display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.75rem; border-radius: 0.75rem;
    border: 1px solid var(--border); background: var(--card);
  }
  .correction p { flex: 1; min-width: 0; font-size: 0.875rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
  .correction-author { display: block; margin-top: 0.125rem; font-size: 0.75rem; color: var(--muted-foreground); }
  .invitation-list { display: grid; gap: 0.5rem; }
  .invitation { display: flex; align-items: center; gap: 0.25rem; padding: 0.5rem 0.5rem 0.5rem 0.75rem; border-radius: 0.75rem; border: 1px solid var(--border); }
  .invitation > div { flex: 1; min-width: 0; }
  .correction-draft { display: grid; gap: 0.75rem; padding: 1rem; border-radius: 0.75rem; border: 1px solid var(--brand); background: var(--brand-soft); }
  .voice-groups { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
  .voice-list { display: grid; gap: 0.5rem; max-height: 21rem; overflow-y: auto; padding: 0.125rem; }
  .voice-option {
    display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 0.75rem; cursor: pointer;
    border: 1px solid var(--border); border-radius: 0.625rem; background: var(--card);
  }
  .voice-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
  .voice-option input { accent-color: var(--brand); }
  .voice-option .name { font-weight: 600; font-size: 0.875rem; }
  .voice-option .desc { font-size: 0.75rem; color: var(--muted-foreground); }

  /* ---------- Admin ---------- */
  .stat { display: block; padding: 1.125rem 1.25rem; border-radius: 0.875rem; border: 1px solid var(--border); background: var(--card); }
  a.stat:hover { border-color: color-mix(in oklab, var(--brand) 45%, var(--border)); }
  .stat[aria-current="page"] { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
  .stat-value { font-size: 1.875rem; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
  .stat-label { font-size: 0.8125rem; color: var(--muted-foreground); }
  .filter-tabs { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.25rem; border-radius: 0.625rem; background: var(--muted); }
  .filter-tabs a, .filter-tabs button { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.375rem 0.75rem; border-radius: 0.5rem; font-size: 0.875rem; font-weight: 500; color: var(--muted-foreground); }
  .filter-tabs button { cursor: pointer; }
  .filter-tabs a[aria-current="page"], .filter-tabs button[aria-current="true"] { background: var(--background); color: var(--foreground); box-shadow: 0 1px 2px rgb(0 0 0 / 0.08); }
  .version { padding-block: 1.5rem; border-top: 1px solid var(--border); }
  .version:first-child { border-top: 0; padding-top: 0; }
  .table td, .table th { white-space: nowrap; }
  .table td.wrap { white-space: normal; min-width: 14rem; }

  /* ---------- Auth ---------- */
  .auth-wrap { display: grid; place-items: center; padding: 3.5rem 1rem 1rem; }
  .auth-card { width: 100%; max-width: 27rem; }
  .auth-logo { display: block; width: 11rem; margin-bottom: 1.75rem; }
  .auth-logo img { width: 100%; height: auto; }
  .divider { display: flex; align-items: center; gap: 0.75rem; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-foreground); }
  .divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

  /* ---------- Recorder ---------- */
  .countdown { position: absolute; inset: 0; display: grid; place-items: center; font-size: 6rem; font-weight: 800; color: #fff; background: rgb(0 0 0 / 0.45); }
  .rec-indicator { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; color: var(--destructive); font-variant-numeric: tabular-nums; }
  .rec-indicator::before { content: ""; width: 0.625rem; height: 0.625rem; border-radius: 999px; background: currentColor; animation: rec-pulse 1s infinite; }
  @keyframes rec-pulse { 50% { opacity: 0.25; } }

  /* ---------- Recording editor: clips on a timeline, webcam in a corner ---------- */
  /* Mirrors mix-recordings.py in the explainer-video-edit skill: a square, as high as the clip's size (--size, % of the
     video's height, set inline), 3 % margin, thin white border, corners rounded by 6 % of its side, soft shadow, and
     the picture mirrored like a selfie camera. Cut out of the background, it has no border or shadow and stands on the
     bottom edge; the background itself is only removed in the composed video. In the intro it fills the picture
     (data-fullscreen), and when the video starts it shrinks into its corner in 0.6 s, eased in and out, as
     mix-recordings.py's MORPH. The stage gives the video's height as a unit (cqh), so every state is a length the
     transition can run between. */
  .cam-stage { position: absolute; inset: 0; container-type: size; pointer-events: none; }
  .cam-overlay {
    position: absolute; width: calc(var(--size, 33) * 1cqh); height: calc(var(--size, 33) * 1cqh); margin: 3cqh;
    line-height: 0; overflow: hidden; border: 2px solid #fff; border-radius: calc(var(--size, 33) * 0.06cqh);
    background: #000; box-shadow: 0 3px 12px rgb(0 0 0 / 0.35);
    transition-property: width, height, margin, border-width, border-radius, box-shadow;
    transition-duration: 0.6s; transition-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
  }
  .cam-overlay[data-fullscreen] { width: 100cqw; height: 100cqh; margin: 0; border-width: 0; border-radius: 0; box-shadow: none; }
  .cam-overlay[data-corner="TopLeft"] { top: 0; left: 0; }
  .cam-overlay[data-corner="TopRight"] { top: 0; right: 0; }
  .cam-overlay[data-corner="BottomLeft"] { bottom: 0; left: 0; }
  .cam-overlay[data-corner="BottomRight"] { bottom: 0; right: 0; }
  .cam-overlay[data-cutout] { border: 0; border-radius: 0; box-shadow: none; }
  .cam-overlay[data-cutout][data-corner^="Bottom"] { margin-bottom: 0; }
  .cam-overlay video, .cam-overlay div { width: 100%; height: 100%; }
  .video-frame .cam-overlay video { width: 100%; height: 100%; max-height: none; object-fit: cover; transform: scaleX(-1); }
  .time-readout { font-variant-numeric: tabular-nums; }
  .clip-timeline {
    position: relative; height: 3rem; border-radius: 0.625rem; cursor: pointer; overflow: hidden;
    background: var(--muted); border: 1px solid var(--border);
  }
  .clip-timeline.is-busy { cursor: default; }
  .timeline-row { display: grid; grid-template-columns: 4.5rem 1fr; gap: 0.375rem; }
  /* The intro, before the video: a slot of its own left of the timeline, since its length isn't on the video's scale. */
  .intro-slot {
    position: relative; display: grid; place-items: center; height: 3rem; padding: 0; overflow: hidden; cursor: pointer;
    border-radius: 0.625rem; border: 1px dashed var(--border); background: var(--muted);
    color: var(--muted-foreground); font-size: 0.75rem; font-weight: 600;
  }
  .intro-slot.has-intro {
    border-style: solid; color: #fff;
    background: repeating-linear-gradient(135deg, var(--brand) 0 8px, color-mix(in oklab, var(--brand) 75%, #fff) 8px 16px);
  }
  .intro-slot.is-recording { border-style: solid; color: #fff; background: var(--destructive); }
  .intro-slot.is-selected { outline: 2px solid var(--foreground); outline-offset: 1px; }
  .intro-slot:disabled { cursor: default; }
  .clip-block, .clip-recording {
    position: absolute; top: 0.375rem; bottom: 0.375rem; min-width: 3px; padding: 0; border: 0; border-radius: 0.375rem;
  }
  .clip-block { background: var(--brand); opacity: 0.85; cursor: pointer; }
  .clip-block.has-video { background: repeating-linear-gradient(135deg, var(--brand) 0 8px, color-mix(in oklab, var(--brand) 75%, #fff) 8px 16px); }
  .clip-block:hover { opacity: 1; }
  .clip-block.is-selected { opacity: 1; outline: 2px solid var(--foreground); outline-offset: 1px; }
  .file-chip.is-selected { border-color: var(--brand); }
  .clip-recording { background: var(--destructive); opacity: 0.8; }
  .cue-mark { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--muted-foreground); opacity: 0.35; pointer-events: none; }
  .clip-playhead { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--foreground); pointer-events: none; }
  /* The voice-over's phrase at the playhead; tall enough for two lines of each, so the page doesn't jump as they change. */
  .prompter { display: grid; gap: 0.25rem; align-content: start; min-height: 7.5rem; padding: 0.75rem 1rem; border-radius: 0.75rem; background: var(--muted); }
  .prompter-now { font-size: 1.125rem; font-weight: 500; line-height: 1.45; }
  .prompter-now.is-upcoming { color: var(--muted-foreground); }
  .corner-picker {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem; width: 7rem; aspect-ratio: 16 / 9; padding: 0.25rem;
    border-radius: 0.5rem; border: 1px solid var(--border); background: var(--muted);
  }
  .corner-picker button { position: relative; padding: 0; border: 0; border-radius: 0.25rem; background: transparent; cursor: pointer; }
  .corner-picker button::after { content: ""; position: absolute; height: 60%; aspect-ratio: 1; border-radius: 0.125rem; background: var(--border); }
  .corner-picker button[data-corner="TopLeft"]::after { top: 0; left: 0; }
  .corner-picker button[data-corner="TopRight"]::after { top: 0; right: 0; }
  .corner-picker button[data-corner="BottomLeft"]::after { bottom: 0; left: 0; }
  .corner-picker button[data-corner="BottomRight"]::after { bottom: 0; right: 0; }
  .corner-picker button[aria-checked="true"]::after { background: var(--brand); }
  .corner-picker button:hover::after { outline: 2px solid var(--brand); }

  .mail-frame { width: 100%; height: 34rem; border: 1px solid var(--border); border-radius: 0.75rem; background: #fff; }
}

@layer components {
  .voice-play .icon-pause, .voice-play[aria-pressed="true"] .icon-play { display: none; }
  .voice-play[aria-pressed="true"] .icon-pause { display: inline-flex; }
  .voice-play span { display: inline-flex; }
  .voice-play .icon-loading, .voice-play[aria-busy="true"] .icon-play { display: none; }
  .voice-play[aria-busy="true"] .icon-loading { display: inline-flex; animation: spin 0.8s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }

  .card-details > * { padding-inline: 1.5rem; }
  .card-details > summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; cursor: pointer; list-style: none; }
  .card-details > summary::-webkit-details-marker { display: none; }
  .card-details .when-open, .card-details[open] .when-closed { display: none; }
  .card-details[open] .when-open { display: inline; }
}

@layer components {
  .card .table th:first-child, .card .table td:first-child { padding-left: 1.5rem; }
  .card .table th:last-child, .card .table td:last-child { padding-right: 1.5rem; }
}

@layer components {
  .row > svg { flex: none; }
}
