/* ============================================================
   XFlow v3 — dynamic layer on top of v2.css
   Adds: C1 activity ticker, C4 scroll-tied rail, B1 reasoning
   stream, B2 mini cashflow chart, B5 T&Cs live grading.
   All animations respect prefers-reduced-motion.
   ============================================================ */

/* ── C1: Floating activity ticker in hero ── */
.activity-ticker {
    position: absolute;
    top: 18px;
    right: clamp(1rem, 3vw, 2rem);
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.85rem;
    background: rgba(10, 12, 18, 0.72);
    backdrop-filter: saturate(140%) blur(12px);
    border: 1px solid var(--line-2);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--fg-2);
    letter-spacing: 0.02em;
    box-shadow:
        0 6px 18px -8px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(59, 130, 246, 0.12) inset;
    max-width: calc(100vw - 2rem);
}
.ticker-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--go);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.20);
    animation: t-pulse 1.6s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes t-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.22); }
    50%      { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0.05); }
}
.ticker-meta { color: var(--fg-3); white-space: nowrap; }
.ticker-meta span { color: var(--accent-300); font-weight: 600; }
.ticker-sep { color: var(--fg-4); padding: 0 0.05rem; }
.ticker-msg {
    color: var(--fg-1);
    white-space: nowrap;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 280ms ease;
}
.ticker-msg.swap-out { opacity: 0; }

@media (max-width: 760px) {
    .activity-ticker { font-size: 0.62rem; padding: 0.35rem 0.65rem; top: 70px; right: 0.5rem; }
    .ticker-msg { max-width: 160px; }
}

/* ────────────────────────────────────────────────────────────
   Horizontal pipeline — replaces the 3x3 stage rail
   9 compact nodes connected by a thin rail; click any node to
   swap the detail panel below. One panel visible at a time.
   ──────────────────────────────────────────────────────────── */
.pipeline {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 0;
    align-items: start;
    padding: 2rem 0;
    margin: 3rem 0 0;
    position: relative;
}
.pipeline::before {
    /* connecting rail behind the circles */
    content: "";
    position: absolute;
    left: 5.5%;
    right: 5.5%;
    top: calc(2rem + 21px); /* aligns to the centre of the circles */
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line-2) 4%, var(--line-2) 96%, transparent);
    z-index: 0;
}
.pipeline-node {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    padding: 0 0.25rem;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: transform 220ms var(--ease);
    min-height: 44px; /* a11y touch target */
}
.pipeline-node .node-num {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line-2);
    border-radius: 50%;
    background: var(--bg-1);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--fg-3);
    transition: all 220ms var(--ease);
}
.pipeline-node .node-label {
    font-family: var(--font-sans);
    font-size: 0.78rem;
    color: var(--fg-3);
    text-align: center;
    line-height: 1.25;
    max-width: 96px;
    transition: color 220ms var(--ease);
    letter-spacing: -0.01em;
}
.pipeline-node:hover .node-num {
    border-color: var(--accent-700);
    color: var(--accent-300);
}
.pipeline-node:hover .node-label {
    color: var(--fg-1);
}
.pipeline-node:focus-visible {
    outline: none;
}
.pipeline-node:focus-visible .node-num {
    border-color: var(--accent-400);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.30);
}
.pipeline-node[aria-selected="true"] {
    transform: translateY(-2px);
}
.pipeline-node[aria-selected="true"] .node-num {
    background: rgba(59, 130, 246, 0.18);
    border-color: var(--accent-400);
    color: var(--accent-300);
    box-shadow:
        0 0 0 3px rgba(59, 130, 246, 0.18),
        0 8px 22px -10px var(--glow);
}
.pipeline-node[aria-selected="true"] .node-label {
    color: var(--fg-0);
    font-weight: 500;
}
/* The "awe moment" node — small dot beside the circle */
.pipeline-node-spot .node-num::after {
    content: "";
    position: absolute;
    top: -3px;
    right: 50%;
    margin-right: -28px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent-400);
    border: 2px solid var(--bg-0);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.30);
    animation: hero-pulse 2.4s ease-in-out infinite;
}

