/* ===== AGENT GUIDE - Override Styles ===== */
/* Base styles from common/base.css */

:root {
    --accent: var(--blue);
    --accent-dim: var(--blue-dim);
    --gradient-1: linear-gradient(135deg, #4f8ff7, #a78bfa);
    --gradient-2: linear-gradient(135deg, #a78bfa, #f472b6);
    --gradient-3: linear-gradient(135deg, #34d399, #22d3ee);
}

/* ===== HERO GLOW (guide-specific colors) ===== */

.hero-glow-1 {
    width: 600px;
    height: 600px;
    background: var(--blue);
    top: -200px;
    right: -100px;
    opacity: 0.15;
}

.hero-glow-2 {
    width: 500px;
    height: 500px;
    background: var(--purple);
    bottom: -200px;
    left: -100px;
    opacity: 0.1;
}

/* ===== FORMULA ===== */
.formula-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    margin-bottom: 48px;
}

.formula {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.formula-item {
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1.1rem;
}

.formula-agent { background: linear-gradient(135deg, var(--blue), var(--purple)); color: white; }
.formula-llm { background: var(--blue-dim); color: var(--blue); border: 1px solid rgba(79,143,247,0.3); }
.formula-memory { background: var(--purple-dim); color: var(--purple); border: 1px solid rgba(167,139,250,0.3); }
.formula-planning { background: var(--green-dim); color: var(--green); border: 1px solid rgba(52,211,153,0.3); }
.formula-tools { background: var(--orange-dim); color: var(--orange); border: 1px solid rgba(251,146,60,0.3); }

.formula-op {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-muted);
}

.formula-source {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== COMPONENTS GRID ===== */
.components-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 48px;
}

.component-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.component-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.component-card[data-color="blue"]::before { background: var(--blue); }
.component-card[data-color="purple"]::before { background: var(--purple); }
.component-card[data-color="green"]::before { background: var(--green); }
.component-card[data-color="orange"]::before { background: var(--orange); }

.component-card:hover {
    transform: translateY(-4px);
    border-color: var(--border);
    box-shadow: var(--shadow);
}

.component-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.component-card[data-color="blue"] .component-icon { background: var(--blue-dim); color: var(--blue); }
.component-card[data-color="purple"] .component-icon { background: var(--purple-dim); color: var(--purple); }
.component-card[data-color="green"] .component-icon { background: var(--green-dim); color: var(--green); }
.component-card[data-color="orange"] .component-icon { background: var(--orange-dim); color: var(--orange); }

.component-icon svg { width: 24px; height: 24px; }

.component-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.component-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.component-tag {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 100px;
    background: var(--bg-surface);
    color: var(--text-muted);
}

/* ===== COMPARISON ===== */
.comparison-section {
    margin-top: 64px;
}

.comparison-table {
    display: flex;
    gap: 24px;
    align-items: stretch;
}

.comparison-col {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
}

.comparison-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.comparison-header h4 {
    font-size: 1.3rem;
    font-weight: 700;
}

.comparison-badge {
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
}

.comparison-workflow .comparison-badge {
    background: var(--green-dim);
    color: var(--green);
}

.comparison-agent .comparison-badge {
    background: var(--purple-dim);
    color: var(--purple);
}

.comparison-col ul {
    list-style: none;
    margin-bottom: 20px;
}

.comparison-col ul li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.comparison-col ul li:last-child { border-bottom: none; }

.comparison-example {
    padding: 12px 16px;
    background: var(--bg-surface);
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.comparison-vs {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-muted);
    padding: 0 8px;
}

/* ===== LEVEL CARDS ===== */
.level-progress {
    margin-bottom: 48px;
}

.level-progress-track {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-bottom: 8px;
    overflow: hidden;
}

.level-progress-fill {
    height: 100%;
    width: 100%;
    background: var(--gradient-1);
    border-radius: 2px;
}

.level-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.level-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    margin-bottom: 32px;
    overflow: hidden;
    transition: all 0.3s;
}

.level-card:hover {
    border-color: rgba(79, 143, 247, 0.2);
}

.level-card-highlight {
    border-color: rgba(167, 139, 250, 0.3);
    box-shadow: 0 0 40px rgba(167, 139, 250, 0.1);
}

.level-milestone {
    background: linear-gradient(135deg, var(--purple-dim), var(--blue-dim));
    border-top: none;
    border-bottom: 1px solid var(--border);
    padding: 14px 32px;
    font-weight: 700;
    color: var(--purple);
    font-size: 0.95rem;
    text-align: center;
    letter-spacing: 0.02em;
    margin: 0;
}

.level-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 28px 32px;
    border-bottom: 1px solid var(--border-light);
}

