/* Area Insights object dashboard. Keep overrides scoped to this page. */
.analytics-object-page {
    margin: 0;
    height: 100dvh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface);
    color: var(--text);
}
.analytics-object-page [hidden] {
    display: none !important;
}
.analytics-object-page .site-header {
    flex: none;
    z-index: 5;
}
.analytics-object-page .site-header .primary-nav {
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: clamp(4px, 1.5vw, 24px);
    padding: 8px clamp(6px, 2vw, 32px);
}
.analytics-object-page .primary-nav .brand-logo img {
    width: clamp(64px, 14vw, 180px);
}
.analytics-object-page .primary-nav-links {
    width: auto;
    flex-wrap: nowrap;
    gap: clamp(3px, 1.7vw, 28px);
}
.analytics-object-page .site-header .primary-nav-links .nav-link {
    font-size: clamp(7px, 1.15vw, 15px);
    padding: 6px 0;
    white-space: nowrap;
}
.analytics-object-page .site-header .primary-nav-links button {
    min-width: 0;
    min-height: 28px;
    padding: 6px clamp(4px, 1.1vw, 16px);
    font-size: clamp(7px, 1.1vw, 14px);
    white-space: nowrap;
}
.workarea {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
#page-notice {
    margin: 0;
    flex: none;
}
.dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(360px, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
    padding: 0 12px 12px;
    flex: 1;
    min-height: 0;
}
.filter-toolbar {
    grid-column: 1/-1;
    position: relative;
    z-index: 4;
    padding: 8px 0;
}
.filters {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(360px, 1fr);
    gap: 12px;
    align-items: center;
    position: relative;
}
.map-filters,
.range-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.filter-group {
    min-width: 0;
    position: relative;
    margin: 0;
}
.suburb-group {
    flex: 1 1 220px;
}
.filter-label {
    font-size: 11px;
    color: var(--muted-dark);
    font-weight: 600;
}
.analytics-object-page #suburb-search {
    margin: 0;
    padding: 8px 10px;
    font-size: 14px;
    width: 100%;
    height: 40px;
    min-height: 0;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--surface);
}
.dropdown {
    flex: 0 1 120px;
}
.colour-group {
    flex: 0 0 145px;
}
.dropdown summary {
    height: 40px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    padding: 8px 26px 8px 10px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
    font-size: 13px;
    cursor: pointer;
    list-style: none;
    position: relative;
}
.dropdown summary::-webkit-details-marker {
    display: none;
}
.dropdown summary::after {
    content: "⌄";
    position: absolute;
    right: 10px;
    top: 8px;
    font-size: 17px;
}
.dropdown summary > span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.dropdown[open] summary {
    border-color: var(--primary);
    background: var(--surface-soft);
}
.web-options {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: auto;
    background: var(--surface);
    padding: 4px;
}
.filters .web-options {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 100%;
    width: max-content;
    max-width: min(350px, 90vw);
    max-height: 300px;
    box-shadow: var(--shadow);
    z-index: 6;
}
#suburb-options {
    width: 100%;
}
.web-options button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 36px;
    padding: 7px 10px;
    border: 0;
    border-radius: 6px;
    box-shadow: none;
    background: var(--surface);
    color: var(--text);
    font:
        13px Inter,
        Arial,
        sans-serif;
    text-align: left;
}
.web-options button:hover:not(:disabled) {
    background: var(--surface-soft);
}
.web-options button[aria-pressed="true"] {
    background: #64836b;
    color: white;
}
.web-options button[aria-pressed="true"]::after {
    content: "✓";
    margin-left: 8px;
}
.web-options button[data-excluded="true"]:not([aria-pressed="true"]) {
    color: #89928f;
    background: #f6f7f7;
}
.web-options button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}
.web-options p {
    padding: 4px 10px;
    font-size: 13px;
}
.web-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(45px, 1fr));
    gap: 4px;
}
.web-grid button {
    justify-content: center;
}
.population-toggle {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    font-size: 11px;
    line-height: 1.4;
    cursor: pointer;
    margin: 0;
}
.analytics-object-page .population-toggle input {
    appearance: auto;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    min-height: 0;
    margin: 0;
    padding: 0;
    accent-color: #64836b;
}
#filter-error {
    position: absolute;
    top: 100%;
    margin: 6px 0 0;
    padding: 8px;
    border-radius: 6px;
    background: #fff0ee;
    color: #b42318;
    font-size: 13px;
    z-index: 7;
}
.map-column {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #f6f7f6;
    border: 1px solid var(--border);
    border-radius: 12px;
}
.embed-region {
    width: 100%;
    min-width: 0;
    min-height: 0;
}
.embed-region qlik-embed {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
}
.map-column > .embed-region {
    height: 100%;
}
.right-column {
    display: grid;
    grid-template-rows: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 12px;
    min-height: 0;
    min-width: 0;
}
.bar-section {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}
.bar-heading {
    flex: none;
    padding: 12px 12px 8px;
}
.bar-heading h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 650;
    line-height: 1.4;
    text-transform: none;
}
.chart-instruction {
    margin: 6px 0 0;
    font-size: 11px;
    color: var(--muted-dark);
    line-height: 1.5;
}
.bar-plot {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.detail-table {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border-top: 1px solid var(--border);
}
.gate {
    position: absolute;
    inset: 0;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--surface);
}
.gate-content {
    max-width: 450px;
    text-align: center;
    font-size: 15px;
    line-height: 1.5;
}
.gate button,
.gate a {
    display: inline-flex;
    justify-content: center;
    margin-top: 14px;
    padding: 10px 16px;
    background: var(--primary);
    color: white;
    border: 0;
    border-radius: 8px;
    text-decoration: none;
}
.mobile-toolbar {
    display: none;
}
#filters-dialog {
    width: min(460px, calc(100% - 24px));
    max-height: calc(100dvh - 32px);
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--text);
    background: var(--surface);
    box-shadow: var(--shadow);
}
#filters-dialog::backdrop {
    background: rgba(16, 39, 35, 0.45);
}
.dialog-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}
.dialog-heading h2 {
    margin: 0;
    font-size: 20px;
}
#close-filters {
    min-height: 36px;
    padding: 7px 14px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
}

