/* =========================================================================
   Viver em Portugal – public website
   Colours taken from the logo: green, ocean blue and sun orange.
   ========================================================================= */

:root {
    --brand: #0b7a3e;
    --brand-dark: #075c2e;
    --brand-soft: #e6f4ec;
    --ocean: #0a6cc2;
    --sun: #f39200;
    --ink: #1f2a24;
    --muted: #6b7a72;
    --line: #e3e8e5;
    --ground: #f6f8f7;
    --header-h: 76px;
    --sidebar-w: 300px;
    --radius: 14px;
    --bs-link-color: var(--brand);
    --bs-link-hover-color: var(--brand-dark);
    --bs-link-color-rgb: 11, 122, 62;
    --bs-link-hover-color-rgb: 7, 92, 46;
}

html {
    scroll-padding-top: calc(var(--header-h) + 1rem);
}

/* Bootstrap's display utilities (.d-flex, .d-grid, ...) use !important, which
   otherwise beats the native [hidden] rule and leaves "hidden" elements visible. */
[hidden] { display: none !important; }

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--ground);
    color: var(--ink);
}

.min-w-0 { min-width: 0; }
.text-brand { color: var(--brand) !important; }

.skip-link {
    position: absolute;
    top: .5rem;
    left: .5rem;
    z-index: 2000;
    background: #fff;
    padding: .5rem 1rem;
    border-radius: 8px;
}

/* ---- Buttons ------------------------------------------------------------ */

.btn-brand {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--brand-dark);
    --bs-btn-active-border-color: var(--brand-dark);
    --bs-btn-disabled-bg: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
    --bs-btn-focus-shadow-rgb: 11, 122, 62;
}

.btn-outline-brand {
    --bs-btn-color: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--brand);
    --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--brand);
    --bs-btn-active-border-color: var(--brand);
    --bs-btn-focus-shadow-rgb: 11, 122, 62;
}

.btn-icon {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 10px;
    color: var(--ink);
    font-size: 1.25rem;
}

.btn-icon:hover { background: var(--brand-soft); color: var(--brand); }

.form-check-input:checked {
    background-color: var(--brand);
    border-color: var(--brand);
}

.form-check-input:indeterminate {
    background-color: var(--brand);
    border-color: var(--brand);
}

.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: #7cc49d;
    box-shadow: 0 0 0 .25rem rgba(11, 122, 62, .18);
}

/* ---- Header ------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--header-h);
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--line);
}

.brand img {
    height: 56px;
    width: auto;
    display: block;
}

.lang-switch {
    display: flex;
    gap: .25rem;
    padding: .2rem;
    background: var(--ground);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.lang-flag {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .55rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    line-height: 1;
}

.lang-flag .fi {
    width: 1.35em;
    line-height: 1em;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
}

.lang-flag:hover { color: var(--ink); background: #fff; }

.lang-flag.active {
    background: #fff;
    color: var(--brand);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}

@media (max-width: 575.98px) {
    :root { --header-h: 64px; }
    .brand img { height: 42px; }
    .lang-code { display: none; }
    .lang-flag { padding: .35rem; }
}

/* ---- Body: sidebar + main ------------------------------------------------ */

.site-body {
    flex: 1 0 auto;
    display: flex;
    align-items: flex-start;
}

.site-main {
    flex: 1 1 auto;
    min-width: 0;
    padding: 1.5rem clamp(1rem, 3vw, 2.5rem) 3rem;
    outline: none;
}

.sidebar {
    background: #fff;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem .5rem;
}

.sidebar-title {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0;
}

.sidebar-tools {
    padding: 0 1rem .75rem;
    border-bottom: 1px solid var(--line);
}

.sidebar-body {
    padding: .5rem 0 1.5rem;
}

