:root {
    /* Color Palette */
    --bg-main: #0B0F19; /* Deep dark blue background */
    --panel-bg: rgba(16, 25, 43, 0.65); /* Glass panel background */
    --panel-border: rgba(64, 153, 255, 0.15);
    
    --text-main: #E2E8F0;
    --text-muted: #94A3B8;
    
    --accent-blue: #3B82F6;
    --accent-glow-blue: rgba(59, 130, 246, 0.6);
    --accent-green: #10B981;
    --accent-red: #EF4444;
    --accent-yellow: #F59E0B;
    
    --sidebar-width: 240px;
    --header-height: 70px;
    
    --font-base: 'Inter', 'Noto Sans SC', sans-serif;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-base);
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 12% 20%, rgba(59, 130, 246, 0.16) 0%, transparent 32%),
        radial-gradient(circle at 82% 14%, rgba(16, 185, 129, 0.10) 0%, transparent 24%),
        radial-gradient(circle at 68% 82%, rgba(59, 130, 246, 0.10) 0%, transparent 26%),
        linear-gradient(180deg, #0a0f18 0%, #0b1220 48%, #09111d 100%);
    min-height: 100vh;
    position: relative;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

body::before {
    background:
        linear-gradient(rgba(148, 163, 184, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.03) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(circle at center, rgba(0,0,0,0.55), transparent 92%);
}

body::after {
    background:
        radial-gradient(circle at 22% 58%, rgba(59, 130, 246, 0.10), transparent 26%),
        radial-gradient(circle at 76% 34%, rgba(16, 185, 129, 0.08), transparent 18%),
        radial-gradient(circle at 52% 6%, rgba(245, 158, 11, 0.06), transparent 16%);
    filter: blur(18px);
}

.app-container,
.main-content,
.sidebar {
    position: relative;
    z-index: 1;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Typography & Glows */
h1, h2, h3, h4 {
    font-weight: 600;
}

.text-glow-green { color: var(--accent-green); text-shadow: 0 0 10px rgba(16, 185, 129, 0.5); }
.text-glow-red { color: var(--accent-red); text-shadow: 0 0 10px rgba(239, 68, 68, 0.5); }
.text-glow-blue { color: var(--accent-blue); text-shadow: 0 0 10px rgba(59, 130, 246, 0.5); }
.text-glow-yellow { color: var(--accent-yellow); text-shadow: 0 0 10px rgba(245, 158, 11, 0.5); }

/* Layout Structure */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    border-right: 1px solid var(--panel-border);
    border-radius: 0; /* Override glass-panel radius on edges */
}

.logo-container {
    display: flex;
    align-items: center;
    padding: 24px 20px;
    border-bottom: 1px solid var(--panel-border);
    position: relative;
}

.logo-icon {
    font-size: 28px;
    color: var(--accent-blue);
    text-shadow: 0 0 12px var(--accent-glow-blue);
    margin-right: 15px;
}

.logo-text {
    font-size: 16px;
    line-height: 1.3;
    letter-spacing: 1px;
}
.logo-text span {
    font-size: 20px;
    color: var(--accent-blue);
    font-weight: 700;
}

.mobile-university-profile {
    display: none;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    flex-grow: 1;
}

.nav-item {
    padding: 15px 24px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 15px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item i {
    width: 24px;
    margin-right: 10px;
    font-size: 18px;
}

.nav-item:hover, .nav-item.active {
    color: #fff;
    background: rgba(59, 130, 246, 0.1);
    border-left-color: var(--accent-blue);
}

.sidebar-bottom {
    padding: 20px;
    border-top: 1px solid var(--panel-border);
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--accent-green);
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 8px var(--accent-green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    padding: 15px 20px;
}

.top-header {
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    margin-bottom: 20px;
    gap: 18px;
    min-width: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 30px;
    flex: 1 1 auto;
    min-width: 0;
}

.header-left h2 {
    font-size: 20px;
    font-weight: 400;
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 0 1 auto;
}

.warning-ticker {
    display: flex;
    align-items: center;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--accent-yellow);
    max-width: 500px;
    flex: 1 1 360px;
    min-width: 0;
}

.warning-icon {
    margin-right: 10px;
    animation: flash 1.5s infinite;
}

@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

#ticker-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.5s ease;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 0 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
}

.sidebar-time-display {
    font-family: monospace;
    font-size: 14px;
    color: var(--accent-blue);
    white-space: nowrap;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.14);
    background: rgba(59, 130, 246, 0.07);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
    letter-spacing: 0.4px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    white-space: nowrap;
    flex: 0 0 auto;
    min-width: 0;
    padding: 8px 12px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
}

