:root {
    color-scheme: dark;
    --bg: #030504;
    --panel: rgba(8, 16, 18, 0.78);
    --panel-strong: rgba(3, 7, 8, 0.92);
    --panel-solid: #071012;
    --border: rgba(185, 255, 236, 0.11);
    --border-strong: rgba(185, 255, 236, 0.22);
    --text: #f5fff9;
    --muted: #9fb6af;
    --muted-2: #667d77;
    --cyan: #2dd4bf;
    --blue: #0ea5e9;
    --violet: #a78bfa;
    --emerald: #22c55e;
    --orange: #f59e0b;
    --red: #ef4444;
    --gold: #facc15;
    --radius: 8px;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.56);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 44% 34%, rgba(45, 212, 191, 0.16), transparent 33%),
        radial-gradient(circle at 78% 24%, rgba(245, 158, 11, 0.1), transparent 24%),
        radial-gradient(circle at 20% 78%, rgba(14, 165, 233, 0.1), transparent 34%),
        linear-gradient(180deg, #030504 0%, #050708 50%, #020303 100%);
    color: var(--text);
    overflow-x: hidden;
}

body.app-loading {
    overflow: hidden;
}

body.app-loading .app-shell {
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
}

body.app-ready .app-shell {
    animation: revealApp 260ms ease both;
}

@keyframes revealApp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

button,
input,
select,
textarea {
    font: inherit;
}

a {
    color: inherit;
}

.app-shell {
    position: relative;
    min-height: 100vh;
    isolation: isolate;
}

.app-loader {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 13px;
    padding: 28px;
    color: var(--text);
    background:
        radial-gradient(circle at 50% 40%, rgba(45, 212, 191, 0.2), transparent 32%),
        radial-gradient(circle at 58% 54%, rgba(245, 158, 11, 0.11), transparent 30%),
        linear-gradient(180deg, #030504 0%, #020303 100%);
    transition: opacity 240ms ease, visibility 240ms ease;
}

body.app-ready .app-loader {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.app-loader::before {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(159, 255, 224, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(159, 255, 224, 0.045) 1px, transparent 1px),
        linear-gradient(115deg, transparent 0 46%, rgba(250, 204, 21, 0.06) 47%, transparent 49% 100%);
    background-size: 44px 44px, 44px 44px, 220px 220px;
    mask-image: radial-gradient(circle at 50% 44%, black, transparent 72%);
    content: "";
}

.app-loader img {
    width: 88px;
    height: 88px;
    filter: drop-shadow(0 0 26px rgba(34, 211, 238, 0.35));
    animation: loaderOrbit 2.4s ease-in-out infinite;
}

.app-loader strong {
    font-size: 20px;
}

.app-loader span {
    max-width: 360px;
    color: var(--muted);
    text-align: center;
    line-height: 1.5;
}

.app-loader-bar {
    overflow: hidden;
    width: min(280px, 72vw);
    height: 5px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
}

.app-loader-bar i {
    display: block;
    width: 42%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--cyan), var(--gold), var(--blue));
    box-shadow: 0 0 24px rgba(34, 211, 238, 0.42);
    animation: loadingSweep 1.25s ease-in-out infinite;
}

@keyframes loaderOrbit {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-4px) scale(1.03);
    }
}

@keyframes loadingSweep {
    from {
        transform: translateX(-105%);
    }
    to {
        transform: translateX(245%);
    }
}

.grid-overlay {
    position: fixed;
    inset: 0;
    z-index: -3;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(159, 255, 224, 0.036) 1px, transparent 1px),
        linear-gradient(90deg, rgba(159, 255, 224, 0.036) 1px, transparent 1px),
        radial-gradient(circle at center, rgba(250, 204, 21, 0.04), transparent 34%);
    background-size: 46px 46px, 46px 46px, 640px 640px;
    mask-image: radial-gradient(circle at 50% 30%, black, transparent 76%);
}

.ambient {
    position: fixed;
    z-index: -4;
    border-radius: 999px;
    filter: blur(80px);
    opacity: 0.55;
    pointer-events: none;
    animation: floatGlow 12s ease-in-out infinite alternate;
}

.ambient-one {
    width: 420px;
    height: 420px;
    top: 12%;
    right: 12%;
    background: rgba(45, 212, 191, 0.18);
}

