/* §§ FILE_HEADER ====================================================
   DAAF Pipeline Explainer — styles (2026-04-17b version)
   See DESIGN_DOCUMENT.md for architecture rationale and changelog.
   Run `Grep §§` on this file to get a navigable section index.
   ================================================================ */

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

/* §§ TOKENS (design variables) ====================================== */
:root {
    --bg: #0a0f1c;
    --bg-secondary: #111827;
    --bg-card: #151d2e;
    --bg-card-hover: #1a2438;
    --bg-card-active: #1b2640;
    --text: #f0f4f8;
    --text-secondary: #b0bcc8;
    --text-muted: #7b8da0;
    --accent: #22d3a8;
    --accent-mint: #6ee7b7;
    --accent-indigo: #6366f1;
    --accent-glow: rgba(34, 211, 168, 0.2);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --phase-discovery: #f59e0b;
    --phase-planning: #22d3a8;
    --phase-acquisition: #6366f1;
    --phase-analysis: #3fb950;
    --phase-synthesis: #a78bfa;
    --phase-checkpoint: #f85149;
    --nav-height: 64px;
    --content-max: 1400px;
    --font-display: 'Space Grotesk', system-ui, sans-serif;
    --font-body: 'DM Sans', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --progress-rail-width: 60px;
}

/* §§ PHASE_CASCADE ==================================================
   Any element with data-phase="N" publishes --phase-color and
   --phase-color-rgb into its subtree via CSS variable inheritance,
   so descendants (tags, badges, dots, glows) get phase-colored
   with zero inline styles.
   ================================================================ */
[data-phase="1"]  { --phase-color: var(--phase-discovery);   --phase-color-rgb: 245, 158, 11; }
[data-phase="2"]  { --phase-color: var(--phase-planning);    --phase-color-rgb: 34, 211, 168; }
[data-phase="3"]  { --phase-color: var(--phase-acquisition); --phase-color-rgb: 99, 102, 241; }
[data-phase="4"]  { --phase-color: var(--phase-analysis);    --phase-color-rgb: 63, 185, 80; }
[data-phase="5"]  { --phase-color: var(--phase-synthesis);   --phase-color-rgb: 167, 139, 250; }
[data-phase="cp"] { --phase-color: var(--phase-checkpoint);  --phase-color-rgb: 248, 81, 73; }

html {
    background: var(--bg);
    color: var(--text);
}

body {
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.7;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse at 15% 0%, rgba(34, 211, 168, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 100%, rgba(99, 102, 241, 0.04) 0%, transparent 50%);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    line-height: 1.15;
    font-weight: 600;
}

/* §§ SKIP_LINKS ====================================================== */
.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    background: var(--accent);
    color: var(--bg);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    z-index: 200;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 0.5rem;
    opacity: 1;
}

/* §§ NAVIGATION ======================================================
   Mirrored from the main openaugments.org nav.
   ================================================================ */
nav {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-height);
    padding: 1rem clamp(1.5rem, 5vw, 4rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(10, 15, 28, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s;
}

.nav-brand {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.1rem;
    color: var(--accent);
    letter-spacing: -0.03em;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Open Augments logo — mask-based pattern matching the main website.
   Uses the white silhouette PNG as an alpha source, tinted via background-color. */
.logo-icon {
    display: inline-block;
    background-color: var(--accent);
    -webkit-mask-image: url('assets/open-augments-logo-white.png');
    mask-image: url('assets/open-augments-logo-white.png');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    flex-shrink: 0;
}
.nav-brand .logo-icon {
    width: clamp(21px, 2.3vw, 28px);
    height: clamp(21px, 2.3vw, 28px);
}

.nav-links {
    display: flex;
    gap: clamp(0.75rem, 2.5vw, 2rem);
    list-style: none;
}

.nav-links a {
    font-family: var(--font-display);
    font-size: clamp(0.8rem, 1vw, 0.9rem);
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s;
    position: relative;
    padding-bottom: 2px;
}
.nav-links a:hover { color: var(--text); opacity: 1; }
.nav-links a.active { color: var(--nav-active-color, var(--accent)); }
.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--nav-active-color, var(--accent));
    border-radius: 1px;
}
/* Phase-colored nav highlights (Overview + Next Steps keep default teal) */
.nav-links a[data-section="phase-1"].active { --nav-active-color: var(--phase-discovery); }
.nav-links a[data-section="phase-2"].active { --nav-active-color: var(--phase-planning); }
.nav-links a[data-section="phase-3"].active { --nav-active-color: var(--phase-acquisition); }
.nav-links a[data-section="phase-4"].active { --nav-active-color: var(--phase-analysis); }
.nav-links a[data-section="phase-5"].active { --nav-active-color: var(--phase-synthesis); }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 110;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    margin: 5px 0;
    transition: transform 0.3s, opacity 0.3s;
}

/* §§ PROGRESS_RAIL ===================================================
   Viewport-scaled dots (clamp-based) so the 25 items fit from
   ~600px tall viewports through 4K+ without overflow or awkward gaps.
   Tooltips live in a .progress-dot-wrap sibling so they are not
   inside the rotated coordinate system of checkpoint diamonds.
   ================================================================ */
