:root {
    --purple: #8b5cf6;
    --purple-light: #ede9fe;
    --indigo: #6366f1;
    --indigo-light: #e0e7ff;
}

/* Back link */
.back-link {
    display: inline-block;
    color: var(--transcend-blue);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 16px;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--transcend-blue-dark);
    text-decoration: underline;
}

.state-copy {
    margin: 16px 0;
    color: var(--text-secondary);
}

.access-copy {
    color: var(--text-primary);
}

/* ==================== TOOL BRIEF ==================== */
.tool-brief {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.tool-brief > div {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 14px;
    min-width: 0;
}

.brief-label {
    display: block;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: var(--transcend-blue);
    margin-bottom: 5px;
}

.tool-brief strong {
    display: block;
    font-size: 0.82rem;
    line-height: 1.35;
}

.source-note {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--warning-amber);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.55;
    margin: -8px 0 24px;
    padding: 12px 14px;
}

.source-note strong {
    color: var(--text-primary);
}

.source-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.source-links a {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--transcend-blue);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 9px;
    text-decoration: none;
}

.source-links a:hover {
    border-color: var(--transcend-blue);
    background: var(--transcend-light);
}

/* ==================== PAGE TITLE ==================== */
.page-header {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.page-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 800px;
}

/* ==================== FILTER BAR ==================== */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-pill {
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: 2px solid var(--border-color);
    background: white;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.filter-pill:hover {
    border-color: #9ca3af;
    color: var(--text-primary);
}

.filter-pill.active {
    border-color: var(--transcend-blue);
    background: var(--transcend-light);
    color: var(--transcend-blue);
}

.filter-bar-actions {
    margin-left: auto;
}

.add-company-btn {
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: 2px dashed var(--transcend-blue);
    background: white;
    color: var(--transcend-blue);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.add-company-btn:hover {
    background: var(--transcend-light);
    border-style: solid;
}

/* ==================== FLOW VISUALIZATION ==================== */
.flow-container {
    background: white;
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow-x: auto;
}

.flow-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.flow-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.flow-legend {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-arrow {
    width: 40px;
    height: 2px;
    position: relative;
}

.legend-arrow.money {
    background: var(--metric-green);
}

.legend-arrow.data {
    background: var(--purple);
}

.legend-arrow::after {
    content: '';
    position: absolute;
    right: 0;
    top: -3px;
    border: 4px solid transparent;
}

.legend-arrow.money::after {
    border-left-color: var(--metric-green);
}

.legend-arrow.data::after {
    border-right-color: var(--purple);
    right: auto;
    left: 0;
}

.flow-grid {
    display: grid;
    grid-template-columns: repeat(var(--col-count, 5), minmax(160px, 1fr));
    gap: 16px;
    min-width: 900px;
    position: relative;
    transition: all 0.3s ease;
}

.flow-layer {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.layer-header {
    text-align: center;
    padding: 12px 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
}

.layer-header.mmp { background: var(--purple); }
.layer-header.walled-garden { background: var(--transcend-blue); }
.layer-header.ad-network { background: var(--metric-green); }
.layer-header.dsp { background: var(--warning-amber); }
.layer-header.mediation { background: var(--danger-red); }
.layer-header.pc-discovery { background: var(--indigo); }

.layer-nodes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 300px;
}

/* ==================== NODES ==================== */
.node {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    min-height: 80px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.node:hover {
    border-color: var(--transcend-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.node.faded {
    opacity: 0.25;
    pointer-events: none;
    filter: grayscale(80%);
    border-style: dashed;
    background: var(--bg-primary);
}

.node-icon {
    font-size: 1.5rem;
    margin-bottom: 6px;
    transition: font-size 0.3s ease;
}

.node-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    transition: font-size 0.3s ease;
}

.node-share {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.node-power {
    display: flex;
    gap: 2px;
    margin-top: 6px;
}

.node-power .star {
    font-size: 0.6rem;
    color: var(--warning-amber);
}

.node-power .star.empty {
    color: var(--border-color);
}

.node.size-xl {
    border-color: var(--transcend-blue);
    background: var(--transcend-light);
    box-shadow: 0 2px 6px rgba(44, 90, 160, 0.15);
}
.node.size-xl .node-name { font-size: 0.95rem; font-weight: 700; }
.node.size-xl .node-icon { font-size: 1.8rem; }

.node.size-lg {
    border-color: #93c5fd;
}
.node.size-lg .node-icon { font-size: 1.6rem; }

.node.size-sm .node-name { font-size: 0.8rem; opacity: 0.9; }
.node.size-sm .node-icon { font-size: 1.3rem; opacity: 0.85; }

/* ==================== TOOLTIP ==================== */
.tooltip {
    position: fixed;
    background: var(--text-primary);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.8rem;
    max-width: 280px;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.tooltip.visible { opacity: 1; }

.tooltip-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.tooltip-oneliner {
    color: #d1d5db;
    margin-bottom: 8px;
    line-height: 1.4;
}

.tooltip-meta {
    display: flex;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid #374151;
    font-size: 0.75rem;
}

.tooltip-share { color: var(--metric-green); }
.tooltip-power { color: var(--warning-amber); }

/* ==================== SIDE DRAWER ==================== */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.drawer-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.drawer {
    position: fixed;
    top: 0;
    right: -500px;
    width: 500px;
    max-width: 90vw;
    height: 100vh;
    background: white;
    z-index: 1001;
    transition: right 0.3s ease;
    overflow-y: auto;
    box-shadow: -4px 0 20px rgba(0,0,0,0.2);
}

.drawer.open { right: 0; }

.drawer-header {
    position: sticky;
    top: 0;
    background: white;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 10;
}

.drawer-title-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.drawer-icon { font-size: 2rem; }

.drawer-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.drawer-layer-badge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 12px;
    color: white;
}

.drawer-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.drawer-close:hover { color: var(--text-primary); }

.drawer-body { padding: 24px; }

.drawer-section {
    margin-bottom: 24px;
}

.drawer-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--bg-secondary);
}

.drawer-oneliner {
    font-size: 1.05rem;
    color: #374151;
    line-height: 1.5;
    margin-bottom: 16px;
}

.drawer-overview {
    font-size: 0.9rem;
    color: #4b5563;
    line-height: 1.7;
}

.drawer-overview p {
    margin-bottom: 12px;
}

/* VC Perspective box */
.vc-perspective {
    background: var(--transcend-light);
    border-left: 4px solid var(--transcend-blue);
    padding: 16px;
    border-radius: 0 8px 8px 0;
    margin: 16px 0;
}

.vc-perspective-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--transcend-blue);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.vc-perspective-text {
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.6;
}

.alpha-box {
    background: var(--amber-light);
    border-color: var(--warning-amber);
}

.alpha-title {
    color: #92400e;
}

/* Pros/Cons */
.pros-cons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.pros-box, .cons-box {
    padding: 16px;
    border-radius: 8px;
}

.pros-box {
    background: var(--green-light);
    border: 1px solid var(--metric-green);
}

.cons-box {
    background: var(--red-light);
    border: 1px solid var(--danger-red);
}

.pros-title, .cons-title {
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.pros-title { color: var(--metric-green); }
.cons-title { color: var(--danger-red); }

.pros-list, .cons-list {
    list-style: none;
    font-size: 0.85rem;
}

.pros-list li, .cons-list li {
    padding: 4px 0;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.pros-list li::before { content: '✓'; color: var(--metric-green); font-weight: bold; }
.cons-list li::before { content: '✗'; color: var(--danger-red); font-weight: bold; }

.quick-reference-card {
    margin-top: 24px;
}

.quick-reference {
    margin-top: 16px;
}

.quick-reference-item {
    background: var(--bg-primary);
    border-left: 4px solid var(--transcend-blue);
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 16px;
}

.quick-reference-item.mmp { border-left-color: var(--purple); }
.quick-reference-item.walled-garden { border-left-color: var(--transcend-blue); }
.quick-reference-item.ad-network { border-left-color: var(--metric-green); }
.quick-reference-item.dsp { border-left-color: var(--warning-amber); }
.quick-reference-item.mediation { border-left-color: var(--danger-red); }
.quick-reference-item.pc-discovery { border-left-color: var(--indigo); }

.quick-reference-layer {
    color: var(--transcend-blue);
    font-weight: 600;
    margin-bottom: 8px;
}

.quick-reference-item.mmp .quick-reference-layer { color: var(--purple); }
.quick-reference-item.walled-garden .quick-reference-layer { color: var(--transcend-blue); }
.quick-reference-item.ad-network .quick-reference-layer { color: var(--metric-green); }
.quick-reference-item.dsp .quick-reference-layer { color: var(--warning-amber); }
.quick-reference-item.mediation .quick-reference-layer { color: var(--danger-red); }
.quick-reference-item.pc-discovery .quick-reference-layer { color: var(--indigo); }

.quick-reference-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.suggest-company-quote {
    color: var(--transcend-blue);
    font-weight: 500;
}

.footer-note,
.comments-empty-help {
    margin-top: 8px;
}

.comments-empty-help {
    font-size: 12px;
}

        @media (max-width: 768px) {
            .tool-brief {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }

            .filter-bar {
                flex-direction: column;
                align-items: stretch;
    }
    .filter-pill {
        text-align: center;
        width: 100%;
    }

    .filter-bar-actions {
        margin-left: 0;
        margin-top: 12px;
        display: flex;
        justify-content: center;
    }

    .add-company-btn {
        width: 100%;
        justify-content: center;
    }

    .flow-grid { grid-template-columns: repeat(3, 1fr); }

    .drawer { width: 100vw; max-width: 100vw; }

            .pros-cons-grid { grid-template-columns: 1fr; }
        }

        @media (max-width: 480px) {
            .tool-brief { grid-template-columns: 1fr; }
        }