.ambient-two {
    width: 360px;
    height: 360px;
    left: 18%;
    bottom: 5%;
    background: rgba(245, 158, 11, 0.11);
    animation-delay: -4s;
}

@keyframes floatGlow {
    from {
        transform: translate3d(-18px, 0, 0) scale(0.96);
    }
    to {
        transform: translate3d(18px, -24px, 0) scale(1.04);
    }
}

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: 72px;
    padding: 16px 28px;
    background: linear-gradient(180deg, rgba(3, 5, 4, 0.95), rgba(3, 5, 4, 0.54));
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    min-width: 220px;
}

.brand-logo {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: block;
    filter: drop-shadow(0 0 18px rgba(45, 212, 191, 0.34));
}

.brand strong {
    display: block;
    letter-spacing: 0;
    font-size: 16px;
    text-transform: uppercase;
}

.brand small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--muted);
    font-size: 14px;
}

.nav-links a {
    text-decoration: none;
}

.nav-links a:hover {
    color: var(--text);
}

.top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 280px;
}

.button.active {
    border-color: rgba(34, 211, 238, 0.42);
    box-shadow: 0 0 30px rgba(34, 211, 238, 0.14);
}

.workspace {
    min-height: 100vh;
    padding: 88px 22px 22px;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 16px;
}

.site-footer {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 0 22px 24px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
}

.site-footer a {
    color: var(--cyan);
    text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
    color: var(--text);
    text-decoration: underline;
}

.filter-panel,
.detail-panel,
.modal,
.table-shell,
.analytics-shell,
.globe-card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.78), rgba(2, 6, 23, 0.78));
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
}

.filter-panel {
    position: sticky;
    top: 88px;
    align-self: start;
    max-height: calc(100vh - 120px);
    overflow: auto;
    border-radius: var(--radius);
    padding: 15px;
}

.panel-heading,
.section-heading {
    margin-bottom: 18px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #8fffe8;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.panel-heading h2,
.section-heading h2,
.modal-header h2 {
    margin: 4px 0 4px;
    font-size: 20px;
}

.panel-heading p,
.hero-copy p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.field {
    display: grid;
    gap: 7px;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 13px;
}

.field span {
    font-weight: 600;
}

.address-field,
.city-field,
.country-field {
    position: relative;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    background: rgba(2, 6, 23, 0.68);
    outline: none;
    padding: 11px 12px;
    min-height: 42px;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
    border-color: rgba(34, 211, 238, 0.8);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.16);
}

input[readonly] {
    color: #c8f7ff;
    border-color: rgba(34, 211, 238, 0.24);
    background: rgba(34, 211, 238, 0.055);
}

.button,
.view-button,
.icon-button {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    background: rgba(15, 23, 42, 0.74);
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 14px;
    font-weight: 700;
}

.button:hover,
.view-button:hover,
.icon-button:hover {
    transform: translateY(-1px);
    border-color: var(--border-strong);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.52;
    transform: none;
}

.button-primary {
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.97), rgba(250, 204, 21, 0.92));
    color: #03110d;
    box-shadow: 0 12px 40px rgba(45, 212, 191, 0.2);
}

.button-secondary {
    background: rgba(15, 23, 42, 0.92);
}

.button-ghost {
    background: rgba(255, 255, 255, 0.045);
}

.full-width {
    width: 100%;
}

.legend {
    display: grid;
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
}

.legend div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    display: inline-block;
    border-radius: 999px;
    box-shadow: 0 0 18px currentColor;
}

.dot.emerald {
    color: var(--emerald);
    background: var(--emerald);
}

.dot.orange {
    color: var(--orange);
    background: var(--orange);
}

.dot.violet {
    color: var(--violet);
    background: var(--violet);
}

.dot.city {
    color: #e2e8f0;
    background: #e2e8f0;
}

.bar {
    width: 8px;
    height: 18px;
    display: inline-block;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--cyan), transparent);
}

.main-stage {
    min-width: 0;
}

.hero {
    position: relative;
    min-height: calc(100vh - 120px);
    display: grid;
    grid-template-rows: auto auto auto minmax(680px, 1fr);
    gap: 16px;
}