.level-badge {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    background: var(--gradient-1);
    color: white;
    flex-shrink: 0;
}

.level-info { flex: 1; }

.level-info h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.level-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
}

.tag-gray { background: var(--bg-surface); color: var(--text-muted); }
.tag-red { background: var(--red-dim); color: var(--red); }
.tag-blue { background: var(--blue-dim); color: var(--blue); }
.tag-green { background: var(--green-dim); color: var(--green); }
.tag-yellow { background: var(--yellow-dim); color: var(--yellow); }
.tag-purple { background: var(--purple-dim); color: var(--purple); }
.tag-cyan { background: var(--cyan-dim); color: var(--cyan); }
.tag-pink { background: var(--pink-dim); color: var(--pink); }

.level-autonomy {
    text-align: right;
    flex-shrink: 0;
}

.autonomy-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 6px;
}

.autonomy-bar {
    width: 120px;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.autonomy-fill {
    height: 100%;
    background: var(--gradient-1);
    border-radius: 3px;
    transition: width 1s ease;
}

.level-body {
    padding: 32px;
}

.level-desc {
    margin-bottom: 32px;
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 800px;
}

.level-desc p { line-height: 1.8; }

/* ===== ARCHITECTURE DIAGRAMS ===== */
.arch-diagram {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 40px;
    margin-bottom: 32px;
    overflow-x: auto;
}

/* Simple flow */
.arch-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.arch-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.arch-node-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.arch-user .arch-node-icon { background: var(--green-dim); color: var(--green); border: 2px solid rgba(52,211,153,0.3); }
.arch-llm .arch-node-icon { background: var(--blue-dim); color: var(--blue); border: 2px solid rgba(79,143,247,0.3); }
.arch-output .arch-node-icon { background: var(--purple-dim); color: var(--purple); border: 2px solid rgba(167,139,250,0.3); }
.arch-tool .arch-node-icon { background: var(--orange-dim); color: var(--orange); border: 2px solid rgba(251,146,60,0.3); }

.arch-node span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.arch-arrow {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.75rem;
    position: relative;
}

.arch-arrow::before {
    content: '';
    width: 40px;
    height: 2px;
    background: var(--border);
    border-radius: 1px;
}

.arch-arrow::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 6px solid var(--border);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
}

