/* Font Imports */

@font-face {
    font-family: 'Aeonik';
    src: url('../assets/fonts/Aeonik-Thin.woff2') format('woff2'),
         url('../assets/fonts/Aeonik-Thin.woff') format('woff');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Aeonik';
    src: url('../assets/fonts/Aeonik-ThinItalic.woff2') format('woff2'),
         url('../assets/fonts/Aeonik-ThinItalic.woff') format('woff');
    font-weight: 100;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Aeonik';
    src: url('../assets/fonts/Aeonik-Light.woff2') format('woff2'),
         url('../assets/fonts/Aeonik-Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Aeonik';
    src: url('../assets/fonts/Aeonik-LightItalic.woff2') format('woff2'),
         url('../assets/fonts/Aeonik-LightItalic.woff') format('woff');
    font-weight: 300;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Aeonik';
    src: url('../assets/fonts/Aeonik-Regular.woff2') format('woff2'),
         url('../assets/fonts/Aeonik-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Aeonik';
    src: url('../assets/fonts/Aeonik-RegularItalic.woff2') format('woff2'),
         url('../assets/fonts/Aeonik-RegularItalic.woff') format('woff');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Aeonik';
    src: url('../assets/fonts/Aeonik-Medium.woff2') format('woff2'),
         url('../assets/fonts/Aeonik-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Aeonik';
    src: url('../assets/fonts/Aeonik-MediumItalic.woff2') format('woff2'),
         url('../assets/fonts/Aeonik-MediumItalic.woff') format('woff');
    font-weight: 500;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Aeonik';
    src: url('../assets/fonts/Aeonik-Bold.woff2') format('woff2'),
         url('../assets/fonts/Aeonik-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Aeonik';
    src: url('../assets/fonts/Aeonik-BoldItalic.woff2') format('woff2'),
         url('../assets/fonts/Aeonik-BoldItalic.woff') format('woff');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Aeonik';
    src: url('../assets/fonts/Aeonik-Black.woff2') format('woff2'),
         url('../assets/fonts/Aeonik-Black.woff') format('woff');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Aeonik';
    src: url('../assets/fonts/Aeonik-BlackItalic.woff2') format('woff2'),
         url('../assets/fonts/Aeonik-BlackItalic.woff') format('woff');
    font-weight: 900;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'PPEditorialNew';
    src: url('../assets/fonts/PPEditorialNew-Italic.woff2') format('woff2'),
         url('../assets/fonts/PPEditorialNew-Italic.woff') format('woff');
    font-style: italic;
    font-display: swap;
}

/* GENERAL FORMATTING */
html {
}
.homepage-root {
    zoom: 0.75;
}
html, body {
    font-family: 'Aeonik', Arial, sans-serif;
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-x: hidden;
    background-color: white;
}

.main-content {
    max-width: 1440px;
    margin: auto;
    padding: 40px 60px;
    width: 100%;
}

/* BASE TEXT */
.dash-text {
    max-width: 100%; 
    margin-bottom: 20px !important; 
    margin: auto;
    padding: 0; 
    text-align: left; 
    line-height: 1.6;
    font-size: 18px;
    font-weight: 400;
    letter-spacing: -0.02em;
}

/* Slightly larger base text */
.heading-text {
    max-width: 100%; 
    margin-bottom: 20px !important; 
    margin: auto;
    padding: 0; 
    text-align: left; 
    line-height: 1.6; 
    font-size: 20px;
    font-weight: 400;
    letter-spacing: -0.02em;
}

/* HEADINGS */
h1 {
    font-family: 'Aeonik', sans-serif;
    text-align: center;
    font-size: clamp(1.8rem, 2.3vw, 2.8rem);
    margin: 10px 0;
    padding: 10px 0;
}

h2, h3 {
    font-family: 'Aeonik', sans-serif;
    text-align: center;
    font-size: clamp(1.5rem, 2vw, 2.5rem);
    margin: 10px 0;
    padding: 10px 0;
}

/* Slightly larger custom title */
.overview-title {
    font-family: 'Aeonik', sans-serif;
    text-align: left;
    font-size: clamp(2.8rem, 4vw, 4.5rem);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.02em;
    color: #000000;
    margin-top: 0.1em;
    margin-bottom: 0.6em;
}

/* Titles for graphs (underneath graphs) */
.graph-title {
    max-width: 100%; 
    /* padding-top: 10px; */
    margin : 0px !important;
    font-size: 16px;
    font-weight: 500;
    text-transform: uppercase;
}

/* Descriptions for graphs (underneath graphs) */
.description-text {
    margin-bottom: 20px !important; 
    margin: auto;
    line-height: 1.6; 
    font-size: 16px;
    font-weight: 400;
    letter-spacing: -0.02em;
}

/* Optional different homepage */
.specific-layout-background {
    background-image: url(''); 
    min-height: 100vh; 
    width: 100%;
    margin: 0; 
    position: absolute; 
    top: 0; 
    left: 0;
    padding: 80px;
}

/* Horizontal thin line */
.hr-line {
    width: 100%;       
    height: 1px;    
    background-color: black !important; 
    border: none;       
    margin: 50px auto; 
    opacity: 1;
}

/* DROPDOWN OPTIONS */
.dropdown-style,
.Select-control {
    font-family: 'Aeonik', sans-serif;
    font-size: .9rem;
    text-transform: uppercase;
    width: 100%;      
    min-width: 220px; 
    
    padding: 1px 8px; 
    margin: 2px auto; 
    line-height: 1.2; 
    
    background-color: transparent;
    border: none !important;
    border-radius: 0;
    box-shadow: none !important;
    position: relative; 
}

/* Modifier: shorter version */
.dropdown-style.shorter {
    max-width: 200px !important;
}

/* Add a manually drawn bottom line */
.dropdown-style::after {
    content: "";
    position: absolute;
    left: 10px;
    bottom: 0;
    width: 90%;
    height: 1px;
    background-color: #000000;
}

/* Ensures dropdowns stack vertically */
.stacked-dropdowns {
    display: flex;
    flex-direction: column;
    gap: 10px; 
    width: 100%;
}

/* Fix Dropdown Row Layout */
.dropdown-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px; 
    width: 100%; 
}

.underline-link {
    text-decoration: none;
}

.underline-link:hover {
    text-decoration: underline !important;
}

/* optional text label to show up above dropdowns */
.dropdown-label {
    font-size: 14px;
    color: #3e3e3e; 
    margin: 0;
    z-index: 10;
    position: absolute; 
    top: -7px; 
    left: 0;
}

/* Selected value (multi-select chips) */
.Select--multi .Select-value {
    background-color: transparent !important;
    border: 1px solid #ccc;
    color: black !important;
}

/* Selected value label text */
.Select--multi .Select-value-label {
    color: black !important;
}

/* Remove the default blue X icon hover background */
.Select--multi .Select-value-icon {
    background-color: transparent !important;
}

/* Optional: Style the dropdown options on hover and selection */
.VirtualizedSelectOption {
    color: black;
}

.VirtualizedSelectFocusedOption {
    background-color: #f0f0f0;
    color: black;
}

.VirtualizedSelectSelectedOption {
    background-color: #e0e0e0;
    color: black;
}

/* GRAPH STYLING */
.dash-graph {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding-top: 20px !important;
    padding: 0 !important;
    box-sizing: border-box;
    overflow: visible !important;
}

/* Map modebar — always visible, larger icons */
.dash-graph .modebar-container {
    top: 8px !important;
    right: 8px !important;
}

.dash-graph .modebar-group {
    background-color: rgba(255, 255, 255, 0.9) !important;
    border-radius: 6px !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15) !important;
    padding: 2px !important;
}

.dash-graph .modebar-btn {
    font-size: 18px !important;
}

.dash-graph .modebar-btn svg {
    width: 22px !important;
    height: 22px !important;
}

.dash-graph .modebar-btn:hover {
    background-color: rgba(0, 0, 0, 0.08) !important;
    border-radius: 4px !important;
}

/* NAVBAR */
.navbar-container {
    width: 100%;
    max-width: none;
    padding: 12px 20px;
    background-color: #F5F5F5; 
    display: flex;
    align-items: center;
    justify-content: center; 
    transition: all 0.3s ease;
}

/* Enhanced Navbar Styles */
.navbar {
    background-color: #F5F5F5 !important; 
    transition: all 0.3s ease;
    padding: 12px 32px;
}

/* Wrapper — main nav centred, utility right-aligned */
.nav-menu-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
}

/* Center Navbar Items */
.nav-menu {
    display: flex;
    justify-content: center;
    flex: 1;
}

/* Utility nav (Admin / Log out) — right-aligned */
.nav-utility {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

.nav-utility-link {
    font-family: 'Aeonik', sans-serif;
    font-size: 0.8rem !important;
    font-weight: 400;
    color: #666 !important;
    text-transform: none;
    padding: 6px 12px !important;
    margin: 0 !important;
    border: 1px solid #ccc;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-utility-link:hover {
    color: #000 !important;
    border-color: #999;
    background-color: rgba(0, 0, 0, 0.03);
}

.nav-utility-link.active {
    color: #000 !important;
    border-color: #000;
    font-weight: 500;
}

/* Remove the underline pseudo-element on utility links */
.nav-utility-link::after {
    display: none !important;
}

/* Navbar Links */
.nav-link {
    color: black !important; 
    font-size: 0.9rem;
    position: relative;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    margin: 0 8px;
    text-transform: uppercase; 
    text-align: center;
}

/* Underline Effect When Hovering */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 1px;
    background-color: black; 
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 90%; 
}

/* Active/Selected Link */
.nav-link.active {
    font-weight: 600;
}

.nav-link.active::after {
    width: 90%;
}

/* Circular toggler for navbar */
.circle-toggler {
    border-radius: 50% !important;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #333;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
  }
  
  /* Optional hover effect */
.circle-toggler:hover {
    background-color: #eaeaea;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
  }

/* OVAL BUTTONS */
/* Buttons */
button, input, select {
    font-family: 'Aeonik', sans-serif;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    cursor: pointer;
}

/* transparent oval buttons */
.transparent-pill-button {
    background-color: transparent !important;
    border: 1px solid black !important;
    border-radius: 70px !important; 
    color: black !important;
    font-size: 1rem !important;
    padding: 8px 20px !important; 
    cursor: pointer !important;
    transition: all 0.3s ease-in-out !important;
    outline: none !important; 
    text-transform: uppercase;
}

/* Hover effect (optional) */
.transparent-pill-button:hover {
    background-color: rgba(0, 0, 0, 0.1) !important; 
    color: black !important;
    border-color: black !important;
    box-shadow: none !important; 
}

/* Prevent blue outline in Safari/Firefox */
.transparent-pill-button::-moz-focus-inner {
    border: none !important;
}

.transparent-pill-button.active {
    background-color: #000000!important;  
    color: white !important;
    border-color: #000000 !important;
    box-shadow: none !important;
}

.drilldown-buttons {
    margin-bottom: 20px;
}

/* OVAL (DARK) BUTTONS */
.reset-pill-button {
    background-color: #000000 !important; 
    color: white !important;
    border: 1px solid black !important;
    border-radius: 70px !important; 
    font-size: 1rem !important;
    padding: 8px 20px !important;
    cursor: pointer !important;
    transition: all 0.3s ease-in-out !important;
    outline: none !important;
    text-transform: uppercase;
    display: inline-block;
}

/* Hover effect */
.reset-pill-button:hover {
    background-color: #1a1a1a !important; 
    color: white !important;
    border-color: black !important;
    box-shadow: none !important;
}

/* Clicked (active) state */
.reset-pill-button.active {
    background-color: white !important;
    color: black !important;
    border-color: black !important;
    box-shadow: none !important;
}

/* Prevent blue outline in Safari/Firefox */
.reset-pill-button::-moz-focus-inner {
    border: none !important;
}

/* CHECKBOX STYLING (ROW) */
.checkbox-style {
    font-family: 'Aeonik', sans-serif;
    font-size: 14px;
    text-transform: uppercase;
    display: flex;  
    flex-wrap: wrap; 
    gap: 15px;  
    align-items: center;
    justify-content: flex-start; 
    padding: 5px 10px; 
    background-color: #F5F5F5 !important; 
    color: black !important; 
    border: none !important;
    font-weight: 500;
    margin-bottom: 10px!important;
}

/* checkbox labels */
.checkbox-style label {
    display: flex;
    align-items: center; 
    cursor: pointer;
    gap: 10px; 
    padding: 5px 10px;
    background-color: #F5F5F5 !important; 
    border-radius: 5px;
    transition: background-color 0.2s ease-in-out;
}

/* Hover effect on checkboxes */
.checkbox-style label:hover {
    background-color: rgba(0, 0, 0, 0.1) !important; 
}

/* Style the actual checkboxes */
.checkbox-style input[type="checkbox"] {
    width: 16px; 
    height: 16px;
    accent-color: black; 
    margin-right: 8px; 
    vertical-align: middle;
}

/* Ensure text stays aligned with checkboxes */
.checkbox-style label span {
    color: black;
    font-size: 0.9rem;
    line-height: 1; 
}

/* SLIDERS */
.slider-style {
    width: 200px;
    margin: auto;
}

/* Slider Handle (Circle) */
.slider-style .rc-slider-handle {
    background-color: #000000 !important;
    width: 14px !important;
    height: 14px !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.slider-style .rc-slider-rail {
    background-color: #D9D9D9 !important;
    height: 1px !important;
    position: absolute !important;
    top: 50%;
    transform: translateY(-50%);
}

/* Move slider marks (numbers) above the slider */
.slider-style .rc-slider-mark {
    top: -25px !important;  
}

/* Default slider mark text (unselected) */
.slider-style .rc-slider-mark-text {
    color: #8f8f8f !important; 
    font-size: 14px !important;
    transition: color 0.2s ease-in-out;  
}

/* Selected slider mark text */
.slider-style .rc-slider-mark-text-active {
    color: #000000 !important;  
    font-weight: bold !important;
}

.slider-style .rc-slider-dot {
    background-color: #D9D9D9 !important;  
    border: 0px solid #D9D9D9 !important;  
    width: 8px !important;  
    height: 8px !important; 
    border-radius: 50% !important;  
    box-shadow: none !important; 
}

/* Default (larger screens) */
.slider-container {
    display: flex;
    align-items: center!important;
    gap: 15px;
    width: 80%;
    margin-top: 25px;
}

/* HELP BUTTON */
.help-button {
    background-color: black !important; 
    color: white !important; 
    border: 1px solid black !important; 
    border-radius: 50% !important; 
    font-family: 'PPEditorialNew';
    font-size: 1rem !important; 
    font-style: italic;
    padding: 10px !important; 
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px !important; 
    height: 40px !important; 
    transition: all 0.2s ease-in-out;
    min-width: 40px !important; 
    min-height: 40px !important; 
    box-sizing: border-box !important;
    -webkit-tap-highlight-color: transparent;
}

/* Hover Effect */
.help-button:hover {
    background-color: white !important;
    color: black !important;
    border: 1px solid black !important;
}

/* Active/Clicked Effect */
.help-button.active {
    background-color: white !important;
    color: black !important;
    border: 1px solid black !important
}

/* Help Button Container */
.help-container {
    position: relative;   
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 5px; 
}

.help-button:focus {
    outline: none !important;
    box-shadow: none !important;
}

.explanation-popover {
    position: absolute;
    top: 100%; 
    left: 50%; 
    z-index: 1000;
    width: 90vw; 
    max-width: 600px; 
    min-height: fit-content; 
    height: auto; 
    font-size: 0.9rem; 
    font-weight: 400;
    line-height: 1.5;
    padding: 20px 24px; 
    background-color: #ffffff;
    border-radius: 10px;
    border: 1px solid #d9d9d9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: 10px;
    overflow: hidden; 
    white-space: normal; 
    word-wrap: break-word;
    text-align: left;  
}

/* RADIO CHECKLISTS */
.radio-container {
    display: flex;
    flex-wrap: wrap;  
    justify-content: center;  
    align-items: center; 
    text-align: center;  
    gap: 20px;  
    margin: 0 auto 25px auto;  
    padding: 10px 15px; 
    width: 100%;  
    background-color: #bbc7a1;
    border-radius: 12px;
    box-shadow: 2px 4px 10px rgba(0,0,0,0.1);
    max-width: 600px;  
}

/* radio button styling */
.radio-style {
    font-size: 1rem;
    font-family: 'Aeonik', sans-serif;
    display: flex;  
    align-items: center;  
    justify-content: center; 
    text-align: center;  
    width: auto;
}


/* Make checkboxes and radio buttons black */
input[type="radio"], 
input[type="checkbox"] {
    accent-color: black !important; 
}

/* Remove default blue focus outline */
input[type="radio"]:focus, 
input[type="checkbox"]:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Remove tap highlight on mobile */
button, input, select {
    -webkit-tap-highlight-color: transparent;
}


/* NAVIGATION CARDS (Homepage) */

/* Outer wrapper — stacks the two rows with consistent gap */
.nav-cards-outer {
    margin: 24px 0 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Row 1 — index tile centred, exactly 2-of-4-column wide.
   With 4 columns and gap:24px the two-column width is calc(50% - 12px). */
.nav-card-row-featured {
    display: flex;
    justify-content: center;
}
/* West Bank Stability Index — editorial anchor tile */
.nav-card--featured {
    width: calc(50% - 12px);
    background: #f0f4e8;                     /* warm olive tint — lifts it above domain tiles */
    border-top: 3px solid #859e38;           /* brand accent — signals primary status */
    border-color: rgba(133, 158, 56, 0.30);  /* softer perimeter than grey domain tiles */
}
.nav-card--featured:hover {
    background: #e6edda;
    border-color: rgba(133, 158, 56, 0.55);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(133, 158, 56, 0.14);
}
.nav-card--featured .nav-card-title {
    font-size: 1.65rem;
    font-weight: 600;
}
.nav-card--featured .nav-card-sparkline {
    border-top-color: rgba(133, 158, 56, 0.20);
}

/* Row 2 — four equal domain tiles */
.nav-card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    max-width: 100%;
    margin: 0;
}

.nav-card {
    background-color: #F5F5F5;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 32px 28px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.nav-card:hover {
    background-color: #eaeaea;
    border-color: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.nav-card-disabled {
    background-color: #F5F5F5;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 32px 28px;
    opacity: 0.5;
    cursor: default;
}

.nav-card-title {
    font-family: 'Aeonik', sans-serif;
    font-size: 1.4rem;
    font-weight: 500;
    margin: 0 0 8px 0;
    padding: 0;
    text-align: left;
    color: #000;
}

.nav-card-subtitle {
    font-family: 'Aeonik', sans-serif;
    font-size: 0.95rem;
    font-weight: 400;
    color: #666;
    margin: 0;
    text-align: left;
}

/* SUB-TAB NAVIGATION (Finances) */
.subtab-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.subtab-link {
    font-family: 'Aeonik', sans-serif;
    font-size: 0.9rem;
    font-weight: 400;
    text-transform: uppercase;
    color: #666;
    text-decoration: none;
    padding: 8px 20px;
    border: 1px solid #ccc;
    border-radius: 70px;
    transition: all 0.2s ease;
}

.subtab-link:hover {
    color: #000;
    border-color: #000;
}

.subtab-link.active {
    background-color: #000;
    color: #fff;
    border-color: #000;
}

/* GRANULARITY TOGGLE */
.granularity-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    font-family: 'Aeonik', sans-serif;
}

.granularity-toggle label {
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 500;
    color: #3e3e3e;
}

.granularity-toggle .form-check-inline {
    margin-right: 0;
}

/* CHART SECTION */
.chart-section {
    margin-bottom: 56px;
    border-top: 3px solid #000;
    padding-top: 20px;
}

.acled-section {
    background-color: #f7f5f0;
    padding: 20px 24px;
    border-radius: 4px;
}

/* Chart ID label (bottom-left reference for citing) */
.chart-wrapper {
    position: relative;
}

.chart-id-label {
    position: absolute;
    bottom: 8px;
    left: 4px;
    font-family: 'Aeonik', sans-serif;
    font-size: 11px;
    font-weight: 400;
    color: #999;
    margin: 0;
    pointer-events: none;
    z-index: 10;
}

.chart-id-label-static {
    position: static;
    font-family: 'Aeonik', sans-serif;
    font-size: 11px;
    font-weight: 400;
    color: #999;
    margin: 4px 0 0 0;
}

/* Hide Plotly modebar on all non-map charts.
   Maps use .dash-graph and keep their zoom/pan toolbar. */
.modebar-container {
    display: none !important;
}
.dash-graph .modebar-container {
    display: flex !important;
}

/* Chart download buttons — injected next to chart-id-label */
.chart-download-btn {
    pointer-events: auto;
    cursor: pointer;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #999;
    border: 1px solid #ccc;
    border-radius: 3px;
    transition: all 0.15s ease;
    display: inline-block;
    vertical-align: middle;
    line-height: 1.4;
}

.chart-download-btn:hover {
    color: #000;
    border-color: #000;
    background-color: rgba(0, 0, 0, 0.04);
}

/* Tab title — top of each page */
.tab-title {
    font-family: 'Aeonik', sans-serif;
    font-size: clamp(1.6rem, 2.5vw, 2.2rem);
    font-weight: 700;
    color: #000;
    margin: 0 0 4px 0;
    padding: 0;
    letter-spacing: -0.02em;
    text-align: left;
}

/* Question heading — bold, left-aligned */
.chart-question {
    font-family: 'Aeonik', sans-serif;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    font-weight: 700;
    text-align: left;
    color: #000;
    margin: 0 0 12px 0;
    padding: 0;
    line-height: 1.3;
}

/* Context paragraph — explains what the chart shows */
.chart-context {
    font-family: 'Aeonik', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.7;
    color: #3e3e3e;
    margin: 0 0 20px 0;
}

/* Overview description (homepage) */
.overview-description {
    font-family: 'Aeonik', sans-serif;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.7;
    color: #3e3e3e;
    margin: 0 0 20px 0;
}

/* Latest monthly update shortcut (homepage, below description) */
.briefing-shortcut-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}
.briefing-shortcut {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(133,158,56,0.10);
    border: 1px solid rgba(133,158,56,0.30);
    border-radius: 6px;
    padding: 9px 20px;
    transition: background 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}
.briefing-shortcut:hover {
    background: rgba(133,158,56,0.18);
    border-color: rgba(133,158,56,0.55);
}
.briefing-shortcut-label {
    font-family: 'Aeonik', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #4a6120;
}
.briefing-shortcut-arrow {
    font-family: 'Aeonik', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #859e38;
}

/* Chart title — clear, prominent, sits above chart */
.chart-title {
    font-family: 'Aeonik', sans-serif;
    font-size: 17px;
    font-weight: 600;
    color: #000;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

/* Small chart subtitle — unit / basis label below title */
.chart-subtitle {
    font-family: 'Aeonik', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin: 0 0 4px 0;
}

/* Insight box — sits below chart */
.chart-insight-box {
    border-left: 3px solid #859e38;
    padding: 12px 0 12px 16px;
    margin-top: 12px;
    margin-bottom: 8px;
}

.chart-insight {
    font-family: 'Aeonik', sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
    color: #555;
    margin: 0;
    font-style: italic;
}

/* Legacy — keep for deep dive charts */
.chart-section-title {
    font-family: 'Aeonik', sans-serif;
    font-size: 16px;
    font-weight: 500;
    text-transform: uppercase;
    margin: 0 0 4px 0;
    padding: 0;
}

.chart-section-desc {
    font-family: 'Aeonik', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #666;
    margin: 0 0 8px 0;
}

/* SCENARIO TOGGLES */
.scenario-toggles {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.scenario-toggle-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scenario-toggle-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Aeonik', sans-serif;
    font-size: 0.85rem;
    text-transform: uppercase;
}

/* CHART ROW — side-by-side charts */
.chart-row {
    display: flex;
    gap: 24px;
    align-items: stretch;
}

.chart-row-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Push chart wrapper down so LHS and RHS charts align
   regardless of how many controls/pills sit above them */
.chart-row-col > .chart-wrapper {
    margin-top: auto;
}

/* PIE CHART DEFINITIONS */
.pie-definitions {
    margin-top: 8px;
    padding: 0 4px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 24px;
}

.pie-definition {
    font-family: 'Aeonik', sans-serif;
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.5;
    color: #555;
    margin: 0 0 6px 0;
}

.pie-definition strong {
    color: #333;
}

/* BREAKDOWN PANELS (withheld / aid, nested under toggles) */
.breakdown-row {
    display: flex;
    gap: 32px;
    padding-left: 64px;
    margin-top: 4px;
    margin-bottom: 8px;
}

.breakdown-row label {
    display: flex;
    align-items: baseline;
    margin-bottom: 1px;
    line-height: 1.35;
    font-size: 12.5px;
}

.breakdown-row label strong {
    font-size: 12.5px;
}

.breakdown-desc {
    font-size: 12px;
    font-weight: 400;
    color: #555;
}

/* --- Area C story grid --- */
.story-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.story-grid-btn {
    font-family: 'Aeonik', sans-serif;
    font-size: 12px !important;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #3e3e3e !important;
    background: transparent !important;
    border: 1px solid #ccc !important;
    border-radius: 70px !important;
    padding: 6px 14px !important;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.story-grid-btn:hover {
    color: #000 !important;
    border-color: #000 !important;
}

.story-grid-btn.active {
    color: #fff !important;
    background-color: #000 !important;
    border-color: #000 !important;
}

/* Compact rectangular toggle for new/cumulative switches */
.chart-toggle-btn {
    font-family: 'Aeonik', sans-serif;
    font-size: 11px !important;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 3px 10px !important;
    border: 1px solid #999 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #666 !important;
    cursor: pointer;
    outline: none !important;
    line-height: 1.3;
    margin-left: -1px;
}

.chart-toggle-btn:first-of-type {
    margin-left: 0;
    border-radius: 3px 0 0 3px !important;
}

.chart-toggle-btn:last-of-type {
    border-radius: 0 3px 3px 0 !important;
}

.chart-toggle-btn:hover {
    color: #000 !important;
    border-color: #000 !important;
    z-index: 1;
    position: relative;
}

.chart-toggle-btn.active {
    background: #000 !important;
    color: #fff !important;
    border-color: #000 !important;
    z-index: 1;
    position: relative;
}

/* Larger rectangular toggle for prominent filter controls */
.chart-toggle-btn-lg {
    font-family: 'Aeonik', sans-serif;
    font-size: 13px !important;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 6px 16px !important;
    border: 1px solid #999 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #666 !important;
    cursor: pointer;
    outline: none !important;
    line-height: 1.3;
    margin-left: -1px;
}

.chart-toggle-btn-lg:first-child {
    margin-left: 0;
    border-radius: 3px 0 0 3px !important;
}

.chart-toggle-btn-lg:last-child {
    border-radius: 0 3px 3px 0 !important;
}

.chart-toggle-btn-lg:hover {
    color: #000 !important;
    border-color: #000 !important;
    z-index: 1;
    position: relative;
}

.chart-toggle-btn-lg.active {
    background: #000 !important;
    color: #fff !important;
    border-color: #000 !important;
    z-index: 1;
    position: relative;
}

#ac-story-content .chart-insight {
    font-size: 15px;
    line-height: 1.7;
}

/* HOMEPAGE SEARCH BAR */
.homepage-search-container {
    max-width: 600px;
    margin: 0 auto 32px auto;
}

.homepage-search-container .Select-control {
    font-family: 'Aeonik', sans-serif;
    border: 1px solid #ccc !important;
    border-radius: 8px !important;
    background-color: #fff;
    box-shadow: none !important;
    min-height: 44px;
}

.homepage-search-container .Select-placeholder {
    font-size: 0.95rem;
    color: #999;
    line-height: 44px;
}

.homepage-search-container .Select-input > input {
    font-family: 'Aeonik', sans-serif;
    font-size: 0.95rem;
}

.homepage-search-container .Select-menu-outer {
    border-radius: 8px;
    border: 1px solid #ccc;
    margin-top: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Remove the manually drawn bottom line on homepage search */
.homepage-search-container .dropdown-style::after {
    display: none;
}

/* SPARKLINE IN NAV CARD */
.nav-card-sparkline {
    margin-top: 16px;
    height: 80px;
    cursor: pointer;
    position: relative;
    border-top: 1px solid #e0e0e0;
    padding-top: 8px;
}

.nav-card-sparkline::after {
    content: 'Click to expand';
    position: absolute;
    top: 8px;
    right: 0;
    font-family: 'Aeonik', sans-serif;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #999;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.nav-card-sparkline:hover::after {
    opacity: 1;
}

.nav-card-sparkline .dash-graph {
    padding: 0 !important;
    pointer-events: none;
}

.nav-card-sparkline .modebar-container {
    display: none !important;
}

/* Modal overrides for sparkline expanded view */
#sparkline-modal .modal-header {
    border-bottom: none;
    padding-bottom: 0;
}

#sparkline-modal .modal-header .btn-close {
    align-self: flex-start;
}

#sparkline-modal .modal-body {
    padding-top: 8px;
}