/* ── Detail panel ── */
.pipeline-detail { margin-top: 1rem; }
.pipeline-panel {
    position: relative;
    padding: clamp(1.5rem, 3vw, 2.25rem) clamp(1.5rem, 3vw, 2.25rem);
    background:
        radial-gradient(900px 220px at 50% 0%, rgba(59, 130, 246, 0.07), transparent 70%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.008));
    border: 1px solid var(--line-2);
    border-radius: 14px;
    animation: panel-in 320ms cubic-bezier(0.16, 1, 0.3, 1);
}
.pipeline-panel[hidden] { display: none; }
.pipeline-panel::before {
    /* small notch arrow pointing up to the active node */
    content: "";
    position: absolute;
    top: -7px;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.008));
    border-top: 1px solid var(--line-2);
    border-left: 1px solid var(--line-2);
    transform: rotate(45deg);
    transition: left 320ms cubic-bezier(0.16, 1, 0.3, 1);
}
/* notch position per active stage — left offset = (stage-1)/9 * 100% + ~5.5% */
.pipeline-panel[data-stage="1"]::before { left: calc(5.5% + 16px); }
.pipeline-panel[data-stage="2"]::before { left: calc(5.5% + 11.1% * 1 + 16px); }
.pipeline-panel[data-stage="3"]::before { left: calc(5.5% + 11.1% * 2 + 16px); }
.pipeline-panel[data-stage="4"]::before { left: calc(5.5% + 11.1% * 3 + 16px); }
.pipeline-panel[data-stage="5"]::before { left: calc(5.5% + 11.1% * 4 + 16px); }
.pipeline-panel[data-stage="6"]::before { left: calc(5.5% + 11.1% * 5 + 16px); }
.pipeline-panel[data-stage="7"]::before { left: calc(5.5% + 11.1% * 6 + 16px); }
.pipeline-panel[data-stage="8"]::before { left: calc(5.5% + 11.1% * 7 + 16px); }
.pipeline-panel[data-stage="9"]::before { left: calc(5.5% + 11.1% * 8 + 16px); }

@keyframes panel-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
.pipeline-panel .pp-num {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    color: var(--accent-300);
    margin-bottom: 0.85rem;
    text-transform: uppercase;
}
.pipeline-panel .pp-tag {
    margin-left: 0.65rem;
    padding: 0.15rem 0.5rem;
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 4px;
    color: var(--accent-300);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.05em;
    text-transform: none;
}
.pipeline-panel h3 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(1.6rem, 2.6vw, 2.1rem);
    line-height: 1.1;
    letter-spacing: -0.025em;
    color: var(--fg-0);
    margin-bottom: 0.85rem;
}
.pipeline-panel > p {
    font-size: 1.02rem;
    color: var(--fg-2);
    line-height: 1.6;
    margin-bottom: 1.2rem;
    max-width: 72ch;
}
.pipeline-panel .pp-feats {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}
.pipeline-panel .pp-feats li {
    position: relative;
    padding-left: 1.4rem;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--fg-1);
}
.pipeline-panel .pp-feats li::before {
    content: "→";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent-400);
    font-weight: 500;
}
.pipeline-panel .pp-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.6rem;
    border-radius: 4px;
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-300);
    border: 1px solid rgba(59, 130, 246, 0.35);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    font-weight: 500;
}

