/*
 * Transfer Center — live conversation + Transfer Arc.
 *
 * Loaded only with ENABLE_TC_CLINICAL_CANVAS. The projection remains the
 * source of truth; this file gives it a continuous visual grammar instead of
 * reproducing the legacy form as nested cards.
 */

.tc-clinical-canvas {
    --tc-arc-void: #071014;
    --tc-arc-deep: #0a1519;
    --tc-arc-surface: #0e1b20;
    --tc-arc-surface-soft: #13242a;
    --tc-arc-text: #eef7f4;
    --tc-arc-muted: #98aaa9;
    --tc-arc-faint: #637878;
    --tc-arc-line: rgb(142 176 175 / 22%);
    --tc-arc-line-strong: rgb(174 207 203 / 40%);
    --tc-arc-live: #59e1cf;
    --tc-arc-live-soft: rgb(89 225 207 / 12%);
    --tc-arc-blue: #8ab4ff;
    --tc-arc-blue-soft: rgb(138 180 255 / 12%);
    --tc-arc-critical: #ff7474;
    --tc-arc-critical-soft: rgb(255 116 116 / 12%);
    --tc-arc-warning: #ffc46b;
    --tc-arc-warning-soft: rgb(255 196 107 / 12%);
    --tc-arc-improving: #7ee2a8;
    --tc-arc-improving-soft: rgb(126 226 168 / 12%);
    --tc-arc-shadow: 0 24px 70px rgb(0 0 0 / 32%);
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 51fr) minmax(28rem, 49fr);
    min-width: 0;
    height: min(76vh, 58rem);
    min-height: 40rem;
    overflow: hidden;
    isolation: isolate;
    border: 1px solid var(--tc-arc-line-strong);
    border-radius: 1.4rem;
    color: var(--tc-arc-text);
    background:
        radial-gradient(circle at 82% 0%, rgb(89 225 207 / 9%), transparent 34rem),
        linear-gradient(145deg, var(--tc-arc-deep), var(--tc-arc-void) 64%);
    box-shadow: var(--tc-arc-shadow);
}

.tc-clinical-canvas::before {
    position: absolute;
    z-index: -1;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgb(255 255 255 / 2%) 1px, transparent 1px),
        linear-gradient(90deg, rgb(255 255 255 / 2%) 1px, transparent 1px);
    background-size: 3.25rem 3.25rem;
    mask-image: linear-gradient(to right, transparent 38%, #000 72%);
    content: "";
}

.tc-clinical-canvas__transcript-pane,
.tc-clinical-canvas__story-pane {
    position: relative;
    z-index: 1;
    min-width: 0;
    min-height: 0;
}

.tc-clinical-canvas__transcript-pane {
    border-right: 1px solid var(--tc-arc-line);
    background: rgb(7 16 20 / 62%);
}

.tc-clinical-canvas__story-pane {
    background: linear-gradient(180deg, rgb(14 27 32 / 72%), rgb(7 16 20 / 44%));
}

.tc-clinical-canvas__switcher,
.tc-clinical-now-ribbon {
    display: none;
}

.tc-clinical-canvas-on .tc-recorder > .tc-clinical-canvas {
    grid-column: 1 / -1;
    grid-row: auto;
    margin-top: 0.55rem;
}

/* Compatibility nodes stay mounted for the legacy generator and autosave but
   never compete with the live clinical surface. */
.tc-clinical-canvas-on #tcLiveIntake,
.tc-clinical-canvas-on #tcTranscriptPanel {
    display: none !important;
}

.tc-clinical-canvas-on .tc-recorder--split #tcChartMaterialsField {
    grid-column: 1 / -1;
    grid-row: auto;
    max-height: 15rem;
}

/*
 * During an active call, conversation and the Transfer Arc own the viewport.
 * The hidden fields remain mounted and writable. They return for wrap-up when
 * the call ends.
 */
body.tc-clinical-canvas-on.tc-clinical-live {
    --tc-arc-void: #071014;
    --tc-arc-deep: #0a1519;
    --tc-arc-surface: #0e1b20;
    --tc-arc-surface-soft: #13242a;
    --tc-arc-text: #eef7f4;
    --tc-arc-muted: #98aaa9;
    --tc-arc-faint: #637878;
    --tc-arc-line: rgb(142 176 175 / 22%);
    --tc-arc-line-strong: rgb(174 207 203 / 40%);
    --tc-arc-live: #59e1cf;
    --tc-arc-live-soft: rgb(89 225 207 / 12%);
    --tc-arc-critical: #ff7474;
    grid-template-columns: 0 minmax(0, 1fr);
}

/* Live capture is a focused clinical instrument. Preserve the app identity and
   current module, but contract navigation and setup chrome until the call ends. */
body.tc-clinical-canvas-on.tc-clinical-live .tc-header {
    min-height: 3.25rem;
    padding: 0.45rem 1rem;
    flex-wrap: nowrap;
    gap: 0.8rem;
    border-bottom-color: var(--tc-arc-line-strong) !important;
    background:
        linear-gradient(90deg, rgb(89 225 207 / 5%), transparent 24rem),
        var(--tc-arc-void);
}

body.tc-clinical-canvas-on.tc-clinical-live .tc-header::after {
    right: 4%;
    left: 4%;
    background: linear-gradient(
        90deg,
        transparent,
        rgb(89 225 207 / 45%),
        transparent
    );
}

body.tc-clinical-canvas-on.tc-clinical-live .tc-logo-mark,
body.tc-clinical-canvas-on.tc-clinical-live .tc-logo-accent,
body.tc-clinical-canvas-on.tc-clinical-live .tc-section-prefix {
    color: var(--tc-arc-live);
    text-shadow: 0 0 12px rgb(89 225 207 / 24%);
}

body.tc-clinical-canvas-on.tc-clinical-live .tc-logo-link,
body.tc-clinical-canvas-on.tc-clinical-live .tc-section-link.active {
    color: var(--tc-arc-text) !important;
}

body.tc-clinical-canvas-on.tc-clinical-live .tc-section-switcher {
    gap: 0;
    margin-left: 0.25rem;
}

body.tc-clinical-canvas-on.tc-clinical-live
    .tc-section-link:not(.active),
body.tc-clinical-canvas-on.tc-clinical-live .sn-mode-chip,
body.tc-clinical-canvas-on.tc-clinical-live .tc-header-controls,
body.tc-clinical-canvas-on.tc-clinical-live .tc-quick-start {
    display: none !important;
}

body.tc-clinical-canvas-on.tc-clinical-live .tc-section-link.active {
    padding-block: 0.35rem;
    border-bottom-color: var(--tc-arc-live) !important;
    font-size: 0.76rem;
    letter-spacing: 0.12em;
}

.tc-clinical-canvas-on.tc-clinical-live .tc-list-panel,
.tc-clinical-canvas-on.tc-clinical-live .tc-columns,
.tc-clinical-canvas-on.tc-clinical-live .tc-decision-spine,
.tc-clinical-canvas-on.tc-clinical-live .tc-decision-detail,
.tc-clinical-canvas-on.tc-clinical-live .tc-workspace-footer,
.tc-clinical-canvas-on.tc-clinical-live #tcChartMaterialsField {
    display: none !important;
}

.tc-clinical-canvas-on.tc-clinical-live .tc-workspace {
    grid-column: 2;
    padding: 0.55rem 0.75rem 0.75rem;
    overflow: hidden;
    background:
        radial-gradient(circle at 78% 0%, rgb(89 225 207 / 4%), transparent 34rem),
        var(--tc-arc-void);
}

.tc-clinical-canvas-on.tc-clinical-live .tc-workspace-form {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

/* Active-call mode has one explicit ownership tree. Legacy form siblings stay
   mounted for state continuity, but none may create implicit grid rows that
   push the patient strip, call rail, or clinical canvas out of the viewport. */
.tc-clinical-canvas-on.tc-clinical-live
    .tc-workspace-form > :not(.tc-topbar):not(.tc-bottom-panel),
.tc-clinical-canvas-on.tc-clinical-live
    .tc-recorder > :not(.tc-recorder-controls):not(.tc-clinical-canvas) {
    display: none !important;
}

.tc-clinical-canvas-on.tc-clinical-live .tc-topbar {
    grid-row: 1;
    min-height: 3.15rem;
    margin-bottom: 0.45rem;
    padding: 0.38rem 0.6rem;
    gap: 0.4rem;
    border: 1px solid var(--tc-arc-line);
    border-radius: 0.75rem;
    background: rgb(14 27 32 / 78%);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 3%);
}

.tc-clinical-canvas-on.tc-clinical-live .tc-topbar::before {
    flex: 0 0 auto;
    color: var(--tc-arc-live);
    font-family: var(--term-font-mono, monospace);
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    content: "Patient";
}

.tc-clinical-canvas-on.tc-clinical-live .tc-topbar .tc-input,
.tc-clinical-canvas-on.tc-clinical-live .tc-topbar .tc-select {
    min-height: 2.25rem;
    margin: 0;
    border-color: transparent;
    color: var(--tc-arc-muted);
    background: transparent;
    box-shadow: none;
}

.tc-clinical-canvas-on.tc-clinical-live .tc-topbar .tc-input:hover,
.tc-clinical-canvas-on.tc-clinical-live .tc-topbar .tc-select:hover {
    border-color: var(--tc-arc-line);
    background: rgb(255 255 255 / 2%);
}

.tc-clinical-canvas-on.tc-clinical-live .tc-topbar .tc-input:focus,
.tc-clinical-canvas-on.tc-clinical-live .tc-topbar .tc-select:focus {
    border-color: var(--tc-arc-live);
    outline: none;
    background: var(--tc-arc-surface-soft);
    box-shadow: 0 0 0 2px rgb(89 225 207 / 12%);
}

.tc-clinical-canvas-on.tc-clinical-live .tc-topbar .tc-topbar-name {
    color: var(--tc-arc-text);
    font-size: 1.08rem;
    font-weight: 650;
}

.tc-topbar-mrn-label {
    display: none;
}