.avatar {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.university-badge {
    width: 40px;
    height: 40px;
    position: relative;
    border-radius: 12px;
    background:
        radial-gradient(circle at 30% 30%, rgba(255,255,255,0.18), transparent 38%),
        linear-gradient(135deg, rgba(59, 130, 246, 0.34), rgba(16, 185, 129, 0.18));
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 8px 18px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.university-badge::before,
.university-badge::after {
    content: "";
    position: absolute;
    inset: 0;
}

.university-badge::before {
    inset: 9px;
    border-radius: 9px;
    border: 2px solid rgba(226, 232, 240, 0.82);
    clip-path: polygon(50% 0%, 92% 28%, 92% 72%, 50% 100%, 8% 72%, 8% 28%);
    opacity: 0.9;
}

.university-badge::after {
    inset: 14px;
    border-radius: 6px;
    background:
        linear-gradient(135deg, transparent 18%, rgba(226, 232, 240, 0.92) 18%, rgba(226, 232, 240, 0.92) 28%, transparent 28%),
        linear-gradient(225deg, transparent 18%, rgba(226, 232, 240, 0.92) 18%, rgba(226, 232, 240, 0.92) 28%, transparent 28%);
    opacity: 0.9;
}

.user-meta {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.user-meta strong {
    color: var(--text-main);
    font-size: 14px;
    font-weight: 700;
}

.user-meta span {
    color: var(--text-muted);
    font-size: 11px;
    letter-spacing: 0.3px;
}

/* View Sections */
.view-section {
    display: none;
    flex-direction: column;
    gap: 20px;
    flex-grow: 1;
}

.view-section.active {
    display: flex;
}

.scene-search-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 20px;
    margin-bottom: 18px;
    min-width: 0;
}

.scene-search-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.scene-search-copy h3 {
    font-size: 18px;
    margin: 10px 0 8px;
    color: var(--text-main);
}

.scene-search-copy p {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.65;
}

.scene-search-form {
    flex: 0 1 520px;
    min-width: 320px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.scene-search-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 48px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid rgba(59, 130, 246, 0.18);
    background:
        linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(16, 185, 129, 0.04)),
        rgba(7, 13, 24, 0.72);
    color: var(--text-main);
    outline: none;
    font-size: 14px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.scene-search-input::placeholder {
    color: rgba(148, 163, 184, 0.78);
}

.scene-search-input:focus {
    border-color: rgba(59, 130, 246, 0.42);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.10);
}

.scene-search-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.scene-search-status {
    margin-top: 10px;
    color: var(--accent-green);
    font-size: 13px;
    letter-spacing: 0.2px;
}

/* Dashboard Grid Layout */
.top-row-flex {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    min-width: 0;
}

.kpi-grid-dashboard {
    flex: 3;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    min-width: 0;
}

.radar-box {
    flex: 1.2;
    min-width: 300px;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.evidence-mini {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 8px 4px 4px;
}

.mini-item {
    padding: 12px 14px;
    border: 1px solid rgba(59, 130, 246, 0.16);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
}

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

.mini-item strong {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-main);
}

.mini-jump-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.mini-jump-card {
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.16);
    background:
        linear-gradient(135deg, rgba(59, 130, 246, 0.10), rgba(16, 185, 129, 0.06)),
        rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.mini-jump-card:hover {
    transform: translateY(-1px);
    border-color: rgba(16, 185, 129, 0.28);
    background:
        linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(16, 185, 129, 0.10)),
        rgba(255, 255, 255, 0.04);
}

.mini-jump-kicker {
    display: block;
    font-size: 11px;
    letter-spacing: 0.6px;
    color: var(--accent-green);
    margin-bottom: 6px;
}

.mini-jump-card strong {
    display: block;
    font-size: 15px;
    margin-bottom: 6px;
}

.mini-jump-card em {
    display: block;
    font-style: normal;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.6;
}