/* ── Mobile: vertical accordion ── */
@media (max-width: 760px) {
    .pipeline {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 0;
        margin: 2rem 0 0.85rem;
        border: 1px solid var(--line-2);
        border-radius: 11px;
        overflow: hidden;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.005));
    }
    .pipeline::before { display: none; }
    .pipeline-node {
        flex-direction: row;
        justify-content: flex-start;
        gap: 0.85rem;
        padding: 0.85rem 1rem;
        border-bottom: 1px solid var(--line);
        background: transparent;
    }
    .pipeline-node:last-child { border-bottom: none; }
    .pipeline-node .node-num { width: 32px; height: 32px; font-size: 0.7rem; }
    .pipeline-node .node-label {
        text-align: left;
        max-width: none;
        font-size: 0.92rem;
    }
    .pipeline-node[aria-selected="true"] {
        transform: none;
        background: rgba(59, 130, 246, 0.06);
    }
    .pipeline-node[aria-selected="true"] .node-num { box-shadow: none; }
    .pipeline-node-spot .node-num::after {
        top: 50%; right: auto; left: 30px; margin: -4px 0 0 0;
    }
    .pipeline-panel { padding: 1.5rem 1.25rem; }
    .pipeline-panel::before { display: none; }
    .pipeline-panel .pp-feats { grid-template-columns: 1fr; gap: 0.45rem; }
}

@media (prefers-reduced-motion: reduce) {
    .pipeline-panel { animation: none; }
    .pipeline-node-spot .node-num::after { animation: none; }
}

/* ── C4: Scroll-tied rail ignition ── */
.rail-step {
    /* Start dim; v3.js fires .lit class via IntersectionObserver */
    transition:
        opacity 500ms cubic-bezier(0.16, 1, 0.3, 1),
        transform 500ms cubic-bezier(0.16, 1, 0.3, 1),
        border-color 350ms ease,
        background 350ms ease,
        box-shadow 350ms ease;
}
.rail-step.lit {
    border-color: rgba(59, 130, 246, 0.45) !important;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.015)) !important;
    box-shadow:
        0 0 0 1px rgba(59, 130, 246, 0.15),
        0 12px 28px -16px rgba(59, 130, 246, 0.35);
}
.rail-step.lit .rail-num {
    color: var(--accent-400);
    text-shadow: 0 0 12px rgba(96, 165, 250, 0.5);
}
.rail-step.lit .rail-chip {
    border-color: rgba(59, 130, 246, 0.35);
    color: var(--accent-300);
    background: rgba(59, 130, 246, 0.10);
}
/* Connector line for the spot/awe step keeps its own glow */
.rail-step.rail-step-spot.lit {
    border-color: rgba(96, 165, 250, 0.6) !important;
}

/* ── B1 + B2: CCF live panel — replaces the static screenshot ── */
.ccf-live {
    background: linear-gradient(180deg, #0E1119 0%, #0A0C12 100%);
    overflow: hidden;
}
.ccf-badge { display: inline-flex; align-items: center; gap: 0.4rem; }
.ccf-badge-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent-400);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
    animation: t-pulse 1.4s ease-in-out infinite;
}

.ccf-console {
    padding: 0.9rem 1rem 0.7rem;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.015);
    min-height: 165px;
}
.ccf-console-head {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    color: var(--fg-4);
    margin-bottom: 0.55rem;
}
.ccf-stream {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.55;
    color: var(--fg-2);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}
.ccf-stream-line {
    display: flex;
    gap: 0.55rem;
    align-items: baseline;
    opacity: 0;
    transform: translateY(2px);
    animation: line-in 320ms cubic-bezier(0.2, 0.6, 0.2, 1) forwards;
}
.ccf-stream-line .ln-tick {
    flex-shrink: 0;
    color: var(--accent-400);
    font-weight: 500;
    width: 14px;
}
.ccf-stream-line .ln-text { color: var(--fg-1); flex: 1; }
.ccf-stream-line .ln-out {
    color: var(--accent-300);
    font-weight: 600;
    margin-left: auto;
    white-space: nowrap;
}
.ccf-stream-line.crit .ln-text { color: var(--warn); }
.ccf-stream-line.final {
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.12);
    font-weight: 600;
    color: var(--fg-0);
}
.ccf-stream-line.final .ln-tick { color: var(--go); }
.ccf-stream-line.final .ln-out { color: var(--go); }
@keyframes line-in {
    to { opacity: 1; transform: translateY(0); }
}