/* ===== CHAT DRAWER ===== */

/* Floating toggle button — bottom-right */
.chat-toggle-btn {
    position: fixed !important;
    bottom: 28px;
    right: 28px;
    z-index: 9998;
    background-color: #000 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 70px !important;
    padding: 12px 24px !important;
    font-family: 'Aeonik', sans-serif;
    font-size: 14px !important;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.chat-toggle-btn:hover {
    background-color: #1a1a1a !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Drawer panel */
.chat-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    height: 100vh;
    background: #fff;
    border-left: 1px solid #e0e0e0;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.chat-drawer-closed {
    transform: translateX(100%);
    pointer-events: none;
}

.chat-drawer-open {
    transform: translateX(0);
    pointer-events: auto;
}

/* Drawer header */
.chat-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.chat-drawer-title {
    font-family: 'Aeonik', sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #000;
}

.chat-close-btn {
    background: transparent !important;
    border: none !important;
    font-size: 24px !important;
    color: #666 !important;
    cursor: pointer;
    padding: 0 4px !important;
    line-height: 1;
    transition: color 0.15s ease;
}

.chat-close-btn:hover {
    color: #000 !important;
}

/* Messages area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Welcome / starter area */
.chat-welcome {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-welcome-text {
    font-family: 'Aeonik', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    color: #666;
    margin: 0;
}

.chat-starter-chips {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-starter-chip {
    font-family: 'Aeonik', sans-serif;
    font-size: 13px !important;
    font-weight: 400;
    color: #333 !important;
    background: #f5f5f5 !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    padding: 10px 14px !important;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    line-height: 1.4;
}

.chat-starter-chip:hover {
    background: #eaeaea !important;
    border-color: #333 !important;
}

/* Message rows */
.chat-message-row {
    display: flex;
}

.chat-message-user {
    justify-content: flex-end;
}

.chat-message-assistant {
    justify-content: flex-start;
}

/* Message bubbles */
.chat-bubble {
    font-family: 'Aeonik', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    padding: 10px 14px;
    border-radius: 12px;
    max-width: 85%;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.chat-bubble-user {
    background-color: #000;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-bubble-assistant {
    background-color: #f5f5f5;
    color: #1a1a1a;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

.chat-answer-text {
    white-space: pre-wrap;
}

/* Show working toggle */
.chat-working-details {
    margin-top: 8px;
    border-top: 1px solid #e0e0e0;
    padding-top: 6px;
}

.chat-working-toggle {
    font-family: 'Aeonik', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #146D9D;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    list-style: none;
}

.chat-working-toggle::-webkit-details-marker {
    display: none;
}

.chat-working-toggle::before {
    content: '\25B6\00a0';
    font-size: 9px;
    display: inline-block;
    transition: transform 0.15s ease;
}

details[open] > .chat-working-toggle::before {
    transform: rotate(90deg);
}

.chat-working-content {
    font-family: 'Aeonik', sans-serif;
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.5;
    color: #666;
    margin-top: 6px;
    white-space: pre-wrap;
}

/* Loading wrapper */
.chat-loading-wrapper {
    min-height: 0;
    padding: 0 20px;
    flex-shrink: 0;
}

/* Input area */
.chat-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
    background: #fff;
}

.chat-input {
    flex: 1;
    font-family: 'Aeonik', sans-serif !important;
    font-size: 14px !important;
    padding: 10px 14px !important;
    border: 1px solid #d0d0d0 !important;
    border-radius: 8px !important;
    outline: none !important;
    background: #fff !important;
    transition: border-color 0.15s ease;
}

.chat-input:focus {
    border-color: #146D9D !important;
}

.chat-send-btn {
    background-color: #000 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    font-size: 18px !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    transition: background-color 0.15s ease;
}

.chat-send-btn:hover {
    background-color: #1a1a1a !important;
}


/* ===== ADMIN PAGE ===== */

.admin-add-form {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 8px;
}

.admin-form-label {
    font-family: 'Aeonik', sans-serif;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    color: #3e3e3e;
    margin-bottom: 4px;
}

.admin-input {
    font-family: 'Aeonik', sans-serif !important;
    font-size: 14px !important;
    border: 1px solid #ccc !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
}

.admin-input:focus {
    border-color: #000 !important;
    box-shadow: none !important;
}

.admin-status {
    min-height: 20px;
}

.admin-users-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Aeonik', sans-serif;
    font-size: 14px;
}

.admin-users-table th {
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #666;
    padding: 10px 12px;
    border-bottom: 2px solid #000;
    text-align: left;
}

.admin-users-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: middle;
}

.admin-users-table tbody tr:hover {
    background-color: #f9f9f9;
}

/* MOBILE VERSION */
/* ── AI-generated monthly overview panel (risk index tab) ───────────────── */

.ri-overview-panel {
    background-color: #f7f5f0;
    border: 1px solid #e8e3db;
    border-top: 2px solid #859e38;
    border-radius: 4px;
    padding: 20px 24px 16px 24px;
    margin: 20px 0 28px 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
}

.ri-overview-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.ri-overview-title {
    font-family: 'Aeonik', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.ri-overview-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #fff;
    background-color: #859e38;
    border-radius: 10px;
    padding: 3px 10px;
    white-space: nowrap;
    vertical-align: middle;
}

/* dcc.Markdown wraps content in <p> — normalise margins per section */
.ri-overview-headline p,
.ri-overview-bullet-md p,
.ri-overview-emerging-md p {
    font-family: 'Aeonik', sans-serif;
    font-size: 15px;
    line-height: 1.65;
    color: #3e3e3e;
    margin: 0 0 6px 0;
}

.ri-overview-drivers {
    margin: 4px 0 10px 0;
    padding-left: 20px;
}

.ri-overview-drivers li {
    margin-bottom: 5px;
}

.ri-overview-emerging {
    border-top: 1px solid #e0dbd0;
    padding-top: 10px;
    margin-top: 6px;
}

.ri-overview-emerging-label {
    font-family: 'Aeonik', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #7a6f5d;
}

.ri-overview-disclaimer {
    font-family: 'Aeonik', sans-serif;
    font-size: 11px;
    font-style: italic;
    color: #999;
    margin: 12px 0 0 0;
}

/* ── Inline chart area (in-app mode) ───────────────────────────────────────── */
.ri-inline-chart-area {
    margin-top: 0;
    border: 1px solid #d8d0c6;
    border-top: 2px solid #859e38;
    background: #fafaf8;
    padding: 16px 20px 12px;
}

.ri-inline-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.ri-inline-chart-title {
    font-family: 'Aeonik', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #4a4035;
}

.ri-inline-close-btn {
    font-family: 'Aeonik', sans-serif;
    font-size: 11px;
    padding: 3px 10px;
    border: 1px solid #c8bfb0;
    border-radius: 12px;
    background: transparent;
    color: #7a6f5d;
    cursor: pointer;
    flex-shrink: 0;
}

.ri-inline-close-btn:hover {
    background: #f0ebe3;
    color: #4a4035;
}

/* Chart trigger buttons (in-app mode) */
.ri-chart-triggers {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #e8e3db;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.ri-chart-triggers-label {
    font-family: 'Aeonik', sans-serif;
    font-size: 11px;
    color: #999;
    flex-shrink: 0;
}

.ri-chart-trigger-btn {
    font-family: 'Aeonik', sans-serif;
    font-size: 11px;
    padding: 4px 12px;
    border: 1px solid #b8b0a4;
    border-radius: 12px;
    background: transparent;
    color: #5a5040;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.ri-chart-trigger-btn:hover {
    background: #f0ebe3;
    border-color: #859e38;
    color: #3a3025;
}

/* ── Schema v2 briefing-note sections ──────────────────────────────────────── */

/* Situation — main assessment paragraph */
.ri-overview-situation p {
    font-family: 'Aeonik', sans-serif;
    font-size: 14px;
    line-height: 1.65;
    color: #2e2920;
    margin: 0 0 16px 0;
}

/* Key driver blocks */
.ri-driver-block {
    margin: 16px 0 8px 0;
    padding: 12px 16px;
    background: rgba(255,255,255,0.55);
    border-radius: 3px;
}

.ri-driver-title {
    font-family: 'Aeonik', sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #859e38;
    margin: 0 0 6px 0;
}

.ri-driver-body p {
    font-family: 'Aeonik', sans-serif;
    font-size: 13.5px;
    line-height: 1.65;
    color: #2e2920;
    margin: 0;
}

/* Trajectory section */
.ri-trajectory-block {
    margin-top: 16px;
    padding: 10px 14px;
    background: rgba(133,158,56,0.06);
    border-radius: 3px;
}

.ri-trajectory-label {
    font-family: 'Aeonik', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #7a8f34;
    display: block;
    margin-bottom: 4px;
}

.ri-trajectory-md p,
.ri-trajectory-md li {
    font-family: 'Aeonik', sans-serif;
    font-size: 13px;
    line-height: 1.6;
    color: #3a3025;
    margin: 0;
}
.ri-trajectory-md ul {
    margin: 4px 0 0 0;
    padding-left: 18px;
}
.ri-driver-body li {
    font-family: 'Aeonik', sans-serif;
    font-size: 13px;
    line-height: 1.65;
    color: #2e2920;
    margin: 0;
}

/* Model context section */
.ri-model-context-block {
    border-top: 1px solid #e0dbd0;
    padding-top: 10px;
    margin-top: 6px;
    margin-bottom: 8px;
}
.ri-model-context-label {
    font-family: 'Aeonik', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.ri-model-context-md p {
    font-family: 'Aeonik', sans-serif;
    font-size: 13px;
    color: #666;
    margin: 3px 0 0 0;
    font-style: italic;
}

/* Overview panel links — monochromatic (olive, not browser-blue) */
.ri-overview-situation a,
.ri-driver-body a,
.ri-trajectory-md a,
.ri-overview-headline a,
.ri-overview-bullet-md a,
.ri-overview-emerging-md a {
    color: #5a7230;
    text-decoration: underline;
    text-decoration-color: rgba(90, 114, 48, 0.4);
    text-underline-offset: 2px;
}
.ri-overview-situation a:hover,
.ri-driver-body a:hover,
.ri-trajectory-md a:hover,
.ri-overview-headline a:hover,
.ri-overview-bullet-md a:hover,
.ri-overview-emerging-md a:hover {
    color: #3d4e22;
    text-decoration-color: rgba(61, 78, 34, 0.7);
}

/* Watch indicators section (kept for backward compat with old stored JSON) */
.ri-watch-block {
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(0,0,0,0.03);
    border-radius: 3px;
}

.ri-watch-label {
    font-family: 'Aeonik', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #7a6f5d;
    display: block;
    margin-bottom: 4px;
}

.ri-watch-md p {
    font-family: 'Aeonik', sans-serif;
    font-size: 13px;
    line-height: 1.6;
    color: #3a3025;
    margin: 0;
}

/* Link-mode toggle (new-tab ↔ in-app) */
.ri-overview-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.ri-overview-docx-btn {
    font-family: 'Aeonik', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #777;
    background: none;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 2px 7px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 12px;
    margin-top: 2px;
    letter-spacing: 0.02em;
}
.ri-overview-docx-btn:hover {
    color: #333;
    border-color: #888;
}

.ri-link-mode-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.ri-link-mode-label {
    font-family: 'Aeonik', sans-serif;
    font-size: 11px;
    color: #999;
}

.ri-link-mode-btn {
    font-family: 'Aeonik', sans-serif;
    font-size: 11px;
    padding: 3px 10px;
    border: 1px solid #c8bfb0;
    border-radius: 12px;
    background: transparent;
    color: #7a6f5d;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.ri-link-mode-btn:hover {
    background: #f0ebe3;
    color: #4a4035;
}

.ri-link-mode-btn.active {
    background: #859e38;
    border-color: #859e38;
    color: #fff;
}

@media screen and (max-width: 768px) {

    .main-content {
        padding: 10px 10px;
        width: 100%;
    }

    .dash-text {
        max-width: 100%;
        font-size: 0.95rem;
        margin-bottom: 20px; 
    }

    .heading-text {
        max-width: 100%;
        font-size: 0.95rem;
        margin-bottom: 20px;
    }

    .overview-title {
        padding: 5px 0;
        font-size: clamp(2.5rem, 3.5vw, 4.5rem);
    }

    .graph-title {
        font-size: 14px;
    }

    .description-text {
        font-size: 14px;
    }

    h2, h3 {
        font-size: 1.3rem; 
        margin: 6px 0;
        padding: 6px 0;
    }

    .dash-graph {
        width: 100vw !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .dropdown-style, .Select-control {
        width: 90% !important; 
        max-width: 95% !important; 
        min-width: 200px !important; 
        font-size: 0.9rem !important; 
        margin: 5px auto 0 auto; 
    }

    .help-container {
        text-align: center;
        padding: 10px;
    }

    .help-button {
        font-size: 0.8rem !important;  
        padding: 3px !important;  
        width: 30px !important;        
        height: 30px !important;      
        min-width: 30px !important;   
        min-height: 30px !important;   
    }

    .explanation-popover {
        transform: translateX(-90%); 
        max-width: 80vw;           
    }

    .navbar-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 10px 15px;
    }

    .navbar-logo img {
        height: 40px; 
    }

    .navbar-subtitle {
        font-size: 0.9rem;
    }

    .nav-link::after {
        left: 20%;
    }

    .nav-link:hover::after {
        width: 40%; 
    }

    .radio-container {
        width: 95%; 
        padding: 10px;  
        gap: 5px;  
        margin-bottom: 15px; 
    }

    .radio-style {
        font-size: 0.9rem;
        align-items: center; 
    }

    .transparent-pill-button {
        font-size: 0.9rem !important;
        padding: 4px 10px !important; 
    }

    .reset-pill-button {
        font-size: 0.9rem !important;
        padding: 4px 10px !important;
    }
    
    .heading-text {
        max-width: 100%;
    }

    .slider-container {
        width: 100%; 
    }

    .slider-style {
        width: 100%; 
    }

    .toggle-button {
        position: relative !important;
        margin-top: 10px !important;
    }

    .dropdown-label {
        display: none;
    }

    .hr-line {
        margin: 25px auto; 
    }

    .checkbox-style {
        font-size: 0.7rem !important;
    }
    
    .checkbox-style {
        display: flex;
        flex-wrap: wrap;
        gap: 3px 8px; 
        padding: 0 !important;
        margin: 0 !important;
        background-color: #f5f5f5;
        padding: 8px !important;
        margin: 0 0px 16px 0px !important; 
    }
    
    .checkbox-style label {
        margin: 0 !important;
        padding: 3px 8px !important;
        font-size: 0.65rem !important;
        line-height: 1 !important;
        display: inline-flex !important;
        align-items: left !important;
    }

    .checkbox-style input[type="checkbox"] {
        margin: 0 6px 0 0 !important;
        padding: 0 !important;
        height: 14px;
        width: 14px;
    }

    .navbar-container {
        padding: 0 !important;
    }

    #navbar-collapse {
        width: 100% !important;
    }

    .nav-menu-wrapper {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .nav-menu {
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: flex-start !important;
        padding-left: 0px !important;
        width: 100% !important;
    }

    .nav-item {
        width: 100% !important;
    }

    .nav-link {
        text-align: left !important;
        width: 100% !important;
        padding-left: 0 !important;
    }

    .nav-utility {
        margin-left: 0 !important;
        margin-top: 8px;
        padding-left: 0.5rem;
        gap: 8px;
    }

    .cluster-nav-section {
        justify-content: center !important;
        margin-top: 16px!important;
    }

    .dropdown-style.shorter {
        min-width: 240px !important;
    }

    .chart-section {
        margin-bottom: 40px;
        padding-top: 16px;
    }

    .chart-question {
        font-size: 1.1rem;
    }

    .chart-context {
        font-size: 14px;
    }

    .chart-insight-box {
        padding: 8px 0 8px 12px;
    }

    .chart-insight {
        font-size: 13px;
    }

    .homepage-search-container {
        max-width: 100%;
        margin: 0 0 20px 0;
    }

    .nav-card-sparkline {
        height: 60px;
    }

    .nav-cards-outer {
        margin: 16px 0 24px;
        gap: 16px;
    }

    .nav-card-row-featured {
        display: block;  /* full width on mobile */
    }

    .nav-card--featured {
        width: 100%;
    }

    .nav-card-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin: 0;
    }

    .nav-card, .nav-card-disabled {
        padding: 20px 18px;
    }

    .nav-card-title {
        font-size: 1.1rem;
    }

    .subtab-nav {
        gap: 6px;
    }

    .subtab-link {
        font-size: 0.8rem;
        padding: 6px 14px;
    }

    .granularity-toggle {
        flex-wrap: wrap;
        gap: 8px;
    }

    .scenario-toggles {
        flex-direction: column;
        gap: 8px;
    }

    .chart-row {
        flex-direction: column;
    }

    /* Chat drawer — full width on mobile */
    .chat-drawer {
        width: 100vw;
    }

    .chat-toggle-btn {
        bottom: 16px;
        right: 16px;
        padding: 10px 18px !important;
        font-size: 13px !important;
    }

    /* AI overview panel — compact on mobile */
    .ri-overview-panel {
        padding: 14px 16px 12px 16px;
        margin: 14px 0 20px 0;
    }

    .ri-overview-title {
        font-size: 18px;
    }

    .ri-overview-badge {
        font-size: 9px;
    }

    .ri-overview-headline p,
    .ri-overview-bullet-md p,
    .ri-overview-emerging-md p {
        font-size: 14px;
    }
}    