@media (min-width: 992px) {
    .sidebar {
        position: sticky;
        top: var(--header-h);
        flex: 0 0 var(--sidebar-w);
        width: var(--sidebar-w);
        height: calc(100vh - var(--header-h));
        border-right: 1px solid var(--line);
        display: flex;
        flex-direction: column;
        transition: margin-left .25s ease, visibility .25s;
    }

    .sidebar-body {
        flex: 1 1 auto;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    body.sidebar-collapsed .sidebar {
        margin-left: calc(-1 * var(--sidebar-w));
        visibility: hidden;
    }
}

@media (max-width: 991.98px) {
    .sidebar.offcanvas-lg { --bs-offcanvas-width: min(var(--sidebar-w), 88vw); }
    .sidebar .offcanvas-body, .sidebar-body { overflow-y: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar { transition: none !important; }
}

/* ---- Category tree -------------------------------------------------------- */

.tree, .tree-children {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tree-children {
    margin-left: 1.15rem;
    border-left: 1px dashed var(--line);
}

.tree-row {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .2rem .75rem .2rem .5rem;
    border-radius: 8px;
    margin: 0 .5rem;
}

.tree-row:hover { background: var(--ground); }

.tree-caret, .tree-caret-spacer {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
}

.tree-caret {
    display: grid;
    place-items: center;
    border: 0;
    background: none;
    border-radius: 6px;
    color: var(--muted);
    padding: 0;
}

.tree-caret:hover { background: var(--line); color: var(--ink); }
.tree-caret .bi { transition: transform .15s ease; font-size: .8rem; }
.tree-caret[aria-expanded="true"] .bi { transform: rotate(90deg); }

.tree-check {
    flex: 0 0 auto;
    margin: 0;
    cursor: pointer;
}

.tree-label {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .3rem 0;
    cursor: pointer;
    font-size: .925rem;
    user-select: none;
}

.tree-label .bi { color: var(--brand); flex: 0 0 auto; }
.tree-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree > .tree-node > .tree-row .tree-label { font-weight: 600; }
.tree-check:checked + .tree-label, .tree-check:indeterminate + .tree-label { color: var(--brand-dark); }

.tree-count {
    flex: 0 0 auto;
    font-size: .72rem;
    font-weight: 600;
    color: var(--muted);
    background: var(--ground);
    border-radius: 999px;
    padding: .1rem .45rem;
    min-width: 1.6rem;
    text-align: center;
}

.tree-count.is-empty { opacity: .55; }

.tree-node.is-filtered-out { display: none; }
.tree-name mark { padding: 0; background: #fff3cd; }

/* ---- Search & welcome ----------------------------------------------------- */

.search-bar {
    max-width: 860px;
    margin-bottom: 1.75rem;
}

.search-bar .input-group-text {
    background: #fff;
    color: var(--muted);
}

.search-bar .form-control { border-left: 0; }

.hero {
    position: relative;
    overflow: hidden;
    border-radius: calc(var(--radius) * 1.4);
    padding: clamp(1.5rem, 4vw, 3rem);
    color: #fff;
    background:
        radial-gradient(circle at 92% 12%, rgba(243, 146, 0, .9) 0, rgba(243, 146, 0, 0) 32%),
        linear-gradient(135deg, var(--brand) 0%, #0d8a6a 45%, var(--ocean) 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: center;
    margin-bottom: 2.5rem;
}

.hero h1 {
    font-size: clamp(1.75rem, 3.2vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -.02em;
}

.hero .lead { color: rgba(255, 255, 255, .92); }

.hero-cards { display: grid; gap: .85rem; }

.hero-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem 1.1rem;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: var(--radius);
    backdrop-filter: blur(4px);
}

.hero-card > .bi { font-size: 1.75rem; line-height: 1; }
.hero-card p { color: rgba(255, 255, 255, .88); }

@media (max-width: 991.98px) {
    .hero { grid-template-columns: 1fr; }
}

.section-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: .35rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 1rem;
}

.category-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .35rem;
    padding: 1.1rem;
    text-align: left;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.category-tile:hover, .category-tile:focus-visible {
    transform: translateY(-2px);
    border-color: #b9dcc8;
    box-shadow: 0 10px 24px -12px rgba(11, 122, 62, .35);
}

.category-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 1.3rem;
    margin-bottom: .35rem;
}

.category-tile:nth-child(3n+2) .category-icon { background: #e5f0fa; color: var(--ocean); }
.category-tile:nth-child(3n+3) .category-icon { background: #fff1de; color: #c46f00; }

.category-name { font-weight: 600; line-height: 1.25; }
.category-count { font-size: .8rem; color: var(--muted); }

.event-card {
    position: relative;
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.event-date {
    flex: 0 0 56px;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    line-height: 1;
}

.event-day { font-size: 1.4rem; font-weight: 800; }
.event-month { font-size: .75rem; text-transform: uppercase; font-weight: 600; margin-top: .15rem; }

/* ---- Results -------------------------------------------------------------- */

.results-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.selection-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .5rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .25rem .35rem .25rem .7rem;
    font-size: .85rem;
    background: var(--brand-soft);
    color: var(--brand-dark);
    border: 1px solid #c7e3d3;
    border-radius: 999px;
}

.chip button {
    border: 0;
    background: none;
    color: inherit;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    padding: 0;
}

.chip button:hover { background: rgba(11, 122, 62, .15); }

.results-loading {
    display: flex;
    justify-content: center;
    padding: 3rem 0;
}

.place-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.place-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    text-align: left;
    padding: 0;
    color: inherit;
    transition: transform .15s ease, box-shadow .15s ease;
}

.place-card:hover, .place-card:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px -16px rgba(31, 42, 36, .35);
}

.place-image {
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, var(--brand-soft), #e5f0fa);
    display: grid;
    place-items: center;
    color: var(--brand);
    font-size: 2.5rem;
    overflow: hidden;
}

.place-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.place-body { padding: 1rem 1.1rem 1.1rem; }

.place-type {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--brand);
}

.place-name { font-size: 1.05rem; font-weight: 700; margin: .2rem 0 .35rem; }
/* The place the visitor asked to see on the map ("View on the map"): ringed so it stands out among the other pins. */
.map-marker.is-focus { box-shadow: 0 0 0 5px rgba(255, 193, 7, .75), 0 2px 6px rgba(0, 0, 0, .3); }

.place-event { font-size: .85rem; font-weight: 600; color: var(--brand); margin: .1rem 0 .35rem; }
.place-event.is-past { color: var(--muted); font-weight: 400; }
.place-description { font-size: .9rem; color: var(--muted); margin: 0; }

.map-container { position: relative; }

.map-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ground);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    z-index: 1;
    pointer-events: none;
    transition: opacity .2s ease;
}

