/*
 * theme.css — Kitchen Ken Burns.
 *
 * Direction: a quiet editing suite, like Frame.io's review screen — warm
 * graphite that lets kitchen photographs carry the colour, with one brass
 * accent borrowed from cabinet hardware. Opens dark (photos read best on a
 * dark ground); the light set below is a warm stone variant, not an inversion.
 * Type: Archivo for headings, DM Sans for reading, DM Mono for timecodes.
 *
 * --x-swatch-black / --x-swatch-white are the two fade colours shown as
 * swatches beside the Black / White choice: they mean the colour itself, so
 * they are the same in both modes.
 */

:root {
  color-scheme: dark;

  --canvas: #141311;
  --surface: #1d1b18;
  --surface-2: #26231f;
  --border: #34302a;
  --border-strong: #4f493f;
  --ink: #f2eee8;
  --muted: #a9a197;
  --accent: #e0a23b;
  --accent-hover: #ebb45a;
  --accent-ink: #1a1206;
  --accent-text: #e8b04f;
  --accent-strong: #f0c47a;
  --accent-soft: #33281a;
  --accent-border: #5a4526;
  --success: #3f9d63;
  --success-ink: #0d1a12;
  --success-soft: #16261c;
  --success-strong: #7cc99a;
  --warning: #d98b2b;
  --warning-ink: #1a1006;
  --warning-soft: #2e2114;
  --warning-strong: #eab071;
  --danger: #d9534a;
  --danger-ink: #ffffff;
  --danger-soft: #311a18;
  --danger-strong: #ef8c84;
  --chart-1: #e0a23b;
  --chart-2: #7cc99a;
  --chart-3: #8fb3e8;
  --chart-4: #ef8c84;
  --chart-5: #c9a3e6;
  --chart-6: #a9a197;

  --font-display: "Archivo Variable", ui-sans-serif, system-ui, sans-serif;
  --font-body: "DM Sans Variable", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "DM Sans Variable", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --display-weight: 700;
  --display-tracking: -0.025em;
  --eyebrow-tracking: 0.08em;

  --radius-btn: 0.625rem;
  --radius-card: 1rem;
  --radius-input: 0.625rem;
  --shadow-card: none;
  --shadow-btn: none;
  --btn-weight: 600;

  --x-swatch-black: #000000;
  --x-swatch-white: #ffffff;
}

html[data-theme="light"] {
  color-scheme: light;

  --canvas: #f5f2ed;
  --surface: #ffffff;
  --surface-2: #ebe6de;
  --border: #ddd6cb;
  --border-strong: #a89e90;
  --ink: #1c1915;
  --muted: #655d53;
  --accent: #8f5c0f;
  --accent-hover: #7a4e0c;
  --accent-ink: #ffffff;
  --accent-text: #80520d;
  --accent-strong: #5f3e09;
  --accent-soft: #f3e6cf;
  --accent-border: #dcc39a;
  --success: #1f7a46;
  --success-ink: #ffffff;
  --success-soft: #dcefe2;
  --success-strong: #1a6a3c;
  --warning: #a85a0c;
  --warning-ink: #ffffff;
  --warning-soft: #f6e5d2;
  --warning-strong: #8a4a09;
  --danger: #b42a22;
  --danger-ink: #ffffff;
  --danger-soft: #f7dedb;
  --danger-strong: #a1241d;
  --chart-1: #8f5c0f;
  --chart-2: #1f7a46;
  --chart-3: #2f5f9e;
  --chart-4: #b42a22;
  --chart-5: #7a4aa0;
  --chart-6: #655d53;

  --x-swatch-black: #000000;
  --x-swatch-white: #ffffff;
}

/*
 * app.css — Kitchen Ken Burns' own screen: the voiceover & music panel (with
 * the Claude writer and the AI music composer), the photo strip (empty drop
 * zone, reorderable cards, add-more tile), the live camera-move preview on
 * each photo, the "From a template" tab and its generated form, the render
 * track, the recent list (with credits used and render time), the API-call
 * view, and the admin's settings page and reminder strip. Tokens only.
 */

/* ---- Ground: a faint brass light from above, over the canvas ---------- */
.app-ground {
  background:
    radial-gradient(ellipse 70% 40% at 50% -8%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
    var(--canvas);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border-radius: 0.625rem;
  background: var(--accent);
  color: var(--accent-ink);
}

/* ---- Admin: the reminder strip on the main page, and /admin ----------- */
.admin-strip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.625rem 0.875rem;
  border: 1px dashed var(--accent-border);
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--accent-soft) 30%, var(--surface));
}

.settings-card {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
}
@media (min-width: 40rem) {
  .settings-card { padding: 1.5rem; }
}