.progress-rail {
    position: fixed;
    left: 0;
    top: var(--nav-height);
    width: var(--progress-rail-width);
    height: calc(100vh - var(--nav-height));
    background: rgba(10, 15, 28, 0.92);
    border-right: 1px solid var(--border);
    z-index: 90;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(0.4rem, 1.4vh, 1.1rem) 0;
    overflow: visible;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}
.progress-rail.visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.progress-rail-phase-label {
    font-family: var(--font-mono);
    font-size: clamp(0.65rem, 1.15vh, 0.9rem);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--phase-color, var(--text-muted));
    margin-top: clamp(6px, 1.2vh, 14px);
    margin-bottom: clamp(2px, 0.35vh, 5px);
    opacity: 0.7;
}

.progress-dot-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: clamp(2px, 0.5vh, 6px) 0;
}
.progress-dot {
    width: clamp(8px, 1.3vh, 14px);
    height: clamp(8px, 1.3vh, 14px);
    border-radius: 50%;
    border: clamp(1.5px, 0.22vh, 2.5px) solid var(--phase-color, var(--text-muted));
    background: transparent;
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
    position: relative;
}
.progress-dot:hover {
    transform: scale(1.35);
    border-color: var(--text);
}

.progress-dot.past {
    background: rgba(var(--phase-color-rgb, 123, 141, 160), 0.3);
}

.progress-dot.active {
    width: clamp(12px, 1.85vh, 20px);
    height: clamp(12px, 1.85vh, 20px);
    border-width: clamp(1.75px, 0.28vh, 3px);
    background: var(--phase-color, var(--accent));
    box-shadow:
        0 0 16px rgba(var(--phase-color-rgb, 34, 211, 168), 0.55),
        0 0 10px rgba(var(--phase-color-rgb, 34, 211, 168), 0.35);
}

.progress-dot.checkpoint-dot {
    border-radius: 3px;
    transform: rotate(45deg);
}
.progress-dot.checkpoint-dot:hover { transform: rotate(45deg) scale(1.35); }
.progress-dot.checkpoint-dot.active { transform: rotate(45deg) scale(1.15); }

.progress-dot-tooltip {
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    font-family: var(--font-body);
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 200;
}
.progress-dot-wrap:hover .progress-dot-tooltip { opacity: 1; }

/* §§ UNIFIED_LAYOUT ==================================================
   Intro and workflow share the same grid; the right column is a
   single continuous sticky reference panel.
   ================================================================ */
.unified-layout {
    display: grid;
    grid-template-columns: 55% 45%;
    margin-left: var(--progress-rail-width);
    background: linear-gradient(to right, transparent 55%, var(--bg-secondary) 55%);
}

.left-column { min-height: 100vh; }

