/* -------------------------
   Global Styles
   ------------------------- */

/* -------------------------
   Foundation Tokens

   Values below mirror repeated literals already used in this file. Keep this
   layer conservative so future visual work can move toward tokens without
   changing the current rendered app.
   ------------------------- */

:root {
    --color-brand-red: #C2282D;
    --color-brand-red-hover: #A01F25;
    --color-text-primary: black;
    --color-text-muted: #555;
    --color-surface: white;
    --color-surface-control: #f0f0f0;
    --color-surface-control-hover: #ddd;
    --color-border-subtle: #ddd;
    --color-border-editorial: rgba(0, 0, 0, 0.14);
    --color-border-control: #ccc;
    --color-link: #007bff;
    --color-control-selected-bg: rgba(194, 40, 45, 0.12);
    --color-control-selected-bg-strong: rgba(194, 40, 45, 0.18);
    --color-control-focus-ring: rgba(194, 40, 45, 0.22);
    --rating-bib-gourmand: #7a2466;
    --rating-one-star: #d7a23c;
    --rating-two-stars: #df6f61;
    --rating-three-stars: #bd2a34;
    --rating-bib-gourmand-filter: brightness(0) saturate(100%) invert(19%) sepia(58%) saturate(1788%) hue-rotate(284deg) brightness(91%) contrast(91%);
    --rating-one-star-filter: brightness(0) saturate(100%) invert(68%) sepia(71%) saturate(430%) hue-rotate(359deg) brightness(91%) contrast(86%);
    --rating-two-stars-filter: brightness(0) saturate(100%) invert(58%) sepia(49%) saturate(903%) hue-rotate(319deg) brightness(94%) contrast(86%);
    --rating-three-stars-filter: brightness(0) saturate(100%) invert(22%) sepia(80%) saturate(1804%) hue-rotate(336deg) brightness(90%) contrast(93%);
    --analysis-page-gutter-bg: #f7f7f7;
    --analysis-paper-bg: #ffffff;
    --analysis-page-max-width: 1340px;
    --analysis-page-padding: 50px;
    --analysis-page-gutter: 24px;
    --analysis-sheet-padding: calc(var(--analysis-page-padding) - var(--analysis-page-gutter));
    --analysis-paper-border: rgba(0, 0, 0, 0.10);
    --shadow-active-control: 0 0 0 1px rgba(0, 0, 0, 0.16), inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

body {
    font-family: 'Libre Franklin', sans-serif;
}

/* -------------------------
   Application Shell: Header and Navigation
   ------------------------- */

/* Header section: fixed at the top */
.header {
    width: 100%; /* Take full width of the viewport */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px; /* Adjust height as needed */
    background-color: var(--color-surface); /* Set background color for visibility */
    z-index: 1000; /* Ensure it stays above other content */
    border-bottom: 1px solid var(--color-border-subtle); /* Optional: Add border for separation */
}

/* Body section will grow to fill available space */
.body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding-top: 90px;
}

/* -------------------------
   General Container Styles
   ------------------------- */

.container-style {
    padding: 1rem;
    background-color: var(--color-surface)/*#EAECEE*/;
}

/* -------------------------
   Title and Year Text Styles
   ------------------------- */

/* Header container that holds title and buttons */
.header-container {
    display: flex;
    justify-content: space-between; /* Align title to the left, buttons to the right */
    align-items: center;
    height: 100%;
    width: 100%; /* Take full width of the header */
}

.header-title {
    /*background-color: lightblue; !* Debug color for the title *!*/
    flex-grow: 1;
    min-width: 0;
    overflow: hidden;
}

.title-section {
    font-family: "Kaisei Decol", serif;
    font-size: 60px;
    line-height: 1;
    margin: 0 0 0 50px;
    overflow: hidden;
    text-overflow: clip;
    white-space: nowrap;
    color: var(--color-text-primary);
    font-weight: 400;
}

.year-text {
    color: var(--color-brand-red);
}

/* -------------------------
   Hamburger Nav Styling
   ------------------------- */

/* Hamburger styles */
.hamburger-menu {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    cursor: pointer;
    margin-right: 50px;
}

.bar {
    height: 3px;
    background-color: var(--color-brand-red); /* Michelin Red */
    border-radius: 2px;
}

/* Base styles for dropdown */
.nav-dropdown {
    position: absolute;
    right: 50px;
    top: 80px;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border-subtle);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    z-index: 999;
    padding: 10px;
    border-radius: 4px;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

/* When visible */
.nav-dropdown.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-link {
    display: block;
    padding: 8px 12px;
    color: var(--color-text-primary);
    text-decoration: none;
    font-weight: 500;
    opacity: 1;
    text-align: left;
    transition: opacity 0.2s ease;
}

.nav-link:hover {
    opacity: 0.8;
}

.nav-link.active {
    color: var(--color-brand-red);
}

/* -------------------------
   Guide Page: City Match Section Styling
   ------------------------- */

.city-match-content-wrapper-mainpage {
    /*background-color: #ffefc1;*/
    width: 100%;
    margin-bottom: 10px;
}

.city-match-sidebar-mainpage {
    /*background-color: #c1e7ff;*/
    width: 35%;
    float: left;
}

.city-match-main-content-mainpage {
    /*background-color: #e1ffc1;*/
    width: 65%;
    float: right;
}

.city-match-output-container-mainpage {
    display: none;  /* Hidden by default */
    margin: 0;
    padding: 0;
    width: 100%;  /* Ensures it stays aligned with the input field */
}

.city-match-output-container-mainpage p {
    margin: 0;
    padding: 0;
}

/* Make the container visible only when it has content */
.city-match-output-container-mainpage.visible {
    display: block;  /* Show when there's content */
    margin: 0;
    padding: 0;
}

.info-toggle-button {
    background-color: var(--color-surface-control);  /* Light grey background */
    color: var(--color-text-muted);  /* Muted text color */
    border: 1px solid var(--color-border-control);  /* Light border */
    border-radius: 5px;
    padding: 5px 10px;
    font-size: 14px;
    cursor: pointer;
    position: relative;
}

/* Hover text (tooltip) for search button */
.info-toggle-button:hover:after {
    content: "Search if a location in France (village, commune, town, or city) has restaurants awarded by Michelin";
    position: absolute;
    top: 50%;
    left: 105%;  /* Move the tooltip to the right of the button */
    transform: translateY(-50%);  /* Vertically center the tooltip */
    background-color: var(--color-surface-control);
    padding: 5px;
    border-radius: 5px;
    border: 1px solid var(--color-border-control);
    color: #333;
    font-size: 12px;
    white-space: nowrap;
    z-index: 9999;
    text-align: left;  /* Align text inside the tooltip */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Add a subtle shadow for depth */
}

.info-toggle-button:hover {
    background-color: var(--color-surface-control-hover);  /* Darken on hover for subtle effect */
}

/* Add margin around the button */
.info-tab-container {
    text-align: left;
}

.city-input-field {
    color: var(--color-text-muted);  /* Text color */
    border: 1px solid var(--color-border-subtle);  /* Light border matching the buttons */
    border-radius: 5px;  /* Rounded corners matching buttons */
    padding: 5px 10px;  /* Ensure similar padding to buttons */
    font-size: 14px;  /* Matching the font size */
    height: 30px;  /* Ensure consistent height with buttons */
    box-sizing: border-box;  /* Ensure the padding and border are included in the input size */
}

/* Adjust spacing inside the search section */
.city-input-container-mainpage {
}

.submit-city-button-mainpage,
.clear-city-button-mainpage {
    background-color: var(--color-surface-control);  /* Light grey background */
    color: var(--color-text-muted);  /* Muted text color */
    border: 1px solid var(--color-border-control);  /* Light border */
    border-radius: 5px;
    padding: 3px 10px;
    font-size: 14px;
    margin-left: 10px;
    cursor: pointer;
}

.submit-city-button-mainpage:hover,
.clear-city-button-mainpage:hover {
    background-color: var(--color-surface-control-hover);  /* Darken on hover */
}

/* -------------------------
   Footer Container Styles
   ------------------------- */

/* Main footer div with debug color */
.footer-main {
    flex: 0 0 auto;
    height: 60px;
    width: 100%;
    /*background-color: lightcoral; !* Debug color for visibility *!*/
    background-color: var(--color-surface);
    display: flex;
    align-items: center;
    border-top: 1px solid var(--color-border-subtle); /* Optional: Add border for separation */
}

/* Info container with its own debug color */
.info-container {
    /*background-color: lightblue; !* Debug color for the content container *!*/
    width: 100%;
    padding: 0 50px; /* Add space on the sides */
    display: flex; /* Flexbox for horizontal alignment */
    align-items: center; /* Vertically center the children */
    justify-content: flex-start; /* Align content to the left */
}

/* Styling for GitHub image */
.info-image {
    margin-right: 0.5rem; /* Space between image and text */
    width: 32px;
}

/* Wrapper for all text */
.text-container {
    display: flex;
    flex-direction: column; /* Stack the two lines vertically */
    line-height: 1.1; /* Adjust line spacing (smaller value reduces the gap) */
}

/* First line with GitHub link */
.info-line {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 0;
}

/* Link styling */
.info-link {
    text-decoration: none; /* Removes underline */
    color: var(--color-link);
    font-size: 12px;
}

.info-link:hover {
    text-decoration: underline; /* Underline on hover */
}

/* Info text styling */
.info-text {
    font-size: 12px;
    color: var(--color-text-primary);
}

.info-footer, .disclaimer-text, .disclaimer-link {
    margin: 0; /* Ensures no unwanted spacing */
    padding: 0;
}

/* Footer text styling */
.info-footer {
    font-size: 9px;
    color: var(--color-text-muted); /* Grey color for footer text */
    opacity: 0.7; /* Slight transparency */
}

/* Disclaimer text styling */
.disclaimer-text {
    font-size: 10px;
    color: var(--color-text-muted); /* Subtle grey color */
}

/* Styling for disclaimer link */
.disclaimer-link {
    font-size: 10px; /* Match disclaimer font size */
    color: var(--color-link); /* Subtle blue for links */
}

/* -------------------------
   404 Styles
   ------------------------- */

.not-found-content-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh; /* Full height of the viewport */
    text-align: center; /* Center text inside the container */
}

.custom-text {
    font-size: 24px; /* Adjust font size as needed */
}

