:root {
    --ink: #172033;
    --muted: #657083;
    --faint: #8a94a6;
    --line: #d7deea;
    --surface: #ffffff;
    --surface-soft: #f2f6fd;
    --surface-tint: #eaf2ff;
    --brand: #2f80ed;
    --brand-deep: #1b3a67;
    --brand-soft: #dfeeff;
    --green: #16b36d;
    --amber: #c98925;
    --coral: #d45b56;
    --violet: #6f5fa8;
    --shadow-sm: 0 10px 28px rgba(28, 43, 70, 0.08);
    --shadow: 0 18px 48px rgba(28, 43, 70, 0.14);
    --radius: 8px;
}

* {
    box-sizing: border-box;
    letter-spacing: 0;
}

html {
    min-width: 320px;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: #edf2fb;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.geos-shell {
    display: grid;
    grid-template-columns: 4.75rem minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 1rem;
    min-height: 100vh;
    padding: 1rem;
}

.product-rail {
    grid-row: 1 / -1;
    display: grid;
    align-content: start;
    justify-items: center;
    gap: 1rem;
    padding: 0.85rem 0;
    border: 1px solid rgba(255, 255, 255, 0.84);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #f8fbff, #e8eef8);
    box-shadow: var(--shadow-sm);
}

.rail-brand {
    display: grid;
    width: 2.75rem;
    height: 2.75rem;
    place-items: center;
    border-radius: 8px;
    color: var(--brand-deep);
    background: #dfeeff;
    font-size: 1.25rem;
    font-weight: 900;
    text-decoration: none;
}

.rail-markers {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.6rem;
}

.rail-markers span {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: rgba(47, 128, 237, 0.22);
}

.rail-markers span:first-child {
    background: var(--brand);
}

.geos-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    min-height: 5.9rem;
    padding: 0.95rem 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(47, 128, 237, 0.1), transparent 38%),
        linear-gradient(315deg, rgba(22, 179, 109, 0.09), transparent 34%),
        rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-sm);
}

.geos-header h1 {
    margin: 0;
    color: var(--brand-deep);
    font-size: clamp(2rem, 4vw, 3.35rem);
    font-weight: 900;
    line-height: 0.9;
}

.geos-header p {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 1rem;
}

.geos-kicker,
.panel-heading p {
    margin: 0;
    color: var(--green);
    font-size: 0.74rem;
    font-weight: 850;
    text-transform: uppercase;
}

.header-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.9rem;
}

.header-metrics span {
    display: inline-flex;
    min-height: 1.85rem;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border: 1px solid rgba(17, 103, 125, 0.16);
    border-radius: 999px;
    color: var(--brand-deep);
    background: rgba(255, 255, 255, 0.68);
    font-size: 0.82rem;
    font-weight: 750;
}

.header-status {
    display: grid;
    gap: 0.45rem;
    min-width: 15.5rem;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(17, 103, 125, 0.14);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.82);
}

.header-status span {
    color: var(--faint);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.header-status strong {
    color: var(--ink);
    font-size: 1.05rem;
}

.header-status form {
    margin: 0.35rem 0 0;
}

.header-logout {
    min-height: 2.25rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid rgba(17, 103, 125, 0.18);
    border-radius: 6px;
    color: var(--brand-deep);
    background: #ffffff;
    font-size: 0.84rem;
    font-weight: 800;
}

.header-logout:hover {
    color: #ffffff;
    border-color: var(--brand);
    background: var(--brand);
}

.geos-tabs {
    display: flex;
    width: fit-content;
    padding: 0.28rem;
    border: 1px solid rgba(17, 103, 125, 0.12);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow-sm);
}

.geos-tabs .nav-link {
    min-width: 8rem;
    color: var(--muted);
    border-radius: 6px;
    font-weight: 850;
}

.geos-tabs .nav-link:hover {
    color: var(--brand-deep);
    background: var(--surface-soft);
}

.geos-tabs .nav-link.active {
    color: #ffffff;
    background: var(--brand);
}

.geos-content {
    display: grid;
    gap: 1rem;
    min-height: 0;
}