.right-column {
    position: sticky;
    top: var(--nav-height);
    height: calc(100vh - var(--nav-height));
    overflow-y: auto;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

/* §§ INTRO_SECTION =================================================== */
.intro-section {
    padding: clamp(3rem, 6vw, 5rem) clamp(1.5rem, 3vw, 3rem) clamp(2rem, 4vw, 3rem);
    min-height: calc(100vh - var(--nav-height));
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.intro-label {
    font-family: var(--font-display);
    font-size: clamp(0.75rem, 1vw, 0.85rem);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin-bottom: 1.5rem;
}

.intro-title {
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 1.25rem;
    max-width: 1000px;
}

.gradient-text {
    background: linear-gradient(135deg, #22d3a8 0%, #6ee7b7 50%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.intro-subtitle {
    font-size: clamp(0.95rem, 1.3vw, 1.1rem);
    color: var(--text-secondary);
    max-width: 1000px;
    margin-bottom: 1.75rem;
    line-height: 1.65;
}

/* --- Intro body: widened reading column, refined rhythm ------------- */
.intro-body {
    color: var(--text-secondary);
    max-width: 1000px;
    margin-bottom: 2rem;
    line-height: 1.8;
    font-size: 0.95rem;
}
.intro-body p { margin-bottom: 1rem; }
.intro-body strong { color: var(--text); }

/* --- Section wrappers: breathing room between logical groups -------- */
.intro-hook,
.intro-what-is-daaf,
.intro-pivot,
.intro-this-page {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.intro-hook p:last-child,
.intro-what-is-daaf p:last-child,
.intro-this-page p:last-child { margin-bottom: 0; }
.intro-pivot p:first-child { margin-bottom: 1rem; }
.intro-pivot p:last-child { margin-bottom: 0; }

/* --- Opening hook: slightly larger + brighter first paragraph ------- */
.intro-hook p:first-child {
    font-size: 1.05rem;
    color: var(--text);
    line-height: 1.75;
}
.intro-hook p:last-child strong {
    font-size: 1.2rem;
    color: var(--accent);
}

/* --- Unordered list: custom teal markers, card-like items ----------- */
.intro-body ul {
    list-style: none;
    margin: 1.25rem 0 0.5rem 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.intro-body ul li {
    position: relative;
    padding: 0.65rem 0.85rem 0.65rem 1.65rem;
    line-height: 1.7;
    font-size: 0.9rem;
    background: rgba(34, 211, 168, 0.03);
    border: 1px solid rgba(34, 211, 168, 0.08);
    border-radius: 8px;
    transition: background 0.2s, border-color 0.2s;
}
.intro-body ul li:hover {
    background: rgba(34, 211, 168, 0.06);
    border-color: rgba(34, 211, 168, 0.15);
    border-left-color: var(--accent);
}
.intro-body ul li::before {
    content: '';
    position: absolute;
    left: 0.6rem;
    top: calc(0.65rem + 0.9rem * 1.7 / 2 - 3px);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.7;
}

/* --- Ordered list: numbered with indigo accent markers -------------- */
.intro-body ol {
    list-style: none;
    margin: 1.25rem 0 0.5rem 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    counter-reset: intro-counter;
}
.intro-body ol li {
    position: relative;
    counter-increment: intro-counter;
    padding: 0.65rem 0.85rem 0.65rem 2.75rem;
    line-height: 1.7;
    font-size: 0.9rem;
    background: rgba(99, 102, 241, 0.03);
    border: 1px solid rgba(99, 102, 241, 0.08);
    border-radius: 8px;
    transition: background 0.2s, border-color 0.2s;
}
.intro-body ol li:hover {
    background: rgba(99, 102, 241, 0.06);
    border-color: rgba(99, 102, 241, 0.15);
    border-left-color: var(--accent-indigo);
}
.intro-body ol li::before {
    content: counter(intro-counter);
    position: absolute;
    left: 0.65rem;
    top: calc(0.65rem + 0.9rem * 1.7 / 2 - 0.75rem);
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-indigo);
    background: rgba(99, 102, 241, 0.12);
    border-radius: 6px;
}

/* --- Callout: rhetorical pivot, display treatment ------------------- */
.intro-body .intro-callout {
    border-left: none;
    padding: 1.25rem 1.5rem;
    margin: 0 0 1rem;
    background: linear-gradient(135deg,
        rgba(34, 211, 168, 0.06) 0%,
        rgba(99, 102, 241, 0.06) 100%);
    border: 1px solid rgba(34, 211, 168, 0.15);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}
.intro-body .intro-callout::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, var(--accent) 0%, var(--accent-indigo) 100%);
    border-radius: 4px 0 0 4px;
}
.intro-body .intro-callout em {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 500;
    font-style: italic;
    color: var(--text);
    line-height: 1.5;
}

/* --- Pivot response: "I'm glad you asked" as a confident beat ------- */
.intro-pivot p:last-child {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: -0.01em;
}

/* --- Impact stat: the "10 minutes" moment --------------------------- */
.intro-impact {
    background: rgba(34, 211, 168, 0.04);
    border: 1px solid rgba(34, 211, 168, 0.12);
    border-radius: 10px;
    padding: 1.15rem 1.35rem;
    margin-top: 0.5rem;
    margin-bottom: 1.25rem;
    position: relative;
}
.intro-impact::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent);
    border-radius: 4px 0 0 4px;
}
.intro-impact strong {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--accent) !important;
    letter-spacing: -0.02em;
}

/* --- Disclaimer: slightly muted, smaller ----- */
.intro-disclaimer {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.75;
    padding-left: 0.75rem;
    border-left: 2px solid rgba(255, 255, 255, 0.06);
}

/* --- Walkthrough guide paragraph ---- */
.intro-walkthrough-guide {
    font-size: 0.9rem;
    line-height: 1.8;
}

/* --- Closing paragraph ---- */
.intro-closing {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* --- Intro links: refined spacing and hover ----- */
.intro-links {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 2rem;
    padding-top: 1rem;
}
.intro-links a {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s, opacity 0.2s;
    width: fit-content;
}
.intro-links a:hover {
    border-bottom-color: rgba(34, 211, 168, 0.3);
    opacity: 1;
}

/* §§ INTRO_SUMMARY_BADGES =============================================
   Stat badges that surface project totals (human time, Claude time,
   dispatches, tool calls). Used in both the intro and next-steps
   sections to bookend the walkthrough symmetrically.
   ================================================================ */
.intro-summary-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1.75rem 0 0.5rem;
    max-width: 1000px;
}
.summary-badge {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.85rem 1.15rem;
    background: rgba(34, 211, 168, 0.04);
    border: 1px solid rgba(34, 211, 168, 0.15);
    border-radius: 10px;
    min-width: 132px;
    flex: 1;
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s var(--ease-out-expo),
                background 0.3s var(--ease-out-expo),
                transform 0.3s var(--ease-out-expo);
}
.summary-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-indigo));
    opacity: 0.5;
    transition: opacity 0.3s;
}
.summary-badge:hover {
    border-color: rgba(34, 211, 168, 0.3);
    background: rgba(34, 211, 168, 0.07);
    transform: translateY(-1px);
}
.summary-badge:hover::before {
    opacity: 1;
}
.summary-badge-label {
    font-family: var(--font-display);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-muted);
    font-weight: 500;
}
.summary-badge-value {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--accent);
    font-weight: 500;
    letter-spacing: -0.02em;
}

/* §§ NEXT_STEPS_SECTION ===============================================
   Mirrors .intro-section. Gives the walkthrough a graceful coda
   with the final report re-displayed in the right panel.
   ================================================================ */