.kpi-group {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.kpi-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.kpi-title {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.kpi-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    font-family: monospace;
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.kpi-trend {
    font-size: 14px;
    font-family: var(--font-base);
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 400;
    text-shadow: none;
}

.kpi-trend.up { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.kpi-trend.down { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }

.kpi-sub {
    font-size: 12px;
    color: rgba(226, 232, 240, 0.4);
}

.charts-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    flex-grow: 1;
    min-height: 480px;
    min-width: 0;
}

.chart-box {
    display: flex;
    flex-direction: column;
    padding: 20px;
}

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

.chart-header h3 {
    font-size: 15px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.chart-header h3 i {
    color: var(--accent-blue);
}

.data-source-badge {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--accent-green);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-family: monospace;
    letter-spacing: 0.5px;
}

.action-btn {
    background: transparent;
    border: 1px solid var(--panel-border);
    color: var(--text-muted);
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.action-btn:hover, .action-btn.active {
    background: rgba(59, 130, 246, 0.2);
    color: #fff;
    border-color: var(--accent-blue);
}

.chart-content {
    flex-grow: 1;
    width: 100%;
    position: relative;
    min-width: 0;
}

.right-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.right-column .chart-box {
    flex: 1;
}

/* Policy Simulator */
.sim-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.val-badge {
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent-blue);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
}

input[type=range].neon-slider {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}
input[type=range].neon-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    margin-top: -6px;
    box-shadow: 0 0 10px var(--accent-blue);
}
input[type=range].neon-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}
input[type=range].neon-slider:focus {
    outline: none;
}

.btn-primary {
    background: var(--accent-blue);
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    background: #2563EB;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.6);
}

.sim-results {
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 15px;
    flex-grow: 1;
    max-height: 420px;
    overflow-y: auto;
    font-size: 13px;
    color: var(--text-muted);
}

.sim-msg {
    margin-bottom: 8px;
    line-height: 1.5;
}

.sim-msg.highlight {
    color: var(--accent-green);
}

.sim-msg.warning {
    color: var(--accent-yellow);
}

.sim-section {
    margin: 12px 0;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sim-section.two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.sim-section-title {
    color: var(--text-main);
    font-size: 12px;
    margin-bottom: 8px;
    letter-spacing: 0.4px;
}

.policy-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.policy-chip {
    flex: 1 1 160px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(59, 130, 246, 0.14);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.policy-chip strong {
    color: var(--text-main);
    font-size: 12px;
}

.policy-chip span {
    color: var(--accent-green);
    font-size: 12px;
}

.policy-chip em {
    color: var(--text-muted);
    font-style: normal;
    font-size: 11px;
    line-height: 1.5;
}

.detail-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--text-muted);
}

.detail-list li {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    line-height: 1.5;
}

.detail-list li i {
    color: var(--accent-blue);
    margin-top: 3px;
    font-size: 11px;
}

.detail-list li strong {
    color: var(--text-main);
    min-width: 74px;
    font-size: 12px;
}

.detail-list li span {
    flex: 1;
}

.detail-list.compact li strong {
    min-width: 0;
}

.score-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 12px 0;
}

.score-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px 12px;
}

.score-item span {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    margin-bottom: 6px;
}

.score-item span small {
    display: block;
    opacity: 0.65;
    font-size: 10px;
    margin-top: 4px;
}

.score-item strong {
    color: var(--text-main);
    font-size: 16px;
    font-family: monospace;
}

.score-item.accent {
    border-color: rgba(16, 185, 129, 0.24);
    background: rgba(16, 185, 129, 0.06);
}

.industry-link-panel {
    margin-top: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.16);
    background:
        linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(16, 185, 129, 0.08)),
        rgba(255, 255, 255, 0.03);
    min-height: 126px;
}