#mobile-menu-toggle,
#mobile-population-slot {
    display: none;
}
.filter-actions {
    display: flex;
    gap: 5px;
    flex: none;
}
.filter-actions button {
    height: 40px;
    padding: 8px 10px;
    font-size: 12px;
    white-space: nowrap;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
}
.filter-actions button:disabled,
.web-options button:disabled {
    opacity: 0.45;
    cursor: default;
}
#suburb-options button[aria-pressed="true"]::after {
    content: none;
}
#map-population-slot {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
}
#map-population-slot .population-toggle {
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 1px 5px #0002;
    white-space: nowrap;
}
.value-range {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.range-heading {
    display: flex;
    flex-direction: column;
    gap: 1px;
    font-size: 11px;
    white-space: nowrap;
}
.range-heading output {
    font-variant-numeric: tabular-nums;
    color: var(--muted-dark);
}
.range-sliders {
    position: relative;
    height: 18px;
    background: linear-gradient(var(--border-strong), var(--border-strong))
        center/100% 3px no-repeat;
}
.analytics-object-page .range-sliders input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 18px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
}
.analytics-object-page .range-sliders input::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--primary);
    border: 2px solid white;
    box-shadow: 0 0 0 1px var(--primary);
    border-radius: 50%;
    pointer-events: auto;
    cursor: grab;
}
.analytics-object-page .range-sliders input::-moz-range-thumb {
    width: 11px;
    height: 11px;
    background: var(--primary);
    border: 2px solid white;
    box-shadow: 0 0 0 1px var(--primary);
    border-radius: 50%;
    pointer-events: auto;
    cursor: grab;
}
.analytics-object-page .range-sliders input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}
.analytics-object-page .range-sliders input:disabled {
    opacity: 0.4;
}
@media (min-width: 761px) and (max-width: 1050px) {
    .map-filters {
        flex-wrap: wrap;
    }
    .map-filters .suburb-group {
        flex-basis: 100%;
    }
    .map-filters .dropdown {
        flex: 1;
    }
}
@media (max-width: 760px) {
    .analytics-object-page .site-header .primary-nav {
        position: relative;
        padding: 10px 14px;
    }
    .analytics-object-page .primary-nav .brand-logo img {
        width: 130px;
    }
    .analytics-object-page #mobile-menu-toggle {
        display: inline-flex;
        align-items: center;
        padding: 9px 12px;
        font-size: 14px;
        border: 0;
        box-shadow: none;
        border-radius: 8px;
        background: var(--surface);
        color: var(--text);
    }
    .analytics-object-page .primary-nav-links {
        display: none;
        position: absolute;
        top: 100%;
        right: 10px;
        width: min(280px, calc(100vw - 20px));
        padding: 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 3px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 12px;
        box-shadow: var(--shadow);
    }
    .analytics-object-page .primary-nav-links[data-open="true"] {
        display: flex;
    }
    .analytics-object-page .site-header .primary-nav-links .nav-link {
        font-size: 15px;
        padding: 10px 12px;
    }
    .analytics-object-page .site-header .primary-nav-links button {
        font-size: 15px;
        padding: 10px 12px;
    }
    .dashboard {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 0 10px 10px;
    }
    #desktop-filters {
        display: none;
    }
    .mobile-toolbar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        flex: none;
        padding: 10px 0 0;
    }
    .mobile-toolbar button {
        min-height: 40px;
        padding: 8px 14px;
        font-size: 13px;
        border: 1px solid var(--border-strong);
        border-radius: 9px;
        color: var(--text);
        background: white;
    }
    .filter-toggle {
        gap: 8px;
    }
    .view-switch {
        display: flex;
        border: 1px solid var(--border-strong);
        border-radius: 10px;
        overflow: hidden;
    }
    .view-switch button {
        border: 0;
        border-radius: 0;
        min-width: 70px;
    }
    .view-switch button[aria-pressed="true"] {
        background: var(--primary);
        color: white;
    }
    .map-column,
    .right-column {
        flex: 1;
        min-height: 0;
    }
    .dashboard[data-view="map"] .right-column,
    .dashboard[data-view="charts"] .map-column {
        display: none;
    }
    #mobile-filters .filters,
    #mobile-filters .map-filters,
    #mobile-filters .range-filters {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
    }
    #mobile-filters .filter-group {
        flex: none;
        width: 100%;
        max-width: none;
    }
    #mobile-filters .web-options {
        position: static;
        width: 100%;
        max-width: none;
        min-width: 0;
        max-height: 180px;
        margin-top: 6px;
        box-shadow: none;
    }
    #mobile-filters summary {
        height: auto;
        min-height: 24px;
        padding: 0;
        border: 0;
        background: transparent;
        pointer-events: none;
        font-size: 13px;
        font-weight: 600;
    }
    #mobile-filters summary::after {
        display: none;
    }
    #mobile-population-slot {
        display: block;
    }
    #mobile-filters .population-toggle {
        font-size: 12px;
    }
    #mobile-filters #filter-error {
        position: static;
        margin: 0;
    }
    #mobile-filters .range-heading {
        flex-direction: row;
        justify-content: space-between;
        font-size: 12px;
    }
    .bar-heading {
        padding: 6px;
    }
    .bar-heading h2 {
        font-size: 14px;
    }
    .chart-instruction {
        font-size: 10px;
    }
}