.next-steps-section {
    padding: clamp(3rem, 6vw, 5rem) clamp(1.5rem, 3vw, 3rem) clamp(2rem, 4vw, 3rem);
    min-height: calc(100vh - var(--nav-height));
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.intro-cta { margin: 2rem 0 2.5rem; }
.btn-begin {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.85rem 2rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    background: var(--accent);
    color: var(--bg);
    text-decoration: none;
    transition: transform 0.2s var(--ease-out-expo), box-shadow 0.2s;
}
.btn-begin:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 24px rgba(34, 211, 168, 0.25);
    color: var(--bg);
}
.btn-begin svg { transition: transform 0.3s var(--ease-out-expo); }
.btn-begin:hover svg { transform: translateY(2px); }

.further-reading {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.further-reading-label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}
.further-reading a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    transition: color 0.2s;
}
.further-reading a:hover {
    color: var(--accent);
}

.workflow-section {
    padding: 2rem clamp(1.5rem, 3vw, 3rem) 8rem;
}

/* §§ REFERENCE_PANEL (right column) ================================= */
.panel-header {
    position: sticky;
    top: 0;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(8px);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    z-index: 10;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
.panel-header-text { flex: 1; min-width: 0; }
.panel-close-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    font-size: 1.4rem;
    line-height: 1;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}
.panel-close-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text);
}

.panel-content-type {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: var(--accent);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
}

.panel-content {
    padding: 1.5rem;
    transition: opacity 0.3s var(--ease-out-expo);
}
.panel-content.fading { opacity: 0; }

/* §§ REPORT_CONTENT -------------------------------------------------- */
.report-content {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.9rem;
}
.report-content h2 {
    font-size: 1.2rem;
    color: var(--text);
    margin: 1.75rem 0 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}
.report-content h2:first-child { margin-top: 0; }
.report-content h3 {
    font-size: 1rem;
    color: var(--text);
    margin: 1.25rem 0 0.4rem;
}
.report-content p { margin-bottom: 0.75rem; color: var(--text-secondary); }
.report-content strong { color: var(--text); }
.report-content blockquote {
    border-left: 3px solid var(--accent);
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    color: var(--text-muted);
    font-style: italic;
    background: rgba(34, 211, 168, 0.03);
    border-radius: 0 6px 6px 0;
}
.report-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.8rem;
}
.report-content th, .report-content td {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    text-align: left;
}
.report-content th {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-weight: 600;
    font-family: var(--font-display);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.report-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}
.report-content ul, .report-content ol {
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}
.report-content li { margin-bottom: 0.3rem; }
.report-content code {
    font-family: var(--font-mono);
    font-size: 0.82em;
    background: rgba(255, 255, 255, 0.06);
    padding: 0.1em 0.35em;
    border-radius: 3px;
}
.report-content img {
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin: 1rem 0 0.5rem;
}
.report-content .figure-caption {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.report-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--phase-analysis);
    background: rgba(63, 185, 80, 0.08);
    border: 1px solid rgba(63, 185, 80, 0.2);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    margin-left: 0.5rem;
}

/* §§ ORIGINAL_QUERY (callout in the report) ------------------------- */
.original-query {
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}
.original-query .query-label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: var(--accent-indigo);
    margin-bottom: 0.75rem;
}
.original-query blockquote {
    border-left: 3px solid var(--accent-indigo);
    background: rgba(99, 102, 241, 0.04);
    margin: 0;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.9rem;
    line-height: 1.7;
    border-radius: 0 6px 6px 0;
}

/* §§ PANEL_INTERNAL (shared heading/code/pre styles) ================ */
.panel-content h2 {
    font-size: 1.25rem;
    margin: 1.25rem 0 0.5rem;
    color: var(--text);
}
.panel-content h3 {
    font-size: 1.1rem;
    margin: 1rem 0 0.5rem;
    color: var(--text);
}
.panel-content p {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.7;
}
.panel-content code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: rgba(255, 255, 255, 0.06);
    padding: 0.15em 0.4em;
    border-radius: 4px;
}
.panel-content pre {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* §§ PHASE_HEADERS =================================================== */
.phase-header {
    margin: 3rem 0 1.5rem;
    padding: 0;
}
.phase-header:first-child { margin-top: 0; }
.phase-header-inner {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}
.phase-number {
    font-family: var(--font-display);
    font-size: clamp(0.7rem, 0.9vw, 0.8rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    white-space: nowrap;
    color: var(--phase-color);
    background: rgba(var(--phase-color-rgb), 0.1);
    border: 1px solid rgba(var(--phase-color-rgb), 0.25);
}
.phase-title {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
}
.phase-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* §§ STEP_CARDS ======================================================
   Glowing left accent uses the cascaded --phase-color variable.
   ================================================================ */
.step-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.75rem 2rem;
    transition: border-color 0.3s var(--ease-out-expo),
                box-shadow 0.3s var(--ease-out-expo),
                background 0.3s var(--ease-out-expo);
    position: relative;
    cursor: pointer;
}
.step-card:hover { border-color: var(--border-hover); }

.step-card[aria-current="step"] {
    background: var(--bg-card-active);
    border-color: rgba(var(--phase-color-rgb, 34, 211, 168), 0.25);
    box-shadow: 0 0 32px rgba(var(--phase-color-rgb, 34, 211, 168), 0.10);
}
.step-card[aria-current="step"]::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 3px;
    background: var(--phase-color, var(--accent));
    box-shadow:
        0 0 12px var(--phase-color, var(--accent)),
        0 0 4px var(--phase-color, var(--accent));
    transition: all 0.3s var(--ease-out-expo);
}

