/* ==========================================================================
   Trade Republic · Competitive Intelligence Radar
   Left Sidebar Competitor Navigation & 5-Second Scannable Intelligence Cards
   ========================================================================== */

:root {
    --bg-page: #f8fafc;
    --bg-surface: #ffffff;
    --border-subtle: #e2e8f0;
    --border-strong: #cbd5e1;
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-dim: #94a3b8;

    --brand-n26: #0d9488;
    --brand-revolut: #0f172a;
    --brand-scalable: #e11d48;
    --brand-bitpanda: #1e293b;

    --accent-emerald: #059669;
    --accent-emerald-bg: #ecfdf5;
    --accent-blue: #0284c7;
    --accent-blue-bg: #f0f9ff;
    --accent-indigo: #4f46e5;
    --accent-indigo-bg: #eef2ff;
    --accent-amber: #d97706;
    --accent-amber-bg: #fffbeb;
    --accent-rose: #dc2626;
    --accent-rose-bg: #fef2f2;
    --accent-purple: #7c3aed;
    --accent-purple-bg: #faf5ff;

    --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-card: 0 2px 8px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.02);
    --shadow-hover: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-drawer: -8px 0 32px rgba(15, 23, 42, 0.15);
    --shadow-modal: 0 20px 40px -15px rgba(0, 0, 0, 0.2);
    
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    font-size: 13.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ==========================================================================
   App Shell Layout (Left Sidebar + Main Content)
   ========================================================================== */

.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100vw;
}

/* ==========================================================================
   Left Sidebar Navigation (Competitors Front & Center)
   ========================================================================== */

.sidebar {
    width: 270px;
    min-width: 270px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 20px 16px;
    justify-content: space-between;
    z-index: 50;
}

.sidebar-top {
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 0 4px;
}

.logo-mark {
    width: 32px;
    height: 32px;
    background: #000000;
    color: #ffffff;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: -0.05em;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.sidebar-live-status {
    background: var(--accent-emerald-bg);
    border: 1px solid #a7f3d0;
    padding: 5px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 22px;
}

.live-pulse-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-emerald);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--accent-emerald);
    flex-shrink: 0;
}

.live-status-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-emerald);
}

.sidebar-nav-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 22px;
}

.sidebar-group-title {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    margin-bottom: 8px;
    padding: 0 8px;
}

/* Primary Competitor Buttons */
.sidebar-competitor-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}

.sidebar-competitor-btn:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

.sidebar-competitor-btn.active {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

.comp-icon-dot {
    font-size: 13px;
    margin-right: 8px;
    display: flex;
    align-items: center;
}

.comp-nav-name {
    flex-grow: 1;
    font-size: 12.5px;
}

.comp-count-pill {
    font-size: 10.5px;
    font-weight: 700;
    background: #e2e8f0;
    color: #475569;
    padding: 1px 7px;
    border-radius: 10px;
}

.sidebar-competitor-btn.active .comp-count-pill {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

/* Reports & Tools View Buttons */
.sidebar-view-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}

.sidebar-view-btn:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

.sidebar-view-btn.active {
    background: var(--accent-blue-bg);
    color: var(--accent-blue);
    font-weight: 700;
}

.nav-icon {
    font-size: 13px;
}

.nav-label {
    flex-grow: 1;
}

/* Sidebar Footer */
.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
}

.btn-baseline-sidebar {
    background: #f8fafc;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 600;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    width: 100%;
}

.btn-baseline-sidebar:hover {
    background: #f1f5f9;
    color: var(--text-main);
    border-color: var(--border-strong);
}

.sidebar-env-badge {
    font-size: 10px;
    color: var(--text-dim);
    text-align: center;
}

/* ==========================================================================
   Main Content Area & Topbar
   ========================================================================== */

.main-content {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
}

.content-topbar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    padding: 14px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 40;
    gap: 16px;
}