.arch-arrow span {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* LLM with tools */
.arch-node-lg {
    position: relative;
}

.arch-sub-nodes {
    margin-top: 12px;
}

.arch-tool-call {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.arch-tool-label {
    font-size: 0.7rem;
    color: var(--orange);
    font-weight: 600;
}

.arch-mini-arrow {
    width: 2px;
    height: 16px;
    background: var(--orange);
    position: relative;
}

.arch-mini-arrow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -3px;
    width: 0;
    height: 0;
    border-top: 5px solid var(--orange);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
}

.arch-node-mini {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.arch-node-mini.arch-tool {
    background: var(--orange-dim);
    color: var(--orange);
    border: 1px solid rgba(251,146,60,0.3);
}

/* Pipeline */
.arch-pipeline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
}

.pipe-node, .pipe-gate {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.pipe-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    background: var(--blue-dim);
    color: var(--blue);
    border: 2px solid rgba(79,143,247,0.3);
}

.pipe-gate .pipe-icon {
    background: var(--yellow-dim);
    color: var(--yellow);
    border-color: rgba(251,191,36,0.3);
    border-radius: 50%;
}

.pipe-node span, .pipe-gate span {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.pipe-connector {
    display: flex;
    align-items: center;
    width: 48px;
    position: relative;
}

.pipe-line {
    width: 100%;
    height: 2px;
    background: var(--border);
}

.pipe-arrow-head {
    position: absolute;
    right: 0;
    width: 0;
    height: 0;
    border-left: 6px solid var(--border);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
}

/* Router */
.arch-router {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
}

.router-branches {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.branch {
    display: flex;
    align-items: center;
    gap: 12px;
}

.branch-line {
    width: 40px;
    height: 2px;
    background: var(--border);
    position: relative;
}

.branch-line::after {
    content: '';
    position: absolute;
    right: 0;
    top: -3px;
    width: 0;
    height: 0;
    border-left: 6px solid var(--border);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
}

.branch-node {
    padding: 10px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 140px;
}

.branch-label {
    font-weight: 700;
    font-size: 0.85rem;
    display: block;
}

.branch-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.branch-a .branch-node { border-color: rgba(52,211,153,0.3); }
.branch-a .branch-label { color: var(--green); }
.branch-b .branch-node { border-color: rgba(79,143,247,0.3); }
.branch-b .branch-label { color: var(--blue); }
.branch-c .branch-node { border-color: rgba(251,146,60,0.3); }
.branch-c .branch-label { color: var(--orange); }

/* ReAct Loop */
.arch-react-loop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.react-cycle {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    border: 2px dashed var(--border);
    border-radius: 20px;
    padding: 40px 32px 24px;
}

.react-loop-back {
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.loop-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.react-nodes-row {
    display: flex;
    align-items: center;
    gap: 20px;
}

.react-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    min-width: 120px;
    text-align: center;
}

.react-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
}

.react-think { background: var(--blue-dim); border: 1px solid rgba(79,143,247,0.3); }
.react-think .react-icon { background: var(--blue); color: white; }
.react-act { background: var(--orange-dim); border: 1px solid rgba(251,146,60,0.3); }
.react-act .react-icon { background: var(--orange); color: white; }
.react-observe { background: var(--green-dim); border: 1px solid rgba(52,211,153,0.3); }
.react-observe .react-icon { background: var(--green); color: white; }
.react-answer { background: var(--purple-dim); border: 1px solid rgba(167,139,250,0.3); }
.react-answer .react-icon { background: var(--purple); color: white; }

.react-node span {
    font-weight: 700;
    font-size: 0.9rem;
}

.react-node p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.react-arrow {
    width: 36px;
    height: 2px;
    background: var(--text-muted);
    position: relative;
    flex-shrink: 0;
}

.react-arrow::after {
    content: '';
    position: absolute;
    right: 0;
    top: -3px;
    width: 0;
    height: 0;
    border-left: 6px solid var(--text-muted);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
}

/* Loop-back arrow on bottom of dashed box */
.react-cycle::after {
    content: '↺';
    position: absolute;
    bottom: -14px;
    right: 32px;
    font-size: 1.2rem;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 0 8px;
    line-height: 1;
}

.react-exit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.react-exit-arrow {
    width: 2px;
    height: 24px;
    background: var(--purple);
    position: relative;
}

.react-exit-arrow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -3px;
    width: 0;
    height: 0;
    border-top: 6px solid var(--purple);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
}

/* ReAct Trace */
.react-example {
    margin-bottom: 32px;
}

.react-example h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}