/* -------------------------
   Dropdown Styles
   ------------------------- */
.dropdown-style {
    margin-bottom: 5px;
}

/* -------------------------
   Guide Page: Main Content Container for Map and Sidebar
   ------------------------- */

/* Main layout wrapping everything */
.main-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;  /* Ensure the full height of the viewport is used */
}

/* Main Content should take up the remaining height between header and footer */
.main-content {
    flex-grow: 1;  /* Fill remaining available space */
    display: flex;
    flex-direction: column;
    height: calc(100vh - 140px);  /* 80px header + 60px footer */
    margin-left: 50px;
    margin-right: 50px;
    /*overflow: hidden;  !* Prevent overflow *!*/
}

.map-sidebar-container {
    display: flex;
    flex-grow: 1;  /* Take up available space */
    height: 100%;  /* Full height of the remaining space */
    overflow-y: hidden;  /* Prevent overflow */
}

/* Map Section: Now on the left */
.map-section {
    float: left;
    width: 70%;  /* Map takes 70% of the width */
    height: 100%;  /* Full height */
    display: flex;
    flex-direction: column;
    padding-right: 20px;  /* Optional padding for spacing */
    box-sizing: border-box;
}

/* Ensure the map display inside takes full height */
.map-display {
    flex-grow: 1;  /* Ensures the map stretches fully inside the container */
}

#map-display .scatterlayer path {
    cursor: pointer !important;  /* Enforces the pointer (arrow) instead of the default cursor */
}

/* Sidebar Section: Now on the right */
.sidebar-container {
    float: right;
    width: 30%;  /* Sidebar takes 30% of the width */
    height: 100%;  /* Full height */
    display: flex;
    flex-direction: column;
    padding-left: 20px;  /* Optional padding for spacing */
    box-sizing: border-box;
    overflow-y: auto;
}

/* Ensure all containers stretch to fit within the layout */
.map-display,
.sidebar-container {
    height: 100%;  /* Both map and sidebar take full height */
    padding: 0;
    margin: 0;
}

.star-ratings-container-main {
    display: flex;
    width: 70%;
    margin-top: 10px;
    margin-bottom: 0;
    justify-content: space-between; /* Ensures equal spacing */
}

.star-ratings-container-main > div {
    flex: 1;               /* Makes all 5 items equal width */
    text-align: left;      /* Aligns content to the left inside each block */
    padding-right: 10px;   /* Optional: small gap between columns */
}

.michelin-star,
.bib-image,
.green-star {
    height: 20px;
    width: auto;
    vertical-align: middle;
}

.star-description-title {
    font-weight: bold;
    font-size: 12px; /* Adjust as needed */
    margin-top: 2px;
    margin-bottom: 0; /* Remove bottom margin */
}

.star-description-text {
    font-size: 10px; /* Smaller text for description */
    color: var(--color-text-muted); /* Darker grey for the description text */
    margin-top: 0; /* Space after the title */
    margin-bottom: 10px; /* Remove bottom margin */
}

.sidebar-container > * {
    padding: 0;
    margin: 0; /* Remove margins to make sure content does not "spill" out */
}

.description-container,
.instructions-container,
.dropdown-container,
.ratings-container,
.restaurant-details-container{
    padding: 0; /* Remove padding */
    background-color: var(--color-surface);/*#f8f9fa*/;
}

/* -------------------------
   Description and Instructions Styles
   ------------------------- */

.description-container {
    margin-bottom: 10px;
}

.site-description {
    font-size: 25px;
    font-weight: 700;
}

.instructions-container {
    margin-bottom: 10px;
}

.instructions {
    font-size: 16px;
    font-weight: 300;
}

.dropdown-title {
    font-size: 16px;
    font-weight: 700;
}

.dropdown-style {
    margin-bottom: 15px; /* Add some space between dropdowns */
}

.dropdown-container {
    margin-bottom: 0;
}

.hidden-paris-section {
    height: 0;
    overflow: hidden;
    transition: height 0.3s ease-in-out;
}

.visible-paris-section {
    height: auto; /* Allows the content to define the height */
    overflow: visible;
    transition: height 0.3s ease-in-out;
}

/* -------------------------
   Star selection Styles
   ------------------------- */

.star-select-title {
    font-size: 16px;
    font-weight: 700;
}

.star-button {
    /*width: 40px;*/
    padding: 5px;
}

.single-button {
    margin-right: 5px;
}

.star-filter-section > div {
    display: flex;
    justify-content: start;
    align-items: center;
    gap: 10px;  /* Adjust this value to manage the gap between buttons */
    margin-bottom: 10px;
}

.star-filter-buttons > * {
    flex: 1;
    text-align: center;
}

/* Hover effect for star buttons */
.star-button:hover {
    opacity: 0.8 !important;
    cursor: pointer;
}

/* Active state for star buttons */
.star-button.active {
    opacity: 1;
    box-shadow: var(--shadow-active-control);
}

/* Inactive state, specifically less opacity when not active */
.star-button.inactive {
    opacity: 0.5; /* Lower opacity for inactive */
}

.star-button,
.selected-toggle-button {
    height: 36px;
    line-height: 1;
    text-align: center;
    border-radius: 8px;
    font-family: inherit;
    flex: 1;
}

.selected-toggle-wrapper {
    display: flex;
    margin-top: 10px;
    gap: 10px;
}

.selected-toggle-inner {
    flex: 1; /* Same width as a star button */
    display: flex;
    justify-content: flex-start;  /* Align the button to the left */
    margin-right: 5px;
}

.selected-toggle-spacer {
    flex: 1;  /* Spacer takes up 75% of the row */
    margin-right: 5px;
}

.selected-toggle-button {
    background-color: #808080; /* Matches the grey marker */
    color: #FFFFFF;
    font-size: 14px;
    text-align: center;
    border: 1px solid black;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.selected-toggle-button:hover {
    opacity: 0.8 !important;
    cursor: pointer;
}

.selected-toggle-button.active {
    opacity: 1;
    box-shadow: var(--shadow-active-control);
}

/* Inactive state, specifically less opacity when not active */
.selected-toggle-button.inactive {
    opacity: 0.5; /* Lower opacity for inactive */
}

/* -------------------------
   Restaurant Details Styles
   ------------------------- */

.restaurant-details {
    background-color: var(--color-surface);
    padding: 15px;
    border-radius: 8px;
    border: 2px solid var(--color-border-control);  /* Default border color */
}

.placeholder-text {
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #666666;  /* Default border color */
    background-color: #f8f8f8;  /* Very light grey background */
    text-align: center;
}

.restaurant-details-container {
    margin-top: 20px;
}

/* Header section containing the name and stars */
.details-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.restaurant-name {
    font-size: 18px; /* Larger text for the name */
    font-weight: 700; /* Make the name stand out */
    margin-right: 10px; /* Space between name and stars */
}

.restaurant-stars {
    display: flex; /* Align star images in a row */
    flex-wrap: nowrap; /* Prevent stars from wrapping to the next line */
}

/* Styling for the cuisine and price */
.details-cuisine,
.details-price {
    font-size: 12px; /* Slightly larger text for key details */
}

.restaurant-info {
    margin-bottom: 10px;
}

/* Address and location styling */
.address-info {
    font-size: 12px; /* Clear and legible font size */
    margin-bottom: 10px; /* Space above address and location */
}

/* Link styling for the website */
.restaurant-website {
    font-size: 12px;
    display: block; /* Ensures the link is on a new line */
    color: #0056b3; /* Traditional link color */
    text-decoration: none; /* Removes underline */
    font-weight: 500; /* Bold for emphasis */
}

.restaurant-website:hover {
    text-decoration: underline; /* Underline on hover for clarity */
}

.container-style {
    padding: 0; /* If you want to remove padding globally */
}


/* -------------------------
   -------------------------
   Analysis-Style Pages: Shared Shell and Analysis Page
   -------------------------
   ------------------------- */

/* Body: Dynamic height based on remaining space */
.content-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    min-height: calc(100vh - 60px);
    padding-left: 50px;
}

.analysis-container {
    flex-grow: 1;
    overflow-y: visible;
    margin-top: 80px; /* Adjust for header */
}

.editorial-page-frame,
.content-container:has(#analysis-content-top),
.content-container:has(#demographics-content-top),
.content-container:has(#wine-content-top) {
    background-color: var(--analysis-page-gutter-bg);
    box-sizing: border-box;
    padding-left: var(--analysis-page-gutter);
    padding-right: var(--analysis-page-gutter);
}

.editorial-sheet,
.analysis-container:has(#demographics-content-top),
.analysis-container:has(#wine-content-top) {
    background-color: var(--analysis-paper-bg);
    border-left: 1px solid var(--analysis-paper-border);
    border-right: 1px solid var(--analysis-paper-border);
    box-sizing: border-box;
    max-width: var(--analysis-page-max-width);
    padding: 34px var(--analysis-sheet-padding) 44px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.editorial-page-frame .editorial-page-title {
    font-size: 25px;
    line-height: 1.22;
}

#analysis-content-top {
    min-height: 0;
}

.clearfix::after {
    content: "";
    clear: both;
    display: table;
}

.placeholder-text-container {
    padding-top: 20px;
    padding-bottom: 20px;
    font-size: 20px;
}

.three-child, .two-child, .one-child, .bib-child, .green-child {
    width: 20%;
    box-sizing: border-box; /* Ensure padding is included in the width calculation */
}

/* Analysis pilot: editorial data-report rhythm */
#analysis-content-top .region-description,
#analysis-content-top .department-description,
#analysis-content-top .arrondissement-description,
#analysis-content-top .ranking-description {
    max-width: 76ch;
}

#analysis-content-top .region-description,
#analysis-content-top .department-description,
#analysis-content-top .arrondissement-description,
#analysis-content-top .ranking-description {
    color: var(--color-text-muted);
    font-size: 15px;
    line-height: 1.45;
    margin-bottom: 14px;
    padding-top: 0;
}

#analysis-content-top .department-content-wrapper,
#analysis-content-top #arrondissement-content-wrapper.visible-section,
#analysis-content-top .ranking-content-wrapper {
    border-top: 0;
    padding-top: 0;
}

#analysis-content-top .department-content-wrapper::before,
#analysis-content-top #arrondissement-content-wrapper.visible-section::before,
#analysis-content-top .ranking-content-wrapper::before {
    content: "";
    display: block;
    width: 100%;
    border-top: 1px solid var(--color-border-editorial);
    margin-bottom: 28px;
}