.map-workspace {
    position: relative;
    height: min(78vh, 60rem);
    min-height: min(78vh, 60rem);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.92);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.map-canvas {
    width: 100%;
    height: 100%;
    min-height: min(78vh, 60rem);
}

.per-capita-heat-canvas {
    opacity: 0.72;
    mix-blend-mode: multiply;
    filter: saturate(1.18) blur(0.15px);
}

.layer-panel,
.map-tools-panel,
.time-filter-panel,
.map-legend-panel {
    border: 1px solid rgba(255, 255, 255, 0.92);
    border-radius: var(--radius);
    background: rgba(246, 249, 255, 0.94);
    box-shadow: 0 18px 44px rgba(28, 43, 70, 0.14);
    backdrop-filter: blur(12px);
}

.layer-panel {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 500;
    display: grid;
    gap: 0.85rem;
    width: min(19rem, calc(100% - 2rem));
    max-height: calc(100% - 2rem);
    padding: 1rem;
    overflow: auto;
}

.map-tools-panel {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 510;
    display: grid;
    gap: 0.75rem;
    width: min(18rem, calc(100% - 22rem));
    min-width: 16rem;
    padding: 0.95rem;
}

.time-filter-panel {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    z-index: 500;
    display: grid;
    grid-template-columns: minmax(10rem, auto) minmax(12rem, 1fr) auto;
    gap: 0.85rem;
    align-items: center;
    width: min(39rem, calc(100% - 23rem));
    min-width: 28rem;
    padding: 0.75rem 0.9rem;
}

.map-legend-panel {
    position: absolute;
    right: 1rem;
    bottom: 5.25rem;
    z-index: 500;
    display: grid;
    gap: 0.55rem;
    width: min(18rem, calc(100% - 22rem));
    min-width: 16rem;
    padding: 0.75rem 0.9rem;
}

.map-legend-panel p {
    margin: 0;
    color: var(--green);
    font-size: 0.72rem;
    font-weight: 850;
    text-transform: uppercase;
}

.legend-items {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem 0.75rem;
}

.legend-items span {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    min-width: 0;
    color: var(--ink);
    font-size: 0.8rem;
    font-weight: 750;
}

.legend-items i {
    display: inline-block;
    width: 0.68rem;
    height: 0.68rem;
    flex: 0 0 auto;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: var(--legend-color);
    box-shadow: 0 0 0 1px rgba(21, 33, 43, 0.14);
}

.panel-heading h2 {
    margin: 0.1rem 0 0;
    color: var(--ink);
    font-size: 1.05rem;
    font-weight: 900;
}

.layer-list,
.draw-actions,
.dashboard-layout,
.filtered-data-panel,
.layer-data-panel {
    display: grid;
}

.layer-list {
    gap: 0.55rem;
}

.layer-toggle {
    display: grid;
    gap: 0.7rem;
    align-items: start;
    padding: 0.72rem;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-soft);
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.layer-toggle-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.65rem;
    align-items: start;
    min-width: 0;
}

.layer-toggle:hover {
    border-color: rgba(17, 103, 125, 0.28);
    background: #ffffff;
    transform: translateY(-1px);
}

.layer-toggle input {
    width: 1rem;
    height: 1rem;
    margin-top: 0.22rem;
    accent-color: var(--brand);
}

.layer-toggle strong,
.layer-toggle span {
    display: block;
}

.layer-toggle strong {
    font-size: 0.92rem;
}

.layer-toggle span,
.panel-note,
.draw-status,
.layer-data-summary {
    color: var(--muted);
    font-size: 0.84rem;
}

.layer-filter-panel {
    display: grid;
    gap: 0.7rem;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(215, 222, 234, 0.82);
}

.layer-filter-panel summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 1.75rem;
    color: var(--brand-deep);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
    list-style: none;
    cursor: pointer;
}

.layer-filter-panel summary::-webkit-details-marker {
    display: none;
}

.layer-filter-panel summary::after {
    width: 1.2rem;
    height: 1.2rem;
    border: 1px solid rgba(47, 128, 237, 0.25);
    border-radius: 999px;
    color: var(--brand);
    background: rgba(47, 128, 237, 0.08);
    content: "+";
    display: grid;
    place-items: center;
    font-weight: 900;
}