.hero::before {
    position: absolute;
    top: 12px;
    right: 6px;
    width: min(420px, 48vw);
    height: 120px;
    pointer-events: none;
    background:
        linear-gradient(90deg, transparent, rgba(45, 212, 191, 0.22), transparent),
        repeating-linear-gradient(90deg, rgba(250, 204, 21, 0.24) 0 1px, transparent 1px 18px);
    mask-image: linear-gradient(90deg, transparent, black 18%, black 82%, transparent);
    opacity: 0.36;
    content: "";
}

.hero-copy {
    max-width: 680px;
    padding: 8px 4px 0;
    z-index: 2;
}

.hero-copy h1 {
    margin: 8px 0 10px;
    font-size: clamp(34px, 4.2vw, 56px);
    line-height: 0.98;
    letter-spacing: 0;
    text-shadow: 0 0 42px rgba(45, 212, 191, 0.12);
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.view-switcher {
    display: inline-flex;
    align-items: center;
    width: max-content;
    gap: 6px;
    padding: 5px;
    background: rgba(2, 6, 23, 0.72);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(16px);
}

.view-button {
    min-width: 92px;
    min-height: 36px;
    padding: 8px 12px;
    color: var(--muted);
}

.view-button.active {
    color: #001018;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 0 34px rgba(34, 211, 238, 0.2);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(142px, 1fr));
    gap: 10px;
    align-items: start;
}

.stat-card {
    position: relative;
    overflow: hidden;
    padding: 14px;
    min-height: 96px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.075), transparent 34%),
        radial-gradient(circle at 86% 16%, rgba(45, 212, 191, 0.15), transparent 36%),
        rgba(7, 16, 18, 0.72);
    backdrop-filter: blur(16px);
}

.stat-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.stat-card span {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.stat-card i {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(34, 211, 238, 0.28);
    border-radius: 999px;
    color: var(--cyan);
    background: rgba(34, 211, 238, 0.08);
    font-style: normal;
    font-weight: 900;
}

.stat-card strong {
    display: block;
    margin-top: 10px;
    font-size: clamp(18px, 1.35vw, 22px);
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.stat-card small {
    display: block;
    margin-top: 9px;
    color: var(--muted-2);
    font-size: 12px;
    line-height: 1.35;
}

.stat-meter,
.quality-meter {
    overflow: hidden;
    height: 5px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.13);
}

.stat-meter {
    margin-top: 12px;
}

.stat-meter span,
.quality-meter span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--cyan), var(--blue));
    box-shadow: 0 0 18px rgba(34, 211, 238, 0.3);
}

.view {
    display: none;
    min-height: 540px;
}

.view.active {
    display: block;
    animation: fadeUp 220ms ease both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.globe-card {
    position: relative;
    overflow: hidden;
    min-height: 680px;
    height: calc(100vh - 250px);
    border-radius: 16px;
    background:
        radial-gradient(circle at 50% 45%, rgba(45, 212, 191, 0.15), transparent 34%),
        radial-gradient(circle at 70% 30%, rgba(250, 204, 21, 0.08), transparent 26%),
        linear-gradient(180deg, #020403 0%, #050708 100%);
    box-shadow: inset 0 0 140px rgba(0, 0, 0, 0.72), 0 32px 90px rgba(0, 0, 0, 0.54);
}

.globe-card::before {
    content: "";
    position: absolute;
    inset: -20%;
    background:
        radial-gradient(circle at 55% 46%, rgba(45, 212, 191, 0.22), transparent 34%),
        radial-gradient(circle at 48% 52%, rgba(14, 165, 233, 0.13), transparent 48%),
        repeating-linear-gradient(115deg, transparent 0 34px, rgba(250, 204, 21, 0.035) 35px 36px);
    pointer-events: none;
}

.globe-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at center, transparent 42%, rgba(2, 6, 23, 0.2) 72%, rgba(2, 6, 23, 0.78) 100%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 18%);
}

#globeViz,
#mapLibreViz {
    position: absolute;
    inset: 0;
    z-index: 1;
}

#globeViz {
    opacity: 0;
    pointer-events: none;
}

#mapLibreViz {
    background: #020617;
}

#globeViz canvas {
    display: block;
}

.maplibregl-canvas {
    outline: none;
}

.maplibregl-ctrl,
.maplibregl-ctrl-attrib,
.maplibregl-popup-tip {
    display: none !important;
}