.react-trace {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.trace-step {
    display: flex;
    gap: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    align-items: flex-start;
}

.trace-label {
    width: 72px;
    flex-shrink: 0;
    font-weight: 700;
    font-size: 0.8rem;
    padding-top: 2px;
}

.trace-content {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.trace-thought { background: var(--blue-dim); }
.trace-thought .trace-label { color: var(--blue); }
.trace-action { background: var(--orange-dim); }
.trace-action .trace-label { color: var(--orange); }
.trace-observe { background: var(--green-dim); }
.trace-observe .trace-label { color: var(--green); }
.trace-answer { background: var(--purple-dim); }
.trace-answer .trace-label { color: var(--purple); }

/* Planning */
.arch-planning {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
    position: relative;
}

.planning-phase {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 28px;
    border-radius: var(--radius-lg);
    min-width: 160px;
    text-align: center;
}

.planning-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: white;
}

.planning-plan { background: var(--cyan-dim); border: 1px solid rgba(34,211,238,0.3); }
.planning-plan .planning-icon { background: var(--cyan); }
.planning-execute { background: var(--orange-dim); border: 1px solid rgba(251,146,60,0.3); }
.planning-execute .planning-icon { background: var(--orange); }
.planning-reflect { background: var(--purple-dim); border: 1px solid rgba(167,139,250,0.3); }
.planning-reflect .planning-icon { background: var(--purple); }

.planning-phase h5 { font-size: 0.95rem; font-weight: 700; }
.planning-phase p { font-size: 0.75rem; color: var(--text-muted); }

.planning-tasks {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.planning-tasks span {
    padding: 2px 8px;
    background: rgba(34,211,238,0.15);
    border-radius: 4px;
    font-size: 0.7rem;
    color: var(--cyan);
    font-weight: 600;
}

.planning-arrows {
    display: flex;
    align-items: center;
}

.planning-arrow-down {
    width: 40px;
    height: 2px;
    background: var(--border);
    position: relative;
}

.planning-arrow-down::after {
    content: '';
    position: absolute;
    right: 0;
    top: -3px;
    width: 0;
    height: 0;
    border-left: 6px solid var(--border);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
}

.planning-replan {
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
}

.planning-replan span {
    font-size: 0.8rem;
    color: var(--cyan);
    font-weight: 600;
}

.replan-arrow {
    width: 120px;
    height: 2px;
    background: var(--cyan);
    border-radius: 1px;
    opacity: 0.5;
}

/* Multi-Agent */
.arch-multi-agent {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.ma-orchestrator { text-align: center; }

.ma-node {
    padding: 14px 24px;
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.ma-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: white;
}

.ma-orch { background: var(--purple-dim); border: 2px solid rgba(167,139,250,0.3); }
.ma-orch .ma-icon { background: var(--purple); }
.ma-research { background: var(--blue-dim); border: 1px solid rgba(79,143,247,0.3); }
.ma-research .ma-icon { background: var(--blue); }
.ma-coder { background: var(--green-dim); border: 1px solid rgba(52,211,153,0.3); }
.ma-coder .ma-icon { background: var(--green); }
.ma-reviewer { background: var(--orange-dim); border: 1px solid rgba(251,146,60,0.3); }
.ma-reviewer .ma-icon { background: var(--orange); }
.ma-writer { background: var(--cyan-dim); border: 1px solid rgba(34,211,238,0.3); }
.ma-writer .ma-icon { background: var(--cyan); }

.ma-connections {
    display: none;
}

.ma-line {
    display: none;
}

.ma-workers {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 680px;
    position: relative;
}

.ma-workers::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--border);
}

.ma-worker {
    position: relative;
    text-align: center;
}

.ma-worker::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    width: 2px;
    height: 20px;
    background: var(--border);
    transform: translateX(-50%);
}

.ma-orchestrator::after {
    content: '';
    display: block;
    width: 2px;
    height: 20px;
    background: var(--border);
    margin: 0 auto;
}

.ma-tools {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ===== EXAMPLE CARDS ===== */
.example-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.example-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 20px;
}

.example-card h5 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}

.example-card-wide {
    grid-column: 1 / -1;
}

.pipeline-steps {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pipeline-steps span:not(.step-arrow) {
    padding: 4px 12px;
    background: var(--blue-dim);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--blue);
    font-weight: 500;
}

.step-arrow {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.router-example {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.router-ex-input {
    padding: 6px 14px;
    background: var(--green-dim);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--green);
    font-weight: 600;
    display: inline-block;
    align-self: flex-start;
}

.router-ex-branches {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 16px;
    border-left: 2px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Plan execution */
.plan-execution {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.plan-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.plan-done { background: var(--green-dim); color: var(--green); }
.plan-failed { background: var(--red-dim); color: var(--red); }
.plan-replan { background: var(--cyan-dim); color: var(--cyan); }
.plan-pending { color: var(--text-muted); }

.plan-check, .plan-x, .plan-refresh, .plan-dot {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.plan-note {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-left: 8px;
}

/* ===== PATTERNS GRID ===== */
.patterns-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.pattern-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 20px;
}

.pattern-card h5 {
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.pattern-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.pattern-example {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 4px 10px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    display: inline-block;
}

/* ===== LEVEL DETAILS ===== */
.level-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}

.detail-col h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text);
}

.detail-col ul {
    list-style: none;
}

.detail-col ul li {
    padding: 4px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    position: relative;
    padding-left: 16px;
}

.detail-col ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border);
}