/* One switch per row: the words on the left, the switch on the right. */
.setting-list {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface-2);
}
.setting-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1rem;
  cursor: pointer;
}
.setting-toggle + .setting-toggle { border-top: 1px solid var(--border); }

/* While every photo dips, the transition and its speed aren't used. */
.settings-form [data-dip-note] { display: none; }
.settings-form:has([data-dip]:checked) [data-transition-row] > .grid { opacity: 0.5; }
.settings-form:has([data-dip]:checked) [data-dip-note] { display: block; }

/* Black / White: the colour every fade and dip passes through. */
.colour-chips {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface-2);
}
.colour-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2rem;
  padding: 0.25rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}
.colour-chip:hover { color: var(--ink); }
.colour-chip:has(input:checked) {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--accent-border);
}
.colour-chip:has(input:focus-visible) { box-shadow: var(--ring); }
.swatch {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
}
.swatch-black { background: var(--x-swatch-black); }
.swatch-white { background: var(--x-swatch-white); }

/* ---- Voiceover & music panel -------------------------------------------- */
.sound-bar {
  margin-bottom: 1rem;
  padding: 1rem 1.25rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.mode-chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface-2);
}
@media (min-width: 64rem) {
  .mode-chips { width: 28rem; flex-shrink: 0; }
}
.mode-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}
.mode-chip:hover { color: var(--ink); }
.mode-chip:has(input:checked) {
  background: var(--accent);
  color: var(--accent-ink);
}
.mode-chip:has(input:focus-visible) { box-shadow: var(--ring); }

/* What shows depends on the voiceover mode, set on the form by app.js. */
#reel-form[data-voice-mode="off"] .voice-only { display: none; }
.script-only,
.lines-only { display: none; }
#reel-form[data-voice-mode="script"] .script-only { display: block; }
#reel-form[data-voice-mode="lines"] .lines-only { display: block; }

.line-box { min-height: 4.5rem; }
.is-long { color: var(--warning-strong); }

/* Claude writes the voiceover: a brass-tinted inset at the top of the panel.
   Tone, business and call to action share a row on wide screens, the button
   sits at the end of it (on its own line between tablet and laptop widths). */
.ai-box {
  padding: 1rem;
  border: 1px solid var(--accent-border);
  border-radius: 0.875rem;
  background: color-mix(in srgb, var(--accent-soft) 40%, var(--surface));
}
.ai-mark {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border-radius: 0.5rem;
  background: var(--accent);
  color: var(--accent-ink);
}
.ai-fields {
  display: grid;
  gap: 0.75rem;
}
@media (min-width: 48rem) {
  .ai-fields {
    grid-template-columns: 13rem minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
  }
  .ai-fields .ai-go { grid-column: 1 / -1; justify-self: start; }
}
@media (min-width: 80rem) {
  .ai-fields { grid-template-columns: 13rem minmax(0, 1fr) minmax(0, 1.2fr) auto; }
  .ai-fields .ai-go { grid-column: auto; }
}

/* ElevenLabs composes the music: shown under the music picker when chosen. */
.music-ai {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  background: var(--surface-2);
}
.music-player {
  display: block;
  width: 100%;
  height: 2.5rem;
}
@media (min-width: 48rem) {
  .music-player { width: 26rem; }
}

/* ---- The photo strip ---------------------------------------------------
   One surface with sprocket holes along both edges. Empty, it is one big
   drop zone; with photos, a grid of cards that reflows from one column on a
   phone to five on a laptop, ending in an "Add more" tile. */
.filmstrip {
  position: relative;
  padding: 2rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  transition: border-color 160ms ease, background-color 160ms ease;
}
.filmstrip::before,
.filmstrip::after {
  content: "";
  position: absolute;
  left: 1rem;
  right: 1rem;
  height: 0.5rem;
  border-radius: 0.125rem;
  background: repeating-linear-gradient(90deg, var(--surface-2) 0 0.875rem, transparent 0.875rem 1.75rem);
  pointer-events: none;
}
.filmstrip::before { top: 0.75rem; }
.filmstrip::after { bottom: 0.75rem; }
@media (min-width: 64rem) {
  .filmstrip { padding: 2rem 1.25rem; }
}
.filmstrip.is-dragover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface));
}

.drop-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 18rem;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  border: 1.5px dashed var(--border-strong);
  border-radius: 0.75rem;
  background: var(--surface-2);
  transition: border-color 160ms ease;
}
.drop-empty:hover,
.filmstrip.is-dragover .drop-empty { border-color: var(--accent); }
.filmstrip:focus-within .drop-empty { box-shadow: var(--ring); }

.frames {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 1.25rem 1rem;
}
.filmstrip:not(.has-photos) .frames { display: none; }
.filmstrip.has-photos .drop-empty { display: none; }

.frame { min-width: 0; }
.frame.is-dragging { opacity: 0.35; }