.step-card-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

/* §§ STEP_TIME_BADGES (Human / Claude time on each step card) ------
   Docked to the right of .step-card-top via margin-left:auto.
   On narrow viewports the flex-wrap on .step-card-top lets the
   badges drop to a new line beneath the phase tag.
   ================================================================ */
.step-time-badges {
    display: inline-flex;
    gap: 0.4rem;
    margin-left: auto;
    flex-wrap: wrap;
}
.time-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.22rem 0.6rem;
    border-radius: 6px;
    line-height: 1.35;
    white-space: nowrap;
}
.time-badge .time-badge-label {
    font-family: var(--font-display);
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.78;
    font-weight: 600;
}
.time-badge.human {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
}
.time-badge.claude {
    color: var(--accent);
    background: rgba(34, 211, 168, 0.08);
    border: 1px solid rgba(34, 211, 168, 0.25);
}
.phase-tag {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    display: inline-block;
    color: var(--phase-color);
    background: rgba(var(--phase-color-rgb), 0.1);
    border: 1px solid rgba(var(--phase-color-rgb), 0.25);
}
.step-number {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-muted);
}
.step-title {
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 2vw, 1.5rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 0.75rem;
    color: var(--text);
}
.step-description {
    color: var(--text-secondary);
    font-size: clamp(0.9rem, 1.1vw, 1rem);
    line-height: 1.7;
    margin-bottom: 0;
}

/* §§ STEP_DETAIL (expandable, closed by default) --------------------
   The inner container is shared by step cards (agent flow content)
   and checkpoint cards (review / actions / referenced files).
   ================================================================ */
.step-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s var(--ease-out-expo), opacity 0.3s;
    opacity: 0;
}
.step-detail.expanded {
    max-height: 12000px;
    opacity: 1;
    margin-top: 1.25rem;
}
.step-detail-inner {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
}
.checkpoint-detail-inner {
    background: rgba(248, 81, 73, 0.03);
    border: 1px solid rgba(248, 81, 73, 0.15);
}

/* §§ FILES_PRODUCED (shared .file-ref class) -----------------------
   Used by the agent-flow cards, checkpoint referenced files,
   and anywhere else a clickable file reference is needed.
   ================================================================ */
.file-ref {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--accent);
    background: rgba(34, 211, 168, 0.06);
    border: 1px solid rgba(34, 211, 168, 0.15);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    margin: 0.2rem 0.25rem 0.2rem 0;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-ref:hover {
    background: rgba(34, 211, 168, 0.12);
    border-color: rgba(34, 211, 168, 0.3);
}

/* §§ VIEWING_STATE (badge whose doc is shown in right panel) -------- */
.file-ref.viewing {
    background: rgba(34, 211, 168, 0.28);
    border-color: var(--accent);
    color: var(--accent-mint);
    box-shadow: 0 0 0 2px rgba(34, 211, 168, 0.28), 0 0 16px rgba(34, 211, 168, 0.30);
}

.expand-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    transition: opacity 0.2s;
}
.expand-toggle:hover { opacity: 0.7; }
.expand-toggle .arrow {
    transition: transform 0.3s var(--ease-out-expo);
    display: inline-block;
}
.expand-toggle.open .arrow { transform: rotate(90deg); }

/* §§ CHECKPOINT_CARDS ================================================ */
.checkpoint-card {
    background: rgba(248, 81, 73, 0.03);
    border: 1px solid rgba(248, 81, 73, 0.2);
    border-radius: 14px;
    padding: 1.75rem 2rem;
    position: relative;
    cursor: pointer;
    transition: border-color 0.3s var(--ease-out-expo),
                box-shadow 0.3s var(--ease-out-expo),
                background 0.3s var(--ease-out-expo);
}
.checkpoint-card[aria-current="step"] {
    border-color: rgba(248, 81, 73, 0.35);
    box-shadow: 0 0 32px rgba(248, 81, 73, 0.10), 0 2px 8px rgba(0,0,0,0.2);
    background: rgba(248, 81, 73, 0.05);
}
.checkpoint-card[aria-current="step"]::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 3px;
    background: var(--phase-checkpoint);
    box-shadow: 0 0 12px var(--phase-checkpoint), 0 0 4px var(--phase-checkpoint);
}
.checkpoint-icon {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--phase-checkpoint);
    transform: rotate(45deg);
    margin-right: 0.5rem;
    vertical-align: middle;
}
.checkpoint-title {
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 2vw, 1.5rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 0.75rem;
    color: var(--text);
}
.checkpoint-description {
    color: var(--text-secondary);
    font-size: clamp(0.9rem, 1.1vw, 1rem);
    line-height: 1.7;
    margin-bottom: 1rem;
}
.checkpoint-review-label, .checkpoint-actions-label, .checkpoint-refs-label {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.checkpoint-review-items, .checkpoint-actions {
    list-style: none;
    margin-bottom: 1rem;
}
.checkpoint-review-items li {
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 0.2rem 0 0.2rem 1.2rem;
    position: relative;
}
.checkpoint-review-items li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65rem;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--phase-checkpoint);
    opacity: 0.6;
}
.checkpoint-actions li {
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 0.2rem 0 0.2rem 1.2rem;
    position: relative;
}
.checkpoint-actions li::before {
    content: '\2192';
    position: absolute;
    left: 0;
    color: var(--phase-checkpoint);
    opacity: 0.6;
}
.checkpoint-refs-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}
.human-gate {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(248, 81, 73, 0.25);
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--phase-checkpoint);
}
.human-gate-icon {
    width: 20px;
    height: 20px;
    border: 2px solid var(--phase-checkpoint);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    flex-shrink: 0;
}