.results-map {
    height: min(70vh, 640px);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    z-index: 0;
}

.map-marker {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    background: var(--brand);
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}

.map-marker .bi { transform: rotate(45deg); color: #fff; font-size: .95rem; }

.empty-state {
    text-align: center;
    padding: 3.5rem 1rem;
    background: #fff;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
}

.empty-state > .bi { font-size: 2.75rem; color: var(--brand); }

.pagination { --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand); --bs-pagination-color: var(--brand); }

.place-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .5rem;
    margin-bottom: 1rem;
}

.place-gallery-item {
    margin: 0;
}

.place-gallery-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

.place-gallery-credit {
    margin-top: .25rem;
}

.place-gallery-credit a {
    color: inherit;
}

.place-description-full { white-space: pre-line; }

/* ---- Auth & content pages ------------------------------------------------- */

.auth-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: clamp(1.5rem, 6vh, 4rem);
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) * 1.3);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    box-shadow: 0 20px 50px -30px rgba(31, 42, 36, .35);
}

.auth-icon, .content-icon {
    width: 56px;
    height: 56px;
    display: inline-grid;
    place-items: center;
    border-radius: 16px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 1.6rem;
    flex: 0 0 auto;
}

.content-page { max-width: 980px; margin: 0 auto; width: 100%; }

