:root {
    --ink: #0c0f14;
    --muted: #5f6b78;
    --accent: #00c1c2;
    --accent-2: #ccdc3a;
    --accent-green: #ccdc3a;
    --accent-blue: #00c1c2;
    --panel: rgba(255, 255, 255, 0.9);
    --panel-strong: rgba(255, 255, 255, 0.98);
    --shadow: 0 18px 50px rgba(17, 27, 39, 0.18);
    --border: rgba(18, 24, 32, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: "proxima-nova-condensed", Arial, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 18%, rgba(0, 193, 194, 0.16), transparent 45%),
        radial-gradient(circle at 88% 12%, rgba(204, 220, 58, 0.18), transparent 42%),
        radial-gradient(circle at 70% 85%, rgba(255, 175, 35, 0.1), transparent 45%),
        linear-gradient(120deg, #f6fbfb 0%, #f3f7f2 100%);
}

.page {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto auto 1fr;
}

header {
    padding: 24px clamp(20px, 5vw, 48px) 12px;
}

header h1 {
    margin: 0 0 8px;
    font-size: clamp(24px, 3vw, 36px);
    letter-spacing: -0.02em;
}

header p {
    margin: 0;
    color: var(--muted);
    max-width: 70ch;
    font-family: "proxima-nova-condensed", Arial, sans-serif;
}

.tabs {
    display: flex;
    gap: 12px;
    padding: 0 clamp(20px, 5vw, 48px) 12px;
    flex-wrap: wrap;
}

.tab-button {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--border);
    color: var(--ink);
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    position: relative;
    overflow: hidden;
}

.tab-button.is-active {
    background: var(--accent);
    color: #083839;
    border-color: rgba(0, 193, 194, 0.6);
}

.tab-button.is-active.is-loading::after {
    background: rgba(255, 255, 255, 0.5);
}

.tab-button.is-disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

.tab-button.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    width: var(--progress, 0%);
    background: rgba(0, 193, 194, 0.4);
    transition: width 0.2s ease;
    z-index: 0;
}

.tab-button.is-loading span,
.tab-button.is-loading {
    z-index: 1;
}

.tab-button.is-ready {
    animation: tab-pop 0.35s ease-out;
}

@keyframes tab-pop {
    0% { transform: scale(0.98); box-shadow: none; }
    60% { transform: scale(1.04); box-shadow: 0 8px 22px rgba(0, 193, 194, 0.25); }
    100% { transform: scale(1); box-shadow: none; }
}

.tab-panel {
    display: none;
}

.tab-panel.is-active {
    display: block;
}

.placeholder-panel {
    margin: 0 clamp(20px, 5vw, 48px) 32px;
}

.placeholder-panel p {
    margin: 0;
    color: var(--muted);
}

.main {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(260px, 340px) 1fr;
    padding: 0 clamp(20px, 5vw, 48px) 32px;
    min-height: calc(100vh - 160px);
    align-items: stretch;
}

.voronoi-layout {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(260px, 340px) 1fr;
    padding: 0 clamp(20px, 5vw, 48px) 32px;
    min-height: calc(100vh - 160px);
    align-items: stretch;
}

.api-response-layout {
    padding: 0 clamp(20px, 5vw, 48px) 32px;
    min-height: calc(100vh - 160px);
}

.panel {
    background: var(--panel-strong);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 20px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    height: 100%;
    overflow: auto;
}

.panel h2 {
    margin: 0 0 14px;
    font-size: 18px;
}

.panel .stat {
    display: grid;
    gap: 4px;
    margin-bottom: 16px;
}

.panel .stat span {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.panel .stat strong {
    font-size: 22px;
}

.control {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.control label {
    font-size: 13px;
    color: var(--muted);
}

select, button {
    font-family: inherit;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: white;
    font-size: 14px;
}

button {
    background: var(--accent);
    color: #083839;
    border-color: rgba(0, 193, 194, 0.6);
    font-weight: 600;
    cursor: pointer;
}

button:hover {
    background: var(--accent-2);
    border-color: rgba(204, 220, 58, 0.7);
}

.toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    margin-bottom: 10px;
}

.toggle input {
    width: 18px;
    height: 18px;
}

.status {
    margin-top: 10px;
    font-size: 13px;
    color: var(--muted);
}

#map {
    width: 100%;
    height: 100%;
    min-height: 520px;
    border-radius: 24px;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow);
}

#voronoi-map {
    width: 100%;
    height: 100%;
    min-height: 520px;
    border-radius: 24px;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.details {
    margin-top: 16px;
    font-size: 14px;
    color: var(--ink);
}

.details p {
    margin: 0 0 8px;
}

.details h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.details hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 12px 0;
}

.json-viewer {
    margin: 12px 0 0;
    padding: 14px;
    border-radius: 12px;
    background: #0b1f22;
    color: #e6f1f1;
    border: 1px solid rgba(0, 0, 0, 0.15);
    font-size: 12px;
    line-height: 1.5;
    max-height: calc(100vh - 260px);
    max-width: 100%;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.info {
    padding: 10px 12px;
    font: 14px/1.4 "proxima-nova-condensed", Arial, sans-serif;
    background: var(--panel);
    box-shadow: var(--shadow);
    border-radius: 12px;
}

.info h4 {
    margin: 0 0 5px;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.legend {
    line-height: 18px;
    color: var(--muted);
}

.legend i {
    width: 18px;
    height: 18px;
    float: left;
    margin-right: 8px;
    opacity: 0.8;
}

@media (max-width: 960px) {
    .main {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .voronoi-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    #map {
        min-height: 480px;
    }

    #voronoi-map {
        min-height: 480px;
    }
}
