  /* Drawer handle — subtle gold accent */
  .drawer-handle {
    position: absolute;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    padding: 11px 24px 13px;
    background: rgba(245,240,232,0.04);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(220, 170, 100, 0.22);
    border-bottom: none;
    border-radius: 14px 14px 0 0;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(220, 170, 100, 0.65);
    cursor: pointer; z-index: 30;
    display: flex; align-items: center; gap: 10px;
  }
  .drawer-handle:hover {
    color: var(--gold-icon);
    border-color: rgba(220, 170, 100, 0.45);
    background: rgba(50, 35, 18, 0.18);
  }
  .drawer-handle .chev { transition: transform 0.4s cubic-bezier(0.2,0,0.2,1); }
  .drawer-handle.open .chev { transform: rotate(180deg); }

  .drawer {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 50vh;
    background: rgba(13, 11, 10, 0.78);
    backdrop-filter: blur(28px) saturate(140%);
    -webkit-backdrop-filter: blur(28px) saturate(140%);
    border-top: 1px solid rgba(220, 170, 100, 0.18);
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.7, 0, 0.2, 1);
    z-index: 25;
    overflow-y: auto;
    padding: 36px 44px 100px;
  }
  .drawer.open { transform: translateY(0); }
  .drawer::-webkit-scrollbar { width: 4px; }
  .drawer::-webkit-scrollbar-track { background: transparent; }
  .drawer::-webkit-scrollbar-thumb { background: var(--bone-15); border-radius: 2px; }

  /* Pinned top zone — header + tuning panel stay fixed while the transcript
     scrolls beneath. Sticky moved here from .drawer-header so the tuning panel
     (a normal-flow child) pins together with the header instead of scrolling
     away with the turns. */
  .drawer-top {
    position: sticky;
    top: 0;
    z-index: 6;
    background: rgba(13, 11, 10, 0.95);
    transition: transform 0.32s cubic-bezier(0.2, 0, 0.2, 1);
  }
  /* Condensing: while reading downward the top zone slides up out of the way;
     scrolling up brings it back (toggled in the drawer scroll handler). */
  .drawer-top.condensed {
    transform: translateY(-100%);
  }
  .drawer-header {
    background: rgba(13, 11, 10, 0.95);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--bone-30);
    padding-bottom: 18px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--bone-08);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    column-gap: 14px;
  }
  .drawer-header .title { color: var(--gold-icon-soft); justify-self: start; }
  .drawer-header #turn-count { justify-self: center; }

  /* Up/down navigation in the drawer header — jump to oldest / latest.
     The up arrow also pages older history in chunks while held. Sits flush
     with turn-count so the header stays a single horizontal strip. */
  .drawer-nav {
    display: flex; gap: 6px;
    justify-self: end;
    /* Shift left of the atrium handle (28px blade at right:0) so the down arrow
       doesn't collide with it — critical on mobile where drawer padding is 20px. */
    margin-right: 12px;
  }
  .drawer-nav-btn {
    width: 22px; height: 22px;
    background: transparent;
    border: 1px solid var(--bone-15);
    border-radius: 4px;
    color: var(--bone-50);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    padding: 0;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  }
  .drawer-nav-btn svg { width: 12px; height: 12px; }
  .drawer-nav-btn:hover {
    color: var(--april);
    border-color: rgba(255, 138, 101, 0.4);
    background: rgba(255, 138, 101, 0.06);
  }
  .drawer-nav-btn:active { transform: scale(0.94); }

  /* ============================================================
     VOICE TUNING STRIP — collapsible settings under the header.
     Turn-gate tolerance + mic sensitivity (TT1 / voice_tuning.py).
     ============================================================ */
  .tune-toggle.active {
    color: var(--april);
    border-color: rgba(255, 138, 101, 0.5);
    background: rgba(255, 138, 101, 0.08);
  }
  .drawer-tuning {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin: 0;
    transition: max-height 0.4s cubic-bezier(0.2,0,0.2,1), opacity 0.3s ease, margin 0.4s ease;
  }
  .drawer-tuning.open {
    max-height: 220px;
    opacity: 1;
    margin: -14px 0 26px;
  }
  .tune-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px 46px;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--bone-08);
  }
  .tune-row:last-child { border-bottom: none; }
  .tune-label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--bone-50);
  }
  .tune-hint {
    font-size: 8px;
    letter-spacing: 0.03em;
    text-transform: none;
    color: var(--bone-30);
  }
  .tune-val {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--april);
    text-align: right;
  }
  .tune-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 2px;
    background: var(--bone-15);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
  }
  .tune-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: rgb(255, 138, 101);
    border: 2px solid rgba(13, 11, 10, 0.9);
    box-shadow: 0 0 8px rgba(255, 138, 101, 0.5);
    cursor: pointer;
  }
  .tune-slider::-moz-range-thumb {
    width: 14px; height: 14px;
    border-radius: 50%;
    background: rgb(255, 138, 101);
    border: 2px solid rgba(13, 11, 10, 0.9);
    box-shadow: 0 0 8px rgba(255, 138, 101, 0.5);
    cursor: pointer;
  }
  @media (max-width: 720px) {
    .tune-row { grid-template-columns: minmax(0, 1fr) 92px 42px; gap: 10px; }
  }


  /* Route + approval lens — active provider, harness, and tool contract. */
  .approval-lens {
    --lens-rgb: 255, 138, 101;
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    min-height: 62px;
    margin: -12px 0 26px;
    padding: 12px 14px;
    border: 1px solid rgba(var(--lens-rgb), 0.30);
    border-radius: 8px;
    background:
      linear-gradient(135deg, rgba(var(--lens-rgb), 0.14), transparent 42%),
      linear-gradient(180deg, rgba(245, 240, 232, 0.055), rgba(245, 240, 232, 0.018));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.10), 0 18px 46px rgba(0,0,0,0.28);
    overflow: hidden;
  }
  .approval-lens[data-kind="claude"] { --lens-rgb: 220, 170, 100; }
  .approval-lens[data-kind="text"] { --lens-rgb: 125, 198, 255; }
  .approval-lens::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(var(--lens-rgb), 0.16), transparent);
    transform: translateX(-120%);
    opacity: 0;
  }
  .approval-lens[data-pulse]::after { animation: lens-sweep 0.9s ease; }
  @keyframes lens-sweep { 35% { opacity: 1; } to { transform: translateX(120%); opacity: 0; } }
  .approval-lens-core { position: relative; width: 36px; height: 36px; }
  .approval-lens-spark, .approval-lens-ring { position: absolute; inset: 0; border-radius: 50%; }
  .approval-lens-spark {
    inset: 10px;
    background: rgb(var(--lens-rgb));
    box-shadow: 0 0 20px rgba(var(--lens-rgb), 0.85);
  }
  .approval-lens-ring {
    border: 1px solid rgba(var(--lens-rgb), 0.46);
    box-shadow: inset 0 0 18px rgba(var(--lens-rgb), 0.16);
  }
  .approval-lens-kicker {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 8px;
    letter-spacing: 0.30em;
    text-transform: uppercase;
    color: rgba(var(--lens-rgb), 0.72);
  }
  .approval-lens-route {
    margin-top: 3px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--bone);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .approval-lens-rail { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
  .approval-chip {
    max-width: 130px;
    border: 1px solid rgba(var(--lens-rgb), 0.24);
    border-radius: 5px;
    padding: 5px 7px;
    color: rgba(245,240,232,0.78);
    background: rgba(0,0,0,0.18);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 8px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .turn {
    display: grid;
    grid-template-columns: 142px 1fr;
    gap: 28px;
    margin-bottom: 26px;
    opacity: 0;
    transform: translateY(8px);
    animation: turn-in 0.7s cubic-bezier(0.2,0,0.2,1) forwards;
  }
  @keyframes turn-in { to { opacity: 1; transform: translateY(0); } }
  .turn-meta {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    line-height: 1.5;
  }
  .turn-meta .who { display: block; margin-bottom: 3px; }
  .turn-meta .route {
    display: block; color: var(--bone-35); font-size: 8px;
    letter-spacing: 0.12em; text-transform: none; word-break: break-word;
    margin: 0 0 4px;
  }
  .turn-meta .time { color: var(--bone-30); font-size: 9px; }
  .turn.april .who { color: var(--april); }
  .turn.tk .who { color: var(--tk); }
  .turn-text {
    font-family: 'Fraunces', serif;
    font-weight: 300;
    font-size: 20px;
    line-height: 1.55;
    color: var(--bone);
    letter-spacing: -0.005em;
    /* Re-enable selection/copy here even though the app shell disables it
       globally for its app-like feel, so transcript text can be highlighted. */
    user-select: text;
    -webkit-user-select: text;
    -webkit-touch-callout: default;
    cursor: text;
  }
  /* Per-turn action buttons — copy (all), replay (Apryl), resend (TK). */
  .turn-actions { display: flex; gap: 6px; margin-top: 6px; }
  .turn-action {
    width: 22px; height: 22px;
    background: transparent;
    border: 1px solid var(--bone-15);
    border-radius: 4px;
    color: var(--bone-30);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  }
  .turn-action svg { width: 13px; height: 13px; }
  .turn-action:hover { color: var(--april); border-color: rgba(255, 138, 101, 0.4); background: rgba(255, 138, 101, 0.06); }
  .turn-action:active { transform: scale(0.94); }
  .turn-action.copied { color: var(--april); border-color: rgba(255, 138, 101, 0.55); background: rgba(255, 138, 101, 0.10); }

  /* ---------------- Mobile ---------------- */
  @media (max-width: 720px) {
    .hud-top { padding: 16px 18px; font-size: 9px; }
    .hud-top .group { gap: 9px; }
    .hud-top .group:last-child > *:not(:last-child) { display: none; }
    .hud-brand { top: 76px; font-size: 7.5px; gap: 7px; letter-spacing: 0.28em; }
    .hud-brand .pin-vox { letter-spacing: 0.36em; }
    .label-april { top: 16%; left: 7%; }
    .label-april .name { font-size: 28px; }
    .label-tk { bottom: 20%; right: 7%; }
    .label-tk .name { font-size: 28px; }
    .center-meta { width: 220px; }
    .live-controls { bottom: 80px; }
    .drawer { padding: 26px 20px 80px; }
    .approval-lens { grid-template-columns: 34px 1fr; gap: 10px; }
    .approval-lens-rail { grid-column: 1 / -1; justify-content: flex-start; }
    .turn { grid-template-columns: 104px 1fr; gap: 16px; }
    .turn-text { font-size: 18px; }
    .idle-controls { gap: 22px; bottom: 11%; }
    .call-btn { width: 68px; height: 68px; }
    .call-btn svg { width: 24px; height: 24px; }
    .cube-label.top { top: 100px; }
    .brand-lockup { bottom: 30%; }
    .brand-house { font-size: 8px; letter-spacing: 0.36em; }
    .brand-name { font-size: 20px; }
    .brand-rule { width: 22px; }
    .cube-label .heading { font-size: 26px; }
    .holo-frame { inset: 8px; }
    .corner { width: 18px; height: 18px; }
    .reg-mark.tl, .reg-mark.tr { display: none; }
    .reg-mark.bl { bottom: 26px; left: 24px; }
    .reg-mark.br { bottom: 26px; right: 24px; }
    .readout { font-size: 8px; }
    .readout.bl { bottom: 16px; left: 22px; }
    .readout.br { bottom: 16px; right: 22px; }
    .mid-tick { font-size: 7px; }
    .orb-tap { width: 200px; height: 200px; }
  }

  @media (prefers-reduced-motion: reduce) {
    body::before { animation: none; }
    .ctrl:hover, .call-btn:hover, .ptt-btn:hover { transform: none; }
    .ptt-btn.held::before { animation: none; }
  }
  /* ============================================================
     DRAWER INPUT ROW — text composition inside transcript drawer
     ============================================================ */
  .drawer-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0 8px;
    border-top: 1px solid var(--bone-08);
    margin-top: 18px;
    position: sticky;
    bottom: 0;
    background: linear-gradient(to top, rgba(13, 11, 10, 0.92) 60%, transparent);
    z-index: 5;
  }
  .drawer-input {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--bone-15);
    padding: 8px 4px;
    color: var(--bone);
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-weight: 300;
    font-size: 18px;
    outline: none;
    transition: border-color 0.3s ease;
  }
  .drawer-input::placeholder { color: var(--bone-30); font-style: italic; }
  .drawer-input:focus { border-bottom-color: rgba(255, 138, 101, 0.6); }
  .drawer-send {
    background: rgba(255, 138, 101, 0.10);
    border: 1px solid rgba(255, 138, 101, 0.4);
    color: rgb(255, 138, 101);
    width: 38px; height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
  }
  .drawer-send:hover { background: rgba(255, 138, 101, 0.25); }
  .drawer-send svg { width: 16px; height: 16px; }