.content-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) * 1.3);
    padding: clamp(1.25rem, 4vw, 2.75rem);
}

.content-body h2 { font-size: 1.15rem; font-weight: 700; margin-top: 1.75rem; }
.content-body p, .content-body li { line-height: 1.7; }

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.contact-item {
    display: flex;
    gap: .85rem;
    padding: 1rem;
    border-radius: var(--radius);
    background: var(--ground);
    overflow-wrap: anywhere;
}

.contact-item > .bi { font-size: 1.4rem; color: var(--brand); }

/* ---- Footer --------------------------------------------------------------- */

.site-footer {
    flex-shrink: 0;
    background: #0f2419;
    color: rgba(255, 255, 255, .85);
    position: relative;
    z-index: 1;
}

.footer-brand img {
    height: 64px;
    width: auto;
}

.footer-muted { color: rgba(255, 255, 255, .65); max-width: 34ch; }

.footer-title {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: .55rem;
}

.footer-links a, .footer-link-btn {
    color: rgba(255, 255, 255, .75);
    text-decoration: none;
    font-size: .925rem;
    text-align: left;
}

.footer-links a:hover, .footer-link-btn:hover { color: #fff; text-decoration: underline; }

.footer-contacts li {
    display: flex;
    gap: .6rem;
    align-items: baseline;
    overflow-wrap: anywhere;
}

.footer-contacts .bi { color: #6fd39b; }

.social-link {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.social-link:hover { background: var(--brand); color: #fff; }

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .1);
    padding: 1rem 0;
    font-size: .85rem;
    color: rgba(255, 255, 255, .6);
}

/* ---- Cookie banner -------------------------------------------------------- */

.cookie-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 1060;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 0;
    max-width: 1200px;
    margin: 0 auto;
    animation: cookie-in .35s ease-out;
}

@keyframes cookie-in {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .cookie-banner { animation: none; }
}

.cookie-category {
    padding: .85rem 0;
    border-bottom: 1px solid var(--line);
}

.cookie-category:last-child { border-bottom: 0; }
.cookie-category .form-check-input { width: 2.5em; height: 1.3em; flex-shrink: 0; }

/* =========================================================================
   Living in Portugal – navigation, filters, cities, indicators, charts
   ========================================================================= */

:root {
    --toolbar-h: 58px;
    --good: #0b7a3e;
    --good-bg: #e6f4ec;
    --bad: #b3261e;
    --bad-bg: #fdecea;
}

.tabular { font-variant-numeric: tabular-nums; }

/* ---- Main menu -------------------------------------------------------------- */

.main-nav {
    list-style: none;
    margin: 0 0 0 1rem;
    padding: 0;
    gap: .25rem;
}

.main-nav a {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .5rem .85rem;
    border-radius: 999px;
    color: var(--ink);
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.main-nav a:hover { background: var(--ground); }
.main-nav a.active { background: var(--brand-soft); color: var(--brand-dark); }
.main-nav .bi { color: var(--brand); }

/* ---- Toolbar (region / city / search / sort / views) ------------------------ */

.toolbar {
    background: #fff;
    border-bottom: 1px solid var(--line);
    z-index: 1020;
}

.toolbar-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
    padding-block: .6rem;
}

.toolbar-field {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
}

.toolbar-field > .bi {
    position: absolute;
    left: .75rem;
    color: var(--muted);
    pointer-events: none;
    z-index: 1;
}

.toolbar-field .form-select,
.toolbar-field .form-control {
    padding-left: 2.1rem;
    min-width: 11rem;
    border-radius: 999px;
}

.toolbar-search { flex: 1 1 16rem; max-width: 30rem; }
.toolbar-search .form-control { width: 100%; }

.view-switch .btn { border-radius: 0; }
.view-switch .btn:first-child { border-radius: 999px 0 0 999px; }
.view-switch .btn:last-child { border-radius: 0 999px 999px 0; }

@media (min-width: 992px) {
    .toolbar { position: sticky; top: var(--header-h); }
    body.has-toolbar .sidebar {
        top: calc(var(--header-h) + var(--toolbar-h));
        height: calc(100vh - var(--header-h) - var(--toolbar-h));
    }
}

@media (max-width: 575.98px) {
    .toolbar-field { flex: 1 1 45%; }
    .toolbar-field .form-select, .toolbar-field .form-control { min-width: 0; width: 100%; }
    .toolbar-search { flex-basis: 100%; max-width: none; }
    .view-switch { width: 100%; }
    .view-switch .btn { flex: 1; }
}

.sidebar-location { color: var(--muted); }
.tree-essential { color: var(--sun); font-size: .65rem; }

/* ---- Location panels & stat tiles --------------------------------------------- */

.page-intro { margin-bottom: 1.5rem; }
.page-intro h1 { font-weight: 800; letter-spacing: -.02em; }

.location-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) * 1.3);
    padding: clamp(1.25rem, 3vw, 2rem);
    margin-bottom: 1.5rem;
}