.industry-link-kicker {
    color: var(--accent-blue);
    font-size: 11px;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.industry-link-title {
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.industry-link-copy {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.7;
}

.industry-link-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.industry-link-metric {
    border-radius: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.industry-link-metric span {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    margin-bottom: 6px;
}

.industry-link-metric strong {
    color: var(--text-main);
    font-size: 15px;
    font-family: monospace;
}

/* Bottom Trend Box */
.bottom-trend {
    padding: 20px;
    height: 250px;
    display: flex;
    flex-direction: column;
}

/* Placeholder for inactive tabs */
.placeholder-panel {
    padding: 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    min-height: 400px;
    color: var(--text-muted);
}

.placeholder-panel h2 {
    color: var(--text-main);
    font-weight: 400;
}

.analysis-grid {
    display: grid;
    gap: 20px;
    align-items: stretch;
}

.trend-analysis-grid {
    grid-template-columns: 1.2fr 1.2fr 0.9fr;
}

.region-analysis-grid {
    grid-template-columns: 1.25fr 0.95fr 0.8fr;
}

.analysis-hero {
    grid-column: 1 / -1;
    padding: 24px 26px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(16, 185, 129, 0.14), transparent 28%),
        radial-gradient(circle at left center, rgba(59, 130, 246, 0.18), transparent 34%),
        rgba(15, 23, 42, 0.78);
}

.analysis-hero-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.analysis-hero-copy {
    max-width: 760px;
}

.analysis-hero-head h3 {
    font-size: 24px;
    color: var(--text-main);
    margin-top: 10px;
    margin-bottom: 10px;
}

.analysis-hero-copy p {
    color: var(--text-muted);
    line-height: 1.75;
    max-width: 680px;
    font-size: 13px;
}

.segmented-control {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.segment-btn {
    border: 1px solid rgba(59, 130, 246, 0.22);
    background: rgba(15, 23, 42, 0.68);
    color: var(--text-muted);
    padding: 10px 16px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.segment-btn.active,
.segment-btn:hover {
    color: var(--text-main);
    border-color: rgba(16, 185, 129, 0.36);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(59, 130, 246, 0.16));
}

.analysis-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.analysis-summary-card {
    padding: 18px 20px;
    border-radius: 14px;
    border: 1px solid rgba(59, 130, 246, 0.14);
    background:
        linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(16, 185, 129, 0.06)),
        rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    min-height: 128px;
}

.analysis-summary-card span {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.analysis-summary-card strong {
    display: block;
    color: var(--text-main);
    font-size: 26px;
    margin-bottom: 10px;
    line-height: 1.2;
}

.analysis-summary-card em {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 12px;
    font-style: normal;
}

.analysis-chart-box {
    padding: 18px;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.analysis-chart {
    height: 340px;
    width: 100%;
    margin-top: 8px;
}

.analysis-chart.compact {
    height: 280px;
}

.insight-box {
    padding: 18px;
    display: flex;
    flex-direction: column;
}

.insight-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.insight-item {
    border-radius: 12px;
    padding: 14px 16px;
    background:
        linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(255, 255, 255, 0.02)),
        rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(59, 130, 246, 0.14);
}

.insight-item span {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 8px;
}

.insight-item strong {
    color: var(--text-main);
    line-height: 1.7;
    font-size: 14px;
}

.trend-analysis-grid > .analysis-chart-box:last-child,
.region-analysis-grid > .analysis-chart-box:last-child {
    grid-column: span 2;
}

.report-print-root {
    display: none;
}

.report-shell {
    background: #ffffff;
    color: #0f172a;
    min-height: 100vh;
    padding: 32px 36px;
    font-family: var(--font-base);
}

.report-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 18px;
    border-bottom: 2px solid #dbeafe;
    margin-bottom: 20px;
}

.report-title {
    font-size: 28px;
    color: #0f172a;
    margin-bottom: 8px;
}

.report-subtitle {
    color: #475569;
    line-height: 1.7;
    max-width: 720px;
}

.report-meta {
    min-width: 220px;
    display: grid;
    gap: 8px;
    font-size: 13px;
    color: #475569;
}

.report-meta strong {
    color: #0f172a;
}

.report-kicker {
    display: inline-block;
    font-size: 12px;
    letter-spacing: 1.2px;
    color: #2563eb;
    margin-bottom: 10px;
}

.report-section {
    margin-top: 24px;
    page-break-inside: avoid;
}

.report-section h2 {
    font-size: 18px;
    color: #0f172a;
    margin-bottom: 12px;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.report-card {
    border: 1px solid #dbeafe;
    border-radius: 10px;
    background: #f8fbff;
    padding: 14px 16px;
    break-inside: avoid;
}

.report-card h3 {
    color: #0f172a;
    font-size: 14px;
    margin-bottom: 8px;
}

.report-card p,
.report-card li {
    color: #475569;
    line-height: 1.7;
    font-size: 13px;
}

.report-card strong {
    color: #0f172a;
}

.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.report-metric {
    border: 1px solid #dbeafe;
    border-radius: 10px;
    background: #ffffff;
    padding: 14px;
}

.report-metric span {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-bottom: 8px;
}

.report-metric strong {
    display: block;
    color: #0f172a;
    font-size: 20px;
    font-family: monospace;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.report-table th,
.report-table td {
    padding: 10px 12px;
    border: 1px solid #dbeafe;
    text-align: left;
    vertical-align: top;
}

.report-table th {
    background: #eff6ff;
    color: #0f172a;
}

.report-footer {
    margin-top: 28px;
    padding-top: 14px;
    border-top: 1px solid #dbeafe;
    color: #64748b;
    font-size: 12px;
    line-height: 1.7;
}

.report-list {
    list-style: none;
    display: grid;
    gap: 8px;
}

.report-list li {
    display: flex;
    gap: 8px;
}

.report-list li::before {
    content: "•";
    color: #2563eb;
    flex: 0 0 auto;
}

.report-score-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.report-score {
    border: 1px solid #dbeafe;
    border-radius: 10px;
    background: #ffffff;
    padding: 14px;
}

.report-score span {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-bottom: 8px;
}

.report-score strong {
    color: #0f172a;
    font-size: 20px;
    font-family: monospace;
}

.report-highlight {
    border-left: 4px solid #10b981;
    padding-left: 14px;
    background: #f0fdf4;
}

@media print {
    body.print-mode {
        background: #ffffff !important;
    }

    body.print-mode #loading-screen,
    body.print-mode .app-container,
    body.print-mode #evidence-panel {
        display: none !important;
    }

    body.print-mode .report-print-root {
        display: block !important;
    }

    body.print-mode .report-shell {
        display: block;
    }

    .report-section,
    .report-card,
    .report-score-grid,
    .report-summary-grid {
        break-inside: avoid;
    }

    @page {
        size: A4 portrait;
        margin: 14mm;
    }
}

/* ========================================================
   NEW: Cinematic Loading Screen
======================================================== */
#loading-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100vh;
    background: #05080e; /* Even darker than bg-main */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transition: opacity 0.8s ease-in-out, visibility 0.8s;
}

.loader-content {
    text-align: center;
    max-width: 400px;
}

.loader-spin {
    font-size: 40px;
    color: var(--accent-blue);
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px var(--accent-blue));
}

.loader-title {
    font-size: 22px;
    letter-spacing: 2px;
    margin-bottom: 30px;
    color: #fff;
}

.loader-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 15px;
    font-family: monospace;
    height: 20px;
}