/* Filters remain with the map; the detail panel occupies the chart column. */
@media (min-width: 761px) {
    #desktop-filters {
        grid-column: 1;
        grid-row: 1;
    }
    .filters {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }
    #map-panel {
        grid-column: 1;
        grid-row: 2;
    }
    #charts-panel {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
}
.range-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.suburb-comparison {
    display: grid;
    grid-template-rows: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 12px;
    min-height: 0;
    height: 100%;
}
.right-column {
    display: block;
    overflow: auto;
}
.filter-clear {
    pointer-events: auto;
    position: absolute;
    top: 9px;
    right: 7px;
    z-index: 2;
    width: 22px;
    height: 22px;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted-dark);
    font-size: 17px;
    box-shadow: none;
}
.filter-clear:disabled {
    opacity: 0.25;
}
.dropdown summary {
    padding-right: 48px;
}
.dropdown summary::after {
    right: 29px;
}
.analytics-object-page #suburb-search {
    padding-right: 30px;
}
.value-range {
    padding-right: 26px;
}
#qlik-map-host > iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}
.suburb-summary {
    container-type: inline-size;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px;
}
.suburb-summary h2 {
    color: var(--primary);
    font-size: 30px;
    margin: 8px 24px 4px 0;
    text-transform: none;
}
#suburb-subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--muted-dark);
}
#close-suburb {
    position: absolute;
    top: 8px;
    right: 10px;
    border: 0;
    background: none;
    color: var(--text);
    padding: 0;
    width: 28px;
    height: 28px;
    min-height: 0;
    font-size: 25px;
}
.suburb-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px 12px;
    margin: 40px 0;
}
.suburb-kpis h3 {
    margin: 0 0 16px;
    font-size: 11px;
    font-weight: 500;
    color: var(--primary);
}
.suburb-kpis strong {
    display: block;
    font-size: clamp(14px, 4cqi, 26px);
    color: #3588bb;
    overflow-wrap: normal;
    white-space: nowrap;
}
.suburb-kpis small {
    display: block;
    margin-top: 12px;
    color: var(--muted-dark);
}
.secondary-kpi {
    padding: 10px;
    border-radius: 10px;
    background: var(--surface-soft);
}
.secondary-kpi h3 {
    margin-bottom: 6px;
}
.secondary-kpi strong,
#kpi-yield {
    color: var(--primary);
}
.suburb-trend {
    flex: 0 0 360px;
    height: 360px;
    min-height: 360px;
}
.suburb-trend qlik-embed {
    height: 320px;
}
@media (max-width: 760px) {
    #mobile-filters .range-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
    }
    #mobile-filters .filter-clear {
        top: 0;
    }
    #mobile-filters .suburb-group .filter-clear {
        top: 9px;
    }
    #mobile-filters .value-range {
        padding-right: 25px;
    }
    .suburb-summary {
        padding: 16px;
    }
    .suburb-kpis {
        gap: 20px 8px;
        margin: 28px 0;
    }

}

@media (min-width: 761px) {
    .map-filters .dropdown { min-width: 145px; }
    .range-filters .colour-group { min-width: 175px; }
}