/* B2 — mini cashflow chart */
.ccf-chart-wrap { padding: 0.85rem 1rem 1rem; }
.ccf-chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.55rem;
}
.ccf-chart-title {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    color: var(--fg-4);
    text-transform: uppercase;
}
.ccf-chart-legend {
    display: inline-flex;
    gap: 0.65rem;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--fg-3);
}
.ccf-chart-legend span { display: inline-flex; align-items: center; gap: 0.3rem; }
.ccf-chart-legend span::before {
    content: "";
    width: 8px; height: 8px;
    border-radius: 2px;
    display: inline-block;
}
.ccf-chart-legend .lg-out::before  { background: rgba(239, 68, 68, 0.75); }
.ccf-chart-legend .lg-in::before   { background: var(--accent-400); }
.ccf-chart-legend .lg-net::before  { background: var(--go); border-radius: 50%; }

.ccf-chart {
    position: relative;
    height: 132px;
    border-bottom: 1px solid var(--line);
    border-top: 1px solid var(--line);
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    padding: 4px 2px 0;
    gap: 2px;
    overflow: hidden;
}
.ccf-chart::before {
    /* zero axis */
    content: "";
    position: absolute;
    left: 0; right: 0;
    top: 50%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.10) 8%, rgba(255, 255, 255, 0.10) 92%, transparent);
}
.ccf-bar {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}
.ccf-bar .bar-neg, .ccf-bar .bar-pos {
    width: 100%;
    border-radius: 2px;
    transform-origin: center;
    transform: scaleY(0);
    transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}
.ccf-bar .bar-neg {
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.85), rgba(239, 68, 68, 0.55));
    margin-top: 50%;
    transform-origin: top center;
}
.ccf-bar .bar-pos {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.95), rgba(59, 130, 246, 0.65));
    margin-bottom: 50%;
    transform-origin: bottom center;
}
.ccf-chart.draw .bar-neg, .ccf-chart.draw .bar-pos { transform: scaleY(1); }
.ccf-chart .net-line {
    position: absolute;
    left: 0; right: 0; top: 0; bottom: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 700ms ease 600ms;
}
.ccf-chart.draw .net-line { opacity: 1; }
.ccf-chart .net-line path {
    fill: none;
    stroke: var(--go);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: net-draw 1400ms ease 700ms forwards;
}
.ccf-chart .net-line circle { fill: var(--go); opacity: 0; animation: net-dot 0s ease 2000ms forwards; }
@keyframes net-draw { to { stroke-dashoffset: 0; } }
@keyframes net-dot  { to { opacity: 1; } }

/* KPIs row */
.ccf-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
    margin-top: 0.65rem;
}
.ccf-kpi {
    padding: 0.4rem 0.55rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.025);
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}
.ccf-kpi .k-lbl {
    font-family: var(--font-mono);
    font-size: 0.56rem;
    letter-spacing: 0.08em;
    color: var(--fg-4);
    text-transform: uppercase;
}
.ccf-kpi .k-val {
    font-family: var(--font-sans);
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--fg-0);
    letter-spacing: -0.015em;
}
.ccf-kpi .k-val.k-go   { color: var(--go); }
.ccf-kpi .k-val.k-crit { color: var(--crit); }

/* ── B5: T&Cs live grading demo ── */
.tc-live {
    margin-top: 1.25rem;
    padding: 0.85rem 1rem 0.95rem;
    border: 1px solid var(--line-2);
    border-radius: 11px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.008));
}
.tc-live-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.7rem;
}
.tc-live-title {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    color: var(--fg-4);
    text-transform: uppercase;
}
.tc-live-score {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    color: var(--fg-3);
}
.tc-live-score strong {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    color: var(--warn);
    letter-spacing: -0.015em;
    margin: 0 0.2rem;
    transition: color 300ms ease;
}
.tc-live-score strong.high { color: var(--crit); }
.tc-live-score strong.ok   { color: var(--go); }