.loader-bar-bg {
    width: 300px;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.loader-bar {
    height: 100%;
    width: 0%;
    background: var(--accent-blue);
    box-shadow: 0 0 10px var(--accent-blue);
    transition: width 0.2s;
}

/* ========================================================
   NEW: AI Processing Modal
======================================================== */
.ai-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 5000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.ai-overlay.active {
    opacity: 1;
    visibility: visible;
}

.ai-box {
    width: 400px;
    padding: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--accent-blue);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
}

.scanning-light {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 10px;
    background: rgba(59, 130, 246, 0.8);
    box-shadow: 0 0 20px rgba(59, 130, 246, 1);
    transform: rotate(30deg);
    animation: scan 2s linear infinite;
    pointer-events: none;
}

@keyframes scan {
    0% { top: -20%; }
    100% { top: 120%; }
}

.ai-icon {
    font-size: 50px;
    color: var(--accent-blue);
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px rgba(59, 130, 246, 0.6));
}

.ai-box h3 { margin-bottom: 10px; color: #fff; }
.ai-box p { font-size: 13px; color: var(--text-muted); font-family: monospace;}

/* ========================================================
   NEW: Custom Scrollbars & Staggered Animations
======================================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.5);
}

.stagger-up {
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes slideUpFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================================
   Province Drill-Down Sidebar
======================================================== */
.province-sidebar {
    position: fixed;
    right: -380px;
    top: 0;
    width: 360px;
    height: 100vh;
    z-index: 200;
    padding: 20px;
    overflow-y: auto;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-radius: 0;
    border-right: none;
    border-left: 1px solid var(--panel-border);
}

.province-sidebar.open {
    right: 0;
}

.sidebar-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.2s;
}

.sidebar-close:hover { background: rgba(239, 68, 68, 0.3); }

.province-header h3 {
    font-size: 20px;
    margin-bottom: 5px;
}

.province-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.p-stat {
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 12px 8px;
    text-align: center;
}

.p-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.p-stat-value {
    font-size: 18px;
    font-weight: 700;
    font-family: monospace;
}

.province-warning {
    font-size: 13px;
    color: var(--accent-yellow);
    line-height: 1.6;
}

/* ========================================================
   Policy Comparison Page
======================================================== */
.policy-compare-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr;
    gap: 20px;
    flex: 1;
    min-height: 0;
}

.scenario-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.scenario-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.scenario-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.badge-a {
    background: rgba(59, 130, 246, 0.3);
    border: 2px solid var(--accent-blue);
    color: var(--accent-blue);
}

.badge-b {
    background: rgba(16, 185, 129, 0.3);
    border: 2px solid var(--accent-green);
    color: var(--accent-green);
}

.scenario-header h3 {
    font-size: 16px;
    font-weight: 600;
    flex: 1;
}