#analysis-content-top .region-content-wrapper,
#analysis-content-top .department-content-wrapper,
#analysis-content-top #arrondissement-content-wrapper.visible-section,
#analysis-content-top .ranking-content-wrapper {
    box-sizing: border-box;
    padding-bottom: 38px;
    padding-right: 0;
    width: 100%;
}

#analysis-content-top .region-content-wrapper {
    padding-top: 0;
}

#analysis-content-top .distribution-header,
#analysis-content-top .ranking-header {
    margin-top: 0;
    margin-bottom: 10px;
}

#analysis-content-top .distribution-section-header {
    margin-top: 14px;
    margin-bottom: 8px;
}

#analysis-content-top .region-controls,
#analysis-content-top .department-controls,
#analysis-content-top .arrondissement-controls,
#analysis-content-top .ranking-controls {
    align-items: flex-start;
    margin-top: 10px;
    margin-bottom: 12px;
}

#analysis-content-top .region-filter-title,
#analysis-content-top .ranking-controls h6,
#analysis-content-top .star-select-title-analysis,
#analysis-content-top .star-select-title-department,
#analysis-content-top .star-select-title-arrondissement {
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
}

#analysis-content-top .dropdown-region-analysis .Select-control,
#analysis-content-top .dropdown-department-analysis .Select-control,
#analysis-content-top .dropdown-arrondissement-analysis .Select-control,
#analysis-content-top .dropdown-granularity .Select-control,
#analysis-content-top .dropdown-ranking .Select-control,
#analysis-content-top .dropdown-star-ranking .Select-control {
    border-color: var(--color-border-control) !important;
    background-color: var(--color-surface) !important;
}

#analysis-content-top .dropdown-region-analysis,
#analysis-content-top .dropdown-department-analysis,
#analysis-content-top .dropdown-arrondissement-analysis,
#analysis-content-top .dropdown-granularity,
#analysis-content-top .dropdown-ranking,
#analysis-content-top .dropdown-star-ranking {
    margin-bottom: 8px;
}

#analysis-content-top .ranking-controls {
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 10px 14px;
    justify-content: flex-start;
    margin-top: 8px;
    margin-bottom: 8px;
}

#analysis-content-top .granularity-filter-container,
#analysis-content-top .top-ranking-filter-container,
#analysis-content-top .rating-filter-container {
    flex: 1 1 170px;
    max-width: 240px;
    min-width: 0;
}

#analysis-content-top .toggle-details-container {
    align-items: flex-end;
    align-self: flex-start;
    flex: 0 0 auto;
    justify-content: flex-start;
    margin-top: calc(11px * 1.2 + 5px);
    padding-left: 0;
}

#analysis-content-top .ranking-controls h6 {
    font-size: 11px;
    line-height: 1.2;
    margin: 0 0 5px;
}

#analysis-content-top .ranking-controls .Select-control {
    border-radius: 0 !important;
    font-size: 13px;
    height: 34px;
    min-height: 34px;
}

#analysis-content-top .ranking-controls .Select-placeholder,
#analysis-content-top .ranking-controls .Select-value,
#analysis-content-top .ranking-controls .Select-input {
    height: 32px;
    line-height: 32px;
}

#analysis-content-top .ranking-controls .Select-value-label {
    color: var(--color-text-primary) !important;
    font-size: 13px;
}

#analysis-content-top .dropdown-region-analysis .Select-value {
    background-color: var(--color-surface-control) !important;
    color: var(--color-text-muted) !important;
    border-left: 1px solid var(--color-control-focus-ring) !important;
}

#analysis-content-top .dropdown-region-analysis .Select-value-label {
    color: var(--color-text-muted) !important;
    font-size: 12px;
    font-weight: 400;
}

#analysis-content-top .dropdown-region-analysis .Select-value-icon {
    color: var(--color-text-muted) !important;
    font-size: 12px;
}

#analysis-content-top .region-visuals,
#analysis-content-top .department-visuals,
#analysis-content-top .arrondissement-visuals,
#analysis-content-top .ranking-main-content {
    background: transparent;
    border-top: 0;
    border-radius: 0;
    padding: 8px 0 0;
    box-sizing: border-box;
}

#analysis-content-top .ranking-main-content {
    padding: 8px 0 0;
}

#analysis-content-top .region-graph,
#analysis-content-top .region-map,
#analysis-content-top .department-graph,
#analysis-content-top .department-map,
#analysis-content-top .arrondissement-graph,
#analysis-content-top .arrondissement-map {
    background-color: var(--color-surface);
    border-radius: 0;
    box-sizing: border-box;
}

#analysis-content-top .region-map,
#analysis-content-top .department-map,
#analysis-content-top .arrondissement-map {
    border-left: 1px solid var(--color-border-subtle);
}

#analysis-content-top .star-button-analysis,
#analysis-content-top .star-button-department,
#analysis-content-top .star-button-arrondissement {
    --analysis-filter-accent: var(--rating-three-stars);
    --analysis-icon-filter: var(--rating-three-stars-filter);
    color: var(--color-text-primary) !important;
}

#analysis-content-top .star-button-analysis:has(.bib-image-invert),
#analysis-content-top .star-button-department:has(.bib-image-invert),
#analysis-content-top .star-button-arrondissement:has(.bib-image-invert) {
    --analysis-filter-accent: var(--rating-bib-gourmand);
    --analysis-icon-filter: var(--rating-bib-gourmand-filter);
}

#analysis-content-top .star-button-analysis:has(.michelin-star-invert):not(:has(.michelin-star-invert + .michelin-star-invert)),
#analysis-content-top .star-button-department:has(.michelin-star-invert):not(:has(.michelin-star-invert + .michelin-star-invert)),
#analysis-content-top .star-button-arrondissement:has(.michelin-star-invert):not(:has(.michelin-star-invert + .michelin-star-invert)) {
    --analysis-filter-accent: var(--rating-one-star);
    --analysis-icon-filter: var(--rating-one-star-filter);
}

#analysis-content-top .star-button-analysis:has(.michelin-star-invert + .michelin-star-invert):not(:has(.michelin-star-invert + .michelin-star-invert + .michelin-star-invert)),
#analysis-content-top .star-button-department:has(.michelin-star-invert + .michelin-star-invert):not(:has(.michelin-star-invert + .michelin-star-invert + .michelin-star-invert)),
#analysis-content-top .star-button-arrondissement:has(.michelin-star-invert + .michelin-star-invert):not(:has(.michelin-star-invert + .michelin-star-invert + .michelin-star-invert)) {
    --analysis-filter-accent: var(--rating-two-stars);
    --analysis-icon-filter: var(--rating-two-stars-filter);
}

#analysis-content-top .star-button-analysis:has(.michelin-star-invert + .michelin-star-invert + .michelin-star-invert),
#analysis-content-top .star-button-department:has(.michelin-star-invert + .michelin-star-invert + .michelin-star-invert),
#analysis-content-top .star-button-arrondissement:has(.michelin-star-invert + .michelin-star-invert + .michelin-star-invert) {
    --analysis-filter-accent: var(--rating-three-stars);
    --analysis-icon-filter: var(--rating-three-stars-filter);
}

#analysis-content-top .star-button-analysis .michelin-star-invert,
#analysis-content-top .star-button-department .michelin-star-invert,
#analysis-content-top .star-button-arrondissement .michelin-star-invert,
#analysis-content-top .star-button-analysis .bib-image-invert,
#analysis-content-top .star-button-department .bib-image-invert,
#analysis-content-top .star-button-arrondissement .bib-image-invert {
    filter: var(--analysis-icon-filter) !important;
    flex: 0 0 auto;
}

#analysis-content-top .star-filter-section-analysis .star-button-analysis.active,
#analysis-content-top .star-filter-section-department .star-button-department.active,
#analysis-content-top .star-filter-section-arrondissement .star-button-arrondissement.active {
    background-color: transparent !important;
    border-color: var(--analysis-filter-accent) !important;
    border-bottom: 2px solid var(--analysis-filter-accent) !important;
    box-shadow: none !important;
}

#analysis-content-top .star-filter-section-analysis .star-button-analysis.inactive,
#analysis-content-top .star-filter-section-department .star-button-department.inactive,
#analysis-content-top .star-filter-section-arrondissement .star-button-arrondissement.inactive {
    opacity: 0.62 !important;
}

#analysis-content-top .star-filter-buttons-analysis,
#analysis-content-top .star-filter-buttons-department,
#analysis-content-top .star-filter-buttons-arrondissement {
    gap: 8px;
    margin-bottom: 8px;
}

#analysis-content-top .button-show-details {
    background-color: transparent;
    border: 1px solid var(--color-border-control);
    border-bottom-color: var(--color-border-editorial);
    border-radius: 0;
    box-shadow: none;
    color: var(--color-text-primary);
    font-size: 12px;
    font-weight: 500;
    height: 34px;
    line-height: 1;
    min-height: 34px;
    padding: 0 12px;
}

#analysis-content-top .button-show-details:hover,
#analysis-content-top .button-show-details:focus-visible {
    background-color: var(--color-surface-control) !important;
    border-color: var(--color-border-editorial);
    border-bottom-color: var(--color-brand-red);
    color: var(--color-text-primary) !important;
    box-shadow: none;
}

#analysis-content-top .ranking-output-container {
    width: 100%;
}

#analysis-content-top .ranking-output-container > div:not(.restaurant-cards-container) {
    margin-bottom: 16px !important;
    text-align: left !important;
}

#analysis-content-top .ranking-output-container > div:not(.restaurant-cards-container) > div:first-child {
    font-size: 18px !important;
    line-height: 1.25;
}

#analysis-content-top .ranking-output-container > div:not(.restaurant-cards-container) > div:last-child {
    color: var(--color-text-muted);
    display: block !important;
    font-size: 13px;
    margin-left: 0 !important;
    margin-top: 4px;
}

#analysis-content-top .restaurant-cards-container {
    align-items: stretch !important;
    gap: 12px 16px !important;
    justify-content: flex-start !important;
    margin-bottom: 26px !important;
}