.layer-filter-panel[open] summary::after {
    content: "-";
}

.layer-filter-grid {
    display: grid;
    gap: 0.58rem;
}

.layer-filter-grid label {
    display: grid;
    gap: 0.28rem;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 850;
}

.layer-filter-grid select {
    min-height: 2.15rem;
    border-color: var(--line);
    border-radius: 6px;
    color: var(--ink);
    background-color: #ffffff;
    font-size: 0.78rem;
}

.layer-filter-clear {
    min-height: 2.1rem;
    border: 1px solid rgba(47, 128, 237, 0.24);
    border-radius: 6px;
    color: var(--brand-deep);
    background: rgba(47, 128, 237, 0.07);
    font-size: 0.78rem;
    font-weight: 850;
}

.layer-filter-clear:hover {
    color: #ffffff;
    border-color: var(--brand);
    background: var(--brand);
}

.layer-search-panel {
    display: grid;
    gap: 0.48rem;
    padding: 0.72rem;
    border: 1px solid rgba(47, 128, 237, 0.16);
    border-radius: 7px;
    background: rgba(47, 128, 237, 0.055);
}

.layer-search-toggle {
    display: flex;
    align-items: center;
    gap: 0.46rem;
    margin: 0;
    color: var(--brand-deep);
    font-size: 0.76rem;
    font-weight: 900;
}

.layer-search-toggle input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--brand);
}

.layer-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.52rem;
}

.layer-search-row input {
    min-height: 2.72rem;
    width: 100%;
    padding: 0 0.78rem;
    border-color: rgba(201, 214, 230, 0.96);
    border-radius: 6px;
    font-size: 0.94rem;
    font-weight: 780;
}

.layer-search-button {
    min-height: 2.46rem;
    width: 100%;
    padding: 0 0.9rem;
    border: 1px solid rgba(47, 128, 237, 0.34);
    border-radius: 6px;
    color: #ffffff;
    background: var(--brand);
    font-size: 0.86rem;
    font-weight: 850;
}

.layer-search-button:disabled {
    color: var(--muted);
    border-color: rgba(201, 214, 230, 0.8);
    background: rgba(255, 255, 255, 0.86);
}

.layer-search-status {
    margin: 0;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.35;
}

.layer-search-status[data-tone="ok"] {
    color: var(--green);
    font-weight: 850;
}

.layer-search-status[data-tone="warning"] {
    color: #963d3b;
    font-weight: 850;
}

.layer-timeline-panel {
    display: grid;
    gap: 0.5rem;
    padding: 0.72rem;
    border: 1px solid rgba(217, 119, 6, 0.2);
    border-radius: 7px;
    background: rgba(251, 191, 36, 0.09);
}

.layer-timeline-panel span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 850;
    text-transform: uppercase;
}

.layer-timeline-panel strong {
    display: block;
    color: var(--ink);
    font-size: 1.05rem;
    line-height: 1.1;
}

.layer-timeline-panel input[type="range"] {
    width: 100%;
    accent-color: #d97706;
}

.layer-timeline-years {
    display: flex;
    justify-content: space-between;
    gap: 0.35rem;
}

.layer-timeline-years span {
    color: var(--brand-deep);
    font-size: 0.68rem;
    font-weight: 850;
    text-transform: none;
}

.panel-note {
    padding-top: 0.8rem;
    border-top: 1px solid var(--line);
}

.layer-warning {
    display: grid;
    gap: 0.2rem;
    padding: 0.72rem;
    border: 1px solid rgba(212, 91, 86, 0.34);
    border-radius: 7px;
    color: #963d3b;
    background: rgba(212, 91, 86, 0.1);
}

.draw-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
}

.draw-action {
    min-height: 2.35rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    background: #ffffff;
    font-size: 0.86rem;
    font-weight: 800;
}

.draw-action:hover,
.draw-action.active {
    color: #ffffff;
    border-color: var(--brand);
    background: var(--brand);
}

.draw-action-danger {
    color: #963d3b;
}

.draw-action-danger:hover {
    border-color: var(--coral);
    background: var(--coral);
}

.draw-status {
    margin: 0;
    line-height: 1.4;
}