.maplibregl-popup-content {
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.startup-map-popup .maplibregl-popup-content {
    min-width: 190px;
}

.map-tooltip {
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 12px;
    color: #f8fafc;
    background: rgba(2, 6, 23, 0.9);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(16px);
    font-size: 12px;
    line-height: 1.45;
}

.map-tooltip strong {
    display: block;
    color: #f8fafc;
    font-size: 13px;
}

.map-tooltip span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.map-tooltip em {
    display: block;
    margin-top: 6px;
    color: var(--cyan);
    font-style: normal;
    font-weight: 700;
}

.globe-loading,
.empty-state {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    gap: 14px;
    align-content: center;
    color: var(--muted);
    background: radial-gradient(circle at center, rgba(15, 23, 42, 0.76), rgba(2, 6, 23, 0.82));
}

.map-error {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 58px;
    z-index: 6;
    padding: 12px 14px;
    border: 1px solid rgba(249, 115, 22, 0.34);
    border-radius: 14px;
    color: #fed7aa;
    background: rgba(67, 20, 7, 0.72);
    backdrop-filter: blur(16px);
    font-size: 13px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.map-toolbar,
.globe-legend {
    position: absolute;
    z-index: 4;
    border: 1px solid rgba(185, 255, 236, 0.14);
    border-radius: 8px;
    background: rgba(3, 7, 8, 0.72);
    backdrop-filter: blur(16px);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
}

.map-toolbar {
    top: 14px;
    right: 14px;
    display: grid;
    flex-wrap: wrap;
    gap: 7px;
    padding: 8px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.control-group > span {
    padding: 0 5px;
    color: var(--muted-2);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.map-toolbar label,
.map-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.map-pill.active,
.map-toolbar label:has(input:checked) {
    color: #e0faff;
    background: rgba(34, 211, 238, 0.1);
    border-color: rgba(34, 211, 238, 0.22);
    box-shadow: 0 0 24px rgba(34, 211, 238, 0.1);
}

.map-toolbar input[type="checkbox"] {
    position: relative;
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    min-height: 15px;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, 0.44);
    border-radius: 4px;
    appearance: none;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.92));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    cursor: pointer;
}

.map-toolbar input[type="checkbox"]::after {
    position: absolute;
    inset: 2px;
    border-radius: 2px;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 140ms ease, transform 140ms ease;
    content: "";
}

.map-toolbar input[type="checkbox"]:checked {
    border-color: rgba(34, 211, 238, 0.82);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12), 0 0 22px rgba(34, 211, 238, 0.18);
}

.map-toolbar input[type="checkbox"]:checked::after {
    opacity: 1;
    transform: scale(1);
}

.globe-legend {
    left: 14px;
    bottom: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    max-width: min(560px, calc(100% - 28px));
    padding: 10px 12px;
    color: var(--muted);
    font-size: 12px;
}

.data-density {
    position: absolute;
    left: 16px;
    top: 16px;
    z-index: 4;
    max-width: min(360px, calc(100% - 32px));
    padding: 8px 11px;
    border: 1px solid rgba(185, 255, 236, 0.16);
    border-radius: 999px;
    color: rgba(226, 232, 240, 0.82);
    background: rgba(3, 7, 8, 0.62);
    backdrop-filter: blur(16px);
    font-size: 12px;
    font-weight: 700;
}

.city-label {
    padding: 3px 6px;
    border-radius: 999px;
    background: rgba(3, 7, 8, 0.68);
    border: 1px solid rgba(185, 255, 236, 0.24);
    color: rgba(226, 232, 240, 0.88);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0;
    backdrop-filter: blur(10px);
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.city-label-secondary {
    font-size: 8px;
    opacity: 0.68;
}

.globe-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.loader {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 2px solid rgba(148, 163, 184, 0.22);
    border-top-color: var(--cyan);
    animation: spin 900ms linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.hidden {
    display: none !important;
}

.table-shell,
.analytics-shell {
    border-radius: var(--radius);
    padding: 18px;
    min-height: 620px;
}

.table-wrap {
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
}

th,
td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

th button {
    color: inherit;
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 0;
    text-transform: inherit;
    letter-spacing: inherit;
    font-weight: 800;
}

tr.company-row {
    cursor: pointer;
}

tr.company-row:hover {
    background: rgba(34, 211, 238, 0.06);
}

.company-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 220px;
}

.logo {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: inline-grid;
    place-items: center;
    border-radius: var(--radius);
    color: #001018;
    font-weight: 900;
    box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.16), 0 0 24px rgba(34, 211, 238, 0.12);
}