#analysis-content-top .restaurant-details {
    background-color: var(--color-surface);
    border-style: solid;
    border-width: 1px 1px 1px 3px;
    border-radius: 4px;
    flex: 1 1 260px;
    box-shadow: none;
    box-sizing: border-box;
    color: var(--color-text-primary);
    max-width: 340px;
    padding: 12px 14px 14px;
}

#analysis-content-top .restaurant-details .details-header {
    align-items: flex-start;
    gap: 10px;
}

#analysis-content-top .restaurant-details .restaurant-name {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    margin-right: 0;
}

#analysis-content-top .restaurant-details .restaurant-stars {
    flex-shrink: 0;
    margin-top: 2px;
    opacity: 0.74;
}

#analysis-content-top .restaurant-details .restaurant-stars img {
    height: 16px !important;
    width: auto !important;
}

#analysis-content-top .restaurant-details .details-cuisine,
#analysis-content-top .restaurant-details .details-price,
#analysis-content-top .restaurant-details .address-info {
    color: var(--color-text-muted);
    font-size: 12px;
    line-height: 1.4;
}

#analysis-content-top .restaurant-details .restaurant-info,
#analysis-content-top .restaurant-details .address-info {
    margin-bottom: 8px;
}

#analysis-content-top .restaurant-details .restaurant-website {
    color: var(--color-brand-red);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
}

#analysis-content-top .restaurant-details .restaurant-website:hover,
#analysis-content-top .restaurant-details .restaurant-website:focus-visible {
    color: var(--color-brand-red-hover);
    text-decoration: underline;
}

/* -------------------------
   Region Section Styling
   ------------------------- */

/* Wrapper to couple sidebar and content for regions */
.region-content-wrapper {
    /*background-color: #d9edf7; !* Pastel blue *!*/
    display: flex;
    flex-direction: column;  /* Change to column layout to stack the description, controls, and graph */
    width: 100%;
    box-sizing: border-box;
    padding-bottom: 40px; /* Space between region and department sections */
    padding-right: 50px;
}

.distribution-header {
    font-weight: 700;
    margin-top: 30px;
}

.distribution-section-header {
    font-size: 20px;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 10px;
}

/* Region description taking full width */
.region-description {
    /*background-color: #f7cac9; !* Soft pastel coral *!*/
    width: 100%;  /* Take full width */
    font-size: 18px;
    line-height: 1.2;
    margin-bottom: 30px;
}

/* Controls (Dropdown and Star Filter) */
.region-controls {
    display: flex;
    justify-content: space-between;
    width: 100%;  /* Take full width */
    gap: 40px;
}

.region-filter-title {
    font-size: 16px;
    line-height: 1.2;
    margin-bottom: 10px;
}

.region-filter-container {
    /*background-color: #fdf5e6; !* Pastel yellow *!*/
    width: 50%;  /* Take 50% width for the dropdown */
    float: left;
    box-sizing: border-box;
}

.star-filter-container-region {
    /*background-color: #c8e6c9; !* Soft pastel green *!*/
    width: 50%;  /* Take 50% width for the star filter */
    box-sizing: border-box;
}

/* Dropdown styling */
.dropdown-region-analysis {
    margin-bottom: 20px;
    width: 100%;
}

/* Visuals (graph and map) are in a row */
.region-visuals {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    height: 100%; /* Stretch to fill the height */
}

.region-graph, .region-map {
    width: 50%;
    height: 100%;
    display: inline-block;
    overflow: hidden; /* Prevents overflow */
}

/* -------------------------
   Analysis-Style Dropdown Controls
   ------------------------- */

/* Shared multi-select chip treatment for Analysis and Economics region filters */
.dropdown-region-analysis .Select-value,
.dropdown-category-demographics .Select-value {
    background-color: var(--color-control-selected-bg) !important;
    color: var(--color-brand-red) !important;  /* Bold red text */
    border-radius: 5px;
    border: none !important; /* Remove blue border */
}

/* Target the label inside each selected value to ensure bold red text */
.dropdown-region-analysis .Select-value-label,
.dropdown-category-demographics .Select-value-label {
    font-size: 14px;
    color: var(--color-brand-red) !important; /* Bold red text */
    box-shadow: none !important; /* Remove blue shadow */
}

/* Dropdown styling for region multi-select controls */
.dropdown-region-analysis .Select-control,
.dropdown-category-demographics .Select-control {
    font-size: 14px; /* Adjust font size of labels */
}

/* Customize the "x" button on hover */
.dropdown-region-analysis .Select-value-icon:hover,
.dropdown-category-demographics .Select-value-icon:hover {
    color: var(--color-brand-red) !important; /* Red color for the "x" icon on hover */
}

/* Ensure the "x" stays black when not hovered */
.dropdown-region-analysis .Select-value-icon,
.dropdown-category-demographics .Select-value-icon {
    color: var(--color-text-primary) !important; /* Black color for the "x" by default */
}

/* Replace the default blue focus affordance with the shared Michelin control ring */
.dropdown-region-analysis .Select-value:focus-visible,
.dropdown-region-analysis .Select-value-icon:focus-visible,
.dropdown-category-demographics .Select-value:focus-visible,
.dropdown-category-demographics .Select-value-icon:focus-visible {
    outline: 1px solid var(--color-control-focus-ring) !important;
    outline-offset: 1px;
}

.analysis-container .Select-control:focus-within {
    border-color: var(--color-border-editorial) !important;
    box-shadow: none !important;
}

.analysis-container .Select-control:has(:focus-visible) {
    border-color: var(--color-brand-red) !important;
    box-shadow: 0 0 0 1px var(--color-control-focus-ring) !important;
}

/* Dropdown menu states shared by Analysis, Economics, and Wine controls */
.analysis-container .Select-option:hover,
.analysis-container .Select-option.is-focused,
.analysis-container .VirtualizedSelectFocusedOption {
    background-color: var(--color-control-selected-bg) !important;
    color: var(--color-brand-red-hover) !important;
}

.analysis-container .Select-option.is-selected,
.analysis-container .VirtualizedSelectSelectedOption {
    background-color: var(--color-control-selected-bg-strong) !important;
    color: var(--color-brand-red) !important;
}

/* -------------------------
   Department Section Styling
   ------------------------- */

/* Wrapper to couple sidebar and content for departments */
.department-content-wrapper {
    /*background-color: #d9f7be; !* Soft pastel green *!*/
    /*border-top: 1px solid black;*/
    display: flex;
    flex-direction: column;  /* Change to column layout to stack the description, controls, and graph */
    width: 100%;
    box-sizing: border-box;
    padding-bottom: 40px; /* Space between department and other sections */
    padding-right: 50px;
}

/* Department description taking full width */
.department-description {
    /*background-color: #ffe4e1; !* Light pastel coral *!*/
    width: 100%;  /* Take full width */
    font-size: 18px;
    line-height: 1.2;
    margin-bottom: 30px;
}

/* Controls (Dropdown and Star Filter) */
.department-controls {
    display: flex;
    justify-content: space-between;
    width: 100%;  /* Take full width */
    gap: 40px;
}

.region-filter-title {
    font-size: 16px;
    line-height: 1.2;
    margin-bottom: 10px;
}

.department-filter-container {
    /*background-color: #fdf5e6; !* Pastel yellow *!*/
    flex: 1;  /* Each child takes up equal space (50% each) */
    box-sizing: border-box;
    max-width: calc(50% - 20px);
}

.star-filter-container-department {
    /*background-color: #c8e6c9; !* Soft pastel green *!*/
    flex: 1;  /* Each child takes up equal space (50% each) */
    display: flex;
    justify-content: flex-end;  /* Align star filter to the right */
    box-sizing: border-box;
}

/* Dropdown styling */
.dropdown-department-analysis {
    margin-bottom: 20px;
    width: 60%;
}

.star-filter-section-department {
    width: 100%; /* Star filter takes full width of its parent */
}

/* Visuals (graph and map) are in a row */
.department-visuals {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    height: 100%; /* Stretch to fill the height */
}

.department-graph, .department-map {
    height: 100%; /* Match the height of visuals container */
    width: 50%;
    display: inline-block;
    overflow: hidden;
}

/* -------------------------
   Arrondissement Section Styling
   ------------------------- */

/* Wrapper to couple sidebar and content for arrondissements */

.hidden-section {
    height: 0;
    overflow: hidden;
    transition: height 0.3s ease-in-out;
}

/* Visible Section - Dynamic Height */
.visible-section {
    /*background-color: #d9edf7; !* Pastel blue *!*/
    /*border-top: 1px solid black;*/
    display: flex;
    flex-direction: column;  /* Ensure elements are stacked vertically */
    transition: height 0.3s ease-in-out;
    height: auto; /* Dynamic height based on content */
    padding-bottom: 40px; /* Space between arrondissement and other sections */
    padding-right: 50px;
}

/* Wrapper for arrondissement content */
.arrondissement-content-wrapper {
    display: flex;
    flex-direction: column;  /* Stacks the description, controls, and main content */
    width: 100%;
    box-sizing: border-box;
    padding-right: 50px;
}

/* Arrondissement description taking full width */
.arrondissement-description {
    /*background-color: #ffebee; !* Light pastel coral *!*/
    width: 100%;  /* Take full width */
    font-size: 18px;
    line-height: 1.2;
    margin-bottom: 30px;
}

/* Controls (Dropdown and Star Filter) */
.arrondissement-controls {
    display: flex;
    justify-content: space-between;
    width: 100%;  /* Full width */
    gap: 40px;  /* Space between the dropdown and star filter */
}

/* Dropdown and filter container styles */
.arrondissement-filter-container {
    /*background-color: #fdf5e6; !* Pastel yellow *!*/
    flex: 1;  /* Each child (dropdown and star filter) takes up equal space */
    box-sizing: border-box;
    max-width: calc(50% - 20px);  /* 50% minus half of the gap */
}

.star-filter-container-arrondissement {
    /*background-color: #c8e6c9; !* Soft pastel green *!*/
    flex: 1;  /* Equal space as dropdown */
    display: flex;
    justify-content: flex-end;  /* Align star filter to the right */
    box-sizing: border-box;
}

/* Dropdown styling */
.dropdown-arrondissement-analysis {
    margin-bottom: 20px;
    width: 60%;  /* The dropdown itself takes 60% of its parent (which is 50% of the total width) */
}

.star-filter-section-arrondissement {
    width: 100%; /* Star filter takes full width of its parent */
}

