  .tl-cycles-shell {
    display: grid;
    grid-template-columns: 220px 1fr 360px;
    gap: var(--tl-space-4);
    min-height: calc(100vh - 240px);
  }
  /* Artifact pane collapsed (hidden) by default => research-only renders as a
     two-column layout (rail + chat). The grid re-flows to 220px 1fr when the
     pane is hidden so the chat fills the freed column. */
  .tl-cycles-shell.tl-no-artifact { grid-template-columns: 220px 1fr; }
  /* Embedded mode: rendered INLINE inside the cycle page's Conversation
     accordion (2026-06-13 — replaced the old iframe embed). No history rail,
     so the chat (+ optional artifact pane) fills the full width. A bounded
     min-height gives the inline widget real presence (the iframe used to supply
     a fixed 640px) while the messages list scrolls internally — the page itself
     scrolls around it, no nested iframe scrollbar. */
  .tl-cycles-shell.tl-embed { grid-template-columns: 1fr 360px; min-height: 600px; }
  .tl-cycles-shell.tl-embed.tl-no-artifact { grid-template-columns: 1fr; }
  @media (max-width: 1199px) {
    .tl-cycles-shell { grid-template-columns: 1fr; gap: var(--tl-space-4); }
    .tl-cycles-shell.tl-no-artifact { grid-template-columns: 1fr; }
    .tl-cycles-shell .tl-chat-history-rail { order: 3; }
    .tl-cycles-shell .tl-cycles-chat       { order: 1; }
    .tl-cycles-shell .tl-cycles-artifact   { order: 2; }
  }

  .tl-chat-history-rail {
    background: rgba(255,255,255,0.015);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    overflow: hidden;
    display: flex; flex-direction: column;
  }
  .tl-chr-head {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(0,0,0,0.18);
    font-family: var(--tl-mono); font-size: 11px;
    text-transform: uppercase; letter-spacing: 1.5px;
    color: rgba(255,255,255,0.55);
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
  }
  .tl-chr-search {
    width: 100%;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.08);
    color: #fff; font-size: 12px; padding: 6px 10px; border-radius: 5px;
    margin: 8px 10px; outline: none;
    box-sizing: border-box; width: calc(100% - 20px);
  }
  .tl-chr-search:focus { border-color: var(--tl-gold); }
  .tl-chr-list { flex: 1; overflow-y: auto; padding: 4px 0 12px; }
  .tl-chr-row {
    display: flex; align-items: flex-start; gap: 6px;
    padding: 8px 12px;
    color: rgba(255,255,255,0.85); text-decoration: none;
    border-left: 2px solid transparent;
    cursor: pointer;
  }
  .tl-chr-row:hover { background: rgba(255,255,255,0.03); color: #fff; }
  .tl-chr-row.active { background: rgba(88,166,255,0.10); border-left-color: var(--tl-gold); }
  .tl-chr-row-body { flex: 1; min-width: 0; }
  .tl-chr-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tl-chr-ts { font-family: var(--tl-mono); font-size: 10px; color: rgba(255,255,255,0.45); margin-top: 2px; }
  .tl-chr-menu {
    background: transparent; border: 0; color: rgba(255,255,255,0.45);
    padding: 2px 4px; cursor: pointer; border-radius: 3px;
  }
  .tl-chr-menu:hover { color: var(--tl-gold); background: rgba(255,255,255,0.06); }
  .tl-chr-empty { padding: 20px 14px; color: rgba(255,255,255,0.45); font-size: 12px; text-align: center; }

  .tl-cycles-chat {
    display: flex; flex-direction: column;
    background: rgba(255,255,255,0.015);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    overflow: hidden;
    min-height: 480px;
  }
  .tl-cc-head {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(0,0,0,0.18);
    display: flex; align-items: center; gap: 10px;
  }
  .tl-cc-title-input {
    flex: 1;
    background: transparent;
    border: 1px solid transparent;
    color: #fff;
    font-family: var(--tl-sans, Inter, sans-serif);
    font-size: 15px; font-weight: 600;
    padding: 4px 8px; border-radius: 4px; outline: none;
    transition: border-color .15s, background .15s;
  }
  .tl-cc-title-input:hover { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.10); }
  .tl-cc-title-input:focus { border-color: var(--tl-gold); background: rgba(0,0,0,0.20); }

  /* Notification-sound mute toggle (Issue 2) — quiet glyph button in the
     chat header, no chrome until hovered so it never competes with Save. */
  .tl-cc-notif-mute {
    flex: 0 0 auto;
    background: transparent;
    border: 1px solid transparent;
    color: rgba(255,255,255,0.55);
    font-size: 15px; line-height: 1;
    padding: 4px 7px; border-radius: 6px; cursor: pointer;
    transition: color .15s, background .15s, border-color .15s;
  }
  .tl-cc-notif-mute:hover { color: #fff; background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.10); }
  .tl-cc-notif-mute[aria-pressed="true"] { color: rgba(255,255,255,0.35); }

  .tl-cc-msgs {
    flex: 1; overflow-y: auto;
    padding: 28px 24px 12px;
    scroll-behavior: smooth;
  }
  /* Conversation centered in a readable measure (Claude/Linear-style) rather
     than an edge-to-edge wall of text. Each turn is a flex column so the user
     turn can right-align and the assistant turn can carry an identity row. */
  .tl-cc-msg {
    max-width: 760px;
    margin: 0 auto 26px;
    display: flex; flex-direction: column;
  }
  .tl-cc-msg.user { align-items: flex-end; }

  /* Identity row: gold assistant avatar + a friendly label. CSS hides the raw
     "user"/"assistant" text (font-size:0) and writes the label via ::after, so
     no template or JS change is needed — applies to server-render + streaming. */
  .tl-cc-msg-role {
    font-family: var(--tl-mono); font-size: 0;
    text-transform: uppercase; letter-spacing: 2px;
    color: rgba(255,255,255,0.45);
    margin-bottom: 8px;
    display: flex; align-items: center; gap: 8px;
  }
  .tl-cc-msg-role::after { font-size: 10px; letter-spacing: 2px; }
  .tl-cc-msg.user .tl-cc-msg-role { color: var(--tl-gold); }
  .tl-cc-msg.user .tl-cc-msg-role::after { content: "YOU"; }
  .tl-cc-msg.assistant .tl-cc-msg-role::after { content: "TITRATELAB"; }
  .tl-cc-msg.assistant .tl-cc-msg-role::before {
    content: "✦";
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%; flex: 0 0 auto;
    background: linear-gradient(135deg, var(--tl-gold-400, #79b8ff), var(--tl-gold-600, #1f6feb));
    color: var(--tl-navy-900, #0a1530); font-size: 11px; font-family: var(--tl-sans);
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  }

  .tl-cc-msg-body {
    font-family: var(--tl-serif, Georgia, serif);
    font-size: 16px; line-height: 1.7;
    color: rgba(255,255,255,0.92);
    white-space: normal;
    word-wrap: break-word;
  }
  /* While streaming, the body holds RAW markdown — preserve its newlines until
     the final render swaps in HTML, then normal whitespace + block margins own
     the rhythm. Server-rendered/seeded turns are never .streaming → clean. */
  .tl-cc-msg.streaming .tl-cc-msg-body { white-space: pre-wrap; }

  /* User turn: a compact gold-tinted bubble, sans-serif, right-aligned. */
  .tl-cc-msg.user .tl-cc-msg-body {
    font-family: var(--tl-sans, Inter, sans-serif);
    font-size: 15px; line-height: 1.55;
    background: rgba(88,166,255,0.12);
    border: 1px solid rgba(88,166,255,0.22);
    border-radius: 14px 14px 4px 14px;
    padding: 11px 15px; max-width: 85%;
    color: #fff;
  }

  /* Block rhythm inside assistant prose — headings in sans for contrast against
     the serif body; lists with breathing room and a gold marker. */
  .tl-cc-msg.assistant .tl-cc-msg-body > :first-child { margin-top: 0; }
  .tl-cc-msg-body h1, .tl-cc-msg-body h2, .tl-cc-msg-body h3, .tl-cc-msg-body h4 {
    font-family: var(--tl-sans, Inter, sans-serif); font-weight: 600;
    line-height: 1.3; color: #fff; margin: 1.5em 0 .55em;
  }
  .tl-cc-msg-body h1 { font-size: 19px; }
  .tl-cc-msg-body h2 { font-size: 17px; }
  .tl-cc-msg-body h3 { font-size: 15px; }
  .tl-cc-msg-body h4 { font-size: 14px; color: rgba(255,255,255,0.85); }
  .tl-cc-msg-body p { margin: 0 0 .85em; }
  .tl-cc-msg-body ul, .tl-cc-msg-body ol { margin: .5em 0 1em; padding-left: 1.35em; }
  .tl-cc-msg-body li { margin: .3em 0; }
  .tl-cc-msg-body li::marker { color: var(--tl-gold); }
  .tl-cc-msg-body strong { color: #fff; font-weight: 600; }
  .tl-cc-msg-body a:not(.tl-cite) { color: var(--tl-gold-400, #79b8ff); text-decoration: underline; text-underline-offset: 2px; }

  .tl-cc-msg.assistant.streaming .tl-cc-msg-body::after {
    content: "▍";
    color: var(--tl-gold);
    animation: tl-blink 1s step-start infinite;
    margin-left: 2px;
  }
  @keyframes tl-blink { 50% { opacity: 0; } }

  /* Bug #489: GFM tables emitted by renderMarkdown — mirror dashboard_chat.html's
     .tl-md-table styling so a Weekly Schedule grid actually renders as a grid
     instead of raw pipe characters. White-space pre-wrap on the parent
     .tl-cc-msg-body is overridden here so table cells don't keep verbatim
     whitespace from the source markdown. */
  .tl-cc-msg-body .tl-md-table {
    width: 100%; border-collapse: collapse; margin: 1em 0;
    font-family: var(--tl-sans, system-ui, sans-serif); font-size: 14.5px;
    line-height: 1.45; white-space: normal;
  }
  .tl-cc-msg-body .tl-md-table th,
  .tl-cc-msg-body .tl-md-table td {
    text-align: left; padding: 6px 10px;
    border: 1px solid rgba(255,255,255,0.10); vertical-align: top;
  }
  .tl-cc-msg-body .tl-md-table th {
    font-family: var(--tl-mono, ui-monospace, monospace);
    font-size: 11px; text-transform: uppercase; letter-spacing: 1.3px;
    color: rgba(255,255,255,0.62); font-weight: 600;
    background: rgba(255,255,255,0.04);
  }
  .tl-cc-msg-body .tl-md-table td { color: rgba(255,255,255,0.9); }
  @media (max-width: 620px) {
    .tl-cc-msg-body .tl-md-table { display: block; overflow-x: auto; }
  }

  /* Research citation chips (lifted from dashboard_chat.html). Rendered
     inline in assistant bodies by renderCitationsInText; clicking opens the
     citation modal. */
  /* Compact superscript citation marker (2026-05-31): a numbered pill, not the
     full title inline. Source type + title live in the hover tooltip + the
     click-through modal — keeps the prose readable. */
  .tl-cc-msg-body .tl-cite {
    display: inline-block; vertical-align: super;
    font-family: var(--tl-mono); font-size: 9px; font-weight: 600;
    line-height: 14px; min-width: 15px; height: 15px; padding: 0 4px;
    margin: 0 1px; text-align: center;
    color: var(--tl-gold);
    background: rgba(88, 166, 255, 0.15);
    border: 1px solid rgba(88, 166, 255, 0.35);
    border-radius: 8px;
    cursor: pointer; text-decoration: none;
    transition: background .15s;
  }
  .tl-cc-msg-body .tl-cite:hover { background: rgba(88, 166, 255, 0.32); }

  /* Research tool-trail + escalation pills (lifted from dashboard_chat.html).
     The unified dispatcher renders one pill per tool_call/escalate event ABOVE
     the assistant body. */
  .tl-tool-trail { display: flex; flex-wrap: wrap; gap: var(--tl-space-2, 6px); margin: 4px 0 8px; }
  .tl-tool-pill {
    font-family: var(--tl-mono); font-size: 11px;
    color: rgba(255,255,255,0.55);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px; padding: 2px 9px;
  }
  .tl-tool-pill strong { color: rgba(255,255,255,0.75); font-weight: 500; }

  /* Commerce quote cards — rendered inline in the assistant message body when
     a quote_state SSE frame arrives. Vendor + totals come ONLY from the
     server-authoritative tool result (the LLM never restates them in prose). */
  /* 3-up responsive grid on desktop, 1-up on mobile. The cards block is given
     full chat-column width via the .tl-cc-msg.has-quotes rule below, so three
     cards actually fit side-by-side instead of being crammed into the
     readable-measure message bubble. minmax(0,1fr) lets each column shrink
     below content size (no overflow); the ≤640px media query forces 1-up. */
  .tl-quote-cards {
    display: grid;
    /* auto-fit flows 2–4 archetype cards: 4-up when wide, fewer when narrow. */
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px; margin: 12px 0 4px;
  }
  /* Break the cards block out of the centered readable measure to the full
     width of the chat column so 3 cards have room. The assistant turn
     (.tl-cc-msg) is normally max-width:760px-centered; when it carries quote
     cards we widen the whole turn to the chat column so the grid has room. The
     cards block is a sibling of .tl-cc-msg-body inside .tl-cc-msg, so widening
     the turn is what gives the grid its width. */
  .tl-cc-msg.has-quotes { max-width: none; }
  .tl-cc-msg.has-quotes .tl-quote-cards { width: 100%; }
  @media (max-width: 640px) {
    .tl-quote-cards { grid-template-columns: 1fr; }
  }
  .tl-quote-card {
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 12px; padding: 12px 14px;
    background: rgba(255,255,255,0.03);
  }
  .tl-quote-card.best { border-color: rgba(88,166,255,0.45); background: rgba(88,166,255,0.06); }
  /* Archetype label chip (Best Price / Most Trusted / Highest Quality / All-Around)
     + the one-line "why" beneath the vendor (spec 2026-06-08). */
  .tl-quote-arch {
    font-family: var(--tl-mono); font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.2px; color: var(--tl-gold);
    margin-bottom: 6px;
  }
  .tl-quote-reason { font-family: var(--tl-serif); font-size: 12px; color: rgba(255,255,255,0.62); margin-top: 3px; line-height: 1.4; }
  .tl-quote-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
  .tl-quote-vendor { font-family: var(--tl-serif); font-size: 15px; color: rgba(255,255,255,0.92); }
  .tl-quote-total { font-family: var(--tl-mono); font-size: 18px; color: var(--tl-gold); font-weight: 600; white-space: nowrap; }
  .tl-quote-ship { font-family: var(--tl-mono); font-size: 11px; color: rgba(255,255,255,0.5); margin-top: 2px; }
  .tl-quote-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
  .tl-qb {
    font-family: var(--tl-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
    padding: 2px 8px; border-radius: 8px; color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
  }
  .tl-qb-lab { color: #8fdc9a; border-color: rgba(143,220,154,0.3); }
  .tl-qb-coa { color: #8fbfe0; border-color: rgba(143,191,224,0.3); }
  .tl-qb-match { color: var(--tl-gold); border-color: rgba(88,166,255,0.3); }
  .tl-quote-expl { font-family: var(--tl-serif); font-size: 13px; color: rgba(255,255,255,0.78); margin-top: 8px; line-height: 1.45; }
  /* Trust stat line (COA count / avg purity / latest COA) + dosing-supply hint —
     the buy-decision data, surfaced on the card itself (2026-06-01). */
  .tl-quote-trust { font-family: var(--tl-mono); font-size: 11px; color: #8fbfe0; margin-top: 8px; letter-spacing: 0.3px; }
  .tl-quote-dose { font-family: var(--tl-mono); font-size: 11px; color: rgba(255,255,255,0.62); margin-top: 4px; line-height: 1.4; }
  /* Ships-from origin + price/mg — fields the card payload already carries
     (line_items[].origin_country; price/mg derived from subtotal ÷ total mg).
     A quiet mono line under the total, paired so the buyer sees lane + unit
     economics at a glance. */
  .tl-quote-meta { font-family: var(--tl-mono); font-size: 11px; color: rgba(255,255,255,0.55); margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
  .tl-quote-meta .tl-qm-k { color: rgba(255,255,255,0.40); }
  .tl-quote-cyclelink { color: var(--tl-gold); text-decoration: none; border-bottom: 1px dotted rgba(88,166,255,0.5); }
  .tl-quote-cyclelink:hover { border-bottom-style: solid; }
  .tl-quote-empty { font-family: var(--tl-serif); font-size: 13px; color: rgba(255,255,255,0.65); padding: 8px 0; }
  /* Add-to-cart affordance on each quote card (P2.2). */
  .tl-quote-actions { margin-top: 10px; }
  .tl-quote-add {
    font-family: var(--tl-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
    background: var(--tl-gold); color: #1a1a1a; border: none; border-radius: 8px;
    padding: 6px 14px; cursor: pointer; font-weight: 600;
  }
  .tl-quote-add:hover { filter: brightness(1.08); }

  /* Interactive cart (P2.2) — line items, kit steppers, total, checkout CTA.
     Mirrors the orders-page cart structure, dark-skinned. Refactored
     2026-06-05 from a scroll-down inline panel into a CENTERED MODAL: the
     cart now opens over a dimmed backdrop on add-to-cart instead of rendering
     below all chat messages. The inner .tl-cart-* content styles are unchanged;
     only the container (.tl-cart-panel) became the modal dialog body. */
  .tl-cart-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7);
    display: none; align-items: center; justify-content: center;
    z-index: 1085; padding: var(--tl-space-6, 24px);
  }
  .tl-cart-backdrop.open { display: flex; }
  .tl-cart-panel {
    position: relative;
    width: 100%; max-width: 460px; max-height: 86vh; overflow-y: auto;
    padding: 18px 20px;
    border: 1px solid rgba(88,166,255,0.40); border-radius: 14px;
    background: #152640;
    box-shadow: 0 18px 50px rgba(0,0,0,0.55);
  }
  .tl-cart-panel.loading { opacity: 0.6; pointer-events: none; }
  /* Modal dismiss (✕) — top-right, mirrors the citation modal's close glyph. */
  .tl-cart-close {
    position: absolute; top: 10px; right: 12px;
    background: transparent; border: none; color: rgba(255,255,255,0.5);
    font-size: 20px; line-height: 1; cursor: pointer; padding: 2px 6px;
  }
  .tl-cart-close:hover { color: #fff; }
  /* Persistent "🛒 Cart (N)" reopen button near the composer — hidden when the
     cart is empty; reveals the count + reopens the modal. */
  .tl-cart-fab {
    display: none;
    margin: 8px auto 0; max-width: 760px;
  }
  .tl-cart-fab.show { display: block; }
  .tl-cart-fab-btn {
    font-family: var(--tl-mono); font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1px;
    background: rgba(88,166,255,0.12); color: var(--tl-gold);
    border: 1px solid rgba(88,166,255,0.40); border-radius: 10px;
    padding: 6px 14px; cursor: pointer;
    transition: background .15s;
  }
  .tl-cart-fab-btn:hover { background: rgba(88,166,255,0.22); }
  .tl-cart-head { display: flex; justify-content: space-between; align-items: center;
    font-family: var(--tl-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 2px;
    color: var(--tl-gold); margin-bottom: 8px; padding-right: 26px; }
  .tl-cart-clear { background: none; border: 1px solid rgba(255,255,255,0.15); color: rgba(255,255,255,0.6);
    border-radius: 7px; font-size: 10px; padding: 2px 9px; cursor: pointer; text-transform: uppercase; letter-spacing: 1px; }
  .tl-cart-clear:hover { color: rgba(255,255,255,0.9); }
  .tl-cart-vendor { font-family: var(--tl-serif); font-size: 13px; color: rgba(255,255,255,0.75); margin-bottom: 10px; }
  .tl-cart-line { display: flex; justify-content: space-between; align-items: center; gap: 10px;
    padding: 8px 0; border-top: 1px solid rgba(255,255,255,0.07); }
  .tl-cart-line-name { font-family: var(--tl-serif); font-size: 14px; color: rgba(255,255,255,0.92); }
  .tl-cart-stepper { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
  .tl-cart-step { width: 24px; height: 24px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.9); font-size: 15px; line-height: 1; cursor: pointer; }
  .tl-cart-step:hover { background: rgba(255,255,255,0.12); }
  .tl-cart-qty { font-family: var(--tl-mono); font-size: 11px; color: rgba(255,255,255,0.6); min-width: 120px; text-align: center; }
  .tl-cart-line-sub { font-family: var(--tl-mono); font-size: 14px; color: rgba(255,255,255,0.9); white-space: nowrap; }
  .tl-cart-total { display: flex; justify-content: space-between; align-items: baseline;
    margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.12);
    font-family: var(--tl-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,0.6); }
  .tl-cart-total strong { font-size: 20px; color: var(--tl-gold); letter-spacing: 0; }
  .tl-cart-shipline { text-align: right; }
  .tl-cart-ship { font-family: var(--tl-mono); font-size: 10px; color: rgba(255,255,255,0.45); }
  .tl-cart-checkout { width: 100%; margin-top: 12px; padding: 10px; border: none; border-radius: 10px;
    background: var(--tl-gold); color: #1a1a1a; font-family: var(--tl-mono); font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 2px; cursor: pointer; }
  .tl-cart-checkout:hover { filter: brightness(1.08); }
  .tl-cart-note { font-family: var(--tl-serif); font-size: 11px; color: rgba(255,255,255,0.5); margin-top: 8px; line-height: 1.4; }
  .tl-cart-note a { color: var(--tl-gold); }
  .tl-cart-msg, .tl-cart-order { font-family: var(--tl-serif); font-size: 13px; color: rgba(255,255,255,0.8); padding: 4px 0; }
  .tl-cart-order strong { color: var(--tl-gold); }

  /* Bug #491: SAVE button debounce affordance — both header + artifact panel
     save buttons get a .saving class while the POST is in flight. */
  .tl-cc-send.saving,
  .tl-ca-btn.saving {
    opacity: 0.6; cursor: progress;
  }

  .tl-cc-empty {
    padding: 32px 0; text-align: center;
    font-family: var(--tl-serif); color: rgba(255,255,255,0.65); font-size: 15px;
  }

  .tl-cc-input-row {
    padding: 14px 24px 18px;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.15);
  }
  .tl-cc-input-wrap {
    display: flex; align-items: flex-end; gap: 10px;
    max-width: 760px; margin: 0 auto;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px; padding: 10px 10px 10px 16px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.28);
    transition: border-color .15s, box-shadow .15s;
  }
  .tl-cc-input-wrap:focus-within { border-color: var(--tl-gold); box-shadow: 0 4px 18px rgba(88,166,255,0.14); }
  .tl-cc-input {
    flex: 1; background: transparent; border: 0; color: #fff;
    font-family: var(--tl-sans, Inter, sans-serif); font-size: 15px; line-height: 1.5;
    resize: none; outline: none; padding: 4px 6px;
    min-height: 24px; max-height: 180px;
  }
  .tl-cc-input::placeholder { color: rgba(255,255,255,0.35); }
  .tl-cc-send {
    background: var(--tl-gold); color: #0b1d33;
    border: 0; border-radius: 11px; padding: 9px 16px;
    font-family: var(--tl-mono); font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1px; cursor: pointer;
    transition: background .15s, transform .15s;
  }
  .tl-cc-send:hover:not(:disabled) { background: var(--tl-gold-400, #79b8ff); }
  .tl-cc-send:disabled { background: rgba(88,166,255,0.30); cursor: not-allowed; }
  .tl-cc-hint { font-family: var(--tl-mono); font-size: 10px; color: rgba(255,255,255,0.40); margin: 8px auto 0; max-width: 760px; text-align: center; }

  .tl-cycles-artifact {
    background: rgba(255,255,255,0.015);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 18px 18px 22px;
    display: flex; flex-direction: column; gap: 12px;
  }
  /* The pane carries `hidden` by default; this rule keeps it out of the grid
     entirely so research-only renders cleanly (the .tl-no-artifact shell rule
     above re-flows the columns). */
  .tl-cycles-artifact[hidden] { display: none; }
  .tl-ca-label { font-family: var(--tl-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 2px; color: rgba(255,255,255,0.50); }
  .tl-ca-title { font-family: var(--tl-serif); font-size: 22px; font-weight: 600; color: #fff; margin: 4px 0 6px; }
  .tl-ca-goal  { font-size: 13px; color: rgba(255,255,255,0.75); }
  .tl-ca-section { margin-top: 12px; }
  .tl-ca-section h4 { font-family: var(--tl-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 2px; color: rgba(255,255,255,0.50); margin: 0 0 6px; }
  .tl-ca-cp {
    display: flex; flex-direction: column; gap: 4px;
    padding: 10px 12px;
    background: rgba(0,0,0,0.20);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    margin-bottom: 8px;
  }
  .tl-ca-cp-name { font-size: 14px; font-weight: 600; color: #fff; }
  .tl-ca-cp-meta { font-family: var(--tl-mono); font-size: 11px; color: rgba(255,255,255,0.60); }
  .tl-ca-warn {
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 200, 0, 0.06);
    border: 1px solid rgba(255, 200, 0, 0.25);
    border-radius: 6px;
    font-size: 12px;
    color: rgba(255, 220, 120, 0.95);
  }
  .tl-ca-empty {
    text-align: center;
    color: rgba(255,255,255,0.50);
    font-style: italic;
    padding: 28px 12px;
  }
  .tl-ca-actions {
    display: flex; gap: 8px; margin-top: auto; padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
  }
  .tl-ca-btn {
    flex: 1; background: var(--tl-gold); color: #0b1d33;
    border: 0; border-radius: 6px; padding: 8px;
    font-family: var(--tl-mono); font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1px; cursor: pointer;
  }
  .tl-ca-btn.secondary {
    background: transparent; color: var(--tl-gold);
    border: 1px solid rgba(88,166,255,0.30);
  }
  .tl-ca-btn:disabled { opacity: 0.4; cursor: not-allowed; }

  /* [M4.3] DDI safety-warning cards rendered below the chat
     transcript. Border + tint vary by severity. */
  .tl-safety-warnings { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
  .tl-safety-warnings:empty { display: none; }
  .tl-safety-card {
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(255, 200, 0, 0.06);
    border-left: 4px solid rgba(255, 200, 0, 0.85);
    border-top: 1px solid rgba(255, 200, 0, 0.20);
    border-right: 1px solid rgba(255, 200, 0, 0.20);
    border-bottom: 1px solid rgba(255, 200, 0, 0.20);
    color: rgba(255, 230, 180, 0.96);
    font-size: 13px;
    line-height: 1.45;
  }
  .tl-safety-card.severity-high {
    background: rgba(220, 53, 69, 0.10);
    border-left-color: rgb(220, 53, 69);
    border-top-color: rgba(220, 53, 69, 0.40);
    border-right-color: rgba(220, 53, 69, 0.40);
    border-bottom-color: rgba(220, 53, 69, 0.40);
    color: rgba(255, 200, 200, 0.98);
  }
  .tl-safety-card.severity-moderate {
    background: rgba(255, 145, 0, 0.08);
    border-left-color: rgb(255, 165, 0);
    border-top-color: rgba(255, 165, 0, 0.30);
    border-right-color: rgba(255, 165, 0, 0.30);
    border-bottom-color: rgba(255, 165, 0, 0.30);
    color: rgba(255, 220, 180, 0.97);
  }
  .tl-safety-card.severity-low {
    background: rgba(120, 180, 255, 0.06);
    border-left-color: rgba(120, 180, 255, 0.85);
    border-top-color: rgba(120, 180, 255, 0.25);
    border-right-color: rgba(120, 180, 255, 0.25);
    border-bottom-color: rgba(120, 180, 255, 0.25);
    color: rgba(200, 220, 255, 0.95);
  }
  .tl-safety-card-head {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 6px;
    font-family: var(--tl-mono); font-size: 11px;
    text-transform: uppercase; letter-spacing: 1.2px;
  }
  .tl-safety-card-sev {
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.25);
    font-weight: 700;
  }
  .tl-safety-card-pair { font-weight: 600; color: #fff; }
  .tl-safety-card-mech { margin-bottom: 6px; }
  .tl-safety-card-rem { font-weight: 500; margin-bottom: 6px; }
  .tl-safety-card-foot {
    margin-top: 6px;
    font-family: var(--tl-mono); font-size: 10px;
    color: rgba(255, 255, 255, 0.50);
    border-top: 1px dashed rgba(255, 255, 255, 0.12);
    padding-top: 6px;
  }
  .tl-safety-card-foot a { color: rgba(255, 255, 255, 0.65); text-decoration: underline; }

  /* Engine byline */
  .tl-engine-line {
    font-family: var(--tl-mono, monospace); font-size: 11px;
    color: rgba(255,255,255,0.45); margin-bottom: 12px;
    text-transform: uppercase; letter-spacing: 1px;
  }

  /* Breadcrumb */
  .tl-breadcrumb { font-family: var(--tl-mono, monospace); font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: rgba(255,255,255,0.55); margin-bottom: 12px; }
  .tl-breadcrumb a { color: rgba(255,255,255,0.7); text-decoration: none; }
  .tl-breadcrumb a:hover { color: var(--tl-gold); }
  .tl-breadcrumb-sep { margin: 0 8px; color: rgba(255,255,255,0.35); }

  /* Citation modal (lifted from dashboard_chat.html) */
  .tl-modal-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7);
    display: none; align-items: center; justify-content: center;
    z-index: 1080; padding: var(--tl-space-6, 24px);
  }
  .tl-modal-backdrop.open { display: flex; }
  .tl-modal {
    position: relative;
    background: #152640;
    border: 1px solid rgba(88, 166, 255, 0.3);
    border-radius: 10px; padding: var(--tl-space-6, 24px);
    max-width: 620px; max-height: 80vh; overflow-y: auto;
    font-family: var(--tl-sans, Inter, sans-serif);
  }
  .tl-modal-type { font-family: var(--tl-mono); font-size: 11px; color: var(--tl-gold); text-transform: uppercase; letter-spacing: 2px; margin-bottom: var(--tl-space-2, 6px); }
  .tl-modal h3 { font-family: var(--tl-serif); font-size: 22px; margin: 0 0 var(--tl-space-3, 10px); color: #fff; }
  .tl-modal-meta { font-family: var(--tl-mono); font-size: 11px; color: rgba(255,255,255,0.55); margin-bottom: var(--tl-space-4, 14px); }
  .tl-modal-snippet { font-family: var(--tl-serif); font-size: 15px; line-height: 1.6; color: rgba(255,255,255,0.88); white-space: pre-wrap; margin-bottom: var(--tl-space-4, 14px); }
  .tl-modal-url { font-family: var(--tl-mono); font-size: 12px; color: var(--tl-gold); word-break: break-all; }
  .tl-modal-close { position: absolute; top: var(--tl-space-3, 10px); right: var(--tl-space-4, 14px); background: transparent; border: none; color: rgba(255,255,255,0.5); font-size: 20px; cursor: pointer; }
  .tl-modal-close:hover { color: #fff; }