.frame-photo {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  cursor: grab;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface-2);
}
.frame-photo:active { cursor: grabbing; }

.frame-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center;
  will-change: transform;
  pointer-events: none;
}

.frame-num {
  position: absolute;
  z-index: 1;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.125rem 0.375rem;
  border-radius: 0.375rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.25;
  color: var(--ink);
  background: color-mix(in srgb, var(--canvas) 82%, transparent);
}

.frame-grip {
  position: absolute;
  z-index: 1;
  top: 0.5rem;
  right: 0.5rem;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.5rem;
  border-radius: 0.375rem;
  color: var(--ink);
  background: color-mix(in srgb, var(--canvas) 82%, transparent);
  opacity: 0;
  transition: opacity 160ms ease;
}
.frame-photo:hover .frame-grip,
.frame-photo:focus-visible .frame-grip { opacity: 1; }
@media (hover: none) { .frame-grip { display: none; } }

/* The fades, drawn as an edge of the fade colour on each photo that fades:
   the first photo's left edge (opening fade-in), the last photo's right edge
   (closing fade-out), and both edges of every photo while dipping. */
.frame-fade {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.frame-fade-in { background: linear-gradient(90deg, rgb(0 0 0 / 0.8), rgb(0 0 0 / 0) 50%); }
.frame-fade-out { background: linear-gradient(270deg, rgb(0 0 0 / 0.8), rgb(0 0 0 / 0) 50%); }
.filmstrip.fade-white .frame-fade-in { background: linear-gradient(90deg, rgb(255 255 255 / 0.85), rgb(255 255 255 / 0) 50%); }
.filmstrip.fade-white .frame-fade-out { background: linear-gradient(270deg, rgb(255 255 255 / 0.85), rgb(255 255 255 / 0) 50%); }
.filmstrip:not(.dip) .frame:not(.is-first) .frame-fade-in,
.filmstrip:not(.dip) .frame:not(.is-last) .frame-fade-out,
.filmstrip.no-fade-in .frame.is-first .frame-fade-in,
.filmstrip.no-fade-out .frame.is-last .frame-fade-out { display: none; }

.frame-busy {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: none;
  place-items: center;
  color: var(--ink);
  background: color-mix(in srgb, var(--canvas) 60%, transparent);
}
.frame.is-busy .frame-busy { display: grid; }

.frame-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  aspect-ratio: 16 / 9;
  padding: 0.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
  cursor: pointer;
  border: 1.5px dashed var(--border-strong);
  border-radius: 0.75rem;
  background: var(--surface-2);
  transition: border-color 160ms ease, color 160ms ease;
}
.frame-add:hover { border-color: var(--accent); color: var(--ink); }

/* ---- The camera-move preview ------------------------------------------
   Each photo plays its chosen move on a 5-second loop, so the card shows
   roughly what JSON2Video will do with it. */
@keyframes kb-zoom-in { from { transform: scale(1); } to { transform: scale(1.16); } }
@keyframes kb-zoom-out { from { transform: scale(1.16); } to { transform: scale(1); } }
@keyframes kb-in-left { from { transform: scale(1.06) translateX(-2%); } to { transform: scale(1.16) translateX(3%); } }
@keyframes kb-out-right { from { transform: scale(1.16) translateX(3%); } to { transform: scale(1.06) translateX(-2%); } }
@keyframes kb-in-up { from { transform: scale(1.06) translateY(-2%); } to { transform: scale(1.16) translateY(3%); } }
@keyframes kb-out-down { from { transform: scale(1.16) translateY(3%); } to { transform: scale(1.06) translateY(-2%); } }

.frame-img[data-effect="zoom-in"] { animation: kb-zoom-in 5s ease-in-out infinite; }
.frame-img[data-effect="zoom-out"] { animation: kb-zoom-out 5s ease-in-out infinite; }
.frame-img[data-effect="in-left"] { animation: kb-in-left 5s ease-in-out infinite; }
.frame-img[data-effect="out-right"] { animation: kb-out-right 5s ease-in-out infinite; }
.frame-img[data-effect="in-up"] { animation: kb-in-up 5s ease-in-out infinite; }
.frame-img[data-effect="out-down"] { animation: kb-out-down 5s ease-in-out infinite; }

html.reduced-motion .frame-img,
.frame.is-dragging .frame-img { animation: none; }

/* ---- From a template ------------------------------------------------------
   The picker, then the form generated from the template's variables: one
   section per top-level group, fields on a grid that reflows from one column
   to three, wide rows for pictures, music, groups and lists, and the
   Generate video bar pinned to the bottom of the screen while the form is
   in view. */