.time-filter-panel p {
    margin: 0;
    color: var(--green);
    font-size: 0.72rem;
    font-weight: 850;
    text-transform: uppercase;
}

.time-filter-panel strong {
    display: block;
    color: var(--ink);
    font-size: 0.95rem;
}

.time-filter-panel input[type="range"] {
    width: 100%;
    accent-color: var(--brand);
}

.time-filter-panel input[type="range"]:disabled {
    opacity: 0.42;
}

.dashboard-layout {
    gap: 1.1rem;
    padding: 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.92);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(240, 247, 251, 0.94)),
        #f5f9fc;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.dashboard-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.05rem 1.15rem;
    border: 1px solid rgba(201, 214, 230, 0.76);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(47, 128, 237, 0.08), rgba(22, 179, 109, 0.06)),
        rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-sm);
}

.dashboard-heading h2 {
    margin: 0.1rem 0 0;
    color: var(--ink);
    font-size: 1.45rem;
    font-weight: 900;
}

.dashboard-heading span {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 750;
}

.filter-bar,
.data-panel,
.kpi-card {
    border: 1px solid rgba(201, 214, 230, 0.76);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-sm);
}

.filter-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    padding: 1rem;
    align-items: end;
}

.filter-bar label,
.chart-controls label,
.layer-data-controls label,
.auth-form label {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 850;
}

.form-select,
.auth-form input {
    min-height: 2.65rem;
    border-color: var(--line);
    border-radius: 6px;
    color: var(--ink);
}

.filter-bar .form-select,
.chart-controls .form-select,
.layer-data-controls .form-select {
    margin-top: 0.35rem;
}

.form-select:focus,
.auth-form input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 0.2rem rgba(17, 103, 125, 0.14);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.kpi-card {
    position: relative;
    min-height: 7.4rem;
    padding: 1rem 1rem 1.05rem;
    overflow: hidden;
    border-top: 4px solid var(--brand);
}

.kpi-card::before {
    position: absolute;
    inset: 0.9rem 1rem auto auto;
    width: 0.72rem;
    height: 0.72rem;
    border-radius: 999px;
    background: var(--brand);
    box-shadow: 0 0 0 0.42rem rgba(47, 128, 237, 0.12);
    content: "";
}

.kpi-card:nth-child(2) {
    border-top-color: var(--green);
}

.kpi-card:nth-child(2)::before {
    background: var(--green);
    box-shadow: 0 0 0 0.42rem rgba(22, 179, 109, 0.13);
}

.kpi-card:nth-child(3) {
    border-top-color: var(--amber);
}

.kpi-card:nth-child(3)::before {
    background: var(--amber);
    box-shadow: 0 0 0 0.42rem rgba(201, 137, 37, 0.14);
}

.kpi-card:nth-child(4) {
    border-top-color: var(--coral);
}

.kpi-card:nth-child(4)::before {
    background: var(--coral);
    box-shadow: 0 0 0 0.42rem rgba(212, 91, 86, 0.13);
}

.kpi-card span {
    display: block;
    max-width: 11rem;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 800;
}

.kpi-card strong {
    display: block;
    margin-top: 0.8rem;
    color: var(--ink);
    font-size: clamp(1.8rem, 3vw, 2.75rem);
    line-height: 1;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(22rem, 1fr));
    gap: 1rem;
}

.data-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 25.5rem;
    padding: 1.1rem;
    overflow: hidden;
}

.data-panel canvas {
    width: 100% !important;
    height: 20.75rem !important;
    min-height: 0;
    margin-top: 0.35rem;
    padding: 0.65rem;
    border: 1px solid rgba(215, 222, 234, 0.78);
    border-radius: 7px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.98)),
        #fbfdff;
}

.age-range-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.65rem;
}

.age-range-action {
    min-height: 2rem;
    padding: 0.35rem 0.65rem;
    border: 1px solid rgba(201, 214, 230, 0.95);
    border-radius: 999px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.96);
    font-size: 0.78rem;
    font-weight: 850;
}

.age-range-action.active,
.age-range-action:hover {
    border-color: rgba(239, 68, 68, 0.42);
    color: #991b1b;
    background: rgba(254, 226, 226, 0.92);
}