.tc-clinical-canvas-on.tc-clinical-live .tc-topbar-mrn-label {
    display: inline;
    margin-left: 0.25rem;
    color: var(--tc-arc-faint);
    font-family: var(--term-font-mono, monospace);
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.tc-clinical-canvas-on.tc-clinical-live
    .tc-topbar .tc-input::placeholder {
    color: var(--tc-arc-faint);
}

.tc-clinical-canvas-on.tc-clinical-live .tc-bottom-panel {
    grid-row: 2;
    min-height: 0;
    height: 100%;
    margin: 0;
    border: 0;
    overflow: hidden;
}

.tc-clinical-canvas-on.tc-clinical-live .tc-bottom-panel > .tc-section,
.tc-clinical-canvas-on.tc-clinical-live .tc-bottom-panel .tc-section-body {
    min-height: 0;
    height: 100%;
    margin: 0;
}

.tc-clinical-canvas-on.tc-clinical-live .tc-recorder {
    display: grid;
    box-sizing: border-box;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    height: 100%;
    margin: 0;
    padding: 0.65rem;
    overflow: hidden;
    border: 1px solid var(--tc-arc-line-strong);
    border-radius: 1.1rem;
    background:
        radial-gradient(circle at 82% 0%, rgb(89 225 207 / 7%), transparent 30rem),
        linear-gradient(145deg, var(--tc-arc-deep), var(--tc-arc-void) 68%);
    box-shadow:
        0 1.25rem 3rem rgb(0 0 0 / 28%),
        inset 0 1px 0 rgb(255 255 255 / 3%);
}

.tc-clinical-canvas-on.tc-clinical-live .tc-recorder::before {
    background: linear-gradient(
        90deg,
        transparent,
        rgb(89 225 207 / 55%),
        transparent
    );
}

.tc-clinical-canvas-on.tc-clinical-live .tc-recorder-controls {
    z-index: 10;
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    min-height: 3.6rem;
    padding: 0.48rem 0.58rem;
    border: 1px solid var(--tc-arc-line-strong);
    border-radius: 0.8rem;
    background:
        linear-gradient(90deg, rgb(89 225 207 / 8%), transparent 42%),
        rgb(14 27 32 / 92%);
    box-shadow:
        0 0.55rem 1.4rem rgb(0 0 0 / 22%),
        inset 0 1px 0 rgb(255 255 255 / 4%);
    isolation: isolate;
}

.tc-clinical-canvas-on.tc-clinical-live .tc-live-control-rail-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
    color: var(--tc-arc-live);
    font-family: var(--term-font-mono, monospace);
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding-right: 0.72rem;
    border-right: 1px solid var(--tc-arc-line);
}

.tc-clinical-canvas-on.tc-clinical-live .tc-live-control-rail-pulse {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--tc-arc-live);
    box-shadow: 0 0 0 0.3rem rgb(89 225 207 / 10%);
}

/* Live-call collapse of the call-setup surface.
   NARROWED 2026-08-02 (owner ruling: "the goal wasn't to trap the doctor").
   This rule used to match .tc-call-setup-control outright, and #tcCaptureChooser
   carries that class — so the moment a call went live (Twilio OR a plain mic
   recording), the doctor lost sight of the number Twilio dials him at AND of the
   direct-number box, with no way back until the call ended. Both are things he
   needs DURING the call: confirming/correcting which phone rings, and writing
   down the callback number the RN reads out mid-conversation.
   `.tc-call-setup-live` exempts the shell and the two phone boxes; the bulky
   copy still collapses (see the live rail block in transfer-unified.css).
   NOTE this rule only ever REMOVES display — it adds none — so the `hidden`
   attribute _updateTwilioUI sets on the dial buttons still governs unchallenged.
   What may be DIALED is JS's call, keyed on real Twilio state; never CSS's. */
.tc-clinical-canvas-on.tc-clinical-live
    .tc-call-setup-control:not(.tc-call-setup-live) {
    display: none !important;
}

.tc-clinical-canvas-on.tc-clinical-live .tc-call-end-controls {
    margin-left: auto;
    padding-left: 0.58rem;
    border-left: 1px solid var(--tc-arc-line);
}

.tc-clinical-canvas-on.tc-clinical-live .tc-call-end-controls > button {
    min-height: 2.75rem;
    padding-inline: 1rem;
}

.tc-clinical-canvas-on.tc-clinical-live .tc-twilio-status {
    color: var(--tc-arc-muted);
    border-color: var(--tc-arc-line);
    background: rgb(7 16 20 / 54%);
}

.tc-clinical-canvas-on.tc-clinical-live .tc-twilio-status--active {
    color: var(--tc-arc-live);
    border-color: rgb(89 225 207 / 36%);
    background: var(--tc-arc-live-soft);
}

.tc-clinical-canvas-on.tc-clinical-live .tc-record-timer {
    min-width: 4.7em;
    padding: 0.35rem 0.6rem;
    color: var(--tc-arc-live);
    border-color: rgb(89 225 207 / 28%);
    background: rgb(89 225 207 / 7%);
    font-size: 0.88rem;
    font-weight: 700;
    text-shadow: none;
}

.tc-clinical-canvas-on.tc-clinical-live .tc-audio-meter {
    border-color: var(--tc-arc-line);
    background: rgb(7 16 20 / 72%);
}

body.tc-clinical-canvas-on.tc-clinical-live .tc-stop-btn {
    color: var(--tc-arc-critical);
    border-color: rgb(255 116 116 / 62%);
    background: rgb(255 116 116 / 7%) !important;
    box-shadow: none;
}

body.tc-clinical-canvas-on.tc-clinical-live .tc-stop-btn:hover {
    color: #fff;
    border-color: var(--tc-arc-critical);
    background: rgb(255 116 116 / 18%) !important;
    box-shadow: 0 0 0 2px rgb(255 116 116 / 10%);
}

body.tc-clinical-canvas-on.tc-clinical-live .tc-twilio-hangup-btn {
    border-color: var(--tc-arc-critical);
    background: var(--tc-arc-critical) !important;
    color: #16090a;
    box-shadow: 0 0 1rem rgb(255 116 116 / 18%);
}

body.tc-clinical-canvas-on.tc-clinical-live .tc-twilio-hangup-btn:hover {
    border-color: #ff8a8a;
    background: #ff8a8a !important;
    box-shadow: 0 0 1.2rem rgb(255 116 116 / 28%);
}

/* A recovered call can briefly coexist with a legacy no-selection/read-only
   recorder state. The clinical canvas stays available in that state, and the
   terminal call actions must too: never let the wrapper's pointer lock trap a
   live microphone or phone bridge. */
.tc-clinical-canvas-on.tc-clinical-live
    .tc-recorder.tc-recorder--disabled > .tc-recorder-controls {
    opacity: 1;
    pointer-events: auto;
}

.tc-clinical-canvas-on.tc-clinical-live
    .tc-recorder.tc-recorder--disabled .tc-call-end-controls,
.tc-clinical-canvas-on.tc-clinical-live
    .tc-recorder.tc-recorder--disabled .tc-call-end-controls > button {
    opacity: 1;
    pointer-events: auto;
}

.tc-clinical-canvas-on.tc-clinical-live .tc-recorder > .tc-clinical-canvas {
    grid-column: 1;
    grid-row: 2;
    min-height: 0;
    height: auto;
    align-self: stretch;
    margin-top: 0.62rem;
    border-radius: 0.9rem;
    box-shadow: none;
}

/* The legacy recorder can be disabled for a closed/read-only transfer. Its
   opacity and pointer lock must not dim or disable the independent clinical
   review surface nested inside it. Keep every legacy child inert while
   restoring the Transfer Arc as a readable, navigable surface. */
.tc-clinical-canvas-on .tc-recorder.tc-recorder--disabled {
    opacity: 1;
    pointer-events: auto;
}

.tc-clinical-canvas-on .tc-recorder.tc-recorder--disabled > :not(.tc-clinical-canvas) {
    opacity: 0.4;
    pointer-events: none;
}

.tc-clinical-canvas-on .tc-recorder.tc-recorder--disabled > .tc-clinical-canvas {
    pointer-events: auto;
}

/* -------------------------------------------------------------------------
   Live transcript
   ------------------------------------------------------------------------- */

.tc-live-transcript,
.tc-story-map {
    display: flex;
    min-width: 0;
    min-height: 0;
    height: 100%;
    flex-direction: column;
    color: var(--tc-arc-text);
}

.tc-live-transcript__header,
.tc-transfer-arc__header {
    display: grid;
    min-height: 4.9rem;
    align-items: center;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.15rem 0.9rem;
    padding: 0.95rem 1.1rem;
    border-bottom: 1px solid var(--tc-arc-line);
    background: rgb(7 16 20 / 72%);
    backdrop-filter: blur(18px);
}

.tc-live-transcript__title,
.tc-transfer-arc__title {
    margin: 0;
    font-family: var(--term-font-display, "Outfit", sans-serif);
    font-size: 1.05rem;
    font-weight: 550;
    line-height: 1.25;
    letter-spacing: 0.01em;
}

.tc-live-transcript__title::before {
    display: inline-block;
    width: 0.48rem;
    height: 0.48rem;
    margin-right: 0.48rem;
    border-radius: 50%;
    background: var(--tc-arc-live);
    box-shadow: 0 0 0 0.3rem rgb(89 225 207 / 10%);
    content: "";
}