.location-title {
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    font-weight: 800;
    letter-spacing: -.02em;
    margin: .15rem 0 0;
}

.stat-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: .75rem;
}

.stat-tile {
    background: var(--ground);
    border-radius: var(--radius);
    padding: .85rem 1rem;
    min-width: 0;
}

.stat-label { font-size: .8rem; color: var(--muted); margin-bottom: .25rem; }
.stat-value { font-size: 1.5rem; font-weight: 600; line-height: 1.2; }
.stat-value-sm { font-size: 1.1rem; }
.stat-note { font-size: .8rem; color: var(--muted); margin-top: .2rem; }

/* Score: number + meter (the unfilled track is a lighter step of the same hue) */
.score { display: inline-flex; flex-direction: column; gap: .3rem; min-width: 7rem; }
.score-number { font-size: 1.5rem; font-weight: 600; line-height: 1; }
.score-number small { font-size: .55em; color: var(--muted); font-weight: 500; margin-left: .1rem; }
.score .meter { display: block; height: 6px; border-radius: 3px; background: var(--brand-soft); overflow: hidden; }
.score .meter > span { display: block; height: 100%; border-radius: 3px; background: var(--brand); }
.score-sm { min-width: 6rem; }
.score-sm .score-number { font-size: 1rem; }
.score-end { align-items: flex-end; }
.score-empty { color: var(--muted); font-size: 1.25rem; }

.scope-badge {
    display: inline-block;
    margin-left: .35rem;
    padding: 0 .4rem;
    font-size: .68rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    vertical-align: middle;
    white-space: nowrap;
}

.change-badge {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    padding: .1rem .45rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    white-space: nowrap;
    color: var(--muted);
    background: var(--ground);
}

.change-badge.is-good { color: var(--good); background: var(--good-bg); }
.change-badge.is-bad { color: var(--bad); background: var(--bad-bg); }

.indicator-value { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---- City & region cards --------------------------------------------------------- */

.city-grid, .region-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1rem;
}

.city-card, .region-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding: 1rem 1.1rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: inherit;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease;
}

.city-card:hover, .region-card:hover, .city-card:focus-visible, .region-card:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -14px rgba(11, 122, 62, .4);
    color: inherit;
}

.city-card-name, .region-card-name { font-weight: 700; font-size: 1.05rem; }

.city-card-rank {
    font-size: .75rem;
    font-weight: 700;
    color: var(--brand-dark);
    background: var(--brand-soft);
    border-radius: 999px;
    padding: .1rem .5rem;
    align-self: flex-start;
}