.table-panel {
    min-height: auto;
}

.dashboard-table-wrap {
    max-height: 22rem;
    overflow: auto;
}

.dashboard-summary-table {
    width: 100%;
}

.dashboard-summary-table th,
.dashboard-summary-table td {
    white-space: nowrap;
}

.dashboard-summary-table td:first-child {
    min-width: 15rem;
    white-space: normal;
}

.heat-report-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.heat-report-grid div {
    min-height: 5.4rem;
    padding: 0.85rem;
    border: 1px solid rgba(215, 222, 234, 0.82);
    border-radius: 7px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.98)),
        #fbfdff;
}

.heat-report-grid span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 850;
}

.heat-report-grid strong {
    display: block;
    margin-top: 0.45rem;
    color: var(--ink);
    font-size: 1.05rem;
    line-height: 1.18;
}

.dashboard-note {
    margin-top: 0.85rem;
}

.filtered-data-panel,
.layer-data-panel {
    gap: 0.8rem;
}

.chart-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(10rem, 1fr));
    gap: 0.75rem;
    margin-top: 0.85rem;
}

.layer-data-controls {
    display: grid;
    grid-template-columns: minmax(14rem, 22rem) minmax(0, 1fr);
    gap: 1rem;
    align-items: end;
}

.layer-data-summary {
    margin: 0 0 0.72rem;
}

.column-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
}

.column-toolbar strong {
    font-size: 0.94rem;
}

.column-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.column-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: 0.5rem;
    max-height: 15rem;
    padding: 0.72rem;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-soft);
}

.column-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.48rem;
    align-items: start;
    min-height: 2.35rem;
    padding: 0.42rem 0.5rem;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--ink);
    background: var(--surface);
    font-size: 0.82rem;
    word-break: break-word;
}

.column-option.selected {
    border-color: rgba(17, 103, 125, 0.28);
    background: rgba(17, 103, 125, 0.08);
}

.column-option input {
    margin-top: 0.18rem;
    accent-color: var(--brand);
}

.geos-table {
    margin: 0.8rem 0 0;
}

.geos-table th {
    color: var(--muted);
    font-size: 0.76rem;
    text-transform: uppercase;
}

.geos-table td {
    min-width: 8rem;
    max-width: 20rem;
    color: var(--ink);
    word-break: break-word;
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.popup-title {
    margin: 0 0 0.35rem;
    color: var(--brand-deep);
    font-weight: 850;
}

.popup-meta {
    margin: 0.12rem 0;
    color: var(--ink);
}

.popup-hint {
    margin: 0.55rem 0 0;
    padding: 0.55rem 0.6rem;
    border-radius: 6px;
    color: var(--brand-deep);
    background: rgba(17, 103, 125, 0.08);
    font-size: 0.82rem;
}

.popup-connection-summary {
    display: grid;
    gap: 0.3rem;
    margin-top: 0.6rem;
    padding: 0.65rem;
    border: 1px solid rgba(17, 103, 125, 0.16);
    border-radius: 7px;
    background: rgba(17, 103, 125, 0.07);
}

.popup-connection-summary strong {
    color: var(--brand-deep);
}

.popup-connection-summary span {
    color: var(--muted);
    font-size: 0.8rem;
}

.cycle-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.2rem;
}

.cycle-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    padding: 0.22rem 0.45rem;
    border-radius: 999px;
    background: #ffffff;
    color: var(--ink) !important;
    font-size: 0.74rem !important;
    font-weight: 800;
}

.cycle-chip::before {
    width: 0.46rem;
    height: 0.46rem;
    border-radius: 999px;
    background: var(--cycle-color);
    content: "";
}

.connection-arrow-marker {
    display: grid;
    place-items: center;
    pointer-events: none;
}

.connection-arrow-marker span {
    display: block;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 12px solid var(--arrow-color);
    filter: drop-shadow(0 1px 2px rgba(23, 32, 51, 0.26));
    transform-origin: center;
}

.per-capita-dot-marker {
    display: grid;
    width: 16px;
    height: 16px;
    place-items: center;
    pointer-events: auto;
}

