    :root {
      --bg:          #f5f6fa;
      --surface:     #ffffff;
      --surface-r:   #f9fafb;
      --surface-h:   #f0f1f8;
      --border:      #e5e7f0;
      --border-s:    #d1d4e8;
      --text-1:      #111827;
      --text-2:      #4b5563;
      --text-3:      #626978;   /* 4.8:1 on white; #9ca3af was 2.5:1 */
      --text-4:      #9ca3af;   /* decorative only, never for readable text */
      --accent:      #4f46e5;
      --accent-ink:  #4346d9;
      --accent-surface: #4f46e5;
      --accent-soft: rgba(91,94,244,0.14);
      --accent-dim:  rgba(91,94,244,0.08);
      --accent-glow: rgba(91,94,244,0.18);
      --success:     #047857;
      --success-bg:  #ecfdf5;
      --warning:     #92400e;
      --warning-bg:  #fffbeb;
      --error:       #c81e1e;
      --error-bg:    #fef2f2;
      --radius-sm:   10px;
      --radius:      14px;
      --radius-lg:   20px;
      --radius-xl:   28px;
      --shadow-col:  0,0,0;
      --shadow-lift: 0 1px 2px rgba(17,24,39,0.04), 0 16px 40px -16px rgba(17,24,39,0.16);
      /* First four of SPEAKER_COLORS (app/main.py), as used by the waveform motif */
      --spk-1: #5b5ef4;
      --spk-2: #10b981;
      --spk-3: #f97316;
      --spk-4: #a855f7;
    }

    html.dark {
      --bg:          #0f1117;
      --surface:     #1a1b23;
      --surface-r:   #1f2029;
      --surface-h:   #252632;
      --border:      #2a2b38;
      --border-s:    #35374a;
      --text-1:      #e8e9ed;
      --text-2:      #9ca0b0;
      --text-3:      #8a8fa1;   /* 5.2:1 on the dark surface; #5c6070 was 2.9:1 */
      --text-4:      #5c6070;
      --accent:      #7375f8;
      --accent-ink:  #a5a7fb;
      --accent-soft: rgba(115,117,248,0.2);
      --accent-dim:  rgba(115,117,248,0.12);
      --accent-glow: rgba(115,117,248,0.25);
      --success:     #34d399;
      --success-bg:  rgba(52,211,153,0.12);
      --warning:     #fbbf24;
      --warning-bg:  rgba(251,191,36,0.12);
      --error:       #f87171;
      --error-bg:    rgba(248,113,113,0.12);
      --shadow-col:  0,0,0;
      --shadow-lift: 0 1px 2px rgba(0,0,0,0.3), 0 16px 40px -16px rgba(0,0,0,0.6);
      --spk-1: #8486f9;
      --spk-2: #34d399;
      --spk-3: #fb923c;
      --spk-4: #c084fc;
    }

    *, *::before, *::after { box-sizing: border-box; margin: 0; }

    html { scroll-behavior: smooth; scrollbar-gutter: stable; }

    body {
      font-family: 'Outfit', system-ui, sans-serif;
      font-weight: 400;
      background: var(--bg);
      color: var(--text-1);
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      -webkit-font-smoothing: antialiased;
    }

    main  { flex: 1; }

    [x-cloak] { display: none !important; }
    .htmx-indicator { opacity: 0; transition: opacity 200ms ease-in; }
    .htmx-request .htmx-indicator { opacity: 1; }

    /* ── Typography ── */
    .font-display { font-family: 'Fraunces', Georgia, serif; }
    .font-mono    { font-family: 'JetBrains Mono', monospace; }

    /* ── Cards ── */
    .card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
    }

    /* ── Buttons ── */
    .btn {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      font-family: 'Outfit', sans-serif;
      font-weight: 500;
      border-radius: var(--radius-sm);
      transition: all 0.16s ease;
      cursor: pointer;
      border: none;
      text-decoration: none;
      white-space: nowrap;
    }
    .btn-primary {
      background: var(--accent-surface);
      color: #fff;
      padding: 0.6rem 1.25rem;
      font-size: 0.875rem;
    }
    .btn-primary:hover:not(:disabled) {
      background: #4749e8;
      transform: translateY(-1px);
      box-shadow: 0 4px 16px var(--accent-glow);
    }
    .btn-primary:disabled {
      opacity: 0.4;
      cursor: not-allowed;
    }
    .btn-ghost {
      background: transparent;
      color: var(--text-2);
      border: 1px solid var(--border-s);
      padding: 0.5rem 1rem;
      font-size: 0.8rem;
    }
    .btn-ghost:hover {
      background: var(--surface-h);
      color: var(--text-1);
    }
    .btn-sm { padding: 0.4rem 0.8rem !important; font-size: 0.78rem !important; }

    /* ── Inputs ── */
    .input {
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      color: var(--text-1);
      font-family: 'Outfit', sans-serif;
      font-size: 0.875rem;
      padding: 0.5rem 0.75rem;
      width: 100%;
      transition: border-color 0.15s, box-shadow 0.15s;
      outline: none;
    }
    .input::placeholder { color: var(--text-3); }
    .input:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px var(--accent-dim);
      background: var(--surface);
    }

    /* ── Badges ── */
    .badge {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      padding: 0.2rem 0.6rem;
      border-radius: 99px;
      font-size: 0.7rem;
      font-weight: 500;
      font-family: 'JetBrains Mono', monospace;
    }

    /* ── Navbar ── */
    .nav-bar {
      background: rgba(255,255,255,0.85);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border-bottom: 1px solid var(--border);
    }
    html.dark .nav-bar {
      background: rgba(26,27,35,0.85);
    }

    /* ── Dark mode toggle ── */
    .theme-toggle {
      background: none;
      border: 1px solid var(--border);
      border-radius: 8px;
      cursor: pointer;
      padding: 5px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-3);
      transition: color 0.15s, border-color 0.15s;
    }
    .theme-toggle:hover {
      color: var(--accent);
      border-color: var(--accent);
    }

    @media (max-width: 640px) {
      .nav-bar .max-w-5xl {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
      }
      .nav-bar a:first-child .font-display {
        display: none;
      }
      .nav-bar .flex.items-center.gap-4 {
        gap: 0.65rem;
      }
      .nav-bar a[href$="/jobs"],
      .nav-bar a[href$="/settings"] {
        font-size: 0.78rem;
      }
    }

    /* ── Page animations ── */
    @keyframes fadeUp {
      from { opacity: 0; transform: translateY(10px); }
      to   { opacity: 1; transform: translateY(0); }
    }
    .fade-up   { animation: fadeUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) both; }
    .fade-up-1 { animation-delay: 0.06s; }
    .fade-up-2 { animation-delay: 0.12s; }
    .fade-up-3 { animation-delay: 0.18s; }

    .wn-overlay {
      position: fixed;
      inset: 0;
      z-index: 100;
      display: flex;
      align-items: center;
      justify-content: center;
      background: rgba(0,0,0,0.45);
      backdrop-filter: blur(6px);
      -webkit-backdrop-filter: blur(6px);
      opacity: 0;
      pointer-events: none;
      visibility: hidden;
      transition: opacity 0.2s ease;
    }
    html.dark .wn-overlay { background: rgba(0,0,0,0.6); }
    .wn-overlay.is-open {
      visibility: visible;
      opacity: 1;
      pointer-events: auto;
    }
    .wn-overlay.is-open .wn-panel {
      transform: translateY(0);
      opacity: 1;
    }
    .wn-panel {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      width: min(540px, calc(100vw - 2rem));
      max-height: calc(100vh - 4rem);
      display: flex;
      flex-direction: column;
      box-shadow: 0 16px 48px rgba(0,0,0,0.18);
      transform: translateY(12px);
      opacity: 0;
      transition: transform 0.25s cubic-bezier(0.16,1,0.3,1), opacity 0.2s ease;
    }
    html.dark .wn-panel { box-shadow: 0 16px 48px rgba(0,0,0,0.5); }
    .wn-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 1.25rem 1.5rem 1rem;
      border-bottom: 1px solid var(--border);
      flex-shrink: 0;
    }
    .wn-title {
      font-family: 'Fraunces', Georgia, serif;
      font-style: italic;
      font-weight: 500;
      font-size: 1.15rem;
      color: var(--text-1);
      letter-spacing: -0.01em;
    }
    .wn-close {
      width: 28px; height: 28px;
      display: grid; place-items: center;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: transparent;
      color: var(--text-3);
      cursor: pointer;
      transition: color 0.15s, border-color 0.15s, background-color 0.15s;
    }
    .wn-close:hover { color: var(--text-1); border-color: var(--border-s); background: var(--surface-h); }
    .wn-body {
      overflow-y: auto;
      padding: 1rem 1.5rem 1.5rem;
      flex: 1;
      min-height: 0;
    }
    .wn-version {
      margin-bottom: 1.25rem;
    }
    .wn-version:last-child { margin-bottom: 0; }
    .wn-ver-header {
      display: flex;
      align-items: baseline;
      gap: 0.5rem;
      margin-bottom: 0.5rem;
    }
    .wn-ver-tag {
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.8rem;
      font-weight: 500;
      color: var(--accent);
      background: var(--accent-dim);
      padding: 0.15rem 0.5rem;
      border-radius: 6px;
    }
    .wn-ver-date {
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.68rem;
      color: var(--text-3);
    }
    .wn-items {
      list-style: none;
      padding: 0;
      margin: 0;
    }
    .wn-items li {
      position: relative;
      padding: 0.25rem 0 0.25rem 1rem;
      font-size: 0.82rem;
      line-height: 1.55;
      color: var(--text-2);
    }
    .wn-items li::before {
      content: "";
      position: absolute;
      left: 0;
      top: 0.65rem;
      width: 5px; height: 5px;
      border-radius: 50%;
      background: var(--border-s);
    }
    .wn-items li strong {
      color: var(--text-1);
      font-weight: 500;
    }

    .back-top-btn {
      position: fixed;
      bottom: 1.5rem;
      right: 1.5rem;
      z-index: 50;
      transform: translateY(5rem);
      opacity: 0;
      pointer-events: none;
      transition: transform 0.2s cubic-bezier(0.4,0,1,1), opacity 0.18s cubic-bezier(0.4,0,1,1);
    }
    .back-top-btn.is-visible {
      transform: translateY(0);
      opacity: 1;
      pointer-events: auto;
      transition: transform 0.45s cubic-bezier(0.16,1,0.3,1), opacity 0.35s cubic-bezier(0.16,1,0.3,1);
    }

    /* ── Transcript: margin-gutter layout ─────────────────────── */
    :root {
      --hl-wash:   rgba(253, 230, 138, 0.45);
      --hl-wash-s: rgba(253, 230, 138, 0.55);
    }
    html.dark {
      --hl-wash:   rgba(251, 191, 36, 0.18);
      --hl-wash-s: rgba(251, 191, 36, 0.28);
    }

    .transcript-grid {
      display: grid;
      grid-template-columns: 160px 1fr;
      /* No column-gap: the visual gap between gutter and body is created by
         padding on each side instead, so the active-segment background paints
         as one continuous band across both grid children. */
    }
    .transcript-seg {
      display: contents;
    }

    .seg-gutter {
      position: relative;
      text-align: right;
      padding: 0.3rem 1.125rem 1rem 0;
      border-right: 1px solid var(--border);
      grid-column: 1;
    }
    .seg-gutter::after {
      content: "";
      position: absolute;
      right: -4.5px;
      top: 0.75rem;
      width: 8px; height: 8px;
      background: var(--spk, var(--accent));
      border-radius: 50%;
      border: 2px solid var(--bg);
      z-index: 1;
      transition: border-color 0.15s;
    }
    .seg-name {
      font-family: 'Fraunces', Georgia, serif;
      font-style: italic;
      font-weight: 600;
      font-size: 1rem;
      letter-spacing: -0.005em;
      color: var(--spk, var(--accent));
      line-height: 1.25;
      outline: none;
      padding: 0.1rem 0.3rem;
      margin: -0.1rem -0.3rem;
      border-radius: 4px;
      cursor: text;
      transition: background 0.15s, box-shadow 0.15s;
      display: inline-block;
      max-width: 100%;
      overflow-wrap: break-word;
    }
    .seg-name.is-placeholder {
      font-weight: 400;
      color: var(--text-3);
      font-style: italic;
    }
    .seg-name:hover:not(:focus) {
      background: color-mix(in srgb, var(--spk, var(--accent)) 8%, transparent);
    }
    .seg-name:focus {
      background: color-mix(in srgb, var(--spk, var(--accent)) 12%, transparent);
      box-shadow: 0 0 0 3px color-mix(in srgb, var(--spk, var(--accent)) 20%, transparent);
      caret-color: var(--spk, var(--accent));
    }
    .seg-time {
      display: block;
      font-size: 0.66rem;
      color: var(--text-3);
      margin-top: 0.3rem;
      letter-spacing: 0.02em;
      cursor: pointer;
      transition: color 0.15s;
    }
    .seg-time:hover { color: var(--accent); }

    .seg-body {
      padding: 0.2rem 0 1.125rem 1.75rem;
      grid-column: 2;
      min-width: 0;
    }
    .seg-text {
      font-size: 0.97rem;
      line-height: 1.75;
      color: var(--text-1);
      outline: none;
      padding: 0.15rem 0.4rem;
      margin: -0.15rem -0.4rem;
      border-radius: 4px;
      transition: background 0.18s, box-shadow 0.18s;
      caret-color: var(--accent);
      cursor: text;
      overflow-wrap: break-word;
    }
    .seg-body:hover .seg-text:not(:focus):not(.is-dirty) {
      background: color-mix(in srgb, var(--accent) 4%, transparent);
    }
    .seg-text:focus,
    .seg-text.is-dirty {
      background: var(--hl-wash);
      box-shadow: 0 0 0 4px var(--hl-wash-s);
    }

    /* Active (playback) highlight — applied to both grid children. With no
       column-gap the backgrounds meet at the gutter's right border, so the
       highlight paints as one continuous band. Soften the gutter's
       border-right so no cold divider cuts through the warm band. */
    .transcript-seg.seg-active > .seg-gutter,
    .transcript-seg.seg-active > .seg-body {
      background: var(--accent-dim);
    }
    .transcript-seg.seg-active > .seg-gutter {
      border-right-color: color-mix(in srgb, var(--accent) 22%, transparent);
    }
    .transcript-seg.seg-active > .seg-gutter::after {
      /* The spine dot's outer 2px border previously matched the page bg;
         behind an active segment it needs to match the active bg instead,
         otherwise the dot reads as a bright halo on the highlight. */
      border-color: color-mix(in srgb, var(--accent-dim) 100%, var(--bg));
    }

    /* Navigation-flash highlight (jump-to) */
    @keyframes seg-pulse {
      0%   { background-color: transparent; }
      18%  { background-color: rgba(91,94,244,0.14); }
      100% { background-color: transparent; }
    }
    .transcript-seg.seg-highlight > .seg-gutter,
    .transcript-seg.seg-highlight > .seg-body {
      animation: seg-pulse 1.85s ease-in-out forwards;
    }

    /* Per-segment toolbar — only while dirty */
    .seg-tools {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      margin-top: 0.625rem;
      padding-top: 0.625rem;
      border-top: 1px dashed var(--border);
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.7rem;
      color: var(--text-3);
      flex-wrap: wrap;
    }
    .seg-kbd {
      display: inline-flex;
      align-items: center;
      gap: 0.25rem;
    }
    .kbd {
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.64rem;
      background: var(--surface-h);
      border: 1px solid var(--border);
      border-radius: 4px;
      padding: 0.1rem 0.4rem;
      color: var(--text-2);
    }
    .seg-dirty-dot {
      display: inline-flex;
      align-items: center;
      gap: 0.3rem;
      margin-left: auto;
      color: #b45309;
      font-size: 0.68rem;
    }
    html.dark .seg-dirty-dot { color: #fbbf24; }
    .seg-dirty-dot::before {
      content: "";
      width: 6px; height: 6px;
      border-radius: 50%;
      background: currentColor;
      animation: seg-dirty-pulse 1.6s infinite;
    }
    @keyframes seg-dirty-pulse {
      0%, 100% { opacity: 1; transform: scale(1); }
      50%      { opacity: 0.55; transform: scale(1.3); }
    }

    /* Stitch divider (spans both grid columns) */
    .stitch-divider {
      grid-column: 1 / -1;
      display: flex;
      align-items: center;
      gap: 0.75rem;
      margin: 0.75rem 0 0.25rem;
      color: var(--text-3);
    }
    .stitch-divider::before,
    .stitch-divider::after {
      content: "";
      height: 1px;
      flex: 1;
      background: linear-gradient(to right, transparent, var(--border));
    }
    .stitch-divider::after {
      background: linear-gradient(to left, transparent, var(--border));
    }
    .stitch-divider-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      padding: 0.2rem 0.55rem;
      border-radius: 999px;
      border: 1px dashed rgba(91,94,244,0.25);
      background: var(--accent-dim);
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.68rem;
      white-space: nowrap;
    }

    .section-label {
      font-size: 0.68rem;
      font-weight: 600;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--text-3);
      font-family: 'JetBrains Mono', monospace;
    }

    /* Transcript toolbar (legend + export + merge) */
    .transcript-toolbar {
      padding: 0.75rem 1rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.75rem;
      flex-wrap: wrap;
    }
    .tb-legend {
      display: flex;
      flex-wrap: wrap;
      gap: 0.4rem;
    }
    .tb-chip {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      padding: 0.25rem 0.65rem 0.25rem 0.5rem;
      border-radius: 99px;
      background: color-mix(in srgb, var(--spk, var(--accent)) 8%, transparent);
      border: 1px solid color-mix(in srgb, var(--spk, var(--accent)) 20%, transparent);
      color: var(--spk, var(--accent));
      font-family: 'Fraunces', Georgia, serif;
      font-style: italic;
      font-weight: 600;
      font-size: 0.82rem;
      text-decoration: none;
      transition: background 0.15s;
    }
    .tb-chip[hidden] { display: none; }
    .tb-chip:hover {
      background: color-mix(in srgb, var(--spk, var(--accent)) 16%, transparent);
    }
    /* Drag-and-drop speaker merge */
    .tb-chip[draggable="true"] {
      cursor: grab;
    }
    .tb-chip[draggable="true"]:active {
      cursor: grabbing;
    }
    .tb-chip-dragging {
      opacity: 0.45;
      transform: scale(0.95);
    }
    .tb-chip-drop-target {
      outline: 2px dashed var(--accent);
      outline-offset: 2px;
      background: color-mix(in srgb, var(--accent) 18%, transparent) !important;
      transform: scale(1.08);
      transition: transform 0.12s ease, background 0.12s ease;
    }
    .tb-chip-dot {
      width: 6px; height: 6px;
      border-radius: 50%;
      background: var(--spk, var(--accent));
    }
    .tb-actions {
      display: flex;
      gap: 0.35rem;
      align-items: center;
    }
    .tb-btn {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      padding: 0.35rem 0.65rem;
      border-radius: 8px;
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.72rem;
      color: var(--text-2);
      background: var(--surface-r);
      border: 1px solid var(--border);
      text-decoration: none;
      cursor: pointer;
      transition: all 0.15s;
    }
    .tb-btn:hover {
      background: var(--accent-dim);
      border-color: rgba(91,94,244,0.3);
      color: var(--accent);
    }
    .tb-btn-ghost {
      background: transparent;
      border-color: transparent;
    }
    .guided-speaker-launch {
      color: var(--accent);
      border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
      background: var(--accent-dim);
    }
    .guided-speaker-count {
      display: inline-grid;
      place-items: center;
      min-width: 1.15rem;
      height: 1.15rem;
      padding: 0 0.25rem;
      border-radius: 99px;
      color: #fff;
      background: var(--accent-surface);
      font-size: 0.64rem;
    }
    .guided-speaker-panel {
      flex-basis: 100%;
      min-width: 0;
      margin-top: 0.5rem;
      padding-top: 0.9rem;
      border-top: 1px solid var(--border);
    }
    .guided-speaker-head,
    .guided-speaker-complete {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
    }
    .guided-speaker-progress {
      margin-top: 0.2rem;
      color: var(--text-2);
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.72rem;
    }
    .guided-speaker-sample {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
      margin: 0.85rem 0;
      padding: 0.8rem;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      background: var(--surface-r);
    }
    .guided-speaker-sample-copy {
      min-width: 0;
    }
    .guided-speaker-label {
      display: block;
      margin-bottom: 0.25rem;
      color: var(--accent);
      font-family: 'Fraunces', Georgia, serif;
      font-style: italic;
      font-weight: 600;
    }
    .guided-speaker-sample-copy p {
      color: var(--text-1);
      font-size: 0.86rem;
      line-height: 1.45;
      overflow-wrap: anywhere;
    }
    .guided-speaker-sample-copy .font-mono {
      display: inline-block;
      margin-top: 0.3rem;
      color: var(--text-3);
      font-size: 0.65rem;
    }
    .guided-speaker-sample-actions {
      display: flex;
      flex: 0 0 auto;
      gap: 0.4rem;
      flex-wrap: wrap;
      justify-content: flex-end;
    }
    .guided-speaker-field {
      display: block;
    }
    .guided-speaker-input {
      display: block;
      width: 100%;
      margin-top: 0.35rem;
      padding: 0.55rem 0.7rem;
      border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
      border-radius: var(--radius-sm);
      background: var(--surface-r);
      color: var(--text-1);
      font-family: 'Fraunces', Georgia, serif;
      font-style: italic;
      font-weight: 600;
      font-size: 1rem;
      outline: none;
      transition: border-color 0.15s, box-shadow 0.15s;
    }
    .guided-speaker-input::placeholder {
      color: var(--text-3);
      font-weight: 400;
    }
    .guided-speaker-input:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
    }
    .guided-speaker-help {
      display: flex;
      align-items: center;
      gap: 0.35rem;
      flex-wrap: wrap;
      margin-top: 0.65rem;
      color: var(--text-3);
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.64rem;
    }
    .guided-speaker-error {
      margin-top: 0.6rem;
      color: var(--error);
      font-size: 0.75rem;
    }
    .guided-speaker-complete p:last-child {
      margin-top: 0.2rem;
      color: var(--text-2);
      font-size: 0.82rem;
    }
    /* Participant roster: optional preset step, one-click assignment, roster edit */
    .participant-help-item {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
    }
    .guided-speaker-input.participant-text-input {
      margin-top: 0;
      padding: 0.42rem 0.6rem;
      font-size: 0.92rem;
    }
    .guided-speaker-input:disabled {
      opacity: 0.6;
      cursor: progress;
    }
    .participant-setup-list {
      display: grid;
      gap: 0.45rem;
      margin: 0.85rem 0 0.7rem;
      padding: 0;
      list-style: none;
    }
    .participant-setup-row {
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }
    .participant-setup-index {
      flex: 0 0 auto;
      width: 1.6rem;
      color: var(--text-3);
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.68rem;
      text-align: right;
    }
    .participant-icon-btn {
      flex: 0 0 auto;
      justify-content: center;
      min-width: 2.1rem;
      min-height: 2.1rem;
    }
    .participant-setup-actions {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.5rem;
      flex-wrap: wrap;
    }
    .participant-setup-actions-end {
      display: flex;
      gap: 0.4rem;
    }
    .participant-roster {
      margin: 0 0 0.85rem;
    }
    .participant-roster-buttons {
      display: flex;
      flex-wrap: wrap;
      gap: 0.4rem;
      margin-top: 0.4rem;
    }
    .participant-option {
      display: inline-flex;
      align-items: center;
      gap: 0.45rem;
      min-height: 2.25rem;
      max-width: 100%;
      padding: 0.3rem 0.75rem 0.3rem 0.45rem;
      border-radius: 99px;
      border: 1px solid var(--border-s);
      background: var(--surface);
      color: var(--text-1);
      font-family: 'Fraunces', Georgia, serif;
      font-style: italic;
      font-weight: 600;
      font-size: 0.88rem;
      cursor: pointer;
      transition: background 0.15s, border-color 0.15s, color 0.15s;
    }
    .participant-option:hover:not(:disabled) {
      background: var(--accent-dim);
      border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
      color: var(--accent-ink);
    }
    .participant-option:focus-visible,
    .participant-tools .tb-btn:focus-visible,
    .participant-manager .tb-btn:focus-visible,
    .participant-icon-btn:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }
    .participant-option:disabled {
      opacity: 0.55;
      cursor: progress;
    }
    .participant-option-name {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .participant-option-key {
      display: inline-grid;
      place-items: center;
      min-width: 1.25rem;
      height: 1.25rem;
      border: 1px solid var(--border);
      border-radius: 6px;
      color: var(--text-3);
      font-family: 'JetBrains Mono', monospace;
      font-style: normal;
      font-weight: 500;
      font-size: 0.62rem;
    }
    .participant-option-count {
      color: var(--text-3);
      font-family: 'JetBrains Mono', monospace;
      font-style: normal;
      font-weight: 400;
      font-size: 0.64rem;
    }
    .participant-tools {
      display: flex;
      align-items: center;
      gap: 0.35rem;
      flex-wrap: wrap;
      margin-top: 0.8rem;
      padding-top: 0.6rem;
      border-top: 1px dashed var(--border);
    }
    .participant-tools .tb-btn:disabled,
    .participant-manager .tb-btn:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }
    .participant-reset-btn {
      margin-left: auto;
    }
    .participant-reset-btn:hover:not(:disabled) {
      color: var(--error);
      background: var(--error-bg);
      border-color: color-mix(in srgb, var(--error) 30%, transparent);
    }
    .participant-confirm {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.75rem 1rem;
      flex-wrap: wrap;
      margin-top: 0.6rem;
      padding: 0.75rem 0.85rem;
      border: 1px solid color-mix(in srgb, var(--error) 35%, var(--border));
      border-radius: var(--radius-sm);
      background: var(--error-bg);
    }
    .participant-confirm-title {
      color: var(--text-1);
      font-size: 0.86rem;
      font-weight: 600;
    }
    .participant-confirm-desc {
      margin-top: 0.15rem;
      color: var(--text-2);
      font-size: 0.78rem;
    }
    .participant-confirm-actions {
      display: flex;
      gap: 0.4rem;
    }
    .participant-danger {
      background: var(--error);
      color: #fff;
    }
    .participant-danger:hover:not(:disabled) {
      filter: brightness(1.08);
    }
    .participant-danger:focus-visible {
      outline: 2px solid var(--error);
      outline-offset: 2px;
    }
    .participant-danger:disabled {
      opacity: 0.5;
      cursor: progress;
    }
    html.dark .participant-danger {
      color: #1a1b23;
    }
    .participant-manager {
      margin-top: 0.8rem;
    }
    .participant-empty {
      margin-top: 0.35rem;
      color: var(--text-2);
      font-size: 0.8rem;
    }
    .participant-list {
      margin: 0.4rem 0 0.6rem;
      padding: 0;
      list-style: none;
      border-top: 1px solid var(--border);
    }
    .participant-row {
      border-bottom: 1px solid var(--border);
    }
    .participant-row-view,
    .participant-row-edit,
    .participant-add {
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }
    .participant-row-view {
      min-height: 2.6rem;
      padding: 0.3rem 0;
    }
    .participant-row-edit {
      padding: 0.45rem 0;
    }
    .participant-row-name {
      flex: 1 1 auto;
      min-width: 0;
      color: var(--text-1);
      font-family: 'Fraunces', Georgia, serif;
      font-style: italic;
      font-weight: 600;
      font-size: 0.92rem;
      overflow-wrap: anywhere;
    }
    .participant-row-meta {
      flex: 0 0 auto;
      color: var(--text-3);
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.64rem;
    }
    .guided-speaker-audio-note {
      flex: 0 1 15rem;
      padding: 0.4rem 0.6rem;
      border: 1px dashed var(--border-s);
      border-radius: var(--radius-sm);
      color: var(--text-2);
      font-size: 0.75rem;
      line-height: 1.4;
    }
    .participant-merge-hint {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.6rem 1rem;
      flex-wrap: wrap;
    }
    .participant-merge-hint p {
      flex: 1 1 18rem;
      color: var(--text-2);
      font-size: 0.78rem;
      line-height: 1.5;
    }
    .participant-setup-row .participant-text-input,
    .participant-row-edit .participant-text-input,
    .participant-add .participant-text-input {
      flex: 1 1 auto;
      min-width: 0;
    }
    .participant-add .tb-btn {
      flex: 0 0 auto;
      min-height: 2.2rem;
    }
    .tb-merge-panel {
      flex-basis: 100%;
      margin-top: 0.5rem;
      padding-top: 0.75rem;
      border-top: 1px solid var(--border);
    }
    select.styled-select {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 8px;
      color: var(--text-1);
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.75rem;
      padding: 0.4rem 0.6rem;
      outline: none;
      cursor: pointer;
      transition: border-color 0.15s, box-shadow 0.15s;
    }
    select.styled-select:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px var(--accent-dim);
    }

    /* ── Save toast (global) ──────────────────────────────────── */
    .save-toast {
      position: fixed;
      bottom: 1.5rem;
      left: 50%;
      transform: translateX(-50%) translateY(calc(100% + 1.5rem));
      background: var(--text-1);
      color: var(--bg);
      padding: 0.5rem 0.9rem;
      border-radius: 99px;
      font-size: 0.78rem;
      font-family: 'JetBrains Mono', monospace;
      letter-spacing: 0.01em;
      opacity: 0;
      pointer-events: none;
      transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s;
      z-index: 50;
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
    }
    .save-toast::before {
      content: "";
      width: 6px; height: 6px;
      border-radius: 50%;
      background: #4ade80;
    }
    .save-toast.is-visible {
      transform: translateX(-50%) translateY(0);
      opacity: 1;
    }

    /* ── Processing-state stepper (P1) ────────────────────────── */
    /* ── Waiting screen (pending/processing); canvas drawn by static/wait-viz.js ── */
    .wait-card { border-radius: 24px; overflow: hidden; box-shadow: var(--shadow-lift); }
    .wait-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.5rem 1.5rem 0; }
    @media (min-width: 640px) { .wait-top { padding: 1.75rem 1.9rem 0; } }
    .wait-pill {
      display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.22rem 0.7rem 0.22rem 0.6rem; border-radius: 99px;
      font-family: 'JetBrains Mono', monospace; font-size: 0.66rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
      background: var(--surface-r); border: 1px solid var(--border); color: var(--text-2);
    }
    .wait-pill[data-state="processing"] { background: var(--accent-dim); border-color: var(--accent-soft); color: var(--accent-ink); }
    .wait-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-4); }
    .wait-pill[data-state="processing"] .wait-dot { background: var(--accent); animation: wait-live 1.8s ease-out infinite; }
    @keyframes wait-live { 0% { box-shadow: 0 0 0 0 var(--accent-glow); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
    .wait-title {
      font-family: 'Fraunces', Georgia, serif; font-weight: 300; letter-spacing: -0.02em; line-height: 1.12;
      font-size: clamp(1.6rem, 4.4vw, 2.1rem); color: var(--text-1); margin: 0.75rem 0 0.3rem;
    }
    .wait-title em { color: var(--accent); }
    .wait-sub { font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; color: var(--text-3); margin: 0; }
    .wait-clock { text-align: right; flex-shrink: 0; }
    .wait-label { display: block; font-family: 'JetBrains Mono', monospace; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--text-3); margin-bottom: 0.15rem; }
    .wait-elapsed { display: block; font-family: 'JetBrains Mono', monospace; font-size: 1.3rem; font-weight: 500; color: var(--text-1); font-variant-numeric: tabular-nums; }
    .wait-eta { display: block; min-height: 1.2em; margin-top: 0.15rem; font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; color: var(--accent-ink); }
    .wait-card[data-over="1"] .wait-eta { color: var(--warning); }
    .wait-viz { position: relative; height: clamp(240px, 44vw, 320px); margin-top: 0.25rem; }
    .wait-viz canvas {
      position: absolute; inset: 0; width: 100%; height: 100%; display: block;
      -webkit-mask-image: radial-gradient(ellipse 72% 78% at 50% 50%, #000 62%, transparent 100%);
              mask-image: radial-gradient(ellipse 72% 78% at 50% 50%, #000 62%, transparent 100%);
    }
    .wait-legend { position: absolute; right: 1.25rem; bottom: 0.4rem; font-family: 'JetBrains Mono', monospace; font-size: 0.66rem; color: var(--text-3); }
    .wait-caption { text-align: center; margin: 0 auto; padding: 0 1.5rem; max-width: 34rem; font-size: 0.95rem; color: var(--text-2); }
    .wait-caption [data-wait-overrun] { display: block; margin-top: 0.2rem; color: var(--text-1); }
    .wait-caption [data-wait-overrun][hidden] { display: none; }
    .wait-steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); margin: 1.4rem 1rem 0; padding: 0; }
    @media (min-width: 640px) { .wait-steps { margin: 1.5rem 1.9rem 0; } }
    .wait-steps li { position: relative; display: grid; justify-items: center; gap: 0.3rem; text-align: center; padding: 0 0.2rem; }
    .wait-steps li::before { content: ""; position: absolute; top: 11px; right: 50%; width: 100%; height: 2px; background: var(--border); }
    .wait-steps li:first-child::before { display: none; }
    .wait-steps li[data-s="done"]::before { background: var(--success); }
    .wait-steps li[data-s="active"]::before { background: linear-gradient(90deg, var(--success), var(--accent)); }
    .wait-step { position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--border-s); color: var(--text-3); }
    .wait-steps li[data-s="done"] .wait-step { background: var(--success); border-color: var(--success); color: #fff; }
    .wait-steps li[data-s="active"] .wait-step { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-dim); }
    .wait-steps li[data-s="active"] .wait-step::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: wait-beat 1.6s ease-in-out infinite; }
    @keyframes wait-beat { 50% { transform: scale(0.6); opacity: 0.6; } }
    .wait-steps strong { font-size: 0.82rem; font-weight: 500; color: var(--text-1); line-height: 1.3; }
    .wait-steps li[data-s="pending"] strong { color: var(--text-3); }
    .wait-steps small { font-family: 'JetBrains Mono', monospace; font-size: 0.68rem; color: var(--text-3); font-variant-numeric: tabular-nums; min-height: 1em; }
    .wait-steps li[data-s="active"] small { color: var(--accent-ink); }
    .wait-foot {
      display: flex; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; flex-wrap: wrap;
      margin-top: 1.5rem; padding: 0.95rem 1.5rem; border-top: 1px solid var(--border); background: var(--surface-r);
      font-size: 0.84rem; color: var(--text-2);
    }
    @media (min-width: 640px) { .wait-foot { padding: 0.95rem 1.9rem; } }
    .wait-note { display: flex; align-items: center; gap: 0.55rem; }
    .wait-note svg { color: var(--accent); flex-shrink: 0; }
    .wait-id { font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; color: var(--text-3); }
    @media (prefers-reduced-motion: reduce) {
      .wait-pill .wait-dot, .wait-steps li .wait-step::after { animation: none !important; }
    }

    /* ── Jobs list: ledger rows (J2) ──────────────────────────── */
    .ledger {
      display: flex;
      flex-direction: column;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 0 1.25rem;
      box-shadow: 0 1px 4px rgba(0,0,0,0.03);
    }
    html.dark .ledger { box-shadow: 0 1px 4px rgba(0,0,0,0.3); }
    .ledger-row {
      display: grid;
      grid-template-columns: 108px 1fr auto;
      column-gap: 1.25rem;
      padding: 1rem 0.25rem;
      border-bottom: 1px solid var(--border);
      align-items: flex-start;
      cursor: pointer;
      transition: background 0.15s;
      margin: 0 -1.25rem;
      padding-left: 1.5rem;
      padding-right: 1.5rem;
      text-decoration: none;
    }
    .ledger-row:hover {
      background: color-mix(in srgb, var(--accent) 4%, transparent);
    }
    .ledger-row:last-child { border-bottom: none; }
    .ledger-row.selected {
      background: var(--accent-dim);
    }
    .ledger-gutter {
      text-align: right;
      padding: 0.15rem 1rem 0 0;
      border-right: 1px solid var(--border);
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.7rem;
      color: var(--text-3);
      letter-spacing: 0.02em;
      line-height: 1.35;
    }
    .ledger-day {
      display: block;
      font-family: 'Fraunces', Georgia, serif;
      font-weight: 500;
      font-style: italic;
      font-size: 1.45rem;
      color: var(--text-1);
      letter-spacing: -0.02em;
      line-height: 1;
      margin-bottom: 0.2rem;
    }
    .ledger-body { min-width: 0; padding-top: 0.1rem; }
    .ledger-title-row {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      margin-bottom: 0.25rem;
      flex-wrap: wrap;
    }
    .ledger-title {
      font-family: 'Fraunces', Georgia, serif;
      font-weight: 400;
      font-size: 1.05rem;
      letter-spacing: -0.01em;
      color: var(--text-1);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .ledger-status {
      display: inline-flex;
      align-items: center;
      gap: 0.3rem;
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.6rem;
      text-transform: uppercase;
      letter-spacing: 0.12em;
      padding: 0.15rem 0.5rem;
      border-radius: 99px;
      flex-shrink: 0;
    }
    .ledger-status.done       { color: var(--success); background: var(--success-bg); }
    .ledger-status.processing { color: var(--warning); background: var(--warning-bg); }
    .ledger-status.pending    { color: var(--warning); background: var(--warning-bg); }
    .ledger-status.failed     { color: var(--error); background: var(--error-bg); }
    .ledger-status.archived   { color: var(--text-3); background: var(--surface-r); border: 1px solid var(--border); }
    .ledger-status::before {
      content: "";
      width: 5px; height: 5px;
      border-radius: 50%;
      background: currentColor;
    }
    .ledger-status.processing::before,
    .ledger-status.pending::before {
      animation: seg-dirty-pulse 1.2s infinite;
    }
    .ledger-subtitle {
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.68rem;
      color: var(--text-3);
      margin-bottom: 0.4rem;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .ledger-meta {
      display: flex;
      align-items: center;
      gap: 0.7rem;
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.68rem;
      color: var(--text-2);
      flex-wrap: wrap;
    }
    .ledger-meta .sep { color: var(--text-3); }
    .ledger-speakers {
      display: inline-flex;
      align-items: center;
      gap: 0.25rem;
    }
    .ledger-spk-dot {
      width: 6px; height: 6px;
      border-radius: 50%;
      background: var(--spk, var(--accent));
    }
    .ledger-end {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 0.4rem;
      padding-top: 0.15rem;
    }

    /* Speaker colors for ledger dots (must match server-side palette) */
    .spk-color-blue    { --spk: #5b5ef4; }
    .spk-color-emerald { --spk: #10b981; }
    .spk-color-orange  { --spk: #f97316; }
    .spk-color-purple  { --spk: #a855f7; }
    .spk-color-teal    { --spk: #14b8a6; }
    .spk-color-pink    { --spk: #ec4899; }
    .spk-color-amber   { --spk: #f59e0b; }
    .spk-color-rose    { --spk: #f43f5e; }

    /* Custom audio player ─ themed to match the surface stack (light + dark) */
    .audio-player {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      padding: 0.5rem 0.75rem;
      background: var(--surface-r);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      user-select: none;
    }
    .audio-btn {
      display: grid;
      place-items: center;
      flex-shrink: 0;
      background: transparent;
      border: none;
      cursor: pointer;
      color: var(--text-2);
      padding: 0.25rem;
      border-radius: 6px;
      transition: color 0.15s, background 0.15s;
    }
    .audio-btn:hover { color: var(--accent); background: var(--accent-dim); }
    .audio-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
    .audio-btn-play {
      width: 36px; height: 36px;
      background: var(--accent-surface);
      color: #fff;
      border-radius: 50%;
    }
    .audio-btn-play:hover {
      background: var(--accent-surface);
      color: #fff;
      filter: brightness(1.1);
      transform: scale(1.04);
    }
    .audio-btn-play .audio-icon { width: 16px; height: 16px; }
    .audio-btn-mute .audio-icon { width: 18px; height: 18px; }
    .audio-icon { display: block; }

    .audio-time {
      font-size: 0.75rem;
      color: var(--text-3);
      flex-shrink: 0;
      min-width: 5.5rem;
      letter-spacing: 0.02em;
    }

    .audio-progress {
      position: relative;
      flex: 1;
      height: 28px;
      cursor: pointer;
      display: flex;
      align-items: center;
    }
    .audio-progress:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
    .audio-progress-track,
    .audio-progress-buffered,
    .audio-progress-fill {
      position: absolute;
      left: 0; top: 50%;
      transform: translateY(-50%);
      height: 4px;
      border-radius: 2px;
      pointer-events: none;
    }
    .audio-progress-track  { width: 100%; background: var(--border); }
    .audio-progress-buffered { background: var(--border-s, var(--border)); opacity: 0.7; }
    .audio-progress-fill   { background: var(--accent); transition: width 0.08s linear; }
    .audio-progress-thumb {
      position: absolute;
      top: 50%;
      width: 12px; height: 12px;
      transform: translate(-50%, -50%);
      background: var(--accent);
      border-radius: 50%;
      box-shadow: 0 0 0 2px var(--surface-r);
      pointer-events: none;
      opacity: 0;
      transition: opacity 0.15s, transform 0.15s;
    }
    .audio-progress:hover .audio-progress-thumb,
    .audio-progress:focus-within .audio-progress-thumb { opacity: 1; }
    .audio-progress-hover {
      position: absolute;
      top: 50%;
      width: 2px; height: 14px;
      transform: translate(-50%, -50%);
      background: var(--accent);
      opacity: 0.45;
      pointer-events: none;
      border-radius: 1px;
    }
    html.dark .audio-progress-thumb { box-shadow: 0 0 0 2px var(--surface-r); }

    @media (max-width: 640px) {
      .transcript-toolbar {
        align-items: stretch;
        padding: 0.75rem;
      }
      .tb-legend,
      .tb-actions {
        width: 100%;
      }
      .tb-actions {
        flex-wrap: wrap;
      }
      .tb-actions .tb-btn {
        flex: 1 1 auto;
        justify-content: center;
        min-height: 2.35rem;
      }
      .tb-merge-panel form {
        align-items: stretch !important;
      }
      .tb-merge-panel select.styled-select {
        flex: 1 1 8.5rem;
        min-width: 0;
      }
      .guided-speaker-head,
      .guided-speaker-complete,
      .guided-speaker-sample {
        align-items: stretch;
        flex-direction: column;
      }
      .guided-speaker-sample-actions {
        justify-content: stretch;
      }
      .guided-speaker-sample-actions .btn {
        flex: 1;
        justify-content: center;
      }
      .participant-setup-actions,
      .participant-setup-actions-end,
      .participant-confirm-actions {
        width: 100%;
      }
      .participant-setup-actions > .btn,
      .participant-setup-actions-end .btn,
      .participant-confirm-actions .btn {
        flex: 1;
        justify-content: center;
        min-height: 2.5rem;
      }
      .participant-option {
        flex: 1 1 auto;
        min-height: 2.6rem;
      }
      .guided-speaker-audio-note {
        flex-basis: auto;
      }
      .participant-merge-hint .btn {
        flex: 1;
        justify-content: center;
        min-height: 2.5rem;
      }
      .participant-tools .tb-btn {
        min-height: 2.35rem;
      }
      .participant-reset-btn {
        margin-left: 0;
      }
      .participant-row-edit {
        flex-wrap: wrap;
      }
      .participant-row-edit .participant-text-input {
        flex-basis: 100%;
      }
      .transcript-grid {
        display: block;
      }
      .transcript-seg {
        display: block;
        margin: 0 0 0.85rem;
        padding: 0.65rem 0 0.8rem 0.75rem;
        border-left: 3px solid var(--spk, var(--accent));
        border-bottom: 1px solid var(--border);
      }
      .transcript-seg:last-child {
        border-bottom: none;
      }
      .transcript-seg.seg-active {
        padding-right: 0.65rem;
        border-radius: var(--radius-sm);
        background: var(--accent-dim);
      }
      .transcript-seg.seg-active > .seg-gutter,
      .transcript-seg.seg-active > .seg-body {
        background: transparent;
      }
      .seg-gutter {
        display: flex;
        align-items: baseline;
        gap: 0.6rem;
        grid-column: auto;
        text-align: left;
        padding: 0;
        border-right: none;
      }
      .seg-gutter::after {
        display: none;
      }
      .seg-name {
        max-width: calc(100% - 4.5rem);
        font-size: 0.92rem;
      }
      .seg-time {
        flex-shrink: 0;
        margin-top: 0;
        margin-left: auto;
      }
      .seg-body {
        grid-column: auto;
        padding: 0.35rem 0.2rem 0 0;
      }
      .seg-text {
        font-size: 0.95rem;
        line-height: 1.65;
      }
      .stitch-divider {
        margin: 0.5rem 0 0.75rem;
      }

      .ledger {
        padding: 0 0.875rem;
      }
      .ledger-row {
        position: relative;
        grid-template-columns: 1fr;
        row-gap: 0.55rem;
        column-gap: 0;
        margin: 0 -0.875rem;
        padding: 0.9rem 1rem 1rem;
      }
      .ledger-gutter {
        display: flex;
        align-items: baseline;
        gap: 0.35rem;
        text-align: left;
        padding: 0;
        border-right: none;
        font-size: 0.66rem;
        line-height: 1.2;
      }
      .ledger-gutter br {
        display: none;
      }
      .ledger-day {
        display: inline;
        margin: 0;
        font-size: 0.9rem;
      }
      .ledger-body {
        padding-top: 0;
        padding-right: 2.5rem;
      }
      .ledger-title-row {
        align-items: flex-start;
        gap: 0.4rem;
      }
      .ledger-title {
        min-width: 0;
        max-width: 100%;
        font-size: 1rem;
      }
      .ledger-subtitle {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
      }
      .ledger-meta {
        gap: 0.45rem;
        line-height: 1.45;
      }
      .ledger-meta .sep {
        display: none;
      }
      .ledger-end {
        position: absolute;
        top: 0.9rem;
        right: 1rem;
        padding-top: 0;
      }

      .audio-player {
        flex-wrap: wrap;
        gap: 0.5rem 0.75rem;
      }
      .audio-time {
        flex: 1;
        min-width: 0;
      }
      .audio-progress {
        order: 3;
        flex-basis: 100%;
      }
    }

    .tb-chip-name, .seg-name { color: var(--text-1); }
    .guided-speaker-launch { color: var(--accent-ink); }
    .seg-time { font-size: 0.75rem; background: none; border: 0; text-align: start; }
    .wn-ver-date { font-size: 0.75rem; }
    .brand-link, .theme-toggle, .wn-close { min-width: 44px; min-height: 44px; }
    :where(a, button, input, select, [contenteditable], [tabindex]):focus-visible {
      outline: 2px solid var(--accent-ink); outline-offset: 3px;
    }
    .audio-progress { min-width: 0; min-height: 44px; }
    .audio-seek {
      position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
      opacity: 0; cursor: pointer; z-index: 2; touch-action: pan-y;
    }
    .audio-progress:focus-within { outline: 2px solid var(--accent-ink); outline-offset: 2px; border-radius: 4px; }
    [data-modal] { overflow-y: auto; }
    @media (max-width: 640px) {
      .nav-bar > div { height: auto; min-height: 3.5rem; padding-block: 0.25rem; flex-wrap: wrap; gap: 0.25rem 0.5rem; }
      .nav-bar > div > div { flex-wrap: wrap; justify-content: flex-end; gap: 0.25rem 0.5rem !important; flex: 1; }
      .nav-bar a, .audio-btn, .tb-btn, .btn { min-height: 44px; }
      .audio-btn { min-width: 44px; }
      .seg-timestamp { min-height: 44px; min-width: 44px; }
      .audio-time { min-width: 0; }
      .tb-actions, .tb-actions > * { min-width: 0; }
    }