.category-grid-sm { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.category-tile-sm { padding: .8rem; }
.category-tile-sm .category-icon { width: 36px; height: 36px; font-size: 1.05rem; }

.hero-card { color: #fff; text-decoration: none; }
.hero-card:hover { color: #fff; background: rgba(255, 255, 255, .22); }

/* ---- Places: list view ---------------------------------------------------------- */

.place-list {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.place-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1.2fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: .8rem 1.1rem;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: #fff;
    text-align: left;
    color: inherit;
}

.place-row:last-child { border-bottom: 0; }
.place-row:hover, .place-row:focus-visible { background: var(--ground); }

.place-row-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 1.15rem;
}

.place-row-name { display: block; font-weight: 600; }
.place-row-type { display: block; font-size: .82rem; color: var(--muted); }
.place-row-meta { font-size: .85rem; }

@media (max-width: 767.98px) {
    .place-row { grid-template-columns: auto minmax(0, 1fr) auto; }
    .place-row-meta { grid-column: 2 / 3; }
}

.place-meta { font-size: .8rem; color: var(--muted); margin-bottom: .35rem; }

.rating {
    display: inline-flex;
    align-items: baseline;
    gap: .25rem;
    margin-right: .5rem;
    font-size: .82rem;
    white-space: nowrap;
}

.rating .bi { color: var(--sun); font-size: .75em; }
.rating-value { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.rating-count { color: var(--muted); }
.place-row .rating { display: block; margin-top: .15rem; }
.is-refreshing { opacity: .5; transition: opacity .15s; }

.place-facts {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: grid;
    gap: .4rem;
}

.place-facts li { display: flex; gap: .6rem; align-items: baseline; overflow-wrap: anywhere; }
.place-facts .bi { color: var(--brand); }

.map-score {
    display: grid;
    place-items: center;
    width: 40px;
    height: 28px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    font-size: .8rem;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}

.map-score.is-empty {
    width: 22px;
    height: 22px;
    margin: 3px 9px;
    background: #fff;
    color: var(--muted);
    border-color: var(--muted);
    font-size: .7rem;
}

/* ---- Cities page ------------------------------------------------------------------ */

.city-table-wrap, .card-surface {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.city-table thead th, .compare-table thead th, .indicator-table thead th {
    font-size: .78rem;
    font-weight: 600;
    color: var(--muted);
    background: var(--ground);
    vertical-align: bottom;
}

.city-table th, .city-table td { padding: .75rem .9rem; }
.city-link { font-weight: 700; color: var(--ink); text-decoration: none; }
.city-link:hover { color: var(--brand); text-decoration: underline; }

.city-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.city-profile-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .85rem;
    padding: 1.1rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.city-profile-top { display: flex; align-items: center; gap: .8rem; }

.city-profile-initial {
    flex: 0 0 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--brand), var(--ocean));
}

.city-facts { display: grid; gap: .35rem; margin: 0; font-size: .88rem; }
.city-facts > div { display: flex; justify-content: space-between; gap: .75rem; }
.city-facts dt { font-weight: 400; color: var(--muted); }
.city-facts dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

.compare-toggle {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-size: .88rem;
    cursor: pointer;
}

.compare-bar {
    position: sticky;
    bottom: 1rem;
    z-index: 1040;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    margin-top: 1rem;
    padding: .75rem 1rem;
    border-radius: var(--radius);
    background: var(--ink);
    color: #fff;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5);
}

/* ---- Compare page ----------------------------------------------------------------- */

.compare-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1.25rem;
}

.chip-lg { padding: .35rem .4rem .35rem .85rem; font-size: .95rem; }
.chip-lg a { color: inherit; text-decoration: none; font-weight: 600; }
.chip-remove { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; }
.chip-remove:hover { background: rgba(11, 122, 62, .15); }
.compare-add { width: auto; min-width: 12rem; border-radius: 999px; }

.compare-table th, .compare-table td { padding: .6rem .9rem; }
.compare-table tbody th { min-width: 14rem; }
.compare-table td { min-width: 9rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.compare-table .group-row th { background: var(--ground); font-weight: 700; font-size: .9rem; padding-top: .9rem; }
.compare-table td.is-best { font-weight: 700; }
.best-mark { color: var(--good); }
.detail-row th, .detail-row td { color: var(--muted); padding-block: .35rem; }

/* ---- City profile ------------------------------------------------------------------- */

.section-nav {
    display: flex;
    gap: .4rem;
    overflow-x: auto;
    padding-bottom: .5rem;
    margin-bottom: 1rem;
    scrollbar-width: thin;
}

.section-nav a {
    flex: 0 0 auto;
    padding: .35rem .85rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    font-size: .88rem;
    color: var(--ink);
    text-decoration: none;
}

.section-nav a:hover { border-color: var(--brand); color: var(--brand); }

.profile-section { margin-top: 2.25rem; scroll-margin-top: calc(var(--header-h) + var(--toolbar-h) + 1rem); }
.profile-section-head { margin-bottom: 1rem; }
.profile-section-head h2 { font-size: 1.35rem; font-weight: 700; margin-bottom: .2rem; display: flex; align-items: center; gap: .6rem; }
.profile-section-head h2 .bi { color: var(--brand); }

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.service-card {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    padding: 1rem 1.1rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.service-card header { display: flex; align-items: center; gap: .75rem; }
.service-card .category-icon { margin: 0; }
.service-list { list-style: none; padding: 0; margin: 0; flex: 1; font-size: .9rem; }
.service-list li { display: flex; justify-content: space-between; gap: .5rem; padding: .3rem 0; border-bottom: 1px solid var(--line); }
.service-list li:last-child { border-bottom: 0; }
.service-list li span:last-child { font-weight: 600; }
.service-list li.is-missing { color: var(--muted); }

.indicator-table th, .indicator-table td { padding: .7rem .9rem; }

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.chart-card {
    margin: 0;
    padding: 1rem 1.1rem .75rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    min-width: 0;
}

.chart-card figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem .75rem; margin-bottom: .5rem; }
.chart { position: relative; width: 100%; }
.chart svg { display: block; max-width: 100%; height: auto; outline: none; }
.chart svg:focus-visible { box-shadow: 0 0 0 3px rgba(11, 122, 62, .3); border-radius: 6px; }
.chart .chart-gridline { stroke: var(--line); stroke-width: 1; }
.chart .chart-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .chart-line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .chart-area { fill: var(--brand); opacity: .1; }
.chart .chart-dot { fill: var(--brand); stroke: #fff; stroke-width: 2; }
.chart .chart-bar { fill: var(--ocean); }
.chart .chart-bar.is-active { fill: #3d8ad0; }
.chart .chart-cross { stroke: var(--muted); stroke-width: 1; }
.chart .chart-end-label { fill: var(--ink); font-size: 12px; font-weight: 600; }

.chart-tip {
    position: absolute;
    z-index: 2;
    display: flex;
    flex-direction: column;
    padding: .35rem .6rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .3);
    font-size: .8rem;
    pointer-events: none;
    white-space: nowrap;
}

.chart-tip strong { font-size: .95rem; }
.chart-tip span { color: var(--muted); }

.chart-table { margin-top: .5rem; font-size: .85rem; }
.chart-table summary { color: var(--brand); cursor: pointer; }
.chart-table .table-responsive { max-height: 220px; overflow-y: auto; }

.development-list { display: grid; gap: .75rem; }

.development-card {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.1rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.development-card .category-icon { margin: 0; flex: 0 0 auto; }

.development-facts {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1.1rem;
    padding: 0;
    margin: .4rem 0 0;
    font-size: .82rem;
    color: var(--muted);
}

.development-facts .bi { margin-right: .3rem; color: var(--brand); }

@media (max-width: 575.98px) {
    .city-grid, .region-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
    .city-card, .region-card { padding: .8rem; }
    .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .compare-table tbody th { min-width: 9rem; }
    .compare-table td { min-width: 6.5rem; }
    .location-panel .btn { width: 100%; }
}

.coming-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .5rem;
}