.muted {
    color: var(--muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 5px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.045);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.badge.good {
    color: #9fffe0;
    border-color: rgba(16, 185, 129, 0.28);
    background: rgba(16, 185, 129, 0.1);
}

.badge.warn {
    color: #fed7aa;
    border-color: rgba(249, 115, 22, 0.28);
    background: rgba(249, 115, 22, 0.1);
}

.badge.violet {
    color: #ddd6fe;
    border-color: rgba(139, 92, 246, 0.28);
    background: rgba(139, 92, 246, 0.12);
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.chart-card {
    min-height: 280px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(2, 6, 23, 0.46);
    padding: 15px;
}

.chart-card h3 {
    margin: 0 0 14px;
    font-size: 15px;
}

.bar-row {
    display: grid;
    grid-template-columns: minmax(110px, 170px) 1fr auto;
    gap: 10px;
    align-items: center;
    margin: 10px 0;
    color: var(--muted);
    font-size: 13px;
}

.bar-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

.bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--cyan), var(--violet));
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.24);
}

.rank-list {
    display: grid;
    gap: 9px;
}

.rank-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.04);
}

.detail-panel {
    position: fixed;
    top: 94px;
    right: 24px;
    z-index: 50;
    width: min(430px, calc(100vw - 48px));
    max-height: calc(100vh - 118px);
    overflow: auto;
    border-radius: var(--radius);
    padding: 18px;
    transform: translateX(calc(100% + 40px));
    opacity: 0;
    pointer-events: none;
    transition: transform 220ms ease, opacity 220ms ease;
}

.detail-panel.open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.detail-title {
    display: flex;
    gap: 12px;
    align-items: center;
}

.detail-title h2 {
    margin: 0;
    font-size: 22px;
}

.detail-title p {
    margin: 4px 0 0;
    color: var(--muted);
}

.detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.icon-button {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    font-weight: 800;
}

.detail-description {
    color: var(--muted);
    line-height: 1.65;
    margin: 18px 0;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 16px 0;
}

.metric {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.04);
}

.metric span {
    color: var(--muted);
    display: block;
    font-size: 12px;
}

.metric strong {
    display: block;
    margin-top: 6px;
    overflow-wrap: anywhere;
}

.data-quality {
    display: grid;
    gap: 10px;
    margin: 16px 0;
    padding: 13px;
    border: 1px solid rgba(34, 211, 238, 0.18);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 8% 0%, rgba(34, 211, 238, 0.13), transparent 36%),
        rgba(2, 6, 23, 0.46);
}

.data-quality > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.data-quality span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.data-quality strong {
    color: var(--cyan);
}

.data-quality p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.detail-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 16px;
}

.detail-actions .button:first-child {
    grid-column: 1 / -1;
}

.hub-hero-number {
    margin: 18px 0;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 18px;
    background: radial-gradient(circle at 20% 10%, rgba(34, 211, 238, 0.14), transparent 44%), rgba(255, 255, 255, 0.035);
}

.hub-hero-number strong {
    display: block;
    font-size: 44px;
    line-height: 1;
}

.hub-hero-number span,
.hub-company-list h3 {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 800;
}

.hub-company-list {
    display: grid;
    gap: 9px;
    margin-top: 18px;
}

.hub-company-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 12px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.035);
    cursor: pointer;
    text-align: left;
}

.hub-company-row:hover {
    border-color: rgba(34, 211, 238, 0.24);
    background: rgba(34, 211, 238, 0.06);
}

.hub-company-row small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}

body.presentation-mode .workspace {
    grid-template-columns: 1fr;
}

body.presentation-mode .filter-panel,
body.presentation-mode .hero-copy,
body.presentation-mode .view-switcher,
body.presentation-mode .nav-links {
    display: none;
}

body.presentation-mode .main-stage {
    width: 100%;
}

body.presentation-mode .hero {
    min-height: calc(100vh - 110px);
    grid-template-rows: auto minmax(720px, 1fr);
}

body.presentation-mode .stats-grid {
    grid-template-columns: repeat(6, minmax(140px, 1fr));
}

body.presentation-mode .globe-card {
    min-height: calc(100vh - 230px);
    height: calc(100vh - 230px);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(8px);
}