/* Visuals (graph and map) are in a row */
.arrondissement-visuals {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    height: 100%; /* Stretch to fill the height */
}

.arrondissement-graph, .arrondissement-map {
    height: 100%;
    width: 50%;  /* Each takes 50% width */
    display: inline-block;
    overflow: hidden;
}


/* -------------------------
   Analysis Page Star Button Styles
   ------------------------- */

.star-button-analysis, .star-button-department, .star-button-arrondissement,
.star-button-cuisine, .star-button-demographics, .star-button-wine {
    width: 40px;
    padding: 5px;
}

.star-filter-buttons-analysis, .star-filter-buttons-department, .star-filter-buttons-arrondissement,
.star-filter-buttons-cuisine, .star-filter-buttons-demographics, .star-filter-buttons-wine {
    display: flex;
    justify-content: start;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.star-button-analysis:hover, .star-button-department:hover, .star-button-arrondissement:hover,
.star-button-cuisine:hover, .star-button-demographics:hover, .star-button-wine:hover  {
    opacity: 0.8 !important;
    cursor: pointer;
}

.star-button-analysis:focus-visible, .star-button-department:focus-visible, .star-button-arrondissement:focus-visible,
.star-button-cuisine:focus-visible, .star-button-demographics:focus-visible, .star-button-wine:focus-visible  {
    outline: 1px solid var(--color-control-focus-ring);
    outline-offset: 2px;
}

.star-filter-section-analysis .star-button-analysis.active,
.star-filter-section-department .star-button-department.active,
.star-filter-section-arrondissement .star-button-arrondissement.active,
.star-filter-section-cuisine .star-button-cuisine.active,
.star-filter-section-demographics .star-button-demographics.active,
.star-filter-section-wine .star-button-wine.active {
    opacity: 1;
    box-shadow: var(--shadow-active-control);
}

.star-filter-section-analysis .star-button-analysis.inactive,
.star-filter-section-department .star-button-department.inactive,
.star-filter-section-arrondissement .star-button-arrondissement.inactive,
.star-filter-section-cuisine .star-button-cuisine.inactive,
.star-filter-section-demographics .star-button-demographics.inactive,
.star-filter-section-wine .star-button-wine.inactive{
    opacity: 0.5;
}

.editorial-rating-button {
    align-items: center;
    background-color: transparent !important;
    border: 1px solid var(--color-border-control) !important;
    border-bottom-color: var(--color-border-editorial) !important;
    box-shadow: none !important;
    box-sizing: border-box;
    display: inline-flex !important;
    flex: 0 0 auto;
    height: 30px;
    justify-content: center;
    min-height: 30px;
    opacity: 1 !important;
    padding: 3px 5px;
    white-space: nowrap;
    width: 68px !important;
}

/* -------------------------
   Top Ranking Section Styling
   ------------------------- */

/* Wrapper for the entire top ranking section */
.ranking-content-wrapper {
    /*background-color: #d9f7be; !* Soft pastel green *!*/
    border-top: 1px solid black;
    display: flex;
    flex-direction: column;  /* Stack description, controls, and content */
    width: calc(100% - 50px);
    box-sizing: border-box;
    padding-right: 50px;
}

/* Apply margin to all stars */
.star-group .michelin-star-header {
    margin-right: 3px;
    width: 25px;
    height: auto;
    vertical-align: middle;
}

/* Remove margin from the last star in each group */
.star-group .michelin-star-header:last-of-type {
    margin-right: 0;
}

.ranking-header {
    font-size: 25px;
    font-weight: 700;
    margin-top: 40px;
}

/* Description section */
.ranking-description {
    /*background-color: #ffebee;  !* Light pastel coral *!*/
    font-size: 18px;
    line-height: 1.2;
    margin-bottom: 30px;
    padding-top: 30px;
    width: 100%;  /* Take full width */
}

/* Controls (Dropdown and Star Filter) */
.ranking-controls {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

/* Container for dropdowns (taking 75% width) */
.dropdowns-container {
    flex-grow: 3;  /* Take 75% of the width */
    display: flex;
    justify-content: space-between;
    gap: 20px;  /* Space between the dropdowns */
}

/* Granularity dropdown container */
.granularity-filter-container, .top-ranking-filter-container, .rating-filter-container {
    /*background-color: #fdf5e6;  !* Pastel yellow *!*/
    flex: 1;
    box-sizing: border-box;
}

/* Dropdown styling for the filters */
.dropdown-granularity, .dropdown-ranking, .dropdown-star-ranking {
    width: 100%;
    margin-bottom: 10px;
}

/* Button container for showing restaurant details (taking 25% width) */
.toggle-details-container {
    flex-grow: 1; /* Take 75% of the width */
    display: flex;
    justify-content: flex-start; /* Center horizontally */
    align-items: center; /* Center vertically */
    padding-left: 20px;
}

/* Main content section for top rankings */
.ranking-main-content {
    /*background-color: #fdf5e6;  !* Light pastel yellow for content area *!*/
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 40px;
    box-sizing: border-box;
}

/* Button for 'Show Restaurant Details' */
.button-show-details {
    padding: 10px 20px;
    background-color: var(--color-brand-red);
    border-radius: 5px;
    border: none;
    cursor: pointer;
    color: white;
}

/* Button hover and active states */
.button-show-details:hover,
.button-show-details:focus-visible {
    background-color: var(--color-brand-red-hover);
    color: white;
}

.button-show-details:focus-visible {
    outline: 1px solid var(--color-control-focus-ring);
    outline-offset: 2px;
}

/* -------------------------
   Economics Page: Demographics Section Styling
   ------------------------- */

/* Wrapper to couple the main content and filter for demographics */
.demographics-container {
    /*background-color: #e2f0f9; !* Light pastel blue *!*/
    box-sizing: border-box;
    width: 100%;
    gap: 0;
    padding-right: 0;
}

.demographics-text-container {
    /*background-color: #f5f5f5; !* Light grey for neutrality *!*/
    border-top: 0;
    padding-bottom: 16px;
    width: 100%;
}

.demographics-header {
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 10px;
}

.demographics-text-paragraph {
    color: var(--color-text-muted);
    font-size: 15px;
    line-height: 1.45;
    margin-bottom: 0;
    max-width: 76ch;
}

.demographics-text-paragraph a {
    color: var(--color-brand-red);
    font-weight: 500;
    text-decoration: none;
}

.demographics-text-paragraph a:hover,
.demographics-text-paragraph a:focus-visible {
    text-decoration: underline;
}

.demographics-filter-container {
    /*background-color: #d9edf7;*/
    align-items: flex-end;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    width: 100%;
    gap: 10px 14px;
    margin-bottom: 10px;
}

/* Dropdown containers for demographics section */
.demographics-dropdown-container {
    /*background-color: #fdf5e6; !* Light grey background *!*/
    flex: 1 1 190px;
    max-width: 280px;
    min-width: 0;
    width: auto;
}

.filter-container {
    /*background-color: #fdf5e6; !* Light grey background *!*/
    flex: 2 1 340px;
    min-width: 260px;
    width: auto;
}

.demographics-dropdown-container h6,
#demographics-add-remove .region-filter-title,
.star-select-title-demographics {
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 5px;
}

#demographics-content-top .dropdown-category-demographics-selector .Select-control,
#demographics-content-top .dropdown-granularity-demographics .Select-control,
#demographics-content-top .dropdown-category-demographics .Select-control {
    background-color: var(--color-surface) !important;
    border-color: var(--color-border-control) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-size: 13px;
    min-height: 34px;
}

#demographics-content-top .dropdown-category-demographics-selector .Select-placeholder,
#demographics-content-top .dropdown-category-demographics-selector .Select-value,
#demographics-content-top .dropdown-category-demographics-selector .Select-input,
#demographics-content-top .dropdown-granularity-demographics .Select-placeholder,
#demographics-content-top .dropdown-granularity-demographics .Select-value,
#demographics-content-top .dropdown-granularity-demographics .Select-input,
#demographics-content-top .dropdown-category-demographics .Select-placeholder,
#demographics-content-top .dropdown-category-demographics .Select-input {
    min-height: 32px;
    line-height: 32px;
}

#demographics-content-top .dropdown-category-demographics-selector .Select-value-label,
#demographics-content-top .dropdown-granularity-demographics .Select-value-label {
    color: var(--color-text-primary) !important;
    font-size: 13px;
}

#demographics-content-top .dropdown-category-demographics .Select-value {
    background-color: var(--color-surface-control) !important;
    border-left: 1px solid var(--color-control-focus-ring) !important;
    border-radius: 0 !important;
    color: var(--color-text-muted) !important;
}

#demographics-content-top .dropdown-category-demographics .Select-value-label {
    color: var(--color-text-muted) !important;
    font-size: 12px;
    font-weight: 400;
}

#demographics-content-top .dropdown-category-demographics .Select-value-icon {
    color: var(--color-text-muted) !important;
    font-size: 12px;
}

#demographics-content-top .dropdown-category-demographics .Select-value-icon:hover {
    color: #23485A !important;
}

#demographics-content-top .Select-control:has(:focus-visible) {
    border-color: #23485A !important;
    box-shadow: 0 0 0 1px rgba(35, 72, 90, 0.22) !important;
}

#demographics-content-top .Select-option:hover,
#demographics-content-top .Select-option.is-focused,
#demographics-content-top .VirtualizedSelectFocusedOption {
    background-color: #EDF2F5 !important;
    color: #23485A !important;
}

#demographics-content-top .Select-option.is-selected,
#demographics-content-top .VirtualizedSelectSelectedOption {
    background-color: #C7D6DE !important;
    color: #173543 !important;
}

#demographics-add-remove {
    min-height: 60px; /* Set a reasonable minimum height */
    max-height: 150px; /* Allow the height to adjust up to 150px depending on the content */
}

.demographics-restaurants-controls {
    align-items: flex-end;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-bottom: 12px;
    margin-top: 8px;
    padding: 0 !important;
}

.toggle-details-container-demographics {
    margin-top: 0;
    margin-bottom: 0;
}

.toggle-details-container-demographics::before {
    content: "";
    display: block;
    height: calc(11px * 1.2 + 5px);
}

#demographics-content-top .button-show-details {
    background-color: transparent;
    border: 1px solid var(--color-border-control);
    border-bottom-color: var(--color-border-editorial);
    border-radius: 0;
    box-shadow: none;
    color: var(--color-text-primary);
    font-size: 12px;
    font-weight: 500;
    height: 34px;
    line-height: 1;
    min-height: 34px;
    padding: 0 12px;
}