/* §§ STEP_CONNECTOR (line between same-phase cards) ----------------- */
.step-connector {
    width: 2px;
    height: 28px;
    margin: 0 auto;
    opacity: 0.35;
    background: repeating-linear-gradient(
        to bottom,
        var(--phase-color, var(--text-muted)) 0px,
        var(--phase-color, var(--text-muted)) 6px,
        transparent 6px,
        transparent 10px
    );
}

/* §§ AGENT_FLOW ======================================================
   Sequential agent-dispatch cards inside the step detail "Read More".
   Each card shows one agent's role, task, and loaded + produced files.
   Dashed connectors between cards inherit phase color via cascade.
   ================================================================ */
.agent-flow {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}
.agent-flow-item {
    position: relative;
    display: flex;
    flex-direction: column;
}
.agent-flow-item:last-child .agent-flow-connector {
    display: none;
}

.agent-flow-card {
    background: var(--bg-card);
    border: 1px solid rgba(var(--phase-color-rgb, 255, 255, 255), 0.15);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.agent-flow-card:hover {
    border-color: rgba(var(--phase-color-rgb, 255, 255, 255), 0.28);
}

.agent-flow-role {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin: 0.4rem 0 0.2rem;
    letter-spacing: -0.005em;
}

.agent-flow-agent-desc {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.55;
    font-style: italic;
    margin: 0 0 0.65rem;
}

.agent-flow-task {
    background: rgba(var(--phase-color-rgb, 255, 255, 255), 0.04);
    border-left: 2px solid rgba(var(--phase-color-rgb, 255, 255, 255), 0.35);
    border-radius: 0 6px 6px 0;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.6;
}
.agent-flow-task-label {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--phase-color, var(--accent));
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* Vertically stacked file sections (e version): each section is a
   labelled "Primary Files Referenced" / "Primary Files Produced" block whose entries
   are two-column rows — file ref on the left, plain-language
   description on the right. Replaces the side-by-side wrap layout. */
.agent-flow-files-section {
    margin-top: 0.85rem;
}
.agent-flow-files-section + .agent-flow-files-section {
    margin-top: 1.1rem;
}
.agent-flow-files-label {
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.agent-flow-files-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(
        to right,
        rgba(var(--phase-color-rgb, 255, 255, 255), 0.18),
        transparent
    );
}
.agent-flow-files-rows {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.agent-flow-file-row {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.45fr);
    gap: 0.9rem;
    align-items: start;
    padding: 0.5rem 0.65rem;
    background: rgba(255, 255, 255, 0.018);
    border: 1px solid rgba(var(--phase-color-rgb, 255, 255, 255), 0.07);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s;
}
.agent-flow-file-row:hover {
    background: rgba(var(--phase-color-rgb, 255, 255, 255), 0.06);
    border-color: rgba(var(--phase-color-rgb, 255, 255, 255), 0.22);
}
.agent-flow-file-row:hover .file-ref {
    background: rgba(var(--phase-color-rgb, 34, 211, 168), 0.18);
    border-color: rgba(var(--phase-color-rgb, 34, 211, 168), 0.35);
}
.agent-flow-file-row .file-ref {
    margin: 0;
    align-self: start;
}
.agent-flow-file-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.55;
    min-width: 0;
    word-wrap: break-word;
}
.agent-flow-file-row.is-spec {
    border-color: rgba(var(--phase-color-rgb, 255, 255, 255), 0.20);
    background: rgba(var(--phase-color-rgb, 255, 255, 255), 0.035);
}
.agent-flow-file-row.is-spec .agent-flow-file-desc {
    color: var(--text-secondary);
}
@media (max-width: 720px) {
    .agent-flow-file-row {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }
}
.agent-flow-empty-files {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
    opacity: 0.6;
    padding: 0.2rem 0;
}

.agent-flow-connector {
    width: 2px;
    height: 20px;
    margin: 0 auto;
    opacity: 0.45;
    background: repeating-linear-gradient(
        to bottom,
        var(--phase-color, var(--text-muted)) 0px,
        var(--phase-color, var(--text-muted)) 4px,
        transparent 4px,
        transparent 8px
    );
}

.agent-flow-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.01);
}