/* ===== COMPARISON TABLE ===== */
.comparison-table-section {
    margin-top: 48px;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.level-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.level-table th {
    background: var(--bg-surface);
    padding: 14px 20px;
    text-align: left;
    font-weight: 700;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

.level-table td {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.level-table tr:last-child td { border-bottom: none; }

.table-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    background: var(--blue-dim);
    color: var(--blue);
}

.badge-highlight {
    background: var(--purple-dim);
    color: var(--purple);
}

.table-highlight {
    background: rgba(167,139,250,0.05);
}

.table-highlight td { color: var(--text); font-weight: 500; }

/* ===== DEEP DIVE CARDS ===== */
.deep-dive-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    margin-bottom: 32px;
    overflow: hidden;
}

.dd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-light);
}

.dd-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
}

.dd-tag {
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--blue-dim);
    color: var(--blue);
}

.dd-body {
    padding: 32px;
}

.dd-body > p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.8;
}

.dd-source {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

/* Memory */
.memory-arch {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.memory-type {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
}

.memory-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    color: white;
    margin: 0 auto 12px;
}

.memory-short { background: var(--blue); }
.memory-long { background: var(--purple); }
.memory-episodic { background: var(--green); }

.memory-type h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.memory-type p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.memory-impl {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 4px 10px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    display: inline-block;
}

/* RAG Comparison */
.rag-comparison {
    display: flex;
    gap: 24px;
    align-items: stretch;
}

.rag-type {
    flex: 1;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
}

.rag-type h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.rag-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 16px;
}

.rag-step {
    padding: 8px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    width: 100%;
    max-width: 200px;
}

.rag-arrow {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.rag-arrow-loop {
    color: var(--cyan);
    font-weight: 700;
}

.rag-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.rag-vs {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-muted);
}

.rag-traditional h4 { color: var(--text-secondary); }
.rag-agentic h4 { color: var(--cyan); }

/* Guardrails */
.guardrails-arch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

.guardrail-layer {
    width: 100%;
    max-width: 600px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 16px 20px;
    text-align: center;
}

.guardrail-label {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.guardrail-items {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.guardrail-items span {
    padding: 4px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.guardrail-arrow {
    color: var(--text-muted);
    font-size: 1rem;
}

.guardrail-core {
    padding: 16px 32px;
    background: var(--blue-dim);
    border: 2px solid rgba(79,143,247,0.3);
    border-radius: var(--radius);
    font-weight: 700;
    color: var(--blue);
}

.guardrail-side {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 16px;
    max-width: 200px;
    text-align: center;
}

/* Cost */
.cost-strategies {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cost-item {
    position: relative;
}

.cost-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-surface);
    border-radius: var(--radius);
    margin-bottom: 4px;
    position: relative;
    overflow: hidden;
}

.cost-bar::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--width);
    background: var(--gradient-1);
    opacity: 0.1;
}

.cost-label {
    font-weight: 700;
    font-size: 0.95rem;
    position: relative;
}

.cost-savings {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--green);
    position: relative;
}

.cost-item > p {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-left: 16px;
}

/* ===== PROTOCOLS ===== */
.protocols-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 48px;
}

.protocol-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.protocol-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    border-bottom: 1px solid var(--border-light);
}

.protocol-logo {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1rem;
    flex-shrink: 0;
}

.protocol-mcp .protocol-logo {
    background: var(--gradient-1);
    color: white;
}

.protocol-a2a .protocol-logo {
    background: var(--gradient-3);
    color: white;
}