#demographics-content-top .button-show-details:hover,
#demographics-content-top .button-show-details:focus-visible {
    background-color: var(--color-surface-control) !important;
    border-color: var(--color-border-editorial);
    border-bottom-color: var(--color-brand-red);
    box-shadow: none;
    color: var(--color-text-primary) !important;
}

#demographics-content-top .star-filter-container {
    min-width: 240px;
    width: auto !important;
}

#demographics-content-top .star-filter-buttons-demographics {
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 0;
}

#demographics-content-top .star-button-demographics {
    --economics-filter-accent: var(--rating-three-stars);
    --economics-icon-filter: var(--rating-three-stars-filter);
    color: var(--color-text-primary) !important;
}

#demographics-content-top .star-button-demographics:has(.michelin-star-invert):not(:has(.michelin-star-invert + .michelin-star-invert)) {
    --economics-filter-accent: var(--rating-one-star);
    --economics-icon-filter: var(--rating-one-star-filter);
}

#demographics-content-top .star-button-demographics:has(.michelin-star-invert + .michelin-star-invert):not(:has(.michelin-star-invert + .michelin-star-invert + .michelin-star-invert)) {
    --economics-filter-accent: var(--rating-two-stars);
    --economics-icon-filter: var(--rating-two-stars-filter);
}

#demographics-content-top .star-button-demographics:has(.michelin-star-invert + .michelin-star-invert + .michelin-star-invert) {
    --economics-filter-accent: var(--rating-three-stars);
    --economics-icon-filter: var(--rating-three-stars-filter);
}

#demographics-content-top .star-button-demographics .michelin-star-invert {
    filter: var(--economics-icon-filter) !important;
    flex: 0 0 auto;
}

#demographics-content-top .star-filter-section-demographics .star-button-demographics.active {
    background-color: transparent !important;
    border-color: var(--economics-filter-accent) !important;
    border-bottom: 2px solid var(--economics-filter-accent) !important;
    box-shadow: none !important;
}

#demographics-content-top .star-filter-section-demographics .star-button-demographics.inactive {
    opacity: 0.62 !important;
}

/* Demographics content wrapper */
.demographics-content-wrapper {
    /*background-color: #d9edf7; !* Light pastel blue for the wrapper *!*/
    display: flex;
    gap: 20px;
    justify-content: space-between;
    width: 100%;
    height: auto;
    margin-top: 8px;
}

/* Demographics map styling */
.demographics-map {
    /*background-color: #cce5ff; !* Light pastel blue *!*/
    box-sizing: border-box;
    flex: 1 1 0;
    height: auto;
    width: 50%;
    display: inline-block;
    min-width: 0;
}

.demographics-chart-mean {
    box-sizing: border-box;
    flex: 1 1 0;
    height: auto;
    width: 50%;
    display: inline-block;
    min-width: 0;
}

/* Demographics bar chart styling */
.demographics-bar-chart {
    /*background-color: #fdf5e6; !* Light pastel yellow *!*/
    height: auto;
    width: 100%;
    display: inline-block;
    margin: 0;  /* Ensure no margin */
    padding: 0; /* Ensure no padding */
}

.weighted-mean-explanation {
    color: var(--color-text-muted);
    font-size: 12px;
    line-height: 1.45;
    max-width: 64ch;
    padding: 6px 0 0;
    text-align: left;
    /*border: 1px solid #007bff;*/
    height: auto;  /* Remove the fixed height to allow dynamic adjustment */
    margin-top: 0;  /* Ensure no extra margin */
    margin-bottom: 0;
}

.weighted-mean-explanation .dash-markdown {
    margin: 0;  /* Remove any margin from the Markdown element */
    padding: 0;  /* Remove any padding from the Markdown element */
}

/* -------------------------
   Wine Section Styling
   ------------------------- */

.wine-container {
    padding-right: 0;
}


.wine-text-container {
    border-top: 0;
    padding-bottom: 12px;
    width: 100%;
}

.wine-header {
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 10px;
}

.wine-text-paragraph {
    color: var(--color-text-muted);
    font-size: 15px;
    line-height: 1.45;
    margin-bottom: 10px;
    max-width: 72ch;
}

.wine-tagline-paragraph {
    font-size: 16px;
    font-style: italic;
    text-align: center;
    line-height: 1.2;
}


.wine-restaurants-wrapper {
    /*background-color: #fdf5e6; !* Light grey background *!*/
}

.wine-restaurants-controls {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 10px 14px;
    padding: 0 !important;
    margin-bottom: 16px;
}

.wine-map-outlines {
    /*background-color: #d9edf7; !* Light pastel blue for the wrapper *!*/
    flex: 0 1 220px;
    margin-bottom: 0;
    min-width: 0;
    width: 220px !important;
}

.wine-map-outlines h6,
.wine-container .star-select-title-wine {
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
    margin: 0 0 6px;
}

.wine-container .button-show-details {
    background-color: transparent;
    border: 1px solid var(--color-border-control);
    border-bottom-color: var(--color-border-editorial);
    border-radius: 0;
    box-shadow: none;
    color: var(--color-text-primary);
    font-size: 12px;
    font-weight: 500;
    height: 34px;
    line-height: 1;
    min-height: 34px;
    padding: 0 12px;
}

.wine-container .button-show-details:hover,
.wine-container .button-show-details:focus-visible {
    background-color: var(--color-surface-control) !important;
    border-color: var(--color-border-editorial);
    border-bottom-color: var(--color-brand-red);
    color: var(--color-text-primary) !important;
    box-shadow: none;
}

.wine-container .dropdown-granularity-wine .Select-control {
    border-color: var(--color-border-control) !important;
    background-color: var(--color-surface) !important;
    border-radius: 0 !important;
    font-size: 13px;
    height: 34px;
    min-height: 34px;
}

.wine-container .dropdown-granularity-wine .Select-placeholder,
.wine-container .dropdown-granularity-wine .Select-value,
.wine-container .dropdown-granularity-wine .Select-input {
    height: 32px;
    line-height: 32px;
}

#star-filter-container-wine {
    flex: 0 0 auto;
    min-width: 0;
    width: auto !important;
}

.wine-container .star-filter-buttons-wine {
    gap: 8px;
    margin-bottom: 0;
    flex-wrap: nowrap;
}

.wine-container .star-button-wine {
    --wine-filter-accent: var(--rating-three-stars);
    --wine-icon-filter: var(--rating-three-stars-filter);
}

.wine-container .star-button-wine:has(.bib-image-invert) {
    --wine-filter-accent: var(--rating-bib-gourmand);
    --wine-icon-filter: var(--rating-bib-gourmand-filter);
}

.wine-container .star-button-wine:has(.michelin-star-invert):not(:has(.michelin-star-invert + .michelin-star-invert)) {
    --wine-filter-accent: var(--rating-one-star);
    --wine-icon-filter: var(--rating-one-star-filter);
}

.wine-container .star-button-wine:has(.michelin-star-invert + .michelin-star-invert):not(:has(.michelin-star-invert + .michelin-star-invert + .michelin-star-invert)) {
    --wine-filter-accent: var(--rating-two-stars);
    --wine-icon-filter: var(--rating-two-stars-filter);
}

.wine-container .star-button-wine:has(.michelin-star-invert + .michelin-star-invert + .michelin-star-invert) {
    --wine-filter-accent: var(--rating-three-stars);
    --wine-icon-filter: var(--rating-three-stars-filter);
}

.wine-container .star-button-wine .michelin-star-invert,
.wine-container .star-button-wine .bib-image-invert {
    filter: var(--wine-icon-filter) !important;
    flex: 0 0 auto;
}

.wine-container .star-filter-section-wine .star-button-wine.active {
    background-color: transparent !important;
    border-color: var(--wine-filter-accent) !important;
    border-bottom: 2px solid var(--wine-filter-accent) !important;
    box-shadow: none !important;
}

.wine-container .star-filter-section-wine .star-button-wine.inactive {
    opacity: 0.62 !important;
}

/* Wine content wrapper */
.wine-content-wrapper {
    display: flex;
    align-items: stretch;
    gap: 34px;
    justify-content: flex-start;
    width: 100%;
    height: auto;
    margin-bottom: 34px;
    /*background-color: #d9edf7; !* Light pastel blue for the wrapper *!*/
}

.wine-map {
    display: block !important;
    flex: 1 1 70%;
    min-width: 0;
    width: 70% !important;
}

#wine-map-graph {
    height: 760px !important;
    min-height: 640px;
    width: 100%;
}

/* Wine LLM Output Wrapper */
.wine-llm-output {
    border-left: 1px solid var(--color-border-subtle);
    display: flex !important;
    flex-direction: column;
    flex: 0 1 30%;
    height: 100%;
    justify-content: flex-start;  /* Ensure content starts from the top */
    max-width: 380px;
    min-width: 280px;
    padding-left: 28px;
    box-sizing: border-box;
    width: 30% !important;
}

.wine-llm-text {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.wine-title {
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
    margin: 0 0 10px;
}

.region-name-placeholder {
    font-size: 18px;
}

.region-name-placeholder h3 {
    font-size: 22px;
    line-height: 1.25;
    margin: 0 0 12px;
}

.LLM-output {
    color: var(--color-text-primary);
    flex-grow: 0;
    line-height: 1.5;
    margin-top: 10px;
    font-size: 14px;
    overflow-y: visible;
}

.LLM-output p {
    margin-bottom: 10px;
}

/* Disclaimer container layout */
#disclaimer-container {
    border-top: 1px solid var(--color-border-control);
    background-color: transparent;
    margin-top: 16px;
    padding-top: 10px;
    padding-bottom: 0;
    padding-left: 0;
    width: 100%;
    text-align: left;
    bottom: 0;
    box-sizing: border-box;
}

/* Align the image and text side by side */
.disclaimer-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    max-width: 100%; /* Prevent overflow of the parent */
    overflow: hidden; /* Hide any potential overflow */
}

/* Styling for OpenAI logo */
.openai-logo {
    opacity: 0.72;
    width: 64px;  /* Adjust size of the logo */
    margin-right: 10px;  /* Add space between the logo and text */
}