/* §§ LOG_MESSAGE (parsed JSONL line viewer) =========================
   Renders a single message extracted from a Claude Code session log.
   Used by renderLogMessageInPanel() — distinct from .document-viewer
   because the source is a parsed JSON record, not a file dump.
   ================================================================ */
.log-message {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}
.log-message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: rgba(34, 211, 168, 0.04);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.log-message-role {
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
/* User (researcher) messages — amber accent to distinguish from assistant teal */
.log-message-user {
    border-color: rgba(245, 158, 11, 0.25);
}
.log-message-header-user {
    background: rgba(245, 158, 11, 0.06);
}
.log-message-header-user .log-message-role {
    color: var(--phase-discovery);
}
.log-message-meta {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.log-message-body {
    padding: 1.1rem 1.25rem;
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--text-secondary);
}
.log-message-body p { margin-bottom: 0.75rem; }
.log-message-body p:last-child { margin-bottom: 0; }
.log-message-body code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: rgba(255,255,255,0.06);
    padding: 0.1em 0.35em;
    border-radius: 3px;
}
.log-message-body pre {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.8rem 0.95rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.55;
    margin: 0.6rem 0;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
}
.log-message-thinking {
    background: rgba(167, 139, 250, 0.05);
    border: 1px solid rgba(167, 139, 250, 0.22);
    border-radius: 8px;
    padding: 0.85rem 1.05rem;
    margin: 0.7rem 0;
    color: var(--text-muted);
}
.log-message-thinking-label {
    font-family: var(--font-display);
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--phase-synthesis);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.45rem;
}
.log-message-thinking-body {
    font-size: 0.85rem;
    line-height: 1.65;
    font-style: italic;
}
.log-message-thinking-body p { margin-bottom: 0.55rem; }
.log-message-thinking-body p:last-child { margin-bottom: 0; }

.log-message-toolcall {
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.22);
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
    margin: 0.65rem 0;
}
.log-message-toolcall-name {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent-indigo);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.4rem;
}
.log-message-toolcall pre {
    margin: 0;
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(99, 102, 241, 0.18);
    font-size: 0.74rem;
}

/* §§ LOG_MESSAGE_GROUP (stacked multi-line log message render) =======
   Container for the multi-card render produced when a step's
   orchestratorLogLine.line is an array. One `.log-message` child per
   requested line. Uses flex-gap for uniform spacing and a subtle
   connecting rail on the left edge to signal the cards are a single
   conversation thread (mirroring the phase-colored connectors used
   between agent-flow sub-cards). The rail uses the teal accent since
   these are always DAAF orchestrator messages.
   ================================================================ */
.log-message-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.log-message-missing {
    opacity: 0.6;
    border-style: dashed;
}
.log-message-missing .log-message-body {
    font-style: italic;
    color: var(--text-muted);
}

/* §§ LOG_TRANSCRIPT_LINK (View full transcript on GitHub header) ----- */
.log-transcript-header {
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 0.75rem;
}

/* §§ DOCUMENT_VIEWER (fetched GitHub files) ========================== */
.document-viewer {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.document-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border);
}
.document-path {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.document-github-link {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent);
    white-space: nowrap;
    flex-shrink: 0;
}
.document-content {
    padding: 1.25rem;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-secondary);
}
.document-content h1 { font-size: 1.4rem; margin: 1.5rem 0 0.75rem; color: var(--text); }
.document-content h2 { font-size: 1.15rem; margin: 1.25rem 0 0.5rem; color: var(--text); }
.document-content h3 { font-size: 1rem; margin: 1rem 0 0.5rem; color: var(--text); }
.document-content p { margin-bottom: 0.75rem; }
.document-content pre {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.55;
    margin: 1rem 0;
}
.document-content ul, .document-content ol { padding-left: 1.5rem; margin-bottom: 0.75rem; }
.document-content li { margin-bottom: 0.3rem; }
.document-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.8rem;
}
.document-content th, .document-content td {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    text-align: left;
}
.document-content th { background: rgba(255,255,255,0.04); color: var(--text); font-weight: 600; }
.document-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    background: rgba(34,211,168,0.03);
    border-radius: 0 6px 6px 0;
    font-style: italic;
    color: var(--text-muted);
}
.document-content code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: rgba(255,255,255,0.06);
    padding: 0.1em 0.35em;
    border-radius: 3px;
}
.document-content .fetched-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
}
.document-content .fetched-image-caption {
    margin-top: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
}

