/* --- Global Design Tokens & High-Contrast Palettes --- */
:root {
    --bg-main: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-sidebar: #ffffff;
    --border-color: #cbd5e1;
    --text-main: #0f172a;
    --text-muted: #334155;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --accent-warn: #c2410c;
    --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    --font-min-size: 14px;
}

html.dark {
    --bg-main: #020617;
    --bg-surface: #0f172a;
    --bg-sidebar: #090d16;
    --border-color: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

/* --- Base Layout & Legibility Enforcements --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: var(--font-min-size);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* --- Explanatory & Structural Typography Resizing --- */
p, text, span, td, th, button {
    font-size: calc(var(--font-min-size) + 1px) !important; /* Forces 15px reading minimum */
}

h1 { font-size: 24px !important; font-weight: 900 !important; }
h2 { font-size: 19px !important; font-weight: 800 !important; }
h3 { font-size: 16px !important; font-weight: 700 !important; }

/* --- Responsive Chart Canvas Scaling Profiles --- */
.chart-wrapper {
    position: relative;
    width: 100%;
    height: 300px;
}
@media (min-width: 1024px) { .chart-wrapper { height: 380px; } }
@media (min-width: 1920px) { .chart-wrapper { height: 460px; } }

/* --- Conspicuous Session Navigation Roadmap System --- */
.tab-btn {
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    background-color: var(--bg-surface);
    color: var(--text-muted);
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    border-color: var(--primary);
    background-color: rgba(37, 99, 235, 0.04);
}

/* Active Roadmap Indicator Marker Style */
.tab-btn.active {
    border-color: var(--primary) !important;
    background-color: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* Completed Roadmap Step Tick Styles */
.roadmap-step {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.05);
    border: 2px solid currentColor;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px !important;
    font-family: monospace;
    font-weight: bold;
    shrink-0: true;
}
.tab-btn.active .roadmap-step {
    background-color: #ffffff;
    color: var(--primary);
}

/* --- High-Density Layout Fixes --- */
.interactive-card {
    background-color: var(--bg-surface);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-md);
    border-radius: 16px;
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.interactive-card:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* Custom Responsive Scrollbar Engine */
.custom-scrollbar::-webkit-scrollbar { width: 6px; height: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 10px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Hidden Tab Panel Layout Rules */
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.25s ease-in-out; }

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

.pulse-indicator { animation: softPulse 2s infinite ease-in-out; }
@keyframes softPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
}