/* Styling for disclaimer text */
.disclaimer-text-wrapper {
    text-align: left;  /* Align text to the left */
    flex-grow: 1;  /* Allow the text to take remaining space */
}

.disclaimer-text-ai {
    font-size: 10px;
    color: #666;  /* Grey text color for the disclaimer */
    margin-top: 0 !important;
    margin-bottom: 0;
}

@media screen and (max-width: 1050px) {
    .wine-content-wrapper {
        flex-direction: column;
        gap: 18px;
    }

    .wine-map,
    .wine-llm-output {
        max-width: none;
        min-width: 0;
        width: 100% !important;
    }

    .wine-llm-output {
        border-left: 0;
        border-top: 1px solid var(--color-border-subtle);
        padding-left: 0;
        padding-top: 16px;
    }

    #wine-map-graph {
        height: 620px !important;
        min-height: 520px;
    }
}

@media screen and (max-width: 600px) {
    .analysis-container:has(#wine-content-top) {
        margin-top: clamp(148px, calc(268px - 20vw), 190px);
        padding: 24px var(--analysis-sheet-padding) 32px;
    }

    .wine-restaurants-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .wine-map-outlines,
    #star-filter-container-wine {
        width: 100% !important;
    }

    #wine-map-graph {
        height: 500px !important;
        min-height: 420px;
    }
}


/* -------------------------
   Responsive Styles
   ------------------------- */

@media screen and (max-width: 1400px) {
    /* Adjust title font size in the header */
    .header {
        height: 70px;
    }

    .title-section {
        font-size: 52px;
    }

    .nav-dropdown {
        top: 70px;           /* Same header height in this breakpoint */
    }

    .body {
        padding-top: 80px;
    }

    .analysis-container {
        margin-top: 60px; /* Adjust for header */
    }

    .description-container {
        margin-bottom: 10px;
    }

    /* Adjust site description font size */
    .site-description {
        font-size: 20px;
    }

    .restaurant-name {
        font-size: 16px;
    }
}

/* Editorial responsive primitives: first shared layer for Analysis, Economics,
   and Wine. Page-specific fallbacks remain below while this layer settles. */
@media screen and (max-width: 1366px) {
    :root {
        --analysis-page-padding: 42px;
        --analysis-page-gutter: 22px;
    }
}


/* Media Query for screens smaller than 1250px (Tablet Layout) */
@media screen and (max-width: 1250px) {
    :root {
        --analysis-page-padding: 30px;
        --analysis-page-gutter: 16px;
    }

    /* Global layout changes */
    .main-content {
        margin-left: 30px;
        margin-right: 30px;
    }

    .header {
        margin-right: 30px;
    }

    .title-section {
        font-size: 44px;
        margin-left: 30px;
    }

    /* Hamburger styles */
    .hamburger-menu {
        margin-right: 30px;
    }

    .nav-dropdown {
        right: 0;
        margin-right: 30px;  /* Aligns with hamburger's new position */
        top: 70px;           /* Same header height in this breakpoint */
    }

    .info-container {
        /*background-color: lightblue; !* Debug color for the content container *!*/
        padding-left: 30px;
        padding-right: 30px;
    }

    /* Main layout changes */
    .main-layout {
        display: flex;
        flex-direction: column;
        min-height: 100vh;  /* Ensure the full height of the viewport is used */
    }

    .main-content {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        height: calc(100vh - 140px);  /* Adjusting height for header and footer */
        /*overflow: auto;  !* Enable scrolling if necessary *!*/
    }

    /* Sidebar now comes above the map */
    .map-sidebar-container {
        display: flex;
        flex-direction: column;  /* Stack sidebar above the map */
    }

    /* Move the sidebar content above the map */
    .sidebar-container {
        /*background-color: lightgreen; !* Debug color *!*/
        width: 100%;  /* Take full width */
        order: 1;  /* Move sidebar to appear first */
        height: auto;
        flex-shrink: 0;
        box-sizing: border-box;
    }

    /* Map section moves below the sidebar */
    .map-section {
        /*background-color: lightblue;*/
        flex-grow: 1;
        width: 100%;  /* Map takes full width on tablet layout */
        padding-right: 0;  /* Remove padding */
        order: 2;  /* Move map below the sidebar */
        z-index: 0;
        position: relative;
    }

    /* Ensure map display takes full width and height */
    .map-display {
        flex-grow: 1;
        width: 100%;
        height: 100%;
    }

    /* Full-width description and instructions at the top of main content */
    .description-container {
        /*background-color: cadetblue;  !* Optional background color *!*/
        width: 100%;  /* Take full width */
        padding: 0;
        margin-bottom: 5px;
    }

    .instructions-container {
        /*background-color: cadetblue;  !* Optional background color *!*/
        margin-bottom: 10px;
    }

    .site-description, .instructions {
        padding: 0;
        margin: 0;  /* Ensure no bottom margin on the description text */
    }

    /* Adjust the city match section to take full width below the description and instructions */
    .city-match-content-wrapper-mainpage {
        display: none;
    }

    .city-match-sidebar-mainpage {
        width: 40%;  /* Take full width on tablet */
        float: left;  /* Disable float */
    }

    .city-match-main-content-mainpage {
        width: 60%;  /* Take full width on tablet */
        float: right;  /* Disable float */
    }

    /* Container for dropdowns to display them side by side */
    .dropdowns-container-main {
        display: flex;  /* Enable flexbox for side-by-side layout */
        gap: 20px;  /* Adjust gap between each dropdown block */
        flex-wrap: wrap;  /* Ensure dropdowns wrap on smaller screens */
        overflow: visible;
        position: relative;  /* Ensure containers are positioned relative to allow absolute positioning inside */
        z-index: 1;
    }

    /* Each dropdown block (label + dropdown) */
    .dropdown-block {
        flex-grow: 1;  /* Allow blocks to grow equally */
        min-width: 200px;  /* Ensure dropdown blocks have a minimum width */
        max-width: 33%;
        z-index: 1000;
    }

    .visible-paris-section {
        flex-grow: 2;
        min-width: 200px;  /* Ensure dropdown blocks have a minimum width */
        max-width: 33%;
    }

    /* Adjustments for dropdown styling */
    .dropdown-style {
        width: 100%;             /* Ensure the dropdown takes full width of its container */
        position: relative;
        z-index: 1000;
    }

    /* When the dropdown is expanded, make sure it floats above the rest */
    .dropdown-style .dropdown-menu {
        position: absolute;  /* Float the expanded dropdown menu */
        top: 100%;  /* Ensure it appears just below the dropdown button */
        left: 0;
        z-index: 2000;  /* Ensure it's above everything else */
        width: 100%;  /* Expand to the full width of the dropdown */
    }

    /* Flexbox container for star ratings and restaurant details */
    .star-ratings-and-details-container {
        flex-grow: 0;
        display: flex;
        flex-direction: row;  /* Place items in a row (side by side) */
        gap: 20px;            /* Adjust gap between the star ratings and restaurant details */
        margin-bottom: 0;
    }

    /* Star ratings section takes up 50% of the width */
    .star-filter-section {
        flex-grow: 1;         /* Allow the section to grow and take available space */
        max-width: 50%;       /* Set a maximum width for this section */
        box-sizing: border-box;
        margin-bottom: 0;
    }

    /* Restaurant details section takes up the other 50% of the width */
    .restaurant-details-container {
        /*background-color: lightcoral;*/
        flex-grow: 1; /* This ensures it takes up available space */
        max-width: 50%; /* Restrict the maximum width to 50% */
        min-width: 50%; /* Ensure it does not shrink below 50% */
        height: auto;
        margin-top: 0;
        margin-bottom: 10px;
    }

    /* Star Ratings Section takes full width below the map */
    .star-ratings-container-main {
        width: 100%;  /* Full width on tablet */
        display: flex;
        justify-content: space-around;  /* Evenly distribute star rating sections */
        margin-top: 10px;
    }

    /* Analysis layout changes */
    .analysis-container {
        margin-top: 60px; /* Adjust for header */
    }

    .content-container {
        padding-left: 30px;
    }

    .region-content-wrapper {
        padding-right: 30px;
    }

    .region-description {
        font-size: 15px;
    }

    .department-content-wrapper {
        padding-right: 30px;
    }

    .department-description {
        font-size: 15px;
    }

    .visible-section {
        padding-right: 30px;
    }

    .arrondissement-description {
        font-size: 15px;
    }

    .ranking-content-wrapper {
        width: calc(100% - 30px);
        padding-right: 30px;
    }

    .ranking-description {
        font-size: 15px;
    }

    .demographics-container {
        padding-right: 30px;
    }

    .demographics-text-paragraph {
        font-size: 15px;
    }

    .wine-container {
        padding-right: 30px;
    }

    .wine-text-paragraph {
        font-size: 15px;
    }
}

/* Shared editorial responsive layer. These rules target the additive hooks used
   by Analysis, Economics, and Wine; page-scoped media queries below keep any
   remaining one-off behavior intact for this first consolidation pass. */
@media screen and (max-width: 1024px) {
    :root {
        --analysis-page-padding: 30px;
        --analysis-page-gutter: 14px;
    }

    .title-section {
        font-size: 38px;
    }

    .editorial-page-frame .editorial-page-title {
        font-size: 24px;
    }

    .editorial-page-frame {
        padding-left: var(--analysis-page-gutter);
        padding-right: var(--analysis-page-gutter);
    }

    .editorial-sheet {
        padding-top: 30px;
        padding-bottom: 40px;
    }

    .editorial-page-description,
    .editorial-section-description {
        max-width: 68ch;
    }

    .editorial-control-row {
        gap: 10px 12px;
    }

    .editorial-control-group,
    .editorial-select,
    .editorial-action-button,
    .editorial-rating-filters,
    .editorial-note {
        min-width: 0;
        max-width: 100%;
    }

    .editorial-select .Select-control {
        max-width: 100%;
        box-sizing: border-box;
    }
}