.tc-live-transcript__status,
.tc-transfer-arc__status {
    grid-column: 1;
    margin: 0;
    color: var(--tc-arc-muted);
    font-family: var(--term-font-mono, monospace);
    font-size: 0.68rem;
    line-height: 1.4;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.tc-live-transcript__follow {
    grid-column: 2;
    grid-row: 1 / span 2;
    min-height: 2.45rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid rgb(89 225 207 / 48%);
    border-radius: 999px;
    color: var(--tc-arc-live);
    background: rgb(89 225 207 / 6%);
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}

.tc-live-transcript__follow.is-paused {
    color: var(--tc-arc-void);
    background: var(--tc-arc-live);
}

.tc-live-transcript__viewport {
    flex: 1;
    min-height: 0;
    padding: 0.55rem 0 1.5rem;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.tc-live-transcript__turns {
    display: flex;
    flex-direction: column;
}

/* Density ladder (2026-07-25) — see live-transcript.js.
 *
 * The transcript showed ~8 turns against 32-40 turns in a call. A line recedes
 * as it ages (data-tier 0..3) unless it carries clinical signal, which holds it
 * open (is-held / is-signal). SIZE and COLOUR only: text is never truncated,
 * folded, or hidden, because the transcript is a record.
 *
 * font-size lives on the row, not the paragraph, so one custom property drives
 * the whole line box and the meta row scales with it. */
.tc-live-transcript__turn {
    position: relative;
    max-width: 92%;
    margin: 0;
    padding: var(--tc-turn-pad-y, 0.38rem) 1.1rem var(--tc-turn-pad-y, 0.38rem) 1.25rem;
    border-left: 3px solid var(--tc-arc-blue);
    font-size: var(--tc-turn-size, 1rem);
    cursor: pointer;
    /* Deliberately no font-size transition: animating it animates LAYOUT across
     * every row in a scrolling container while _scrollToLatest measures. Tiers
     * snap, and they only change when a turn arrives — already a visual event. */
    transition: border-color var(--tc-motion-fast) var(--tc-ease), background var(--tc-motion-fast) var(--tc-ease), transform var(--tc-motion-fast) var(--tc-ease);
}

/* An unresolved speaker must not silently read as "referring". Roles resolve
 * from direction of transfer now (f50e17a2) and `unknown` is a real state. */
.tc-live-transcript__turn[data-speaker-role="unknown"] {
    border-left-color: var(--tc-arc-line);
}

.tc-live-transcript__turn[data-tier="0"] {
    --tc-turn-size: 1rem;
    --tc-turn-lh: 1.55;
    --tc-turn-pad-y: 0.38rem;
}

.tc-live-transcript__turn[data-tier="1"] {
    --tc-turn-size: 0.94rem;
    --tc-turn-lh: 1.5;
    --tc-turn-pad-y: 0.3rem;
}

.tc-live-transcript__turn[data-tier="2"] {
    --tc-turn-size: 0.86rem;
    --tc-turn-lh: 1.42;
    --tc-turn-pad-y: 0.24rem;
    --tc-turn-ink: var(--tc-arc-muted);
}

/* Legibility floor. 0.8rem is small but readable, and only a line with no
 * number, no citation and no flag is ever allowed to reach it.
 *
 * Ink stops at --tc-arc-muted (7.6:1). --tc-arc-faint measures 3.96:1 on this
 * ground and FAILS WCAG 1.4.3 for body text — it is fine for a timestamp glyph,
 * not for transcript prose at 12.8px. */
.tc-live-transcript__turn[data-tier="3"] {
    --tc-turn-size: 0.8rem;
    --tc-turn-lh: 1.35;
    --tc-turn-pad-y: 0.2rem;
    --tc-turn-ink: var(--tc-arc-muted);
}

/* A held line is not merely un-shrunk — it is the thing worth finding again.
 *
 * The mark is a SECOND inset stripe, never the border-left: that rail encodes
 * WHO IS SPEAKING, and recolouring it made a held *referring* line read as
 * accepting. Two meanings must not share one channel. Numerals additionally set
 * in tabular figures at a heavier weight so vitals and doses pop out of the
 * column when the doctor scans for them. */
.tc-live-transcript__turn.is-held {
    box-shadow: inset 3px 0 0 var(--tc-arc-live);
}

.tc-live-transcript__turn.is-held[data-rank-reason~="critical"] {
    box-shadow: inset 3px 0 0 var(--tc-arc-critical);
}

.tc-live-transcript__turn.is-held .tc-live-transcript__text,
.tc-live-transcript__turn.is-signal .tc-live-transcript__text {
    font-variant-numeric: tabular-nums;
}

.tc-live-transcript__turn.is-held .tc-live-transcript__text {
    font-weight: 500;
}

/* Continuation of the same speaker: the bubble side and rail colour already say
 * who is talking, so the meta row collapses and buys back ~1rem per turn. The
 * speaker name stays in the a11y tree via .tc-visually-hidden (set in JS).
 *
 * The row is taken OUT OF FLOW rather than expanded on hover. An earlier
 * revision restored height on :hover, which pushed every row below it down 32px
 * as the cursor crossed the column — the same reflow-under-the-doctor that the
 * no-resize-on-hover rule elsewhere in this file exists to forbid. */
.tc-live-transcript__turn.is-continuation .tc-live-transcript__turn-meta {
    position: absolute;
    inset-block-start: 0.1rem;
    inset-inline-end: 0.35rem;
    height: auto;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.tc-live-transcript__turn.is-continuation:hover .tc-live-transcript__turn-meta,
.tc-live-transcript__turn.is-continuation:focus-within .tc-live-transcript__turn-meta {
    opacity: 1;
    pointer-events: auto;
}

.tc-live-transcript__turn[data-speaker-role="accepting"],
.tc-live-transcript__turn[data-speaker-role="transfer_center"] {
    align-self: flex-end;
    margin-right: 0.8rem;
    border-left-color: var(--tc-arc-live);
}

.tc-live-transcript__turn + .tc-live-transcript__turn {
    margin-top: 0.15rem;
}

.tc-live-transcript__turn:hover,
.tc-live-transcript__turn.is-related {
    background: linear-gradient(90deg, rgb(89 225 207 / 9%), transparent 88%);
}

.tc-live-transcript__turn.is-selected {
    border-left-color: var(--tc-arc-live);
    background: linear-gradient(90deg, rgb(89 225 207 / 15%), transparent 92%);
    box-shadow: inset 0.3rem 0 1.6rem rgb(89 225 207 / 5%);
}

.tc-live-transcript__turn-meta {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.45rem;
}

.tc-live-transcript__speaker {
    color: var(--tc-arc-blue);
    font-family: var(--term-font-mono, monospace);
    font-size: 0.72rem;
    line-height: 1.4;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tc-live-transcript__turn[data-speaker-role="accepting"] .tc-live-transcript__speaker,
.tc-live-transcript__turn[data-speaker-role="transfer_center"] .tc-live-transcript__speaker {
    color: var(--tc-arc-live);
}

.tc-live-transcript__time {
    color: var(--tc-arc-faint);
    font-family: var(--term-font-mono, monospace);
    font-size: 0.66rem;
}

.tc-live-transcript__flag {
    padding: 0.12rem 0.38rem;
    border-radius: 999px;
    color: var(--tc-arc-muted);
    background: rgb(255 255 255 / 5%);
    font-family: var(--term-font-mono, monospace);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.tc-live-transcript__flag.is-critical {
    color: var(--tc-arc-critical);
    background: var(--tc-arc-critical-soft);
}

.tc-live-transcript__flag.is-clarify {
    color: var(--tc-arc-warning);
    background: var(--tc-arc-warning-soft);
}

.tc-live-transcript__flag.is-corrected {
    color: var(--tc-arc-blue);
    background: var(--tc-arc-blue-soft);
}

.tc-live-transcript__edit {
    /* Out of flow: its 2rem min-height was setting the height of the entire
     * meta row on every run head, which late in a call is taller than the line
     * of speech it labels. Absolute keeps the 2.75rem hit target without
     * charging every turn for it. Revealed on hover/focus so it stays reachable
     * by keyboard; always visible on touch, where there is no hover. */
    position: absolute;
    inset-block-start: 0.1rem;
    inset-inline-end: 0.25rem;
    min-width: 2.75rem;
    min-height: 1.7rem;
    opacity: 0;
    padding: 0.25rem 0.45rem;
    border: 0;
    color: var(--tc-arc-muted);
    background: transparent;
    font: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
}

.tc-live-transcript__turn:hover .tc-live-transcript__edit,
.tc-live-transcript__edit:focus-visible {
    opacity: 1;
}

@media (pointer: coarse) {
    .tc-live-transcript__edit {
        position: static;
        min-height: 2.75rem;
        margin-left: auto;
        opacity: 1;
    }
}

.tc-live-transcript__edit:hover {
    color: var(--tc-arc-live);
}

/* Size/leading/ink come from the row's tier (see the density ladder above).
 * font-size: 1em inherits the row so the whole line box scales together. */
.tc-live-transcript__text {
    margin: 0.1rem 0 0;
    max-width: 76ch;
    color: var(--tc-turn-ink, var(--tc-arc-text));
    font-size: 1em;
    font-weight: 390;
    line-height: var(--tc-turn-lh, 1.55);
    text-wrap: pretty;
    transition: color var(--tc-motion-base) var(--tc-ease);
}

/* Recovering a receded line restores INK ONLY, never size: re-sizing on hover
 * would reflow the column under the doctor's cursor mid-scroll. Mirrors the
 * bedside stale-reading precedent, which is likewise opacity-only. */
.tc-live-transcript__turn:hover .tc-live-transcript__text,
.tc-live-transcript__turn:focus-within .tc-live-transcript__text,
.tc-live-transcript__turn.is-selected .tc-live-transcript__text,
.tc-live-transcript__turn.is-related .tc-live-transcript__text {
    color: var(--tc-arc-text);
}

.tc-live-transcript__evidence {
    padding: 0.04em 0.12em;
    border-radius: 0.2rem;
    color: var(--tc-arc-text);
    background: rgb(89 225 207 / 22%);
    box-shadow: 0 0 0 1px rgb(89 225 207 / 24%);
    box-decoration-break: clone;
}

.tc-live-transcript__partials {
    position: relative;
    margin: 0.65rem 1rem 0;
    padding: 0.85rem 0.95rem 0.85rem 1.2rem;
    border-left: 2px solid var(--tc-arc-live);
    color: var(--tc-arc-muted);
    background: linear-gradient(90deg, rgb(89 225 207 / 9%), transparent);
    font-size: 0.96rem;
    line-height: 1.55;
}

.tc-live-transcript__partials::after {
    display: inline-block;
    width: 0.12rem;
    height: 1.05em;
    margin-left: 0.3rem;
    vertical-align: -0.12em;
    background: var(--tc-arc-live);
    animation: tc-caret calc(var(--tc-motion-slow) * 2.25) var(--tc-ease-soft) infinite;
    content: "";
}

.tc-live-transcript__partial {
    opacity: 0.92;
}

.tc-live-transcript__partial-speaker {
    margin-right: 0.35rem;
    color: var(--tc-arc-live);
    font-family: var(--term-font-mono, monospace);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

@keyframes tc-caret {
    50% { opacity: 0; }
}

/* -------------------------------------------------------------------------
   Transfer Arc header and empty state
   ------------------------------------------------------------------------- */

.tc-transfer-arc {
    overflow: hidden;
}

.tc-transfer-arc__identity {
    min-width: 0;
}

.tc-transfer-arc__eyebrow {
    display: block;
    margin-bottom: 0.12rem;
    color: var(--tc-arc-live);
    font-family: var(--term-font-mono, monospace);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.tc-transfer-arc__header {
    grid-template-columns: minmax(0, 1fr);
}

.tc-transfer-arc__status {
    grid-column: 1;
}

.tc-transfer-arc__stage {
    flex: 1;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.tc-transfer-arc__empty {
    display: grid;
    min-height: 100%;
    place-items: center;
    align-content: center;
    gap: 2.1rem;
    padding: 3rem clamp(1.5rem, 5vw, 4.5rem);
    text-align: center;
}

.tc-transfer-arc__empty-visual {
    position: relative;
    width: min(100%, 22rem);
    height: 4rem;
}

.tc-transfer-arc__empty-path {
    position: absolute;
    top: 50%;
    right: 1.1rem;
    left: 1.1rem;
    height: 1px;
    background: linear-gradient(90deg, var(--tc-arc-blue), var(--tc-arc-live));
    box-shadow: 0 0 1.2rem rgb(89 225 207 / 24%);
}

.tc-transfer-arc__empty-origin,
.tc-transfer-arc__empty-horizon {
    position: absolute;
    z-index: 1;
    top: calc(50% - 0.55rem);
    width: 1.1rem;
    height: 1.1rem;
    border: 2px solid var(--tc-arc-blue);
    border-radius: 50%;
    background: var(--tc-arc-void);
}

.tc-transfer-arc__empty-origin {
    left: 0;
}

.tc-transfer-arc__empty-horizon {
    right: 0;
    border-color: var(--tc-arc-live);
    border-radius: 0.2rem;
    transform: rotate(45deg);
}

.tc-transfer-arc__empty-copy {
    max-width: 34rem;
}

.tc-transfer-arc__empty-kicker,
.tc-transfer-arc__empty-note {
    margin: 0;
    color: var(--tc-arc-muted);
}

.tc-transfer-arc__empty-kicker {
    font-family: var(--term-font-mono, monospace);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.tc-transfer-arc__empty-title {
    margin: 0.65rem 0 0.75rem;
    font-family: var(--term-font-display, "Outfit", sans-serif);
    font-size: clamp(1.35rem, 2.4vw, 2rem);
    font-weight: 420;
    line-height: 1.18;
    text-wrap: balance;
}

.tc-transfer-arc__empty-note {
    font-size: 0.9rem;
    line-height: 1.6;
}

/* -------------------------------------------------------------------------
   Current-state nucleus
   ------------------------------------------------------------------------- */

.tc-now-nucleus {
    position: relative;
    padding: 1.4rem 1.35rem 1.2rem;
    overflow: hidden;
    border-bottom: 1px solid var(--tc-arc-line);
    background:
        radial-gradient(circle at 88% 26%, rgb(89 225 207 / 14%), transparent 17rem),
        linear-gradient(110deg, rgb(255 255 255 / 3%), transparent 72%);
}

/* Phase 3c (2026-08-01): the narrative hugged the left ~40% of an 1150px
   canvas — cap the reading measure so the block composes instead of
   stranding. The section keeps its full-width chrome; only the text column
   is bounded. */
.tc-now-nucleus__fact,
.tc-now-nucleus__movement,
.tc-now-nucleus__provenance {
    max-width: 70ch;
}

.tc-now-nucleus::after {
    position: absolute;
    top: 1.65rem;
    right: 1.45rem;
    width: 4.6rem;
    height: 4.6rem;
    border: 1px solid rgb(89 225 207 / 18%);
    border-radius: 50%;
    box-shadow:
        0 0 0 0.7rem rgb(89 225 207 / 3%),
        0 0 0 1.4rem rgb(89 225 207 / 2%);
    content: "";
}

.tc-now-nucleus.is-critical {
    background:
        radial-gradient(circle at 88% 26%, rgb(255 116 116 / 14%), transparent 17rem),
        linear-gradient(110deg, rgb(255 255 255 / 3%), transparent 72%);
}

.tc-now-nucleus__label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--tc-arc-live);
    font-family: var(--term-font-mono, monospace);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.tc-now-nucleus__fact {
    max-width: 88%;
}

.tc-now-nucleus__fact .tc-clinical-knot__value {
    font-family: var(--term-font-display, "Outfit", sans-serif);
    font-size: clamp(1.25rem, 2.3vw, 1.8rem);
    font-weight: 430;
    line-height: 1.22;
}

.tc-now-nucleus__movement {
    display: block;
    max-width: 88%;
    margin: 0.65rem 0 0;
    color: var(--tc-arc-muted);
}

.tc-now-nucleus__movement .tc-clinical-knot__button {
    min-height: 0;
    padding: 0;
}

.tc-now-nucleus__movement .tc-clinical-knot__shape {
    display: none;
}

.tc-now-nucleus__movement .tc-clinical-knot__copy {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.15rem 0.5rem;
}

.tc-now-nucleus__movement .tc-clinical-knot__label {
    align-self: baseline;
    color: var(--tc-arc-faint);
    font-size: 0.58rem;
}

.tc-now-nucleus__movement .tc-clinical-knot__value {
    align-self: baseline;
    color: var(--tc-arc-muted);
    font-size: 0.83rem;
    font-weight: 480;
    line-height: 1.45;
}

.tc-now-nucleus__movement .tc-clinical-knot__meta {
    grid-column: 2;
}

.tc-now-nucleus__movement.is-worsening .tc-clinical-knot__value {
    color: var(--tc-arc-critical);
}

.tc-now-nucleus__movement.is-improving .tc-clinical-knot__value {
    color: var(--tc-arc-improving);
}

.tc-now-nucleus__provenance {
    display: block;
    margin-top: 0.8rem;
    color: var(--tc-arc-faint);
    font-family: var(--term-font-mono, monospace);
    font-size: 0.59rem;
    letter-spacing: 0.02em;
}

/* -------------------------------------------------------------------------
   Evidence-time river
   ------------------------------------------------------------------------- */

.tc-evidence-river {
    padding: 0.8rem 1.3rem 1rem;
    border-bottom: 1px solid var(--tc-arc-line);
    background: rgb(7 16 20 / 36%);
}

.tc-evidence-river__header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 0.6rem;
    color: var(--tc-arc-faint);
    font-family: var(--term-font-mono, monospace);
    font-size: 0.55rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.tc-evidence-river__header strong {
    color: var(--tc-arc-muted);
    font-weight: 700;
}

.tc-evidence-river__header span:last-child {
    text-align: right;
}

.tc-evidence-river__track {
    position: relative;
    height: 2.3rem;
}

.tc-evidence-river__line {
    position: absolute;
    top: calc(50% - 0.5px);
    right: 0;
    left: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--tc-arc-blue), var(--tc-arc-live));
    opacity: 0.48;
}

.tc-evidence-river__line::after {
    position: absolute;
    top: -0.22rem;
    right: -0.05rem;
    width: 0.45rem;
    height: 0.45rem;
    border-top: 1px solid var(--tc-arc-live);
    border-right: 1px solid var(--tc-arc-live);
    transform: rotate(45deg);
    content: "";
}

/* Phase 3e (2026-08-01): quarter ticks — honest ordinal position marks
   between the header's Call opening / Now endpoints. */
.tc-evidence-river__tick {
    position: absolute;
    top: calc(50% - 0.3rem);
    left: var(--tc-moment);
    width: 1px;
    height: 0.6rem;
    background: var(--tc-arc-line);
    opacity: 0.7;
    pointer-events: none;
}

.tc-evidence-river__marker {
    position: absolute;
    z-index: 1;
    top: calc(50% + var(--tc-lane, 0rem));
    left: var(--tc-moment);
    /* Phase 3e (2026-08-01): 0.72rem hollow outlines were sub-perceptual at
       arm's length — 14px solid-filled markers at raised contrast. */
    width: 0.875rem;
    height: 0.875rem;
    padding: 0;
    border: 2px solid var(--tc-arc-muted);
    border-radius: 50%;
    background: color-mix(in srgb, var(--tc-arc-muted) 55%, var(--tc-arc-void));
    box-shadow: 0 0 0 0.2rem rgb(7 16 20 / 92%);
    transform: translate(-50%, -50%);
    cursor: pointer;
}

/* Hover/focus ring — the markers are buttons; say so. */
.tc-evidence-river__marker:hover,
.tc-evidence-river__marker:focus-visible {
    box-shadow:
        0 0 0 0.2rem rgb(7 16 20 / 92%),
        0 0 0 0.3rem var(--tc-arc-live);
    outline: none;
}

/* Phase 3e (2026-08-01): cluster marker — >2 facts at one moment collapse
   into one counted button (clinical-story-map _renderEvidenceRiver). */
.tc-evidence-river__cluster {
    width: 1.15rem;
    height: 1.15rem;
    color: var(--tc-arc-text);
    font-family: var(--term-font-mono, monospace);
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--tc-arc-muted) 30%, var(--tc-arc-void));
}

.tc-evidence-river__marker.is-chevron {
    border-radius: 0.1rem;
    clip-path: polygon(0 0, 68% 0, 100% 50%, 68% 100%, 0 100%, 28% 50%);
}

.tc-evidence-river__marker.is-diamond {
    border-radius: 0.08rem;
    transform: translate(-50%, -50%) rotate(45deg);
}

.tc-evidence-river__marker.is-fork {
    border-style: dashed;
    border-color: var(--tc-arc-warning);
}

/* Phase 3e (2026-08-01): trajectory facts declare shape 'wave' but had no
   rule — they silently fell back to circle. A flattened pill reads as
   movement without a new glyph system. */
.tc-evidence-river__marker.is-wave {
    height: 0.5rem;
    border-radius: 999px;
}

.tc-evidence-river__marker.is-critical,
.tc-evidence-river__marker.is-worsening {
    border-color: var(--tc-arc-critical);
    background: color-mix(in srgb, var(--tc-arc-critical) 45%, var(--tc-arc-void));
}

.tc-evidence-river__marker.is-improving,
.tc-evidence-river__marker.is-confirmed {
    border-color: var(--tc-arc-improving);
    background: color-mix(in srgb, var(--tc-arc-improving) 45%, var(--tc-arc-void));
}

.tc-evidence-river__marker.is-actionable {
    border-color: var(--tc-arc-live);
    background: color-mix(in srgb, var(--tc-arc-live) 45%, var(--tc-arc-void));
}

/* Phase 3e (2026-08-01): conflict / uncertain / negated all muted to the
   same gray — three different epistemic states, three distinct voices. */
.tc-evidence-river__marker.is-conflict {
    border-color: var(--tc-arc-warning);
    background: color-mix(in srgb, var(--tc-arc-warning) 45%, var(--tc-arc-void));
}

.tc-evidence-river__marker.is-uncertain {
    border-color: var(--tc-arc-warning);
    border-style: dashed;
    background: color-mix(in srgb, var(--tc-arc-warning) 20%, var(--tc-arc-void));
}

.tc-evidence-river__marker.is-negated {
    border-color: var(--tc-arc-faint);
    background: var(--tc-arc-void);
    opacity: 0.75;
}

/* Phase 3e (2026-08-01): compact tone key under the track. */
.tc-evidence-river__key {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 0.85rem;
    margin-top: 0.4rem;
    color: var(--tc-arc-muted);
    font-family: var(--term-font-mono, monospace);
    font-size: 0.62rem;
    letter-spacing: 0.05em;
}

.tc-evidence-river__key-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.tc-evidence-river__key-swatch {
    width: 0.5rem;
    height: 0.5rem;
    border: 1px solid var(--tc-arc-muted);
    border-radius: 50%;
}

.tc-evidence-river__key-swatch.is-critical { border-color: var(--tc-arc-critical); background: color-mix(in srgb, var(--tc-arc-critical) 45%, var(--tc-arc-void)); }
.tc-evidence-river__key-swatch.is-worsening { border-color: var(--tc-arc-critical); background: color-mix(in srgb, var(--tc-arc-critical) 45%, var(--tc-arc-void)); }
.tc-evidence-river__key-swatch.is-improving { border-color: var(--tc-arc-improving); background: color-mix(in srgb, var(--tc-arc-improving) 45%, var(--tc-arc-void)); }
.tc-evidence-river__key-swatch.is-actionable { border-color: var(--tc-arc-live); background: color-mix(in srgb, var(--tc-arc-live) 45%, var(--tc-arc-void)); }
.tc-evidence-river__key-swatch.is-uncertain { border-color: var(--tc-arc-warning); border-style: dashed; }
.tc-evidence-river__key-swatch.is-conflict { border-color: var(--tc-arc-warning); background: color-mix(in srgb, var(--tc-arc-warning) 45%, var(--tc-arc-void)); }

.tc-evidence-river__marker[aria-pressed="true"] {
    background: currentColor;
    box-shadow:
        0 0 0 0.22rem var(--tc-arc-void),
        0 0 0 0.32rem var(--tc-arc-live);
}

/* -------------------------------------------------------------------------
   Continuous clinical flow
   ------------------------------------------------------------------------- */

.tc-transfer-flow {
    position: relative;
    padding: 0.4rem 1.25rem 0.25rem;
}

.tc-transfer-flow::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 1.82rem;
    width: 1px;
    background: linear-gradient(
        to bottom,
        transparent,
        var(--tc-arc-line-strong) 8%,
        var(--tc-arc-line-strong) 92%,
        transparent
    );
    content: "";
}

.tc-flow-scene {
    position: relative;
    display: grid;
    grid-template-columns: 1.2rem minmax(0, 1fr);
    gap: 0 0.85rem;
    padding: 1rem 0 1.1rem;
}

.tc-flow-scene + .tc-flow-scene {
    border-top: 1px solid var(--tc-arc-line);
}

.tc-flow-scene__marker {
    position: relative;
    z-index: 1;
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 0.75rem;
    height: 0.75rem;
    margin-top: 0.18rem;
    border: 2px solid var(--tc-arc-blue);
    border-radius: 50%;
    background: var(--tc-arc-deep);
    box-shadow: 0 0 0 0.24rem var(--tc-arc-deep);
}

.tc-flow-scene--problems .tc-flow-scene__marker {
    border-color: var(--tc-arc-critical);
}

.tc-flow-scene--care .tc-flow-scene__marker {
    border-color: var(--tc-arc-live);
    border-radius: 0.12rem;
    clip-path: polygon(0 0, 68% 0, 100% 50%, 68% 100%, 0 100%, 28% 50%);
}

.tc-flow-scene--open .tc-flow-scene__marker {
    border-color: var(--tc-arc-warning);
    border-style: dashed;
}

.tc-flow-scene__heading {
    grid-column: 2;
    margin-bottom: 0.65rem;
}

.tc-flow-scene__heading h3 {
    margin: 0;
    font-family: var(--term-font-display, "Outfit", sans-serif);
    font-size: 0.93rem;
    font-weight: 550;
    line-height: 1.25;
}

.tc-flow-scene__heading p {
    margin: 0.16rem 0 0;
    color: var(--tc-arc-faint);
    font-size: 0.7rem;
    line-height: 1.4;
}

.tc-flow-scene__content {
    display: grid;
    grid-column: 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem 1rem;
}

/* Clinical knots are visual marks on the story, not cards. */
.tc-clinical-knot {
    min-width: 0;
    color: var(--tc-arc-text);
}

.tc-clinical-knot__button {
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 2.75rem;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.42rem 0.5rem;
    border: 0;
    border-radius: 0.55rem;
    color: inherit;
    background: transparent;
    text-align: left;
    font: inherit;
    cursor: pointer;
    transition: background var(--tc-motion-fast) var(--tc-ease), transform var(--tc-motion-fast) var(--tc-ease);
}

.tc-clinical-knot__button:hover,
.tc-clinical-knot.is-related .tc-clinical-knot__button {
    background: rgb(255 255 255 / 4%);
}

.tc-clinical-knot.is-selected .tc-clinical-knot__button {
    background: linear-gradient(90deg, var(--tc-arc-live-soft), transparent 92%);
    box-shadow: inset 2px 0 0 var(--tc-arc-live);
}

.tc-clinical-knot__shape {
    position: relative;
    width: 0.72rem;
    height: 0.72rem;
    flex: 0 0 auto;
    margin-top: 0.26rem;
    border: 2px solid var(--tc-arc-muted);
    border-radius: 50%;
    color: var(--tc-arc-muted);
    background: var(--tc-arc-deep);
}

.tc-clinical-knot.is-chevron .tc-clinical-knot__shape {
    border: 0;
    border-radius: 0.08rem;
    background: currentColor;
    clip-path: polygon(0 0, 68% 0, 100% 50%, 68% 100%, 0 100%, 28% 50%);
}

.tc-clinical-knot.is-diamond .tc-clinical-knot__shape {
    border-radius: 0.08rem;
    transform: rotate(45deg);
}

.tc-clinical-knot.is-fork .tc-clinical-knot__shape {
    border-color: var(--tc-arc-warning);
    border-style: dashed;
}

.tc-clinical-knot.is-wave .tc-clinical-knot__shape {
    height: 0.45rem;
    margin-top: 0.38rem;
    border-width: 2px 0 0;
    border-radius: 50%;
    transform: rotate(-12deg);
}

.tc-clinical-knot.is-critical .tc-clinical-knot__shape,
.tc-clinical-knot.is-worsening .tc-clinical-knot__shape {
    border-color: var(--tc-arc-critical);
    color: var(--tc-arc-critical);
}

.tc-clinical-knot.is-actionable .tc-clinical-knot__shape {
    border-color: var(--tc-arc-live);
    color: var(--tc-arc-live);
}

.tc-clinical-knot.is-improving .tc-clinical-knot__shape,
.tc-clinical-knot.is-confirmed .tc-clinical-knot__shape {
    border-color: var(--tc-arc-improving);
    color: var(--tc-arc-improving);
}

.tc-clinical-knot.is-conflict .tc-clinical-knot__shape,
.tc-clinical-knot.is-uncertain .tc-clinical-knot__shape {
    border-color: var(--tc-arc-warning);
    color: var(--tc-arc-warning);
}

.tc-clinical-knot.is-negated {
    opacity: 0.78;
}

.tc-clinical-knot__copy {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 0.12rem;
}

.tc-clinical-knot__label {
    color: var(--tc-arc-faint);
    font-family: var(--term-font-mono, monospace);
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tc-clinical-knot__value {
    color: var(--tc-arc-text);
    font-size: 0.88rem;
    font-weight: 560;
    line-height: 1.4;
    overflow-wrap: anywhere;
    /* Phase 3c (2026-08-01): 2-line clamp resting — a long fact can't swallow
       the card row; selection expands (detail view shows full text anyway). */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.tc-clinical-knot.is-selected .tc-clinical-knot__value,
.tc-now-nucleus .tc-clinical-knot__value {
    display: block;
    overflow: visible;
}

.tc-clinical-knot__meta {
    color: var(--tc-arc-muted);
    font-size: 0.65rem;
    line-height: 1.4;
}

.tc-clinical-knot.is-new {
    animation: tc-knot-enter var(--tc-motion-slow) var(--tc-ease-soft);
}

@keyframes tc-knot-enter {
    from {
        opacity: 0;
        transform: translateY(0.6rem) scale(0.97);
    }
}

/* Live refinement (2026-09-12): a fact that changed words or tone under the
   physician's eyes is outlined for a beat; a withdrawn one leaves visibly
   instead of vanishing between two renders. Keyed by reconcileKnots. */
.tc-clinical-knot.is-revised {
    animation: tc-knot-revised calc(var(--tc-motion-slow) * 3) var(--tc-ease-soft);
}

@keyframes tc-knot-revised {
    0%, 55% {
        box-shadow: 0 0 0 2px var(--term-gold, #D4A857);
    }
    100% {
        box-shadow: 0 0 0 2px transparent;
    }
}

.tc-clinical-knot.is-withdrawn {
    animation: tc-knot-leave calc(var(--tc-motion-slow) * 1.5) var(--tc-ease-soft) forwards;
    pointer-events: none;
}

@keyframes tc-knot-leave {
    to {
        opacity: 0;
        transform: translateY(0.4rem) scale(0.98);
    }
}

@media (prefers-reduced-motion: reduce) {
    .tc-clinical-knot.is-new,
    .tc-clinical-knot.is-revised {
        animation: none;
    }
    .tc-clinical-knot.is-withdrawn {
        display: none;
    }
}

.tc-clinical-knot__detail {
    margin: 0.2rem 0.5rem 0.55rem 1.85rem;
    padding: 0.55rem 0.65rem;
    border-left: 1px solid rgb(89 225 207 / 42%);
    background: linear-gradient(90deg, rgb(89 225 207 / 7%), transparent);
}

.tc-clinical-knot__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.tc-clinical-knot__source,
.tc-clinical-knot__correct {
    min-height: 2rem;
    padding: 0.28rem 0.48rem;
    border: 1px solid var(--tc-arc-line-strong);
    border-radius: 999px;
    color: var(--tc-arc-muted);
    background: rgb(7 16 20 / 64%);
    font: inherit;
    font-size: 0.64rem;
    font-weight: 700;
    cursor: pointer;
}

.tc-clinical-knot__source[aria-pressed="true"] {
    border-color: var(--tc-arc-live);
    color: var(--tc-arc-live);
    background: var(--tc-arc-live-soft);
}

.tc-clinical-knot__correct {
    margin-left: auto;
}

.tc-clinical-knot__quote {
    margin: 0.5rem 0 0;
    color: var(--tc-arc-muted);
    font-size: 0.74rem;
    line-height: 1.45;
}

.tc-clinical-knot__quote[data-source-kind="chart"]::before {
    display: block;
    margin-bottom: 0.18rem;
    color: var(--tc-arc-blue);
    font-family: var(--term-font-mono, monospace);
    font-size: 0.54rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    content: "Chart material";
}

/* -------------------------------------------------------------------------
   Explicit intervention ↔ response weave
   ------------------------------------------------------------------------- */

.tc-care-weave {
    grid-column: 2;
}

.tc-care-arc {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) 4.6rem minmax(0, 1fr);
    gap: 0.4rem;
    align-items: center;
    padding: 0.55rem 0;
}

.tc-care-arc + .tc-care-arc {
    border-top: 1px dashed var(--tc-arc-line);
}

.tc-care-arc__label {
    grid-column: 1 / -1;
    color: var(--tc-arc-faint);
    font-family: var(--term-font-mono, monospace);
    font-size: 0.55rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tc-care-arc__actions,
.tc-care-arc__responses {
    min-width: 0;
}

.tc-care-arc__connector {
    position: relative;
    min-width: 0;
    color: var(--tc-arc-faint);
    text-align: center;
}

.tc-care-arc__connector-line {
    display: flex;
    min-height: 1.25rem;
    align-items: center;
    justify-content: center;
    font-family: var(--term-font-mono, monospace);
    font-size: 0.46rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tc-care-arc.is-connected .tc-care-arc__connector::before {
    position: absolute;
    top: 50%;
    right: 0.2rem;
    left: 0.2rem;
    height: 1px;
    border-top: 1px dashed var(--tc-arc-live);
    content: "";
}

.tc-care-arc.is-connected .tc-care-arc__connector::after {
    position: absolute;
    top: calc(50% - 0.22rem);
    right: 0.05rem;
    width: 0.4rem;
    height: 0.4rem;
    border-top: 1px solid var(--tc-arc-live);
    border-right: 1px solid var(--tc-arc-live);
    transform: rotate(45deg);
    content: "";
}

.tc-care-arc.is-connected .tc-care-arc__connector-line {
    position: relative;
    z-index: 1;
    width: max-content;
    margin: auto;
    padding: 0 0.25rem;
    color: var(--tc-arc-live);
    background: var(--tc-arc-deep);
}

.tc-care-arc__awaiting {
    margin: 0;
    padding: 0.45rem 0.5rem;
    border-left: 1px dashed var(--tc-arc-warning);
    color: var(--tc-arc-warning);
    font-size: 0.7rem;
    line-height: 1.4;
}

/* -------------------------------------------------------------------------
   Open branches and transfer horizon
   ------------------------------------------------------------------------- */

.tc-open-branches {
    display: grid;
    grid-column: 2;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.35rem;
}

.tc-open-turn {
    display: flex;
    min-height: 2.75rem;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.5rem;
    border: 0;
    border-left: 1px dashed var(--tc-arc-warning);
    color: var(--tc-arc-text);
    background: transparent;
    text-align: left;
    font: inherit;
    font-size: 0.78rem;
    line-height: 1.45;
    cursor: pointer;
}

.tc-open-turn__label {
    flex: 0 0 auto;
    color: var(--tc-arc-warning);
    font-family: var(--term-font-mono, monospace);
    font-size: 0.53rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tc-transfer-horizon {
    position: relative;
    margin-top: 0.35rem;
    padding: 1.2rem 1.35rem 1.35rem;
    border-top: 1px solid rgb(89 225 207 / 48%);
    background:
        linear-gradient(180deg, rgb(89 225 207 / 9%), transparent 72%),
        rgb(7 16 20 / 48%);
}

.tc-transfer-horizon::before {
    position: absolute;
    top: -0.3rem;
    left: 1.55rem;
    width: 0.58rem;
    height: 0.58rem;
    border: 1px solid var(--tc-arc-live);
    background: var(--tc-arc-deep);
    transform: rotate(45deg);
    content: "";
}

.tc-transfer-horizon__kicker {
    color: var(--tc-arc-live);
    font-family: var(--term-font-mono, monospace);
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.tc-transfer-horizon__title {
    margin: 0.18rem 0 0.75rem;
    font-family: var(--term-font-display, "Outfit", sans-serif);
    font-size: 1.05rem;
    font-weight: 500;
}

.tc-transfer-horizon__facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem 0.8rem;
}

.tc-transfer-seal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px dashed var(--tc-arc-line-strong);
}

.tc-transfer-seal__status {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.5rem;
    color: var(--tc-arc-muted);
    font-size: 0.72rem;
    font-weight: 650;
}

.tc-transfer-seal__mark {
    width: 0.75rem;
    height: 0.75rem;
    flex: 0 0 auto;
    border: 1px solid var(--tc-arc-muted);
    border-radius: 50%;
}

.tc-transfer-seal.is-acknowledged .tc-transfer-seal__mark {
    border-color: var(--tc-arc-improving);
    background: var(--tc-arc-improving);
    box-shadow: 0 0 0 0.22rem var(--tc-arc-improving-soft);
}

.tc-transfer-seal.is-stale .tc-transfer-seal__mark {
    border-color: var(--tc-arc-warning);
    border-style: dashed;
    border-radius: 0;
    transform: rotate(45deg);
}

.tc-transfer-seal__action {
    min-height: 2.6rem;
    padding: 0.4rem 0.7rem;
    border: 1px solid var(--tc-arc-live);
    border-radius: 999px;
    color: var(--tc-arc-void);
    background: var(--tc-arc-live);
    font: inherit;
    font-size: 0.68rem;
    font-weight: 800;
    cursor: pointer;
}

.tc-transfer-seal__error,
.tc-inline-correction__error {
    margin: 0.35rem 0 0;
    color: var(--tc-arc-critical);
    font-size: 0.72rem;
    line-height: 1.4;
}

/* -------------------------------------------------------------------------
   Inline correction
   ------------------------------------------------------------------------- */

.tc-inline-correction {
    margin: 0.35rem 0.5rem 0.6rem 1.85rem;
}

.tc-inline-correction__label {
    display: grid;
    gap: 0.35rem;
    color: var(--tc-arc-muted);
    font-size: 0.68rem;
    font-weight: 700;
}

.tc-inline-correction__input {
    width: 100%;
    min-height: 4.75rem;
    resize: vertical;
    padding: 0.6rem;
    border: 1px solid var(--tc-arc-line-strong);
    border-radius: 0.45rem;
    color: var(--tc-arc-text);
    background: var(--tc-arc-surface);
    font: inherit;
    font-size: 0.88rem;
    line-height: 1.5;
}

.tc-inline-correction__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.45rem;
    margin-top: 0.45rem;
}

.tc-inline-correction__cancel,
.tc-inline-correction__save {
    min-height: 2.5rem;
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--tc-arc-line-strong);
    border-radius: 999px;
    color: var(--tc-arc-text);
    background: var(--tc-arc-deep);
    font: inherit;
    font-size: 0.7rem;
    font-weight: 750;
    cursor: pointer;
}

.tc-inline-correction__save {
    border-color: var(--tc-arc-live);
    color: var(--tc-arc-void);
    background: var(--tc-arc-live);
}

.tc-clinical-canvas button:focus-visible,
.tc-clinical-canvas [tabindex]:focus-visible,
.tc-inline-correction__input:focus-visible {
    outline: 3px solid var(--tc-arc-blue);
    outline-offset: 2px;
}

.tc-clinical-canvas button:disabled {
    cursor: wait;
    opacity: 0.6;
}

/* -------------------------------------------------------------------------
   Responsive shell and compact modes
   ------------------------------------------------------------------------- */

@media (max-width: 1199.98px) { /* adjudicate F-13: was 1099.98 — the 1100-1199.98 band fell through to the base 2-col fixed-height regime with the switcher hidden (both panes side-by-side, clip risk). The tapestry sub-desktop stack is already max 1199.98, so the canvas compact regime now owns the same band. */
    html {
        height: auto;
        overflow: auto;
    }

    body.tc-clinical-canvas-on {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(9rem, 22vh) auto;
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .tc-clinical-canvas-on .tc-header {
        grid-column: 1;
        grid-row: 1;
    }

    .tc-clinical-canvas-on .tc-list-panel {
        display: block;
        grid-column: 1;
        grid-row: 2;
        max-height: 22vh;
        overflow-y: auto;
        border-right: 0;
        border-bottom: 1px solid var(--term-boundary);
        box-shadow: 0 1px 0 rgb(0 0 0 / 60%);
    }

    .tc-clinical-canvas-on.tc-clinical-live .tc-list-panel {
        display: none;
    }

    body.tc-clinical-canvas-on.tc-clinical-live {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
        height: 100vh;
        min-height: 0;
        overflow: hidden;
    }

    .tc-clinical-canvas-on .tc-workspace,
    .tc-clinical-canvas-on.tc-clinical-live .tc-workspace {
        grid-column: 1;
        grid-row: 3;
        min-width: 0;
        overflow: visible;
    }

    .tc-clinical-canvas-on.tc-clinical-live .tc-workspace {
        grid-row: 2;
        min-height: 0;
        height: 100%;
        overflow: hidden;
    }

    .tc-clinical-canvas-on .tc-workspace-form,
    .tc-clinical-canvas-on .tc-recorder {
        min-width: 0;
    }

    /* REMOVED (2026-08-06, responsive audit Stage 1): this block declared
       `.tc-clinical-canvas { grid-template-columns: minmax(0,1fr) minmax(24rem,1fr);
       min-height: 38rem }` — DEAD ON ARRIVAL. The later same-condition block
       below (1-col, min-height:36rem) overrides both declarations at equal
       specificity. It survived only as re-arm risk on any reorder. */

    .tc-clinical-canvas-on.tc-clinical-live .tc-recorder > .tc-clinical-canvas {
        min-height: 0;
        height: auto;
    }

    .tc-flow-scene__content,
    .tc-transfer-horizon__facts {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 1199.98px) { /* adjudicate F-13: was 1099.98 — the 1100-1199.98 band fell through to the base 2-col fixed-height regime with the switcher hidden (both panes side-by-side, clip risk). The tapestry sub-desktop stack is already max 1199.98, so the canvas compact regime now owns the same band. */
    .tc-clinical-canvas {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto minmax(0, 1fr);
        height: min(72vh, 52rem);
        min-height: 36rem;
    }

    .tc-clinical-canvas__switcher {
        display: grid;
        z-index: 3;
        grid-column: 1;
        grid-row: 1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.25rem;
        padding: 0.3rem;
        border-bottom: 1px solid var(--tc-arc-line);
        background: var(--tc-arc-deep);
    }

    .tc-clinical-canvas__switcher button {
        min-height: 2.8rem;
        border: 0;
        border-radius: 0.5rem;
        color: var(--tc-arc-muted);
        background: transparent;
        font: inherit;
        font-size: 0.78rem;
        font-weight: 750;
        cursor: pointer;
    }

    .tc-clinical-canvas__switcher button[aria-pressed="true"] {
        color: var(--tc-arc-text);
        background: var(--tc-arc-surface-soft);
        box-shadow: inset 0 -2px 0 var(--tc-arc-live);
    }

    .tc-clinical-now-ribbon {
        display: grid;
        z-index: 2;
        grid-column: 1;
        grid-row: 2;
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 0.4rem 0.65rem;
        align-items: center;
        min-height: 3.2rem;
        padding: 0.55rem 0.75rem;
        border: 0;
        border-bottom: 1px solid var(--tc-arc-line);
        color: var(--tc-arc-text);
        background: linear-gradient(90deg, var(--tc-arc-live-soft), var(--tc-arc-deep));
        text-align: left;
        font: inherit;
        cursor: pointer;
    }

    .tc-clinical-now-ribbon[hidden] {
        display: none;
    }

    .tc-clinical-now-ribbon span {
        color: var(--tc-arc-live);
        font-family: var(--term-font-mono, monospace);
        font-size: 0.58rem;
        font-weight: 800;
        letter-spacing: 0.1em;
        text-transform: uppercase;
    }

    .tc-clinical-now-ribbon strong {
        overflow: hidden;
        font-size: 0.76rem;
        font-weight: 650;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .tc-clinical-now-ribbon em {
        color: var(--tc-arc-warning);
        font-family: var(--term-font-mono, monospace);
        font-size: 0.56rem;
        font-style: normal;
    }

    .tc-clinical-canvas__transcript-pane,
    .tc-clinical-canvas__story-pane {
        grid-column: 1;
        grid-row: 3;
        border-right: 0;
    }

    .tc-clinical-canvas[data-clinical-view="transcript"] .tc-clinical-canvas__story-pane,
    .tc-clinical-canvas[data-clinical-view="story"] .tc-clinical-canvas__transcript-pane {
        display: none;
    }

    .tc-clinical-canvas-on.tc-clinical-live .tc-recorder > .tc-clinical-canvas {
        min-height: 0;
        height: auto;
    }
}

@media (max-width: 600px) {
    .tc-clinical-canvas-on .tc-workspace,
    .tc-clinical-canvas-on.tc-clinical-live .tc-workspace {
        padding: 0.55rem;
    }

    .tc-clinical-canvas-on .tc-topbar {
        flex-wrap: wrap;
    }

    .tc-clinical-canvas-on .tc-topbar-name {
        width: 100%;
        flex: 1 1 100%;
    }

    .tc-clinical-canvas-on .tc-decision-buttons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tc-clinical-canvas-on .tc-decision-btn {
        min-width: 0;
    }

    .tc-clinical-canvas {
        min-height: 34rem;
        border-radius: 0.9rem;
    }

    .tc-live-transcript__header,
    .tc-transfer-arc__header {
        min-height: 4.5rem;
        padding-inline: 0.8rem;
    }

    .tc-live-transcript__turn {
        max-width: 96%;
        padding-inline: 0.85rem;
    }

    .tc-live-transcript__turn[data-speaker-role="accepting"],
    .tc-live-transcript__turn[data-speaker-role="transfer_center"] {
        margin-right: 0.3rem;
    }

    .tc-live-transcript__turn-meta {
        flex-wrap: wrap;
    }

    .tc-now-nucleus {
        padding: 1.15rem 0.9rem 1rem;
    }

    .tc-now-nucleus::after {
        right: 0.7rem;
    }

    .tc-now-nucleus__fact,
    .tc-now-nucleus__movement {
        max-width: 92%;
    }

    .tc-evidence-river {
        padding-inline: 0.9rem;
    }

    .tc-transfer-flow {
        padding-inline: 0.75rem;
    }

    .tc-transfer-flow::before {
        left: 1.3rem;
    }

    .tc-flow-scene {
        grid-template-columns: 1rem minmax(0, 1fr);
        gap: 0 0.55rem;
    }

    .tc-flow-scene__content {
        grid-template-columns: minmax(0, 1fr);
    }

    .tc-care-arc {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.3rem;
    }

    .tc-care-arc__label,
    .tc-care-arc__actions,
    .tc-care-arc__connector,
    .tc-care-arc__responses {
        grid-column: 1;
    }

    .tc-care-arc__connector {
        width: 1.1rem;
        height: 1.6rem;
        margin-left: 0.6rem;
    }

    .tc-care-arc.is-connected .tc-care-arc__connector::before {
        top: 0;
        bottom: 0;
        left: 50%;
        width: 1px;
        height: auto;
        border-top: 0;
        border-left: 1px dashed var(--tc-arc-live);
    }

    .tc-care-arc.is-connected .tc-care-arc__connector::after {
        top: auto;
        right: auto;
        bottom: 0.05rem;
        left: calc(50% - 0.2rem);
        transform: rotate(135deg);
    }

    .tc-care-arc__connector-line {
        display: none;
    }

    .tc-transfer-horizon {
        padding-inline: 0.9rem;
    }

    .tc-transfer-horizon__facts {
        grid-template-columns: minmax(0, 1fr);
    }

    .tc-transfer-seal {
        align-items: stretch;
        flex-direction: column;
    }

    .tc-transfer-seal__action {
        width: 100%;
    }

    .tc-clinical-knot__detail,
    .tc-inline-correction {
        margin-left: 1.35rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tc-clinical-canvas *,
    .tc-clinical-canvas *::before,
    .tc-clinical-canvas *::after {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }
}

@media (forced-colors: active) {
    .tc-clinical-canvas,
    .tc-clinical-knot__shape,
    .tc-evidence-river__marker,
    .tc-flow-scene__marker,
    .tc-transfer-seal__mark {
        border-color: CanvasText;
    }

    .tc-live-transcript__turn.is-selected,
    .tc-clinical-knot.is-selected {
        outline: 2px solid Highlight;
    }
}

/* -------------------------------------------------------------------------
 * Bedside rail — the room layer (2026-07-18).
 *
 * Door card, stated-measurement monitor, voice presence, and the call clock.
 * Every value restates projection data or doctor-entered workspace fields.
 * Movement glyphs restate value pairs the fact itself asserts; the rail never
 * charts, extrapolates, or invents a trend.
 * ------------------------------------------------------------------------- */

.tc-clinical-canvas {
    grid-template-rows: auto minmax(0, 1fr);
}

.tc-clinical-canvas__bedside {
    z-index: 2;
    grid-column: 1 / -1;
    grid-row: 1;
    min-width: 0;
}

.tc-clinical-canvas__transcript-pane,
.tc-clinical-canvas__story-pane {
    grid-row: 2;
}

.tc-bedside {
    display: flex;
    align-items: stretch;
    gap: 0.9rem;
    min-height: 3.3rem;
    padding: 0.45rem 0.9rem;
    border-bottom: 1px solid var(--tc-arc-line);
    background: linear-gradient(180deg, rgb(14 27 32 / 88%), rgb(10 21 25 / 62%));
}

.tc-bedside.is-empty {
    display: none;
}

.tc-bedside__door {
    display: flex;
    flex: 0 1 auto;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    max-width: 15rem;
}

.tc-bedside__name {
    overflow: hidden;
    color: var(--tc-arc-text);
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tc-bedside__descriptor {
    color: var(--tc-arc-muted);
    font-family: var(--term-font-mono, monospace);
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tc-bedside__signals {
    display: flex;
    flex: 1 1 auto;
    align-items: stretch;
    gap: 0.45rem;
    min-width: 0;
    padding-block: 0.1rem;
    overflow-x: auto;
    scrollbar-width: thin;
}

.tc-bedside__signal {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    justify-content: center;
    gap: 0.14rem;
    min-width: 7.5rem;
    max-width: 13rem;
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--tc-arc-line);
    border-radius: 0.6rem;
    color: var(--tc-arc-text);
    background: rgb(7 16 20 / 72%);
    text-align: left;
    font: inherit;
    cursor: pointer;
    transition: border-color var(--tc-motion-fast) var(--tc-ease), box-shadow var(--tc-motion-fast) var(--tc-ease);
}

.tc-bedside__signal:hover,
.tc-bedside__signal:focus-visible {
    border-color: var(--tc-arc-line-strong);
}

.tc-bedside__signal.is-selected {
    border-color: var(--tc-arc-live);
    box-shadow: 0 0 0 1px var(--tc-arc-live), 0 0 18px rgb(89 225 207 / 22%);
}

.tc-bedside__signal.is-critical {
    border-color: rgb(255 116 116 / 55%);
    box-shadow: 0 0 14px rgb(255 116 116 / 14%);
}

.tc-bedside__signal.is-worsening {
    border-color: rgb(255 196 107 / 45%);
}

.tc-bedside__signal.is-improving {
    border-color: rgb(126 226 168 / 40%);
}

.tc-bedside__signal-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--tc-arc-muted);
    font-family: var(--term-font-mono, monospace);
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.tc-bedside__movement {
    font-size: 0.7rem;
    line-height: 1;
}

.tc-bedside__movement.is-down { color: var(--tc-arc-warning); }
.tc-bedside__movement.is-up { color: var(--tc-arc-blue); }

.tc-bedside__signal-value {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    color: var(--tc-arc-text);
    font-family: var(--term-font-mono, monospace);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.25;
}

.tc-bedside__signal-time {
    color: var(--tc-arc-faint);
    font-family: var(--term-font-mono, monospace);
    font-size: 0.55rem;
}

/* Stated-reading run: "68 → 61 → 54". Quieter than the current value, which
 * stays the thing the eye lands on. Every number here was spoken on the call. */
.tc-bedside__signal-series {
    color: var(--tc-arc-faint);
    font-family: var(--term-font-mono, monospace);
    font-size: 0.58rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* Aged reading: still the latest thing said, so it dims rather than hides.
 * Opacity only — no reordering, no motion, nothing that pulls the eye. */
.tc-bedside__signal.is-stale {
    opacity: 0.55;
}

.tc-bedside__signal.is-stale:hover,
.tc-bedside__signal.is-stale:focus-visible,
.tc-bedside__signal.is-stale.is-selected {
    opacity: 1;
}

/* -------------------------------------------------------------------------
 * Capture health (2026-07-25).
 *
 * Renders only when capture is NOT healthy. A degraded pipeline used to look
 * exactly like a quiet room; this is the line that tells the two apart, and it
 * says what to do rather than naming a state.
 * ---------------------------------------------------------------------- */

.tc-bedside__capture {
    display: flex;
    flex: 0 0 auto;
    /* Sits beside the door card, so it must NOT stretch to rail height — the
     * patient's name is the thing that should dominate this strip. Rendering it
     * showed a transient warning taking a third of the rail with a tall empty
     * box under two words of text. */
    align-self: center;
    max-width: 22rem;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.24rem 0.55rem;
    border: 1px solid var(--term-status-editing, #d79921);
    border-radius: 0.55rem;
    background: color-mix(in srgb, var(--term-status-editing, #d79921) 12%, transparent);
}

.tc-bedside__capture.is-severe {
    border-color: var(--term-red, #cc241d);
    background: color-mix(in srgb, var(--term-red, #cc241d) 14%, transparent);
}

.tc-bedside__capture-label {
    color: var(--tc-arc-text);
    font-size: 0.66rem;
    font-weight: 600;
}

.tc-bedside__capture-detail {
    color: var(--tc-arc-faint);
    font-family: var(--term-font-mono, monospace);
    font-size: 0.58rem;
}

/* -------------------------------------------------------------------------
 * Collapsed call-noise run (2026-07-25, ENABLE_TC_NOISE_TRIAGE).
 *
 * Content-free chatter is grouped, never removed. The chip is deliberately
 * plain — it is a seam in the conversation, not an alert — and one click opens
 * the run verbatim.
 * ---------------------------------------------------------------------- */

.tc-live-transcript__noise-run {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.16rem 0.5rem;
    border: 1px dashed var(--tc-arc-line);
    border-radius: 0.5rem;
    background: transparent;
    color: var(--tc-arc-faint);
    font-family: inherit;
    font-size: 0.62rem;
    text-align: left;
    cursor: pointer;
}

.tc-live-transcript__noise-run:hover,
.tc-live-transcript__noise-run:focus-visible {
    border-style: solid;
    color: var(--tc-arc-text);
}

.tc-live-transcript__noise-caret {
    font-family: var(--term-font-mono, monospace);
}

/* An expanded noise line stays legible but recedes — the doctor opened it, so
 * it must be readable; it is still not the clinical thread.
 *
 * Ink is pinned back to full white here so noise dims on the opacity channel
 * ALONE. Darkened ink and reduced opacity are independent dimming channels and
 * they multiply in perceived contrast: tier-3 muted ink at 0.6 measures 3.5:1,
 * and the original faint ink measured 2.19:1. Dimming twice is how a line
 * becomes unreadable while every individual rule still looks defensible. */
.tc-live-transcript__turn.is-noise {
    --tc-turn-ink: var(--tc-arc-text);
    opacity: 0.6;
}

.tc-live-transcript__turn.is-noise:hover,
.tc-live-transcript__turn.is-noise:focus-within,
.tc-live-transcript__turn.is-noise.is-selected {
    opacity: 1;
}

.tc-bedside__presence {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.55rem;
}

.tc-bedside__voice {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    color: var(--tc-arc-muted);
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
}

.tc-bedside__voice-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: var(--tc-arc-faint);
    transition: background-color var(--tc-motion-base) var(--tc-ease), box-shadow var(--tc-motion-base) var(--tc-ease);
}

.tc-bedside__voice[data-speaker-role="accepting"] .tc-bedside__voice-dot,
.tc-bedside__voice[data-speaker-role="transfer_center"] .tc-bedside__voice-dot {
    background: rgb(89 225 207 / 55%);
}

.tc-bedside__voice[data-speaker-role="referring"] .tc-bedside__voice-dot {
    background: rgb(138 180 255 / 55%);
}

.tc-bedside__voice.is-speaking {
    color: var(--tc-arc-text);
}

.tc-bedside__voice.is-speaking .tc-bedside__voice-dot {
    background: var(--tc-arc-live);
    box-shadow: 0 0 8px rgb(89 225 207 / 55%);
    animation: tc-voice-breathe calc(var(--tc-motion-slow) * 4) var(--tc-ease-soft) infinite;
}

.tc-bedside__voice[data-speaker-role="referring"].is-speaking .tc-bedside__voice-dot {
    background: var(--tc-arc-blue);
    box-shadow: 0 0 8px rgb(138 180 255 / 55%);
}

@keyframes tc-voice-breathe {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.35); opacity: 0.72; }
}

.tc-bedside__clock {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 0.1rem;
}

.tc-bedside__elapsed {
    color: var(--tc-arc-live);
    font-family: var(--term-font-mono, monospace);
    font-size: 0.82rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
}

.tc-bedside__quiet {
    color: var(--tc-arc-warning);
    font-family: var(--term-font-mono, monospace);
    font-size: 0.58rem;
    letter-spacing: 0.05em;
}

/* Reduced motion: the ladder still applies, it just snaps instead of easing.
 * Substitution rather than relying on the canvas-wide blanket, so the intent is
 * explicit at the rule that owns the motion. */
@media (prefers-reduced-motion: reduce) {
    .tc-live-transcript__turn,
    .tc-live-transcript__text,
    .tc-live-transcript__turn-meta {
        transition: none;
    }
}

.tc-visually-hidden {
    position: absolute;
    overflow: hidden;
    width: 1px;
    height: 1px;
    margin: -1px;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* -------------------------------------------------------------------------
 * Room lighting — the canvas ambient follows the patient's stated state.
 * A tint layer eases in when critical facts are active (or, when the
 * projection states it, a worsening/improving trajectory). Color is never
 * the sole signal: the same facts render as text in the nucleus and arc.
 * ------------------------------------------------------------------------- */

.tc-clinical-canvas::after {
    position: absolute;
    z-index: 0;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--tc-motion-slow) var(--tc-ease);
    content: "";
}

.tc-clinical-canvas[data-room-tone]::after {
    opacity: 1;
}

.tc-clinical-canvas[data-room-tone="critical"]::after {
    background: radial-gradient(circle at 12% 8%, rgb(255 116 116 / 8%), transparent 30rem);
}

.tc-clinical-canvas[data-room-tone="critical"] {
    border-color: rgb(255 116 116 / 34%);
}

.tc-clinical-canvas[data-room-tone="worsening"]::after {
    background: radial-gradient(circle at 12% 8%, rgb(255 196 107 / 7%), transparent 30rem);
}

.tc-clinical-canvas[data-room-tone="improving"]::after {
    background: radial-gradient(circle at 12% 8%, rgb(126 226 168 / 6%), transparent 30rem);
}

/* -------------------------------------------------------------------------
 * Critical arrivals flare once, then rest. Open branches hold a lantern.
 * ------------------------------------------------------------------------- */

.tc-clinical-knot.is-new.is-critical .tc-clinical-knot__shape {
    animation: tc-critical-flare calc(var(--tc-motion-slow) * 3.75) var(--tc-ease-soft) 1;
}

@keyframes tc-critical-flare {
    0% { box-shadow: 0 0 0 0 rgb(255 116 116 / 60%); }
    100% { box-shadow: 0 0 0 1.1rem rgb(255 116 116 / 0%); }
}

.tc-evidence-river__marker.is-critical {
    box-shadow: 0 0 10px rgb(255 116 116 / 45%);
}

.tc-flow-scene--open .tc-flow-scene__marker {
    box-shadow: 0 0 12px rgb(255 196 107 / 30%);
}

/* Provisional speech breathes with the speaker while words settle. */
.tc-live-transcript__partial {
    border-left: 2px solid rgb(138 180 255 / 45%);
    animation: tc-partial-breathe calc(var(--tc-motion-slow) * 5.5) var(--tc-ease-soft) infinite;
}

@keyframes tc-partial-breathe {
    0%, 100% { opacity: 0.92; }
    50% { opacity: 0.62; }
}

/* Responsive: the rail compresses to one scrollable line under the mobile
   switcher/ribbon rows; panes drop one row down. */
@media (max-width: 1199.98px) { /* adjudicate F-13: was 1099.98 — the 1100-1199.98 band fell through to the base 2-col fixed-height regime with the switcher hidden (both panes side-by-side, clip risk). The tapestry sub-desktop stack is already max 1199.98, so the canvas compact regime now owns the same band. */
    .tc-clinical-canvas {
        grid-template-rows: auto auto auto minmax(0, 1fr);
    }

    .tc-clinical-canvas__bedside {
        grid-column: 1;
        grid-row: 3;
    }

    .tc-clinical-canvas__transcript-pane,
    .tc-clinical-canvas__story-pane {
        grid-row: 4;
    }

    .tc-bedside {
        gap: 0.6rem;
        min-height: 2.9rem;
        padding: 0.35rem 0.6rem;
    }

    .tc-bedside__door {
        max-width: 9.5rem;
    }

    .tc-bedside__presence {
        gap: 0.4rem;
    }

    .tc-bedside__voice span:not(.tc-bedside__voice-dot) {
        display: none;
    }

    .tc-bedside__voice.is-speaking span:not(.tc-bedside__voice-dot) {
        display: inline;
    }
}

@media (forced-colors: active) {
    .tc-bedside,
    .tc-bedside__signal,
    .tc-bedside__voice-dot {
        border: 1px solid CanvasText;
    }

    .tc-bedside__signal.is-selected {
        outline: 2px solid Highlight;
    }
}

/* The renderer toggles [hidden] on rail sections; flex must not defeat it. */
.tc-bedside__signals[hidden],
.tc-bedside__presence[hidden],
.tc-bedside__clock[hidden] {
    display: none !important;
}

/* Phones: the monitor compresses to single-line readings so the rail stays
   one compact strip between the ribbon and the panes. */
@media (max-width: 1199.98px) { /* adjudicate F-13: was 1099.98 — the 1100-1199.98 band fell through to the base 2-col fixed-height regime with the switcher hidden (both panes side-by-side, clip risk). The tapestry sub-desktop stack is already max 1199.98, so the canvas compact regime now owns the same band. */
    .tc-bedside__signal {
        min-width: 6.5rem;
        padding-block: 0.24rem;
    }

    .tc-bedside__signal-value {
        -webkit-line-clamp: 1;
        line-clamp: 1;
    }

    .tc-bedside__signal-time {
        display: none;
    }
}

/* -------------------------------------------------------------------------
 * Negative-space agenda (2026-07-18, ENABLE_TC_NEGATIVE_SPACE).
 *
 * The call's remaining agenda: ten registry-static need-slots, fixed order,
 * open or answered. Calm by design — answered dims via a slow opacity-only
 * transition; open is neutral, never alarmed. No keyframes, no reordering.
 * ------------------------------------------------------------------------- */

.tc-clinical-canvas {
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.tc-clinical-canvas__agenda {
    z-index: 2;
    grid-column: 1 / -1;
    grid-row: 3;
    min-width: 0;
}

.tc-agenda {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.4rem;
    padding: 0.3rem 0.9rem;
    border-top: 1px solid var(--tc-arc-line);
    background: rgb(7 16 20 / 78%);
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--term-border-default, #2A2720) transparent;
    /* Phase 1 (2026-08-01): the last chip hard-clipped at the panel edge with
       no continuation signal — fade the trailing edge. */
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2.2rem), transparent 100%);
    mask-image: linear-gradient(to right, #000 calc(100% - 2.2rem), transparent 100%);
}

/* Phase 1 (2026-08-01): the ten slots always overflow this strip, so the raw
   native horizontal scrollbar sat permanently under the bottom band. Give it
   the app's thin custom treatment (pattern: transfer-center.css S22). */
.tc-agenda::-webkit-scrollbar {
    height: 6px;
}

.tc-agenda::-webkit-scrollbar-track {
    background: transparent;
}

.tc-agenda::-webkit-scrollbar-thumb {
    background: var(--term-border-default, #2A2720);
    border-radius: 3px;
}

.tc-agenda::-webkit-scrollbar-thumb:hover {
    background: var(--term-border-strong, #3A352F);
}

.tc-agenda__slot {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.34rem;
    padding: 0.22rem 0.6rem;
    border: 1px solid var(--tc-arc-line);
    border-radius: 1rem;
    color: var(--tc-arc-text);
    background: transparent;
    font: inherit;
    font-size: 0.6875rem; /* P-3c8 (2026-08-15): 10.6px -> 11px legibility floor */
    font-weight: 600;
    white-space: nowrap;
    transition: opacity var(--tc-motion-slow) var(--tc-ease), border-color var(--tc-motion-slow) var(--tc-ease);
}

.tc-agenda__slot.is-answered {
    opacity: 0.45;
    border-color: var(--tc-arc-line);
}

/* Only fact-backed answered chips are clickable (rendered as <button>); a
   disposition-only answered "logistics" chip is a non-interactive <span> and
   must not show a hand cursor. */
button.tc-agenda__slot.is-answered {
    cursor: pointer;
}

.tc-agenda__slot.is-open {
    opacity: 1;
}

.tc-agenda__dot {
    width: 0.4rem;
    height: 0.4rem;
    border: 1px solid var(--tc-arc-muted);
    border-radius: 50%;
    background: transparent;
}

.tc-agenda__slot.is-answered .tc-agenda__dot {
    border-color: var(--tc-arc-live);
    background: var(--tc-arc-live);
}

.tc-agenda__open-copy {
    color: var(--tc-arc-faint);
    font-family: var(--term-font-mono, monospace);
    font-size: 0.56rem;
    font-weight: 500;
}

/* Phase 3e (2026-08-01): the chip row is a CALL AGENDA, not a timeline
   legend — name it at the row's left edge (negative-space-panel emits the
   kicker span; aria-label already carried the meaning for screen readers). */
.tc-agenda__kicker {
    flex: 0 0 auto;
    align-self: center;
    margin-right: 0.35rem;
    color: var(--tc-arc-muted);
    font-family: var(--term-font-mono, monospace);
    font-size: 0.6875rem; /* P-3c8 (2026-08-15): 9.9px -> 11px legibility floor */
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

/* Phase 3e (2026-08-01): 'unasked' must read as a STATE, not as disabled
   chrome — hollow chip, full-contrast label, open-copy raised to 11px. */
.tc-agenda__slot.is-open {
    border-style: dashed;
    border-color: var(--tc-arc-muted);
}

.tc-agenda__slot.is-open .tc-agenda__open-copy {
    color: var(--tc-arc-muted);
    font-size: 0.6875rem;
}

@media (max-width: 1199.98px) { /* adjudicate F-13: was 1099.98 — the 1100-1199.98 band fell through to the base 2-col fixed-height regime with the switcher hidden (both panes side-by-side, clip risk). The tapestry sub-desktop stack is already max 1199.98, so the canvas compact regime now owns the same band. */
    .tc-clinical-canvas {
        grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    }

    .tc-clinical-canvas__agenda {
        grid-column: 1;
        grid-row: 5;
    }

    .tc-agenda {
        padding: 0.28rem 0.6rem;
    }
}

@media (forced-colors: active) {
    .tc-agenda__slot,
    .tc-agenda__dot {
        border-color: CanvasText;
    }
}

/* Post-call assembly (2026-07-29, data-story-phase="assembling")
   The empty state's copy is true but static, so for the 15-85s the projection
   actually takes it is indistinguishable from "nothing is coming" -- which is
   precisely how a working panel got reported as dead. Set by clinical-canvas.js
   while the post-call poll is in flight; removed on every terminal phase. */
#tcClinicalCanvas[data-story-phase="assembling"] .tc-transfer-arc__empty-kicker::after {
    content: " — assembling";
    color: var(--tc-loom-brass, #c8a45c);
}
#tcClinicalCanvas[data-story-phase="assembling"] .tc-transfer-arc__empty-path {
    animation: tc-story-assembling calc(var(--tc-motion-slow) * 4) var(--tc-ease-soft) infinite;
}
@keyframes tc-story-assembling {
    0%, 100% { opacity: 0.25; }
    50%      { opacity: 0.85; }
}
@media (prefers-reduced-motion: reduce) {
    #tcClinicalCanvas[data-story-phase="assembling"] .tc-transfer-arc__empty-path {
        animation: none;
        opacity: 0.85;
    }
}