.per-capita-dot-marker span {
    position: relative;
    display: block;
    width: 13px;
    height: 13px;
    border: 2px solid #d92910;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 32%, #fff27a 0 16%, #ff9822 34%, #f04a15 68%, #c81710 100%);
    box-shadow:
        0 0 0 1px rgba(255, 236, 118, 0.65) inset,
        0 1px 3px rgba(84, 19, 10, 0.42);
}

.per-capita-dot-marker span::after {
    position: absolute;
    top: 2px;
    left: 3px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.84);
    content: "";
}

.draw-delete-button {
    min-height: 2rem;
    padding: 0.35rem 0.7rem;
    border: 1px solid rgba(212, 91, 86, 0.35);
    border-radius: 6px;
    color: #963d3b;
    background: rgba(212, 91, 86, 0.08);
    font-weight: 800;
}

.draw-delete-button:hover {
    color: #ffffff;
    background: var(--coral);
}

.meeting-marker {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: var(--coral);
    box-shadow: 0 6px 16px rgba(66, 22, 27, 0.35);
}

.meeting-marker span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffffff;
}

.municipal-health-marker {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 2px solid rgba(255, 255, 255, 0.96);
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand), #16b36d);
    box-shadow: 0 9px 22px rgba(47, 128, 237, 0.34);
}

.municipal-health-marker span {
    position: relative;
    display: block;
    width: 18px;
    height: 18px;
}

.municipal-health-marker span::before,
.municipal-health-marker span::after {
    position: absolute;
    inset: 0;
    margin: auto;
    border-radius: 2px;
    background: #ffffff;
    content: "";
}

.municipal-health-marker span::before {
    width: 6px;
    height: 18px;
}

.municipal-health-marker span::after {
    width: 18px;
    height: 6px;
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: clamp(1rem, 3vw, 2.5rem);
    background:
        linear-gradient(135deg, rgba(17, 103, 125, 0.2), transparent 36%),
        linear-gradient(315deg, rgba(20, 128, 92, 0.16), transparent 32%),
        #eef3f4;
}

.auth-panel {
    display: grid;
    grid-template-columns: minmax(17rem, 0.9fr) minmax(20rem, 28rem);
    gap: clamp(1.5rem, 5vw, 4rem);
    align-items: center;
    width: min(64rem, 100%);
}

.auth-brand {
    display: grid;
    gap: 1rem;
}

.auth-brand span {
    color: var(--brand-deep);
    font-size: clamp(3.5rem, 9vw, 7.2rem);
    font-weight: 950;
    line-height: 0.86;
}

.auth-brand strong {
    max-width: 28rem;
    color: var(--ink);
    font-size: clamp(1.25rem, 2vw, 1.8rem);
    line-height: 1.18;
}

.auth-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.auth-highlights span {
    width: auto;
    height: auto;
    padding: 0.42rem 0.72rem;
    border: 1px solid rgba(17, 103, 125, 0.16);
    border-radius: 999px;
    color: var(--brand-deep);
    background: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: 850;
    line-height: 1;
}

.auth-card {
    display: grid;
    gap: 1rem;
    padding: clamp(1.25rem, 3vw, 2rem);
    border: 1px solid rgba(255, 255, 255, 0.92);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
}

.auth-card h1 {
    margin: 0;
    color: var(--brand-deep);
    font-size: 2rem;
    font-weight: 900;
}

.auth-card p {
    margin: 0;
    color: var(--muted);
}

.auth-form {
    display: grid;
    gap: 0.9rem;
}

.auth-form label {
    display: grid;
    gap: 0.35rem;
}

.auth-form input {
    padding: 0.65rem 0.75rem;
    background: #ffffff;
}

.auth-form button {
    min-height: 2.8rem;
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    background: var(--brand);
    font-weight: 900;
}

.auth-form button:hover {
    background: var(--brand-deep);
}