.modal {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 80;
    width: min(760px, calc(100vw - 40px));
    max-height: calc(100vh - 48px);
    overflow: auto;
    border-radius: var(--radius);
    padding: 20px;
    transform: translate(-50%, -50%);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.company-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.company-form .field {
    margin-bottom: 0;
}

.field-wide {
    grid-column: 1 / -1;
}

.field-note {
    margin: -2px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.city-status {
    color: var(--muted-2);
    font-size: 11px;
    line-height: 1.35;
}

.city-status.verified {
    color: #9fffe0;
}

.rank-item.wide {
    grid-column: 1 / -1;
}

.rank-item a {
    color: var(--cyan);
    text-decoration: none;
}

.rank-item a:hover {
    text-decoration: underline;
}

.city-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 70;
    display: grid;
    gap: 4px;
    max-height: 250px;
    overflow: auto;
    padding: 6px;
    border: 1px solid rgba(34, 211, 238, 0.26);
    border-radius: var(--radius);
    background: rgba(2, 6, 23, 0.96);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(18px);
}

.city-suggestion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 38px;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: var(--text);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.city-suggestion:hover,
.city-suggestion:focus-visible {
    border-color: rgba(34, 211, 238, 0.28);
    background: rgba(34, 211, 238, 0.1);
}

.city-suggestion span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.city-suggestion-empty {
    padding: 9px 10px;
    color: var(--muted);
    font-size: 12px;
}

.address-suggestion {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
}

.address-suggestion strong {
    line-height: 1.35;
}

.address-suggestion span {
    line-height: 1.35;
}

.notification {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 90;
    max-width: 360px;
    border-radius: var(--radius);
    padding: 14px 16px;
    background: rgba(16, 185, 129, 0.16);
    border: 1px solid rgba(16, 185, 129, 0.32);
    color: #d1fae5;
    box-shadow: var(--shadow);
}

.empty-state-inline {
    padding: 28px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.035);
}

.boot-error {
    position: fixed;
    left: 24px;
    right: 24px;
    top: 88px;
    z-index: 100;
    display: grid;
    gap: 4px;
    padding: 14px;
    border-radius: var(--radius);
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.32);
    color: #fee2e2;
}

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

    .filter-panel {
        position: relative;
        top: auto;
        max-height: none;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }

    .filter-panel .panel-heading,
    .filter-panel .legend,
    .filter-panel .full-width {
        grid-column: 1 / -1;
    }

    .stats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .globe-card {
        min-height: 600px;
        height: 66vh;
    }
}

@media (max-width: 760px) {
    .topbar {
        height: auto;
        align-items: flex-start;
        padding: 14px;
    }

    .brand {
        min-width: 0;
    }

    .brand small,
    .nav-links {
        display: none;
    }

    .top-actions {
        min-width: 0;
        gap: 6px;
    }

    .top-actions .button {
        padding: 8px 10px;
        font-size: 12px;
    }

    .workspace {
        padding: 84px 12px 12px;
    }

    .site-footer {
        padding: 0 12px 18px;
    }

    .filter-panel {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .hero {
        grid-template-rows: auto auto auto minmax(420px, 1fr);
    }

    .hero-copy h1 {
        font-size: 38px;
    }

    .view-switcher {
        width: 100%;
    }

    .view-button {
        flex: 1;
        min-width: 0;
    }

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

    .globe-card {
        min-height: 420px;
        height: 58vh;
    }

    .map-toolbar {
        left: 10px;
        right: 10px;
        top: 10px;
        overflow-x: auto;
    }

    .control-group {
        width: max-content;
    }

    .map-toolbar label,
    .map-pill {
        min-width: 92px;
        justify-content: center;
    }

    .globe-legend {
        left: 10px;
        right: 10px;
        bottom: 10px;
        max-width: none;
    }

    .data-density {
        top: 96px;
        left: 10px;
        right: 10px;
        max-width: none;
        text-align: center;
    }

    .city-label {
        font-size: 10px;
        padding: 2px 6px;
    }

    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .company-form {
        grid-template-columns: 1fr;
    }

    .detail-panel {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: 82vh;
        border-radius: 12px 12px 0 0;
        transform: translateY(105%);
    }

    .detail-panel.open {
        transform: translateY(0);
    }
}