@media screen and (max-width: 768px) {
    :root {
        --analysis-page-padding: 24px;
        --analysis-page-gutter: 10px;
    }

    .title-section {
        font-size: 34px;
        line-height: 1;
    }

    .editorial-page-frame .editorial-page-title {
        font-size: 23px;
    }

    .editorial-sheet {
        padding-top: 28px;
        padding-bottom: 36px;
    }

    .editorial-control-row {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .editorial-control-group,
    .editorial-select,
    .editorial-action-button,
    .editorial-rating-filters {
        flex: 0 1 auto;
        width: 100% !important;
    }

    .editorial-rating-filter-row {
        flex-wrap: wrap;
        margin-bottom: 0;
    }

    .editorial-rating-button {
        width: auto !important;
    }

    .editorial-evidence--split,
    .editorial-evidence--map-led {
        flex-direction: column;
        gap: 16px;
    }

    .editorial-evidence--split > .editorial-chart,
    .editorial-evidence--split > .editorial-map,
    .editorial-evidence--map-led > .editorial-map,
    .editorial-evidence--map-led > .editorial-info-panel {
        display: block !important;
        flex: 0 1 auto;
        max-width: none;
        min-width: 0;
        width: 100% !important;
    }

    .editorial-evidence .dash-graph,
    .editorial-evidence .js-plotly-plot,
    .editorial-evidence .plot-container,
    .editorial-evidence .svg-container {
        max-width: 100% !important;
    }

    .editorial-info-panel {
        border-left: 0;
        border-top: 1px solid var(--color-border-subtle);
        padding-left: 0;
        padding-top: 16px;
    }

    .editorial-card-grid {
        gap: 10px !important;
    }

    .editorial-guide-entry {
        flex-basis: 100%;
        max-width: 100%;
        min-width: 0;
    }
}

@media screen and (max-width: 600px) {
    :root {
        --analysis-page-padding: 18px;
        --analysis-page-gutter: 6px;
    }

    .title-section {
        font-size: 28px;
    }

    .editorial-page-frame .editorial-page-title {
        font-size: 22px;
        line-height: 1.24;
    }

    .editorial-page-frame .editorial-page-description,
    .editorial-page-frame .editorial-section-description {
        font-size: 15px;
        line-height: 1.45;
    }

    .editorial-action-button {
        min-width: 0;
        width: auto !important;
    }
}

@media screen and (max-width: 480px) {
    .title-section {
        font-size: 20px;
        margin-left: 16px;
    }

    .editorial-page-frame .editorial-page-title {
        font-size: 20px;
        line-height: 1.22;
    }

    .hamburger-menu {
        margin-right: 16px;
    }

    .nav-dropdown {
        margin-right: 16px;
    }
}


/* Economics responsive refinements: carry the Analysis sheet pattern without
   broad shared breakpoint changes. */
@media screen and (max-width: 1200px) {
    .analysis-container:has(#demographics-content-top) {
        padding-top: 30px;
        padding-bottom: 40px;
    }

    .demographics-container {
        padding-right: 0;
    }

    .demographics-text-paragraph {
        font-size: 15px;
    }
}

@media screen and (max-width: 900px) {
    .content-container:has(#demographics-content-top) {
        padding-left: var(--analysis-page-gutter);
        padding-right: var(--analysis-page-gutter);
    }

    .analysis-container:has(#demographics-content-top) {
        padding-top: 28px;
        padding-bottom: 36px;
    }

    .demographics-text-paragraph {
        max-width: 68ch;
    }

    .demographics-filter-container,
    .demographics-restaurants-controls {
        align-items: stretch;
    }

    .demographics-dropdown-container,
    .filter-container {
        flex-basis: 100%;
        max-width: none;
        min-width: 0;
    }

    .demographics-content-wrapper {
        flex-direction: column;
        gap: 12px;
    }

    .demographics-map,
    .demographics-chart-mean {
        display: block !important;
        flex-basis: auto;
        width: 100% !important;
    }
}

@media screen and (max-width: 600px) {
    .analysis-container:has(#demographics-content-top) {
        margin-top: clamp(148px, calc(268px - 20vw), 190px);
        padding-top: 24px;
        padding-bottom: 32px;
    }

    .demographics-header {
        margin-bottom: 8px;
    }

    #demographics-content-top .star-filter-container {
        min-width: 0;
        width: 100% !important;
    }
}


/* Analysis responsive consolidation: preserves the desktop paper sheet while
   making the existing section structure stack cleanly on smaller screens. */
@media screen and (max-width: 1200px) {
    :root {
        --analysis-page-padding: 28px;
        --analysis-page-gutter: 14px;
    }

    #analysis-content-top {
        padding-top: 30px;
        padding-bottom: 40px;
    }

    #analysis-content-top .region-content-wrapper,
    #analysis-content-top .department-content-wrapper,
    #analysis-content-top #arrondissement-content-wrapper.visible-section,
    #analysis-content-top .ranking-content-wrapper {
        padding-bottom: 34px;
    }

    #analysis-content-top .ranking-controls {
        gap: 10px 12px;
    }
}

@media screen and (max-width: 900px) {
    :root {
        --analysis-page-padding: 24px;
        --analysis-page-gutter: 10px;
    }

    .content-container:has(#analysis-content-top) {
        padding-left: var(--analysis-page-gutter);
        padding-right: var(--analysis-page-gutter);
    }

    #analysis-content-top {
        padding-top: 28px;
        padding-bottom: 36px;
    }

    #analysis-content-top .region-description,
    #analysis-content-top .department-description,
    #analysis-content-top .arrondissement-description,
    #analysis-content-top .ranking-description {
        max-width: 68ch;
    }

    #analysis-content-top .department-content-wrapper::before,
    #analysis-content-top #arrondissement-content-wrapper.visible-section::before,
    #analysis-content-top .ranking-content-wrapper::before {
        margin-bottom: 24px;
    }

    #analysis-content-top .region-controls,
    #analysis-content-top .department-controls,
    #analysis-content-top .arrondissement-controls,
    #analysis-content-top .ranking-controls {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    #analysis-content-top .region-filter-container,
    #analysis-content-top .department-filter-container,
    #analysis-content-top .arrondissement-filter-container,
    #analysis-content-top .star-filter-container-region,
    #analysis-content-top .star-filter-container-department,
    #analysis-content-top .star-filter-container-arrondissement,
    #analysis-content-top .granularity-filter-container,
    #analysis-content-top .top-ranking-filter-container,
    #analysis-content-top .rating-filter-container,
    #analysis-content-top .toggle-details-container {
        flex: 0 1 auto;
        max-width: none;
        min-width: 0;
        width: 100%;
    }

    #analysis-content-top .star-filter-container-department,
    #analysis-content-top .star-filter-container-arrondissement {
        justify-content: flex-start;
    }

    #analysis-content-top .dropdown-region-analysis,
    #analysis-content-top .dropdown-department-analysis,
    #analysis-content-top .dropdown-arrondissement-analysis,
    #analysis-content-top .dropdown-granularity,
    #analysis-content-top .dropdown-ranking,
    #analysis-content-top .dropdown-star-ranking {
        width: 100%;
    }

    #analysis-content-top .star-filter-buttons-analysis,
    #analysis-content-top .star-filter-buttons-department,
    #analysis-content-top .star-filter-buttons-arrondissement {
        flex-wrap: wrap;
        margin-bottom: 0;
    }

    #analysis-content-top .star-button-analysis,
    #analysis-content-top .star-button-department,
    #analysis-content-top .star-button-arrondissement {
        width: 68px !important;
    }

    #analysis-content-top .toggle-details-container {
        align-items: flex-start;
        margin-top: 0;
    }

    #analysis-content-top .region-visuals,
    #analysis-content-top .department-visuals,
    #analysis-content-top .arrondissement-visuals {
        flex-direction: column;
        gap: 16px;
    }

    #analysis-content-top .region-graph,
    #analysis-content-top .region-map,
    #analysis-content-top .department-graph,
    #analysis-content-top .department-map,
    #analysis-content-top .arrondissement-graph,
    #analysis-content-top .arrondissement-map {
        display: block !important;
        min-width: 0;
        width: 100% !important;
    }

    #analysis-content-top .region-map,
    #analysis-content-top .department-map,
    #analysis-content-top .arrondissement-map {
        border-left: 0;
        border-top: 1px solid var(--color-border-subtle);
        padding-top: 12px;
    }

    #analysis-content-top .dash-graph,
    #analysis-content-top .js-plotly-plot,
    #analysis-content-top .plot-container,
    #analysis-content-top .svg-container {
        max-width: 100% !important;
    }

    #analysis-content-top .ranking-main-content {
        padding-top: 4px;
    }

    #analysis-content-top .restaurant-details {
        flex-basis: calc(50% - 8px);
        max-width: calc(50% - 8px);
        min-width: 240px;
    }
}

@media screen and (max-width: 600px) {
    :root {
        --analysis-page-padding: 18px;
        --analysis-page-gutter: 6px;
    }

    #analysis-content-top {
        margin-top: clamp(148px, calc(268px - 20vw), 190px);
        padding-top: 24px;
        padding-bottom: 32px;
    }

    #analysis-content-top .region-content-wrapper,
    #analysis-content-top .department-content-wrapper,
    #analysis-content-top #arrondissement-content-wrapper.visible-section,
    #analysis-content-top .ranking-content-wrapper {
        padding-bottom: 30px;
    }

    #analysis-content-top .distribution-header,
    #analysis-content-top .ranking-header {
        margin-bottom: 8px;
    }

    #analysis-content-top .ranking-header {
        font-size: 22px;
        line-height: 1.24;
    }

    #analysis-content-top .distribution-section-header {
        font-size: 18px;
        line-height: 1.25;
    }

    #analysis-content-top .region-description,
    #analysis-content-top .department-description,
    #analysis-content-top .arrondissement-description,
    #analysis-content-top .ranking-description {
        margin-bottom: 12px;
    }

    #analysis-content-top .department-content-wrapper::before,
    #analysis-content-top #arrondissement-content-wrapper.visible-section::before,
    #analysis-content-top .ranking-content-wrapper::before {
        margin-bottom: 20px;
    }

    #analysis-content-top .star-button-analysis,
    #analysis-content-top .star-button-department,
    #analysis-content-top .star-button-arrondissement {
        min-width: 68px;
    }

    #analysis-content-top .button-show-details {
        min-width: 0;
        width: auto;
    }

    #analysis-content-top .restaurant-cards-container {
        gap: 10px !important;
    }

    #analysis-content-top .restaurant-details {
        flex-basis: 100%;
        max-width: 100%;
        min-width: 0;
    }
}

@media screen and (max-width: 480px) {
    #analysis-content-top .ranking-header {
        font-size: 20px;
        line-height: 1.22;
    }
}