.title-with-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.title-with-badge h1 {
    font-size: 16.5px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.topbar-filter-badge {
    font-size: 11px;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
}

.topbar-subtitle {
    font-size: 11px;
    color: var(--text-muted);
}

.topbar-search-area {
    width: 280px;
}

.search-input {
    width: 100%;
    padding: 6px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    background: #f8fafc;
    color: var(--text-main);
    outline: none;
    transition: all 0.15s ease;
}

.search-input:focus {
    background: #ffffff;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.content-scroll-container {
    padding: 24px 32px 60px 32px;
    max-width: 1280px;
    width: 100%;
}

/* ==========================================================================
   Executive KPI Strip
   ========================================================================== */

.kpi-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    box-shadow: var(--shadow-subtle);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.kpi-label {
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.kpi-val {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 1px;
}

.kpi-sub {
    font-size: 11px;
    color: var(--text-dim);
}

.text-emerald { color: #059669; }
.text-blue { color: #0284c7; }
.text-indigo { color: #4f46e5; }
.text-purple { color: #7c3aed; }
.text-rose { color: #dc2626; }

/* ==========================================================================
   View Panels
   ========================================================================== */

.view-panel {
    display: none;
}

.view-panel.active {
    display: block;
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(2px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Quick Filter Bar (Triage + Strategic Pillars)
   ========================================================================== */

.quick-filter-bar {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-subtle);
    flex-wrap: wrap;
}

.filter-chips {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-row-label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-right: 2px;
}

.filter-chip {
    background: #f8fafc;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-chip:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

.filter-chip.active {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

/* ==========================================================================
   Clean Intelligence Card Grid (5-Second F-Pattern Scan)
   ========================================================================== */

.intel-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.intel-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    box-shadow: var(--shadow-subtle);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.15s ease;
    min-height: 185px;
}

.intel-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-card);
    transform: translateY(-2px);
}

/* 1. Header: Source Reliability Pill + Strategic Impact Tag */
.intel-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 8px;
}

.source-reliability-pill {
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.pill-green {
    background: var(--accent-emerald-bg);
    color: var(--accent-emerald);
    border: 1px solid #a7f3d0;
}

.pill-amber {
    background: var(--accent-amber-bg);
    color: var(--accent-amber);
    border: 1px solid #fde68a;
}

.pill-gray {
    background: #f1f5f9;
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
}

.impact-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 2px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.badge-moat { background: #dcfce7; color: #15803d; }
.badge-threat { background: #fef3c7; color: #b45309; }
.badge-noise { background: #f1f5f9; color: #64748b; }

/* 2. Headline: Competitor & Feature Name */
.intel-card-headline {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.35;
    margin-bottom: 8px;
}

.comp-brand {
    font-weight: 800;
}

.comp-n26 { color: #0d9488; }
.comp-scalable { color: #e11d48; }
.comp-revolut { color: #0f172a; }
.comp-bitpanda { color: #1e293b; }

/* 3. Body: Strategic Delta & Estimated Dev Impact (Truncated to 2 lines) */
.intel-card-body {
    margin-bottom: 12px;
    flex-grow: 1;
}

.intel-delta-line {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.45;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.intel-impact-line {
    font-size: 11.5px;
    color: #334155;
    font-weight: 500;
}

/* 4. Footer: Action Buttons */
.intel-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.btn-diff-link {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.btn-diff-link:hover {
    color: var(--text-main);
    background: #f1f5f9;
}

.btn-open-spec-drawer {
    background: #0f172a;
    color: #ffffff;
    border: none;
    font-size: 11.5px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-open-spec-drawer:hover {
    background: #334155;
}

/* ==========================================================================
   Slide-Over 1-Page Spec Drawer (Drawer Modal)
   ========================================================================== */

.spec-drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    display: flex;
    justify-content: flex-end;
}

.spec-drawer-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.spec-drawer-panel {
    background: var(--bg-surface);
    width: 100%;
    max-width: 620px;
    height: 100vh;
    box-shadow: var(--shadow-drawer);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.spec-drawer-backdrop.active .spec-drawer-panel {
    transform: translateX(0);
}

.drawer-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-subtle);
    background: #f8fafc;
    position: relative;
}

.drawer-header-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.drawer-header h2 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.35;
    padding-right: 32px;
}

.drawer-subtitle {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

.drawer-close-btn {
    position: absolute;
    top: 16px;
    right: 18px;
    background: transparent;
    border: none;
    font-size: 22px;
    color: var(--text-dim);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

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

.drawer-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex-grow: 1;
}

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

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.section-title-row h3 {
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
}

.section-pill {
    font-size: 10px;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
    padding: 1px 7px;
    border-radius: 10px;
}

.section-pill.pill-amber {
    background: #fef3c7;
    color: #92400e;
}

.section-pill.pill-indigo {
    background: #e0e7ff;
    color: #3730a3;
}

.spec-block {
    background: #f8fafc;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px;
}

.spec-subhead {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.spec-text {
    font-size: 12.5px;
    color: var(--text-main);
    line-height: 1.45;
}

.spec-text-highlight {
    font-size: 12.5px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.45;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}

.spec-bullet-list {
    list-style: none;
    padding: 0;
    margin: 4px 0 0 0;
}

.spec-bullet-list li {
    font-size: 12px;
    padding: 3px 0;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    color: #334155;
}

.out-of-scope-card {
    background: #fffdf9;
    border: 1px solid #fef3c7;
    border-radius: var(--radius-md);
    padding: 14px;
}

.out-of-scope-bullets li {
    color: #991b1b;
}

.spec-code-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px;
    font-weight: 600;
    color: #0f172a;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
}

.gherkin-code-block {
    background: #0f172a;
    color: #e2e8f0;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-x: auto;
}

.diff-view-box {
    background: #0f172a;
    color: #e2e8f0;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
}

.diff-line.added { color: #4ade80; background: rgba(74, 222, 128, 0.1); display: block; }
.diff-line.removed { color: #f87171; background: rgba(248, 113, 113, 0.1); display: block; }
.diff-line.header { color: #94a3b8; display: block; }

.provenance-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    gap: 8px;
}

.hash-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-dim);
}

.primary-link-btn {
    font-size: 11.5px;
    font-weight: 600;
    color: #0284c7;
    text-decoration: none;
}

.primary-link-btn:hover {
    text-decoration: underline;
}

.drawer-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border-subtle);
    background: #f8fafc;
}

.drawer-footer-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-primary {
    background: #0f172a;
    color: #ffffff;
    border: none;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-primary:hover {
    background: #334155;
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--text-main);
    border: 1px solid var(--border-subtle);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-slack {
    background: transparent;
    color: #64748b;
    border: 1px solid var(--border-subtle);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.btn-slack:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-slack.sent {
    color: var(--accent-emerald);
    background: var(--accent-emerald-bg);
}

/* ==========================================================================
   VIEW 2 & 3: Content Panel Cards (Brief, Matrix, Simulator, Integrity)
   ========================================================================== */

.content-panel-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-subtle);
}

.panel-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    gap: 10px;
}

.panel-header-row h2 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.panel-subtitle {
    font-size: 11.5px;
    color: var(--text-muted);
}

.format-toggle {
    display: flex;
    background: #f1f5f9;
    padding: 2px;
    border-radius: var(--radius-sm);
}

.format-btn {
    background: transparent;
    border: none;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 4px;
    cursor: pointer;
}

.format-btn.active {
    background: #ffffff;
    color: var(--text-main);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.brief-visual-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 20px;
}

.brief-column-title {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.brief-bullet-card, .brief-action-card {
    background: #f8fafc;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 10px;
}

.brief-bullet-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 700;
    margin-bottom: 4px;
}

.brief-bullet-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.brief-code-box {
    background: #0f172a;
    color: #e2e8f0;
    padding: 16px;
    border-radius: var(--radius-md);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* Parity Matrix Table */
.parity-table-container {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.parity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.parity-table th {
    background: #f8fafc;
    padding: 10px 14px;
    text-align: left;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
}

.parity-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-main);
    vertical-align: middle;
}

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

.parity-table tr:hover td {
    background: #f8fafc;
}

/* Simulator Grid */
.simulator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.sim-block {
    background: #f8fafc;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
}

.sim-block h3 {
    font-size: 13.5px;
    font-weight: 700;
    margin-bottom: 12px;
}

.sim-control-group {
    margin-bottom: 12px;
}

.sim-control-header {
    display: flex;
    justify-content: space-between;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.sim-slider {
    width: 100%;
    accent-color: #0f172a;
}

.sim-result-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-top: 10px;
}

.sim-result-metric {
    font-size: 18px;
    font-weight: 700;
    margin: 2px 0;
}

/* Architecture & Integrity Tab */
.arch-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.arch-stat-box {
    background: #f8fafc;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px;
    text-align: center;
}

.arch-stat-num {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-blue);
}

.arch-stat-lbl {
    font-size: 10.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

.arch-pipeline-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.arch-step {
    background: #f8fafc;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px;
}

.arch-step-num {
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent-blue);
    margin-bottom: 3px;
}

.arch-step h3 {
    font-size: 12.5px;
    font-weight: 700;
    margin-bottom: 3px;
}

.arch-step p {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

.arch-pillar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.arch-pillar-box {
    background: #f8fafc;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
}

.arch-pillar-box h3 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

.arch-pillar-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.arch-pillar-features {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 11px;
}

.arch-pillar-features li {
    padding: 3px 0;
    border-bottom: 1px dashed #e2e8f0;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    color: #334155;
}

.arch-feature-icon {
    color: var(--accent-emerald);
    font-weight: 700;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-modal);
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--bg-surface);
    z-index: 10;
}

.close-modal {
    background: transparent;
    border: none;
    font-size: 18px;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
}

.modal-body {
    padding: 18px 20px;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar { width: 230px; min-width: 230px; }
    .intel-cards-grid { grid-template-columns: 1fr; }
    .kpi-strip { grid-template-columns: 1fr 1fr; }
    .brief-visual-grid { grid-template-columns: 1fr; }
    .simulator-grid { grid-template-columns: 1fr; }
    .arch-stats-row { grid-template-columns: 1fr 1fr; }
    .arch-pipeline-grid { grid-template-columns: 1fr 1fr; }
    .arch-pillar-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .app-layout { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--border-subtle); }
    .content-topbar { flex-direction: column; align-items: flex-start; gap: 10px; }
    .topbar-search-area { width: 100%; }
    .kpi-strip { grid-template-columns: 1fr; }
    .quick-filter-bar { flex-direction: column; align-items: stretch; }
    .spec-drawer-panel { max-width: 100%; }
}
