:root {
    color-scheme: light;
    --bg: #f5f7f9;
    --panel: #ffffff;
    --ink: #18212b;
    --muted: #657386;
    --line: #d9e0e8;
    --accent: #0c6b5f;
    --accent-2: #274c77;
    --danger: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
}

a {
    color: var(--accent-2);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.topbar {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: #15202b;
    color: #fff;
}

.brand,
.topbar a {
    color: #fff;
}

.brand {
    font-weight: 700;
    letter-spacing: .2px;
}

.topbar nav {
    display: flex;
    gap: 18px;
}

.shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px;
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

h1,
h2 {
    margin: 0;
}

h1 {
    font-size: 28px;
}

h2 {
    font-size: 18px;
    margin-bottom: 12px;
}

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

.search {
    display: flex;
    gap: 8px;
}

input,
button,
.button {
    min-height: 38px;
    border-radius: 6px;
    border: 1px solid var(--line);
    font: inherit;
}

input {
    padding: 8px 10px;
    min-width: 260px;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    cursor: pointer;
}

.button.secondary {
    background: #ffffff;
    color: var(--accent-2);
    border-color: var(--line);
}

.table-wrap,
.panel,
.login-panel,
.map-panel,
.split article {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.table-wrap {
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

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

th {
    color: var(--muted);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.metrics div {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
}

.metrics strong {
    display: block;
    font-size: 24px;
}

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

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 18px;
}

.split article,
.panel {
    padding: 16px;
}

.facts {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 8px 14px;
}

.facts dt,
.field-list dt {
    color: var(--muted);
    font-weight: 700;
}

.facts dd,
.field-list dd {
    margin: 0;
}

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

.list li {
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}

.list small {
    display: block;
    color: var(--muted);
}

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

.object-row {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 8px;
    align-items: start;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
}

.object-row small {
    grid-column: 2;
    color: var(--muted);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    margin-top: 4px;
}

.field-list {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 14px;
}

.text-block {
    white-space: normal;
    line-height: 1.45;
}

.badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #fff1f0;
    color: var(--danger);
    font-size: 12px;
}

.highlight-dot {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--accent);
    font-weight: 700;
}

.highlight-dot::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #f7c948;
    box-shadow: 0 0 0 2px #fff7d6;
}

.link-button {
    background: transparent;
    border: 0;
    color: var(--accent-2);
    padding: 0;
    min-height: 0;
}

.tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-bottom: 12px;
}

.tabs a {
    padding: 8px 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 999px;
    white-space: nowrap;
}

.tabs a.active {
    background: var(--accent-2);
    color: #fff;
}

.map-panel {
    padding: 10px;
}

svg {
    width: 100%;
    height: min(70vh, 680px);
}

.map-bg {
    fill: #eef3f6;
}

.map-ref {
    fill: #ffffff;
    stroke: #94a3b8;
    stroke-dasharray: 6 4;
}

.map-ref-label,
.map-label {
    font-size: 12px;
    fill: #1f2937;
}

.map-ref-label {
    pointer-events: none;
}

.map-label-bg {
    fill: rgba(255, 255, 255, .88);
    stroke: rgba(203, 213, 225, .78);
    rx: 4px;
}

.map-object:hover .map-label-bg {
    fill: #ffffff;
    stroke: #274c77;
}

.map-object:hover .map-label {
    font-weight: 700;
}

.map-line {
    stroke: #64748b;
    stroke-width: 2;
    opacity: .45;
}

.map-node {
    stroke: #fff;
    stroke-width: 3;
}

.login-panel {
    max-width: 420px;
    margin: 8vh auto 0;
    padding: 22px;
}

.login-panel form {
    display: grid;
    gap: 12px;
}

.login-panel label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-weight: 700;
}

.login-panel input {
    min-width: 0;
    width: 100%;
}

.error {
    color: var(--danger);
}

@media (max-width: 760px) {
    .page-head,
    .search {
        align-items: stretch;
        flex-direction: column;
    }

    .metrics,
    .split {
        grid-template-columns: 1fr;
    }

    .field-list,
    .facts {
        grid-template-columns: 1fr;
    }
}