.scenario-controls {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.scenario-result {
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    max-height: 340px;
    overflow-y: auto;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 8px;
}

.result-row:last-child { border-bottom: none; padding-bottom: 0; }
.result-row span { color: var(--text-muted); }
.result-row strong { font-family: monospace; font-size: 14px; }

.comparison-center {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.comparison-chart-box {
    padding: 16px;
}

.policy-recommend {
    margin-top: 15px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid rgba(245, 158, 11, 0.4);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-main);
}

@media (max-width: 1280px) {
    .scene-search-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .scene-search-form {
        width: 100%;
        min-width: 0;
        flex-basis: auto;
    }

    .top-header {
        padding: 0 18px;
    }

    .header-left {
        gap: 18px;
    }

    .warning-ticker {
        flex-basis: 260px;
    }

    .kpi-grid-dashboard {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .top-row-flex,
    .bottom-row,
    .charts-container {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .trend-analysis-grid,
    .region-analysis-grid {
        grid-template-columns: 1fr;
    }

    .analysis-summary-grid {
        grid-template-columns: 1fr;
    }

    .analysis-hero-head {
        flex-direction: column;
    }
}

@media (max-width: 1100px) {
    :root {
        --sidebar-width: 210px;
    }

    .top-header {
        height: auto;
        align-items: flex-start;
        flex-direction: column;
        padding: 16px 18px;
    }

    .header-left,
    .header-right {
        width: 100%;
    }

    .header-right {
        justify-content: space-between;
        gap: 12px;
        flex-wrap: wrap;
    }

    .header-right .btn-secondary {
        order: 1;
    }

    .header-right .time-display {
        order: 2;
    }

    .header-right .user-profile {
        order: 3;
    }

    .evidence-trigger {
        min-width: 0;
    }

    .header-left h2 {
        font-size: 18px;
        max-width: 220px;
    }

    .warning-ticker {
        max-width: none;
    }

    .radar-box,
    .bottom-row .bottom-trend,
    .main-map,
    .right-column {
        min-width: 0;
        width: 100%;
    }

    .kpi-value {
        font-size: 28px;
    }
}

@media (max-width: 900px) {
    :root {
        --sidebar-width: 176px;
    }

    .main-content {
        padding: 12px 14px;
    }

    .logo-container {
        padding: 20px 14px;
    }

    .logo-text {
        font-size: 14px;
    }

    .logo-text span {
        font-size: 18px;
    }

    .nav-item {
        padding: 14px 16px;
        font-size: 14px;
    }

    .header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .header-left h2 {
        max-width: 100%;
    }

    .warning-ticker {
        width: 100%;
    }

    .header-right {
        gap: 10px;
    }

    .header-right .btn-secondary {
        padding: 8px 12px;
        font-size: 12px;
    }

    .header-right .time-display {
        font-size: 13px;
    }

    .user-meta strong {
        font-size: 13px;
    }

    .university-badge {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .evidence-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .evidence-footer .btn-primary {
        width: 100%;
    }

    .kpi-grid-dashboard {
        grid-template-columns: 1fr;
    }

    .province-stats,
    .analysis-summary-grid,
    .score-grid,
    .report-summary-grid,
    .report-score-grid,
    .faq-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 100%;
        --header-height: auto;
    }

    body {
        overflow-x: hidden;
    }

    .app-container {
        flex-direction: column;
    }

    .sidebar {
        position: sticky;
        top: 0;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--panel-border);
        z-index: 220;
        background: rgba(11, 15, 25, 0.92);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        box-shadow: 0 18px 40px rgba(2, 6, 23, 0.34);
    }

    .sidebar::before,
    .sidebar::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        pointer-events: none;
    }

    .sidebar::before {
        top: 0;
        height: 100%;
        background:
            linear-gradient(180deg, rgba(255,255,255,0.06), transparent 22%),
            radial-gradient(circle at 14% 0%, rgba(59, 130, 246, 0.22), transparent 34%),
            radial-gradient(circle at 86% 0%, rgba(16, 185, 129, 0.14), transparent 28%);
        opacity: 0.85;
        z-index: 0;
    }

    .sidebar::after {
        bottom: -1px;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.5), rgba(16, 185, 129, 0.25), transparent);
        z-index: 1;
    }

    .sidebar > * {
        position: relative;
        z-index: 2;
    }

    .logo-container {
        padding: 14px 16px;
        padding-right: 132px;
        min-height: 66px;
    }

    .logo-icon {
        font-size: 22px;
        margin-right: 12px;
    }

    .logo-text {
        font-size: 14px;
    }

    .logo-text span {
        font-size: 18px;
    }

    .mobile-university-profile {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        position: absolute;
        top: 10px;
        right: 12px;
        max-width: 124px;
        padding: 7px 9px 7px 8px;
        border-radius: 14px;
        border: 1px solid rgba(255,255,255,0.08);
        background:
            linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)),
            rgba(15, 23, 42, 0.82);
        box-shadow:
            inset 0 1px 0 rgba(255,255,255,0.06),
            0 10px 22px rgba(2, 6, 23, 0.22);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .mobile-university-profile .avatar {
        width: 28px;
        height: 28px;
        flex: 0 0 28px;
    }

    .mobile-university-profile .user-meta strong {
        display: block;
        font-size: 10px;
        line-height: 1.2;
        white-space: nowrap;
    }

    .nav-menu {
        padding: 10px 12px 14px;
        flex-direction: row;
        gap: 10px;
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: none;
    }

    .nav-menu::-webkit-scrollbar {
        display: none;
    }

    .nav-item {
        flex: 0 0 auto;
        min-width: 124px;
        padding: 12px 14px;
        border-left: none;
        border-radius: 12px;
        background: rgba(255,255,255,0.02);
        border: 1px solid rgba(59, 130, 246, 0.08);
        justify-content: flex-start;
    }

    .nav-item i {
        width: 18px;
        margin-right: 8px;
        font-size: 15px;
    }

    .nav-item:hover,
    .nav-item.active {
        border-left-color: transparent;
        border-color: rgba(59, 130, 246, 0.28);
    }

    .sidebar-bottom {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        padding: 12px 14px 16px;
        background: linear-gradient(180deg, rgba(8, 15, 26, 0), rgba(8, 15, 26, 0.18));
    }

    .sidebar-time-display {
        font-size: 12px;
        padding: 8px 10px;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 12px;
    }

    .scene-search-panel {
        padding: 14px;
        gap: 14px;
    }

    .scene-search-copy h3 {
        font-size: 16px;
        line-height: 1.45;
    }

    .scene-search-copy p {
        font-size: 12px;
    }

    .scene-search-form {
        flex-direction: column;
        align-items: stretch;
        min-width: 0;
        gap: 10px;
    }

    .scene-search-input {
        height: 44px;
        font-size: 13px;
    }

    .scene-search-btn {
        width: 100%;
        justify-content: center;
    }

    .scene-search-status {
        font-size: 12px;
        line-height: 1.5;
    }

    .top-header {
        padding: 14px;
        gap: 12px;
        margin-top: 4px;
    }

    .header-left,
    .header-right {
        width: 100%;
    }

    .header-left h2 {
        font-size: 18px;
        line-height: 1.3;
    }

    .warning-ticker {
        width: 100%;
        max-width: 100%;
        min-height: 40px;
        font-size: 11px;
        padding: 6px 10px;
        border-radius: 14px;
        flex: 0 0 auto;
    }

    .warning-icon {
        margin-right: 8px;
        font-size: 12px;
    }

    #ticker-text {
        display: block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.3;
    }

    .header-right {
        justify-content: flex-start;
        flex-wrap: nowrap;
        width: 100%;
    }

    .evidence-trigger {
        flex: 1 1 100%;
        max-width: 100%;
        width: 100%;
        min-height: 58px;
        padding: 12px 14px;
        border-radius: 16px;
        align-items: center;
    }

    .evidence-trigger-copy strong {
        font-size: 13px;
    }

    .evidence-trigger-copy em {
        display: block;
        font-style: normal;
        font-size: 11px;
        line-height: 1.45;
        color: rgba(219, 234, 254, 0.76);
        margin-top: 2px;
        white-space: normal;
    }

    .top-header .user-profile {
        display: none;
    }

    .top-row-flex,
    .bottom-row,
    .charts-container,
    .policy-compare-grid {
        flex-direction: column;
        display: flex;
        gap: 14px;
    }

    .analysis-grid,
    .trend-analysis-grid,
    .region-analysis-grid {
        display: grid;
        grid-template-columns: 1fr !important;
        gap: 14px;
    }

    .analysis-hero,
    .analysis-chart-box,
    .insight-box,
    .trend-analysis-grid > .analysis-chart-box:last-child,
    .region-analysis-grid > .analysis-chart-box:last-child {
        grid-column: auto !important;
    }

    .analysis-hero {
        padding: 18px 16px;
    }

    .analysis-hero-head {
        flex-direction: column;
        gap: 14px;
        margin-bottom: 14px;
    }

    .analysis-hero-copy,
    .analysis-hero-copy p {
        max-width: 100%;
    }

    .analysis-hero-head h3 {
        font-size: 20px;
        margin-top: 8px;
        margin-bottom: 8px;
        line-height: 1.35;
    }

    .segmented-control {
        justify-content: flex-start;
        width: 100%;
    }

    .segment-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .kpi-grid-dashboard {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .kpi-card,
    .chart-box,
    .analysis-chart-box,
    .insight-box,
    .scenario-card,
    .comparison-chart-box {
        padding: 14px;
    }

    .kpi-value {
        font-size: 24px;
    }

    .kpi-card {
        min-height: 132px;
    }

    .kpi-title {
        font-size: 13px;
        line-height: 1.4;
    }

    .kpi-sub {
        font-size: 11px;
        line-height: 1.55;
    }

    .kpi-trend {
        font-size: 11px;
        padding: 4px 8px;
    }

    .analysis-chart {
        height: 280px;
    }

    .analysis-chart.compact,
    #compareChart,
    #compareTrendChart {
        height: 240px !important;
    }

    .sim-results,
    .scenario-result {
        max-height: none;
    }

    .evidence-box {
        width: 100%;
    }

    .province-sidebar {
        width: min(100vw, 380px);
    }
}