.protocol-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.protocol-by {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.protocol-body {
    padding: 24px;
}

.protocol-direction {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.protocol-dir-label {
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--purple-dim);
    color: var(--purple);
}

.protocol-direction span:last-child {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.protocol-body > p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.7;
}

.protocol-primitives {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.primitive {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
}

.primitive strong {
    min-width: 80px;
    font-size: 0.85rem;
}

.primitive span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.protocol-tech {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 8px 12px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
}

/* Protocol Relationship */
.protocol-relationship {
    text-align: center;
}

.protocol-rel-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
}

.rel-box {
    padding: 16px 28px;
    border-radius: var(--radius);
    text-align: center;
}

.rel-box strong {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.rel-box span {
    font-size: 0.85rem;
}

.rel-mcp {
    background: var(--blue-dim);
    border: 1px solid rgba(79,143,247,0.3);
    color: var(--blue);
}

.rel-a2a {
    background: var(--green-dim);
    border: 1px solid rgba(52,211,153,0.3);
    color: var(--green);
}

.rel-connector {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.protocol-rel-note {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ===== FRAMEWORKS ===== */
.frameworks-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.fw-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.3s;
}

.fw-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.fw-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.fw-header h4 {
    font-size: 1.1rem;
    font-weight: 700;
}

.fw-badge {
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--blue-dim);
    color: var(--blue);
}

.fw-card > p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.6;
}

.fw-features {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.fw-features span {
    padding: 2px 8px;
    background: var(--bg-surface);
    border-radius: 4px;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.fw-best {
    font-size: 0.8rem;
    color: var(--green);
    font-weight: 500;
}

/* ===== MISTAKES ===== */
.mistakes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.mistake-item {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.2s;
}

.mistake-item:hover {
    border-color: var(--red);
    background: rgba(248,113,113,0.03);
}

.mistake-num {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--red);
    opacity: 0.5;
    flex-shrink: 0;
    width: 36px;
}

.mistake-item h5 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.mistake-item p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ===== STATS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 900;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.stat-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ===== ADVICE ===== */
.advice-section {
    margin-top: 48px;
}

.advice-card {
    display: flex;
    gap: 20px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    transition: all 0.2s;
}

.advice-card:hover {
    border-color: rgba(79,143,247,0.3);
}

.advice-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--gradient-1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: white;
    flex-shrink: 0;
}

.advice-card h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.advice-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ===== PAPERS ===== */
.papers-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 48px;
}

.paper-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.paper-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-1);
    opacity: 0;
    transition: opacity 0.3s;
}

.paper-card:hover::before { opacity: 1; }
.paper-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.paper-foundational { border-color: rgba(79,143,247,0.2); }
.paper-industry { border-color: rgba(52,211,153,0.2); }

.paper-type {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 10px;
    background: var(--bg-surface);
    color: var(--text-muted);
}

.paper-foundational .paper-type { background: var(--blue-dim); color: var(--blue); }
.paper-industry .paper-type { background: var(--green-dim); color: var(--green); }

.paper-card h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.paper-authors {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.paper-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.paper-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.paper-tags span {
    padding: 2px 8px;
    background: var(--bg-surface);
    border-radius: 4px;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== BENCHMARKS ===== */
.benchmarks-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.benchmark-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.benchmark-card h4 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.benchmark-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.benchmark-score {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cyan);
    padding: 4px 12px;
    background: var(--cyan-dim);
    border-radius: var(--radius-sm);
    display: inline-block;
}

/* ===== RESPONSIVE (guide-specific) ===== */
@media (max-width: 1024px) {
    .components-grid { grid-template-columns: repeat(2, 1fr); }
    .frameworks-grid { grid-template-columns: repeat(2, 1fr); }
    .protocols-layout { grid-template-columns: 1fr; }
    .guardrail-side { position: static; transform: none; max-width: 100%; }
}

@media (max-width: 768px) {
    .components-grid { grid-template-columns: 1fr; }
    .comparison-table { flex-direction: column; }
    .comparison-vs { justify-content: center; padding: 8px; }

    .level-header { flex-direction: column; align-items: flex-start; }
    .level-autonomy { align-self: flex-end; }

    .arch-flow { gap: 8px; }
    .react-cycle { padding: 32px 16px 20px; }
    .react-nodes-row { flex-direction: column; gap: 12px; }
    .react-arrow {
        width: 2px;
        height: 24px;
    }
    .react-arrow::after {
        right: auto;
        top: auto;
        bottom: 0;
        left: -3px;
        border-left: 4px solid transparent;
        border-right: 4px solid transparent;
        border-top: 6px solid var(--text-muted);
        border-bottom: none;
    }
    .react-cycle::after { display: none; }

    .patterns-grid { grid-template-columns: 1fr; }
    .memory-arch { grid-template-columns: 1fr; }
    .rag-comparison { flex-direction: column; }
    .rag-vs { justify-content: center; }
    .mistakes-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .papers-grid { grid-template-columns: 1fr; }
    .benchmarks-grid { grid-template-columns: 1fr; }
    .frameworks-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .formula { gap: 6px; }
    .formula-item { padding: 8px 14px; font-size: 0.9rem; }
}