/* §§ SYNTAX_HIGHLIGHTING (Python, token-safe) ----------------------- */
.syntax-comment { color: #7b8da0; font-style: italic; }
.syntax-string { color: #6ee7b7; }
.syntax-keyword { color: #22d3a8; font-weight: 500; }
.syntax-builtin { color: #a78bfa; }
.syntax-number { color: #f59e0b; }
.syntax-decorator { color: #f85149; }

/* §§ LOADING_ERROR_STATES ------------------------------------------- */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
}
.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
}
.fetch-error {
    color: var(--phase-checkpoint);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 1rem;
    background: rgba(248, 81, 73, 0.06);
    border: 1px solid rgba(248, 81, 73, 0.15);
    border-radius: 8px;
}

/* §§ FOOTER ========================================================== */
.site-footer {
    padding: 3rem clamp(1.5rem, 5vw, 4rem);
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-left: var(--progress-rail-width);
}
.site-footer a { color: var(--accent); }

/* §§ MOBILE_SHEET (bottom sheet, pill button, backdrop) ==============
   Base styles define elements as hidden (display:none). The ≤900px
   media query in §§ RESPONSIVE activates them. The .sheet-open class
   on the right-column and .active class on the backdrop are toggled
   by JS (see §§ MOBILE_SHEET in the JS file).
   ================================================================ */
.sheet-handle {
    display: none;
    justify-content: center;
    padding: 10px 0 2px;
    cursor: default;
}
.sheet-handle::before {
    content: '';
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
}

.mobile-panel-pill {
    display: none;
    position: fixed;
    bottom: max(28px, env(safe-area-inset-bottom, 0px) + 12px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 150;
    background: rgba(21, 29, 46, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(34, 211, 168, 0.4);
    border-radius: 100px;
    padding: 0.75rem 1.5rem;
    color: var(--accent);
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5),
                0 0 16px rgba(34, 211, 168, 0.12),
                0 0 0 1px rgba(34, 211, 168, 0.15);
    transition: transform 0.3s var(--ease-out-expo),
                opacity 0.3s var(--ease-out-expo),
                box-shadow 0.3s;
}
.mobile-panel-pill:active {
    transform: translateX(-50%) scale(0.95);
}
.mobile-panel-pill.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(20px);
}
.mobile-pill-arrow {
    font-size: 1rem;
    line-height: 1;
    transition: transform 0.3s;
}

.mobile-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 190;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s;
}
.mobile-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.mobile-progress {
    display: none;
}

/* §§ RESPONSIVE ====================================================== */
@media (max-width: 900px) {
    :root { --progress-rail-width: 0px; }
    .progress-rail { display: none; }
    .unified-layout {
        grid-template-columns: 1fr;
        margin-left: 0;
        background: none;
    }
    /* Bottom sheet: slides up from below the viewport on demand */
    .right-column {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        height: 85vh;
        max-height: none;
        z-index: 200;
        border-left: none;
        border-top: none;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
        transition: transform 0.35s var(--ease-out-expo);
        box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
    }
    .right-column.sheet-open { transform: translateY(0); }
    .sheet-handle { display: flex; }
    .panel-close-btn { display: flex; }
    .mobile-panel-pill { display: flex; }
    .mobile-backdrop { display: block; }
    .mobile-progress {
        display: flex;
        position: sticky;
        top: var(--nav-height);
        z-index: 99;
        background: rgba(10, 15, 28, 0.95);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border-bottom: 1px solid var(--border);
    }
    .mobile-progress-segment {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 8px 2px;
        cursor: pointer;
        transition: opacity 0.3s;
        opacity: 0.35;
        position: relative;
    }
    .mobile-progress-segment::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 12%;
        right: 12%;
        height: 2.5px;
        background: var(--phase-color);
        border-radius: 2px;
        opacity: 0;
        transition: opacity 0.3s;
    }
    .mobile-progress-segment.past { opacity: 0.55; }
    .mobile-progress-segment.active { opacity: 1; }
    .mobile-progress-segment.active::after { opacity: 1; }
    .mobile-progress-label {
        font-family: var(--font-display);
        font-size: clamp(0.55rem, 2.2vw, 0.65rem);
        font-weight: 500;
        color: var(--text-muted);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .mobile-progress-segment.active .mobile-progress-label {
        color: var(--phase-color);
        font-weight: 600;
    }
    .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: rgba(10, 15, 28, 0.95);
        backdrop-filter: blur(12px);
        flex-direction: column;
        padding: 1rem 2rem 1.5rem;
        border-bottom: 1px solid var(--border);
        gap: 0.25rem;
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 0.5rem 0; }
    .nav-toggle { display: block; }
    .site-footer { margin-left: 0; }
}

@media (max-width: 560px) {
    .step-card, .checkpoint-card { padding: 1.25rem; }
    .intro-links { flex-direction: column; gap: 0.6rem; }
    .intro-body ul li,
    .intro-body ol li {
        padding-left: 1.4rem;
    }
    .intro-body ol li { padding-left: 2.5rem; }
    .intro-body .intro-callout { padding: 1rem 1.15rem; }
    .intro-impact { padding: 1rem 1.15rem; }
    .summary-badge { min-width: unset; flex: 1 1 calc(50% - 0.5rem); }
}

/* §§ ANIMATIONS ====================================================== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.fade-up {
    opacity: 0;
    animation: fadeUp 0.6s var(--ease-out-expo) forwards;
}

@keyframes pillPulse {
    0%   { box-shadow: 0 4px 24px rgba(0,0,0,0.4), 0 0 0 1px rgba(34,211,168,0.08); }
    50%  { box-shadow: 0 4px 24px rgba(0,0,0,0.4), 0 0 0 4px rgba(34,211,168,0.3); }
    100% { box-shadow: 0 4px 24px rgba(0,0,0,0.4), 0 0 0 1px rgba(34,211,168,0.08); }
}
.mobile-panel-pill.pulse { animation: pillPulse 0.8s ease; }

/* §§ REDUCED_MOTION ================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .fade-up { opacity: 1; transform: none; }
}