/* ============================================================
   Bottom Row Layout (Trend + Radar)
   ============================================================ */
.bottom-row {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.bottom-row .bottom-trend {
    flex: 2;
    margin-top: 0;
}

.radar-box {
    flex: 1;
    min-width: 320px;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   Evidence Panel (Slide-out)
   ============================================================ */
.evidence-overlay {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none; /* Controlled by JS via display: flex */
    justify-content: flex-end;
}

.evidence-box {
    width: 450px;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.evidence-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.evidence-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-evidence {
    cursor: pointer;
    font-size: 28px;
    color: var(--text-muted);
    transition: color 0.2s;
}

.close-evidence:hover {
    color: var(--text-bright);
}

.evidence-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.evidence-note-block {
    padding: 14px 16px;
    border: 1px solid rgba(59, 130, 246, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
}

.e-section {
    margin-bottom: 30px;
}

.e-section h4 {
    color: var(--text-bright);
    margin-bottom: 12px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 3px solid var(--accent-blue);
    padding-left: 10px;
}

.e-list {
    list-style: none;
    padding: 0;
}

.e-list li {
    padding: 10px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.e-table-wrapper {
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 10px;
}

.e-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.e-table th, .e-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.e-table th {
    color: var(--text-muted);
    font-weight: 500;
    background: rgba(255, 255, 255, 0.02);
}

.e-tag {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
}

.e-tag.pass { background: rgba(16, 185, 129, 0.1); color: #10B981; border: 1px solid rgba(16, 185, 129, 0.2); }
.e-tag.warn { background: rgba(245, 158, 11, 0.1); color: #F59E0B; border: 1px solid rgba(245, 158, 11, 0.2); }

.faq-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.faq-card {
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.14);
    background:
        linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(16, 185, 129, 0.04)),
        rgba(255, 255, 255, 0.03);
}

.faq-card span {
    display: inline-block;
    color: var(--accent-green);
    font-size: 11px;
    letter-spacing: 0.6px;
    margin-bottom: 8px;
}

.faq-card strong {
    display: block;
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.faq-card p {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.7;
}

.evidence-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.evidence-footer-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.evidence-footer-copy strong {
    color: var(--text-main);
    font-size: 14px;
}

.evidence-footer-copy span {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.6;
}

.btn-secondary {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--accent-blue);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex: 0 0 auto;
    min-width: fit-content;
    writing-mode: horizontal-tb;
}

.btn-secondary:hover {
    background: rgba(59, 130, 246, 0.2);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.evidence-trigger {
    min-width: 0;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(59, 130, 246, 0.08)),
        rgba(15, 23, 42, 0.84);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 8px 18px rgba(2, 6, 23, 0.18);
}

.evidence-trigger-icon {
    width: 34px;
    height: 34px;
    position: relative;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 30% 30%, rgba(255,255,255,0.18), transparent 38%),
        linear-gradient(135deg, rgba(59, 130, 246, 0.26), rgba(59, 130, 246, 0.12));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 0 0 1px rgba(59, 130, 246, 0.12);
    flex: 0 0 auto;
}

.evidence-trigger-icon::before,
.evidence-trigger-icon::after {
    content: "";
    position: absolute;
}

.evidence-trigger-icon::before {
    width: 14px;
    height: 16px;
    border: 1.8px solid rgba(219, 234, 254, 0.92);
    border-radius: 4px;
    top: 8px;
    left: 10px;
    box-shadow: 0 0 10px rgba(147, 197, 253, 0.18);
}

.evidence-trigger-icon::after {
    width: 8px;
    height: 8px;
    top: 6px;
    right: 8px;
    border-top: 1.8px solid rgba(219, 234, 254, 0.92);
    border-right: 1.8px solid rgba(219, 234, 254, 0.92);
    transform: rotate(45deg);
    border-radius: 1px;
}

.evidence-trigger-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    min-width: 0;
}

.evidence-trigger-copy strong {
    font-size: 14px;
    font-weight: 700;
    color: #DBEAFE;
}

.evidence-trigger-copy em {
    display: none;
}