/* Full-width property toolbar and chart-first desktop layout. */
#map-population-slot { left: 10px; right: auto; }
@media (min-width: 761px) {
    .dashboard { grid-template-columns: minmax(300px, 2fr) minmax(0, 3fr); gap: 10px; padding: 10px 24px 12px; }
    #desktop-filters { grid-column: 1 / -1; grid-row: 1; padding: 14px 18px; background: #f7f8f6; border: 1px solid var(--border); border-radius: 10px; }
    #charts-panel { grid-column: 1; grid-row: 2; }
    #map-panel { grid-column: 2; grid-row: 2; }
    .filters { grid-template-columns: minmax(150px, 1fr) minmax(220px, 1.6fr) minmax(270px, 1.4fr) auto; gap: 16px 22px; align-items: end; }
    .map-filters, .range-filters { display: contents; }
    .map-filters .dropdown { grid-row: 1; min-width: 0; }
    .map-filters .dropdown:nth-child(2) { grid-column: 1; }
    .map-filters .dropdown:nth-child(3) { grid-column: 2; }
    .range-filters .value-range { grid-column: 3; grid-row: 1; padding-bottom: 5px; }
    .filter-actions { grid-column: 4; grid-row: 1; align-self: end; }
    .range-filters .colour-group { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: 160px minmax(0, 1fr); align-items: center; border-top: 1px solid var(--border); padding-top: 12px; }
    .dropdown summary, .dropdown[open] summary { height: 24px; padding: 0 28px 5px 0; border: 0; border-radius: 0; background: transparent; pointer-events: none; font-weight: 600; font-size: 12px; text-transform: uppercase; }
    .dropdown summary::after { display: none; }
    .dropdown .filter-clear { top: 0; right: 2px; pointer-events: auto; }
    .filters .dropdown .web-options { position: static; display: flex; width: 100%; min-width: 0; max-width: none; max-height: none; gap: 5px; box-shadow: none; border-radius: 5px; padding: 5px; }
    .dropdown .web-options button { justify-content: center; flex: 1; width: auto; min-height: 27px; padding: 4px 8px; border-radius: 0; font-size: 12px; white-space: nowrap; }
    .dropdown .web-options button[aria-pressed="true"]::after { display: none; }
    :is(.colour-group .web-options, #combined-colour-options) { background: transparent; }
    :is(.colour-group .web-options, #combined-colour-options) button { background: transparent; gap: 8px; white-space: normal; text-align: left; justify-content: flex-start; }
    :is(.colour-group .web-options, #combined-colour-options) button::before { content: ""; flex: 0 0 17px; height: 17px; border: 2px solid currentColor; border-radius: 50%; }
    :is(.colour-group .web-options, #combined-colour-options) button[aria-pressed="true"] { color: var(--primary); }
    :is(.colour-group .web-options, #combined-colour-options) button[aria-pressed="true"]::before { background: var(--primary); box-shadow: inset 0 0 0 3px #f7f8f6; }
    #filter-error { grid-column: 1 / -1; }
}
@media (min-width: 761px) and (max-width: 1100px) {
    .dashboard { padding: 8px; }
    .filters { grid-template-columns: minmax(140px, 1fr) minmax(200px, 1.4fr); gap: 12px; }
    .range-filters .value-range { grid-column: 1; grid-row: 2; }
    .filter-actions { grid-column: 2; grid-row: 2; justify-self: end; }
    .range-filters .colour-group { grid-row: 3; grid-template-columns: 120px minmax(0, 1fr); }
    .colour-group .web-options { flex-wrap: wrap; }
    :is(.colour-group .web-options, #combined-colour-options) button { flex-basis: 28%; }
}

/* Keep the range caption aligned with the other filter headings. */
.range-heading,
#mobile-filters .range-heading {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
}
#value-range-label { text-transform: uppercase; }
.range-heading output { font-size: inherit; font-weight: 400; }
@media (min-width: 761px) {
    .suburb-comparison { grid-template-rows: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 10px; }
    .detail-table { border-top: 1px solid var(--border); padding-top: 10px; }
}

/* Fit suburb metrics and the full trend plot inside the available panel. */
.suburb-summary {
    box-sizing: border-box;
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    padding: 12px 14px;
    overflow: hidden;
}
.suburb-summary h2 {
    font-size: clamp(21px, 4.5cqi, 28px);
    margin: 0 28px 3px 0;
}
#suburb-subtitle { font-size: 12px; }
.suburb-kpis {
    gap: 12px 8px;
    margin: 16px 0;
}
.suburb-kpis h3 { margin-bottom: 6px; font-size: 10px; }
.suburb-kpis strong { font-size: clamp(14px, 3.8cqi, 24px); }
.suburb-kpis small { margin-top: 4px; font-size: 11px; }
.secondary-kpi { padding: 7px 8px; border-radius: 8px; }
.suburb-trend {
    height: 100%;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}
.suburb-trend qlik-embed { height: 100%; }
@media (max-height: 700px) {
    .suburb-summary { padding: 8px 10px; }
    .suburb-summary h2 { font-size: 21px; }
    .suburb-kpis { margin: 8px 0; gap: 7px; }
    .suburb-kpis h3 { margin-bottom: 3px; }
    .suburb-kpis strong { font-size: clamp(14px, 3.4cqi, 20px); }
    .secondary-kpi { padding: 5px 7px; }
}

/* Targeted filter controls: compact range and explicit per-field clear actions. */
.range-sliders { width: 100%; }
#clear-detail { width: auto; min-width: 36px; font: inherit; font-size: 11px; text-transform: none; }
@media (min-width: 761px) {
    .range-filters .value-range { align-self: stretch; justify-content: space-between; padding-top: 0; padding-bottom: 5px; }
    .range-heading { min-height: 24px; align-items: baseline; }
    .dropdown summary { padding-right: 44px; }
}
#close-suburb:disabled { opacity: .35; cursor: default; }

/* Fixed range footprint, with its actions immediately alongside. */
.filters .value-range,
#mobile-filters .value-range {
    box-sizing: border-box;
    width: 320px;
    max-width: 100%;
    padding-right: 0;
}
.range-heading,
#mobile-filters .range-heading {
    justify-content: flex-start;
    gap: 8px;
    white-space: nowrap;
}
.range-heading output {
    min-width: 0;
    font-variant-numeric: tabular-nums;
}
@media (min-width: 1101px) {
    .filters {
        grid-template-columns: minmax(150px, 1fr) minmax(220px, 1.5fr) 320px max-content;
        column-gap: 12px;
    }
}
@media (min-width: 761px) and (max-width: 1100px) {
    .filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 12px; }
    .range-filters .value-range { justify-self: end; }
    .filter-actions { justify-self: start; }
}
/* Give Qlik a definite content box; its own table manages scrolling/header layout. */
.detail-table {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    box-sizing: border-box;
    padding: 10px;
    isolation: isolate;
}
@media (min-width: 761px) {
    .detail-table { padding-top: 10px; }
    .map-filters .dropdown:nth-child(2) summary { padding-right: 0; }
}

/* Two analysis views share the toolbar and Qlik object hosts. */
.data-navigation { grid-column: 1 / -1; display: flex; gap: 8px; border-bottom: 1px solid var(--border); padding: 4px 0; }
.data-navigation button { min-height: 36px; padding: 6px 22px; border-radius: 4px; background: transparent; color: var(--text); font-size: 15px; box-shadow: none; }
.data-navigation button[aria-pressed="true"] { background: #69826c; color: white; }
.dashboard { grid-template-rows: auto auto minmax(0, 1fr); }
@media (min-width: 761px) {
    #desktop-filters { grid-row: 2; }
    #map-panel, #charts-panel { grid-row: 3; }
    #catchment-filter { grid-column: 1 / -1; grid-row: 3; display: grid; grid-template-columns: 160px minmax(0, 1fr); align-items: center; }
}
@media (min-width: 761px) and (max-width: 1100px) { #catchment-filter { grid-row: 4; } }
#clear-sector { width: auto; min-width: 36px; font-size: 11px; }
.dashboard[data-switching="true"] #charts-panel,
.dashboard[data-switching="true"] #map-panel { visibility: hidden; }
.suburb-summary[data-content-view="school"] { grid-template-rows: auto auto auto minmax(120px, .7fr) minmax(160px, 1fr); gap: 8px; overflow: auto; }
.school-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; margin: 8px 0; }
.school-kpis h3 { font-size: 12px; font-weight: 500; margin: 0 0 4px; color: var(--primary); }
.school-kpis strong { font-size: clamp(18px, 4cqi, 28px); color: #3588bb; }
.school-kpis .secondary-kpi strong { color: var(--text); }
.school-kpis small { display: block; font-size: 10px; color: var(--muted-dark); }
.school-language { display: flex; flex-direction: column; min-height: 0; }
.school-language h3, #school-trend-title { font-size: 14px; text-transform: none; margin: 0 0 6px; }
.school-language-key { display: flex; justify-content: space-around; font-size: 11px; padding: 2px 0; }
.school-language > .embed-region { flex: 1; min-height: 0; }
.suburb-summary[data-content-view="school"] .suburb-trend { display: flex; flex-direction: column; }
.suburb-summary[data-content-view="school"] .suburb-trend qlik-embed { flex: 1; min-height: 0; height: auto; }
@media (max-width: 760px) { .data-navigation { flex: none; } .data-navigation button { flex: 1; font-size: 14px; } }

#school-language-host > qlik-embed { width: 100%; height: 100%; }
.suburb-summary[data-content-view="school"] .suburb-trend { position: relative; }
.suburb-summary[data-content-view="school"] .suburb-trend > h3 { flex: none; }
/* qlik-embed uses display:contents; its rendered root must receive the remaining row. */
.suburb-summary[data-content-view="school"] .suburb-trend { display: grid; grid-template-rows: auto minmax(0, 1fr); }

@media (min-width: 1101px) {
    .dashboard[data-content-view="school"] .range-filters .colour-group { grid-column: 1 / 4; }
    #catchment-filter { grid-column: 4; grid-row: 2; display: block; }
}
.dashboard[data-content-view="school"] #property-options,
.dashboard[data-content-view="school"] #detail-options { flex-wrap: wrap; }
:is(#property-options, #detail-options, #catchment-options) button[aria-pressed="true"]:hover:not(:disabled) { background: #55735c; color: white; }

/* School has two colour measures; keep their choices together. */
@media (min-width: 761px) {
    .dashboard[data-content-view="school"] .range-filters .colour-group { width: min(100%, 560px); justify-self: start; box-sizing: border-box; }
}


/* One full-width divider, with the School controls grouped beneath it. */
.colour-catchment-row { display: contents; }
@media (min-width: 761px) {
    .dashboard[data-content-view="school"] .colour-catchment-row { grid-column: 1 / -1; grid-row: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; border-top: 1px solid var(--border); padding-top: 12px; }
    .dashboard[data-content-view="school"] .range-filters .colour-catchment-row .colour-group { border-top: 0; padding-top: 0; width: 100%; }
    .dashboard[data-content-view="school"] .range-filters .colour-group { flex: 0 1 560px; width: min(100%, 560px); }
    .dashboard[data-content-view="school"] .colour-catchment-row #catchment-filter { display: grid; grid-template-columns: auto minmax(140px, 1fr); align-items: center; gap: 12px; flex: 0 1 340px; min-width: 280px; }
}
@media (min-width: 761px) and (max-width: 1100px) {
    .dashboard[data-content-view="school"] .colour-catchment-row { grid-row: 3; }
}
.school-kpis { gap: 16px 24px; margin: 12px 0; }
.school-kpis > div { width: 100%; max-width: 230px; }
.school-kpis > div:nth-child(even) { justify-self: end; }
.school-kpis > div:not(.secondary-kpi) h3 { background: #f7f8f6; text-transform: uppercase; }
.school-kpis .secondary-kpi { background: #f7f8f6; border: 1px solid var(--border); border-radius: 6px; padding: 6px; box-sizing: border-box; }
.school-kpis .secondary-kpi h3 { text-transform: none; color: var(--text); }
.school-language-key { padding: 6px 0; }
.school-language-key span { display: flex; flex-direction: column-reverse; align-items: center; gap: 8px; }
.school-language-key i { width: 12px; height: 12px; border-radius: 50%; }
.language-no { background: #4e6550; }
.language-yes { background: #86a687; }
.language-unknown { background: #a8b3bf; }

/* Stack the mobile catchment label and options like the other filters. */
@media (max-width: 760px) {
    #catchment-filter { display: block; }
    #catchment-filter summary { padding-right: 0; }
    #catchment-filter summary::after { display: none; }
    #catchment-options { position: static; min-width: 0; width: 100%; box-sizing: border-box; }
}

/* Combined analysis shares the two-row toolbar and reuses the two chart hosts. */
@media (min-width: 761px) {
    .dashboard[data-content-view="combined"] .filters { grid-template-columns: minmax(100px, 1fr) minmax(115px, 1.2fr) minmax(100px, 1fr) minmax(130px, 1.3fr) minmax(110px, 1fr) minmax(170px, 1.5fr); gap: 12px; }
    .dashboard[data-content-view="combined"] .colour-catchment-row { display: contents; }
    .dashboard[data-content-view="combined"] #combined-sector-filter { grid-column: 3; grid-row: 1; }
    .dashboard[data-content-view="combined"] #combined-type-filter { grid-column: 4; grid-row: 1; }
    .dashboard[data-content-view="combined"] #catchment-filter { grid-column: 5; grid-row: 1; display: block; }
    .dashboard[data-content-view="combined"] .range-filters .value-range { grid-column: 6; grid-row: 1; width: 100%; min-width: 0; }
    .dashboard[data-content-view="combined"] .filter-actions { grid-column: 6; grid-row: 2; justify-self: end; }
    .dashboard[data-content-view="combined"] .range-filters .colour-group { grid-column: 1 / 7; grid-row: 2; grid-template-columns: max-content minmax(0, 1fr); gap: 12px; }
    .dashboard[data-content-view="combined"] #combined-colour-options { grid-column: 5; grid-row: 2; display: flex; position: static; min-width: 0; padding: 5px; box-shadow: none; }
    .dashboard[data-content-view="combined"] .web-options button { font-size: 12px; padding: 4px; white-space: normal; min-width: 0; }
    .dashboard[data-content-view="combined"] .dropdown summary { font-size: 12px; }
    .dashboard[data-content-view="combined"] .web-options { flex-wrap: nowrap; }
    .dashboard[data-content-view="combined"] .filter-clear { font-size: 11px; }
}
.dashboard[data-content-view="combined"] .suburb-comparison { grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
.dashboard[data-content-view="combined"] #combined-colour-options button { flex: 1; }
@media (max-width: 760px) {
    #combined-colour-options { position: static; width: 100%; min-width: 0; box-sizing: border-box; }
    .data-navigation button { padding-inline: 8px; }
}

@media (min-width: 761px) {
    .dashboard[data-content-view="combined"] .colour-group summary { padding-right: 0; }
    .dashboard[data-content-view="combined"] #colour-summary { overflow: visible; text-overflow: clip; }
    #combined-colour-options { border-radius: 5px; align-self: end; gap: 5px; }
    #combined-colour-options button { width: auto; min-height: 27px; border-radius: 0; font-size: 12px; font-weight: 400; font-family: inherit; }
    #combined-colour-options button[aria-pressed="true"]::after { display: none; }
}

/* Combined toolbar divider spans the whole colour-filter row. */
@media (min-width: 761px) {
    .dashboard[data-content-view="combined"] .filters::before {
        content: "";
        grid-column: 1 / -1;
        grid-row: 2;
        align-self: start;
        border-top: 1px solid var(--border);
        pointer-events: none;
    }
    .dashboard[data-content-view="combined"] .range-filters .colour-group { border-top: 0; }
}

/* Combined colours and actions share the bottom row. */
@media (min-width: 761px) {
    .dashboard[data-content-view="combined"] .filters { --filter-gap: 12px; grid-template-columns: max-content max-content max-content max-content max-content minmax(180px, 1fr); gap: var(--filter-gap); }
    .dashboard[data-content-view="combined"] .map-filters .dropdown:nth-child(2) { grid-column: 1; }
    .dashboard[data-content-view="combined"] .map-filters .dropdown:nth-child(3) { grid-column: 2; }
    .dashboard[data-content-view="combined"] #combined-sector-filter { grid-column: 3; }
    .dashboard[data-content-view="combined"] #combined-type-filter { grid-column: 4; }
    .dashboard[data-content-view="combined"] #catchment-filter { grid-column: 5; }
    .dashboard[data-content-view="combined"] .range-filters .value-range { grid-column: 6; }
    .dashboard[data-content-view="combined"] .range-filters .colour-group { grid-column: 1 / 5; gap: var(--filter-gap); min-width: 0; }
    .dashboard[data-content-view="combined"] #combined-colour-options { grid-column: 5; }
    .dashboard[data-content-view="combined"] .filter-actions { grid-column: 6; grid-row: 2; gap: var(--filter-gap); }
    .dashboard[data-content-view="combined"] .filter-actions button { padding-inline: 8px; }
    .dashboard[data-content-view="combined"] :is(#colour-options, #combined-colour-options) { gap: var(--filter-gap); overflow-x: auto; box-sizing: border-box; }
    .dashboard[data-content-view="combined"] :is(#colour-options, #combined-colour-options) button { flex: 1 0 auto; white-space: nowrap; }
}

@media (min-width: 761px) {
    .dashboard[data-content-view="combined"] :is(.map-filters .dropdown, #combined-sector-filter, #combined-type-filter, #catchment-filter) { min-width: 0; }
    .dashboard[data-content-view="combined"] :is(#property-options, #detail-options, #combined-sector-options, #combined-type-options, #catchment-options) { width: max-content; min-width: 100%; box-sizing: border-box; gap: 12px; }
    .dashboard[data-content-view="combined"] :is(#property-options, #detail-options, #combined-sector-options, #combined-type-options, #catchment-options) button { flex: 0 0 auto; white-space: nowrap; padding-inline: 10px; }
    .dashboard[data-content-view="combined"] .filters { overflow-x: auto; }
}


/* Balance the binary catchment control within its existing filter width. */
.dashboard[data-content-view] .filters #catchment-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    gap: 5px;
}
.dashboard[data-content-view] .filters #catchment-options button {
    width: 100%;
    min-width: 0;
    justify-content: center;
}

/* Compact mobile filter controls; desktop ordering is unchanged. */


/* Keep population filtering last, outside either Combined filter group. */
#mobile-population-slot { display: none; grid-column: 1 / -1; order: 99; }
.filters #mobile-population-slot .population-toggle { position: static; white-space: nowrap; }
.filters :is(#colour-options,#combined-colour-options) { max-height: none; overflow: visible; flex-wrap: wrap; }


@media (min-width: 761px) {
 .dashboard[data-content-view] .filters :is(#colour-options,#combined-colour-options) { overflow: visible; flex-wrap: wrap; width: 100%; min-width: 0; }
}

/* Match the Combined school heading to the other mobile filter headings. */


@media (max-width: 760px) {

 .data-navigation { display: flex; flex-wrap: nowrap; gap: 4px; }
 .data-navigation button { flex: 1 1 auto; min-width: 0; min-height: 32px; padding: 6px 5px; font-size: clamp(10px, 3vw, 13px); white-space: nowrap; }
 .mobile-toolbar { gap: 5px; }
 .mobile-toolbar button { padding: 6px; font-size: 11px; min-height: 34px; }
 .mobile-quick-actions { display: flex; gap: 4px; }
 .view-switch #show-charts { order: -1; }
 .dialog-heading { flex-wrap: wrap; gap: 8px; }
 .dialog-heading h2 { width: 100%; margin: 0; }
 #mobile-filter-actions { flex: 1; }
 #mobile-filter-actions .filter-actions { display: flex; gap: 6px; }
 #mobile-filter-actions button, #close-filters { padding: 8px 10px; font-size: 12px; min-height: 36px; }
 #combined-filter-switch { display: flex; gap: 6px; margin-bottom: 14px; }
 #combined-filter-switch button { flex: 1; padding: 6px; min-height: 32px; }
 #combined-filter-switch button[aria-pressed="true"] { background: var(--primary); color: white; }
 #mobile-filters .map-filters, #mobile-filters .range-filters, #mobile-filters .colour-catchment-row { display: contents; }
 #mobile-filters .colour-group { order: 0; }
 #mobile-filters #primary-filter { order: 1; }
 #mobile-filters .value-range { order: 2; }
 #mobile-filters #detail-filter { order: 3; }
 #mobile-filters #combined-sector-filter { order: 3; }
 #mobile-filters #combined-type-filter { order: 4; }
 #mobile-filters #catchment-filter { order: 5; }
 #mobile-filters :is(#property-options,#detail-options,#combined-sector-options,#combined-type-options,#catchment-options) { display: flex; flex-wrap: nowrap; gap: 3px; overflow-x: auto; }
 #mobile-filters :is(#property-options,#detail-options,#combined-sector-options,#combined-type-options,#catchment-options) button { flex: 1 0 auto; width: auto; min-width: 0; padding: 7px 5px; font-size: 12px; white-space: nowrap; justify-content: center; }
 #filters-dialog[data-content-view="school"] #primary-filter { order: 3; }
 #filters-dialog[data-content-view="school"] #detail-filter { order: 4; }
 #filters-dialog[data-content-view="combined"][data-filter-group="property"] :is(#combined-colour-options,#combined-sector-filter,#combined-type-filter,#catchment-filter) { display: none; }
 #filters-dialog[data-content-view="combined"][data-filter-group="school"] :is(.colour-group,#primary-filter,#detail-filter) { display: none; }
 #mobile-filters #combined-colour-options { order: 0; }
 #filters-dialog[data-content-view="combined"][data-filter-group="school"] #combined-colour-options::before { content: "Colour Map By"; display: block; font-weight: 600; margin-bottom: 6px; }


 #filters-dialog { width: min(520px, calc(100vw - 20px)); height: min(740px, calc(100dvh - 20px)); max-height: calc(100dvh - 20px); padding: 14px; box-sizing: border-box; }
 #mobile-filters .filters { gap: 12px; }
 #mobile-filters :is(#colour-options,#combined-colour-options) { display: grid; grid-template-columns: minmax(0,1fr); max-height: none; overflow: visible; gap: 4px; }
 #mobile-filters :is(#colour-options,#combined-colour-options) button { min-width: 0; white-space: normal; padding: 7px; font-size: 12px; min-height: 36px; }

 #filters-dialog[data-content-view="combined"][data-filter-group="school"] .value-range { display: flex; }
 #mobile-population-slot { display: block; margin-top: 4px; }
 #mobile-population-slot .population-toggle { font-size: 11px; }


 #mobile-filters summary,
 #mobile-filters .range-heading,
 #filters-dialog[data-content-view="combined"][data-filter-group="school"] #combined-colour-options::before {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-transform: none;
 }
 #mobile-filters #value-range-label { text-transform: none; }
 #mobile-filters .web-options button { font-family: inherit; font-size: 12px; font-weight: 400; line-height: 1.4; }

}

/* Estimated initial loading progress, scoped to the analytics gate. */
.gate-content { width: min(100%, 360px); }
.analytics-progress {
    position: relative;
    height: 8px;
    border-radius: 999px;
    background: var(--primary-soft);
    margin: 28px 0 18px;
}
.analytics-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--primary);
    border-radius: inherit;
    transition: width 150ms linear;
}
.analytics-progress-number {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.gate-content #gate-text {
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
}
@media (prefers-reduced-motion: reduce) {
    .analytics-progress-fill { transition: none; }
}

/* Fixed-width dots fade in sequence without shifting the centred caption. */
.loading-dots { display: inline-block; width: 0.9em; text-align: left; }
.loading-dots span:nth-child(2) { animation: loading-dot-two 1.8s ease-in-out infinite; }
.loading-dots span:nth-child(3) { animation: loading-dot-three 1.8s ease-in-out infinite; }
@keyframes loading-dot-two {
    0%, 25%, 100% { opacity: 0; }
    35%, 90% { opacity: 1; }
}
@keyframes loading-dot-three {
    0%, 58%, 100% { opacity: 0; }
    68%, 90% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .loading-dots span { animation: none; }
}