.tc-live-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
}
.tc-cat {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.015);
    font-size: 0.7rem;
    color: var(--fg-3);
    opacity: 0.45;
    transition:
        opacity 280ms ease,
        border-color 280ms ease,
        background 280ms ease,
        color 280ms ease,
        transform 280ms ease;
}
.tc-cat.lit { opacity: 1; }
.tc-cat-name { flex: 1; line-height: 1.2; }
.tc-cat-flag {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--line-strong);
    box-shadow: 0 0 0 3px transparent;
    transition: background 280ms ease, box-shadow 280ms ease;
    flex-shrink: 0;
}
.tc-cat.lit[data-flag="crit"] {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.06);
    color: var(--fg-1);
}
.tc-cat.lit[data-flag="crit"] .tc-cat-flag {
    background: var(--crit);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}
.tc-cat.lit[data-flag="watch"] {
    border-color: rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.05);
    color: var(--fg-1);
}
.tc-cat.lit[data-flag="watch"] .tc-cat-flag {
    background: var(--warn);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}
.tc-cat.lit[data-flag="ok"] {
    border-color: rgba(16, 185, 129, 0.32);
    background: rgba(16, 185, 129, 0.05);
    color: var(--fg-1);
}
.tc-cat.lit[data-flag="ok"] .tc-cat-flag {
    background: var(--go);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
}

@media (max-width: 760px) {
    .tc-live-grid { grid-template-columns: repeat(2, 1fr); gap: 0.35rem; }
    .ccf-kpis { grid-template-columns: repeat(2, 1fr); }
    .ccf-console { min-height: 145px; }

    /* ── Defensive: live monitor panels must never overflow the viewport ── */
    .monitor, .ccf-live, .mi-live, .phe-live, .tc-live-monitor {
        max-width: 100%;
        overflow: hidden;
    }
    /* Monitor top bar — let the URL truncate so the AGENT badge stays visible */
    .monitor-bar, .mon-bar { min-width: 0; gap: 0.4rem; padding: 0.55rem 0.75rem; }
    .monitor-bar .url, .mon-bar .url {
        min-width: 0;
        flex: 1 1 auto;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 0.58rem;
    }
    .monitor-bar .badge, .mon-bar .badge { flex-shrink: 0; font-size: 0.58rem; gap: 0.3rem; }
    .ccf-badge { gap: 0.3rem; }

    /* Inner product-UI mockup — clamp every grid descendant to parent width */
    .monitor-body.mk, .mk-body, .mk-card, .mk-kpi-row, .mk-input-grid {
        max-width: 100%;
        min-width: 0;
    }
    .mk-input-grid { grid-template-columns: 1fr 1fr; gap: 0.4rem; }
    .mk-kpi .val { font-size: 0.88rem; }
    .mk-kpi .lbl { font-size: 0.58rem; }

    /* Reasoning stream — wrap lines so the right-side ln-out doesn't push off-screen */
    .ccf-stream { font-size: 0.7rem; line-height: 1.5; }
    .ccf-stream-line { flex-wrap: wrap; gap: 0.35rem; }
    .ccf-stream-line .ln-out { margin-left: 0; }
    .ccf-stream-line .ln-text { min-width: 0; word-break: break-word; }
    .ccf-console-head { font-size: 0.55rem; }

    /* mk-decision verdict pill — let the label + value wrap on narrow widths */
    .mk-decision { flex-wrap: wrap; gap: 0.4rem; }
    .mk-decision .val { font-size: 0.78rem; flex-wrap: wrap; }
    .mk-clause-title { font-size: 0.72rem; line-height: 1.35; }

    /* Container itself: prevent any wide child from forcing the page wider */
    .container { overflow-x: hidden; }
}

/* ── Reduced-motion: disable streams and chart anims gracefully ── */
@media (prefers-reduced-motion: reduce) {
    .ccf-stream-line { animation: none; opacity: 1; transform: none; }
    .ccf-chart .bar-neg, .ccf-chart .bar-pos { transition: none; transform: scaleY(1); }
    .ccf-chart .net-line { opacity: 1; transition: none; }
    .ccf-chart .net-line path { animation: none; stroke-dashoffset: 0; }
    .ticker-dot, .ccf-badge-dot { animation: none; }
    .tc-cat { opacity: 1; }
    .rail-step { opacity: 1 !important; transform: none !important; }
}