.auth-alert,
.auth-hint {
    padding: 0.75rem 0.85rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.auth-alert {
    border: 1px solid rgba(212, 91, 86, 0.34);
    color: #963d3b;
    background: rgba(212, 91, 86, 0.1);
}

.auth-hint {
    border: 1px solid rgba(17, 103, 125, 0.24);
    color: var(--brand-deep);
    background: rgba(17, 103, 125, 0.08);
}

@media (max-width: 980px) {
    .geos-shell {
        grid-template-columns: 1fr;
    }

    .product-rail {
        display: none;
    }

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

@media (max-width: 720px) {
    .geos-shell {
        padding: 0.75rem;
    }

    .auth-panel,
    .filter-bar,
    .kpi-grid,
    .chart-grid,
    .layer-data-controls,
    .chart-controls {
        grid-template-columns: 1fr;
    }

    .geos-header {
        align-items: start;
        flex-direction: column;
    }

    .header-status {
        width: 100%;
    }

    .geos-tabs {
        width: 100%;
    }

    .geos-tabs .nav-link {
        flex: 1;
        min-width: 0;
    }

    .column-toolbar {
        align-items: start;
        flex-direction: column;
    }

    .map-workspace,
    .map-canvas {
        min-height: 72vh;
    }

    .layer-panel {
        top: auto;
        bottom: 5.5rem;
        max-height: 38%;
    }

    .map-tools-panel {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        width: auto;
        min-width: 0;
    }

    .draw-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .time-filter-panel {
        right: 1rem;
        bottom: 1rem;
        left: 1rem;
        width: auto;
        min-width: 0;
        grid-template-columns: 1fr auto;
    }

    .time-filter-panel input[type="range"] {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .map-legend-panel {
        display: none;
    }
}

/* Map panels: compact collapsible controls */
.time-filter-panel {
    display: none !important;
}

.collapsible-map-panel {
    overflow: hidden;
}

.collapsible-map-panel summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: -0.1rem 0 0.75rem;
    cursor: pointer;
    list-style: none;
}

.collapsible-map-panel summary::-webkit-details-marker {
    display: none;
}

.collapsible-map-panel summary::after {
    content: "+";
    display: grid;
    width: 1.55rem;
    height: 1.55rem;
    place-items: center;
    border: 1px solid rgba(17, 103, 125, 0.18);
    border-radius: 999px;
    color: var(--brand-deep);
    background: rgba(255, 255, 255, 0.8);
    font-weight: 900;
}

.collapsible-map-panel[open] summary::after {
    content: "-";
}

.collapsible-map-panel summary span {
    color: var(--brand);
    font-size: 0.72rem;
    font-weight: 950;
    line-height: 1;
    text-transform: uppercase;
}

.collapsible-map-panel summary strong {
    color: var(--ink);
    font-size: 1rem;
    font-weight: 900;
}

.collapsible-map-panel:not([open]) {
    padding-bottom: 0.75rem;
}

.collapsible-map-panel:not([open]) summary {
    margin-bottom: 0;
}

.municipal-health-marker {
    z-index: 600 !important;
}


/* Fully hideable map panels */
.panel-heading-actions {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 0.75rem;
}

.panel-hide-button {
    display: inline-grid;
    flex: 0 0 auto;
    width: 1.55rem;
    height: 1.55rem;
    place-items: center;
    border: 1px solid rgba(17, 103, 125, 0.18);
    border-radius: 999px;
    color: var(--brand-deep);
    background: rgba(255, 255, 255, 0.88);
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
}

.panel-hide-button:hover,
.map-panel-reopen-button:hover {
    color: #ffffff;
    border-color: var(--brand);
    background: var(--brand);
}

.collapsible-map-panel summary .panel-hide-button {
    margin-left: auto;
}

.collapsible-map-panel summary::after {
    flex: 0 0 auto;
}

.map-panel-hidden {
    display: none !important;
}

.map-panel-reopen {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    z-index: 530;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    max-width: calc(100% - 2rem);
    pointer-events: none;
}

.map-panel-reopen-button {
    min-height: 2rem;
    padding: 0.35rem 0.7rem;
    border: 1px solid rgba(17, 103, 125, 0.18);
    border-radius: 999px;
    color: var(--brand-deep);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 26px rgba(28, 43, 70, 0.14);
    font-size: 0.78rem;
    font-weight: 850;
    pointer-events: auto;
}

.map-panel-reopen-button[hidden] {
    display: none !important;
}