.tpl-picker {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
}
.tpl-picker-controls {
  display: grid;
  gap: 0.75rem;
}
@media (min-width: 48rem) {
  .tpl-picker-controls { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); align-items: end; }
}
@media (min-width: 64rem) {
  .tpl-picker { flex-direction: row; align-items: flex-end; }
  .tpl-picker-controls { width: 40rem; flex-shrink: 0; }
}

.tpl-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.tpl-sections {
  display: grid;
  gap: 1rem;
}
.tpl-section {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
}
.tpl-section-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}
.tpl-grid {
  display: grid;
  gap: 1rem 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  align-items: start;
}
.tpl-wide { grid-column: 1 / -1; }
.tpl-field { min-width: 0; }
.tpl-toggle { align-self: end; min-height: 2.5rem; }

.tpl-group {
  min-width: 0;
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.875rem;
}
.tpl-legend {
  padding: 0 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.tpl-media,
.tpl-audio {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  background: var(--surface-2);
}
.tpl-media-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.5rem;
}
@media (min-width: 40rem) {
  .tpl-media-row { flex-direction: row; align-items: flex-start; }
}
.tpl-thumb {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 0.625rem;
  background: var(--surface);
}
@media (min-width: 40rem) {
  .tpl-thumb { width: 12rem; }
}
.tpl-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* A picture can be transparent (a logo, say): a light checkerboard behind
   it shows its shape in both light and dark mode. */
.tpl-thumb:has(img) {
  background-color: color-mix(in srgb, var(--x-swatch-white) 94%, var(--x-swatch-black));
  background-image: conic-gradient(
    color-mix(in srgb, var(--x-swatch-white) 80%, var(--x-swatch-black)) 0 25%,
    transparent 0 50%,
    color-mix(in srgb, var(--x-swatch-white) 80%, var(--x-swatch-black)) 0 75%,
    transparent 0
  );
  background-size: 1rem 1rem;
}
.tpl-thumb-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  color: var(--muted);
}
.tpl-media-opts {
  display: grid;
  gap: 0.75rem 1rem;
  margin-top: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr));
  align-items: end;
}

.tpl-color {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.tpl-swatch {
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  padding: 0.1875rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-input);
  background: var(--surface);
  cursor: pointer;
}
.tpl-swatch::-webkit-color-swatch-wrapper { padding: 0; }
.tpl-swatch::-webkit-color-swatch { border: none; border-radius: 0.25rem; }
.tpl-swatch::-moz-color-swatch { border: none; border-radius: 0.25rem; }
.tpl-swatch:disabled { opacity: 0.5; cursor: not-allowed; }

.tpl-font {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 6.5rem;
  gap: 0.5rem;
}

.tpl-items {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.tpl-item {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  background: var(--surface-2);
}
.tpl-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.tpl-item .tpl-media,
.tpl-item .tpl-audio,
.tpl-item .tpl-group { background: var(--surface); }

.tpl-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--canvas) 92%, transparent);
  backdrop-filter: blur(6px);
}
@media (min-width: 40rem) {
  .tpl-actions { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* ---- Rendering -------------------------------------------------------- */
.render-card { border-color: var(--accent-border); }

@keyframes render-slide {
  from { transform: translateX(-100%); }
  to { transform: translateX(300%); }
}
.render-track {
  height: 0.25rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}
.render-track > span {
  display: block;
  width: 35%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  animation: render-slide 1.6s ease-in-out infinite;
}
html.reduced-motion .render-track > span { width: 100%; animation: none; opacity: 0.6; }

.reel-player {
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
}
.reel-player video {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---- Recent renders --------------------------------------------------- */
.recent-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
}
.recent-row + .recent-row { border-top: 1px solid var(--border); }

.recent-thumb {
  width: 5rem;
  aspect-ratio: 16 / 9;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 0.5rem;
  background: var(--surface-2);
}
.recent-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (min-width: 40rem) {
  .recent-thumb { width: 7rem; }
}

/* Credits used and time taken, a small line under each finished video. */
.recent-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.875rem;
  margin-top: 0.375rem;
  font-size: 0.75rem;
  line-height: 1.25rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.recent-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  white-space: nowrap;
}
.recent-stat .icon {
  width: 0.875rem;
  height: 0.875rem;
  color: var(--accent-text);
}

/* ---- The API call ----------------------------------------------------- */
.api-call > * + * { margin-top: 1.5rem; }
.api-step > * + * { margin-top: 0.75rem; }
.api-step-title {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
}
.api-step-num {
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: var(--accent);
  color: var(--accent-ink);
}
.api-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}
.api-line code {
  min-width: 0;
  overflow-wrap: anywhere;
}
.api-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
}
.code-block {
  max-height: 18rem;
  margin-top: 0.25rem;
  overflow: auto;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.625rem;
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.6;
  white-space: pre;
  tab-size: 2;
}
