:root {
    color-scheme: dark;
    --tt-topnav-h: 60px;
    --bg: #0e1522;
    --surface: #161f30;
    --field: #101929;
    --line: #354157;
    --text: #f2f6ff;
    --muted: #b6c2d6;
    --blue: #99bdff;
    --gutter: clamp(16px, 2.5vw, 52px);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.55 Inter, system-ui, sans-serif; }
[hidden] { display: none !important; }
.atlas { width: 100%; padding: clamp(16px, 2vw, 36px) var(--gutter) 0; }
.atlas :is(button, input, select) { font: inherit; }
.atlas :is(button, select) { cursor: pointer; }
.atlas a { color: var(--blue); }
.atlas :is(a, button, input, select, summary):focus-visible { outline: 3px solid #ffda78; outline-offset: 3px; }
.atlas h1, .atlas h2, .atlas h3, .atlas p { margin: 0; }
.atlas h2 { font-size: clamp(1.2rem, 1.7vw, 1.6rem); line-height: 1.25; letter-spacing: -.035em; }
.atlas-hero { position: relative; isolation: isolate; overflow: hidden; background: #142c53; border: 1px solid #345077; border-radius: 16px; }
.atlas-map { position: absolute; z-index: -2; right: 0; top: 0; width: 66%; height: 100%; object-fit: cover; object-position: 45% 41%; }
.atlas-hero::after { content: ''; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, #142c53 33%, #142c53db 47%, #142c5312 73%); }
.hero-copy { padding: clamp(22px, 2.9vw, 56px); width: min(61%, 930px); }
.atlas h1 { font-weight: 700; font-size: clamp(2.3rem, 4.5vw, 5rem); letter-spacing: -.059em; line-height: 1.03; text-wrap: balance; }
.hero-copy p { margin-top: 14px; color: #d0def2; max-width: 54ch; font-size: clamp(1rem, 1.1vw, 1.25rem); }
.modes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin: 16px 0 24px; }
.atlas .mode { display: flex; align-items: center; gap: 14px; padding: 13px clamp(11px, 1.4vw, 26px); border: 1px solid var(--line); border-radius: 11px; color: var(--text); text-decoration: none; background: var(--surface); min-height: 68px; }
.mode i { display: grid; place-items: center; flex: 0 0 36px; height: 36px; background: #26334a; color: #bdd4fa; border-radius: 8px; }
.mode span, .mode small, .mode strong { display: block; }
.mode small { color: var(--muted); font-size: .845rem; }
.mode strong { letter-spacing: -.025em; }
.atlas .mode:hover { border-color: #7e99bf; }
.atlas .mode[aria-current] { border-color: #719ffd; background: #20365a; }
.mode[aria-current] i { color: #dbe9ff; background: #36588c; }
.workbench { display: grid; grid-template-columns: minmax(245px, .72fr) minmax(0, 2.55fr); gap: clamp(18px, 2vw, 38px); align-items: start; }
.controls { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: clamp(16px, 1.45vw, 28px); }
.controls h2 { font-size: 1.25rem; }
.hint { color: var(--muted); }
.controls .hint { margin: 6px 0 20px; font-size: .925rem; }
.field { display: grid; gap: 6px; margin-bottom: 14px; font-size: .925rem; font-weight: 600; }
.atlas :is(input,select) { width: 100%; min-width: 0; min-height: 46px; padding: 8px 12px; background-color: var(--field); color: var(--text); border: 1px solid #495970; border-radius: 7px; font-weight: 400; }
.atlas select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' fill='none' stroke='%23bcc9df' stroke-width='2' viewBox='0 0 14 8'%3E%3Cpath d='m1 1 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.atlas select option { background-color: #1a1a24; color: #ffffff; }
.input-wrap { display: flex; align-items: center; position: relative; }
.input-wrap i { position: absolute; left: 12px; color: var(--muted); }
.input-wrap input { padding-left: 37px; }
.atlas input::placeholder { color: #9eaac0; opacity: 1; }
.atlas button { background: #24334b; color: var(--text); border: 1px solid #485a73; border-radius: 8px; min-height: 44px; padding: 8px 15px; font-weight: 600; }
.atlas button:hover { background: #30435e; }
.atlas button:disabled { opacity: .5; cursor: default; }
.atlas button.primary { display: flex; justify-content: center; align-items: center; gap: 10px; width: 100%; background: #a8c7ff; border-color: #a8c7ff; color: #10284a; }
.atlas button.primary:hover { background: #c0d7ff; }
.results-pane { min-width: 0; }
.results-head { display: flex; gap: 10px; justify-content: space-between; align-items: baseline; padding: 4px 0 14px; }
.count { color: var(--muted); font-size: .92rem; font-variant-numeric: tabular-nums; text-align: right; }
.result-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 10px; }
.result-card { display: flex; flex-direction: column; align-items: start; gap: 8px; min-width: 0; overflow-wrap: anywhere; padding: clamp(15px, 1.3vw, 24px); border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.card-meta { display: flex; gap: 9px; align-items: center; color: var(--muted); font-size: .82rem; }
.card-meta i { display: grid; place-items: center; flex: 0 0 28px; height: 28px; color: #a6c9ff; background: #22334c; border-radius: 7px; }
.result-card h3 { font-size: 1.06rem; letter-spacing: -.02em; line-height: 1.36; }
.result-card h3 a { color: var(--text); text-decoration: none; }
.result-card h3 a:hover { text-decoration: underline; }
.result-card p { color: var(--muted); font-size: .925rem; }
.card-actions { display: flex; align-items: center; flex-wrap: wrap; column-gap: 16px; margin-top: auto; }
.atlas .action-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--blue); font-size: .925rem; font-weight: 600; text-decoration: none; }
.action-link:hover { text-decoration: underline; }
.action-link i { font-size: .75rem; }
.pager { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 16px 0 0; }
.pager span { color: var(--muted); font-size: .92rem; }
.feedback { display: grid; justify-items: start; gap: 8px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); padding: 22px; margin-bottom: 10px; }
.feedback small { font-size: .925rem; color: var(--muted); }
.detail { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 12px; padding: clamp(14px, 1.7vw, 30px); background: var(--surface); min-width: 0; }
.detail h3 { font-size: 1.25rem; margin: 8px 0; overflow-wrap: anywhere; }
.detail .field { max-width: 22rem; }
.detail .action-link { margin: 0 10px 12px 0; }
.detail .table-scroll { overflow-x: auto; margin: 10px 0; max-height: 60vh; }
.detail table { border-collapse: collapse; width: 100%; font-size: .925rem; text-align: left; }
.detail th { position: sticky; top: 0; background: #23324a; }
.detail th, .detail td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.detail td.number { font-variant-numeric: tabular-nums; white-space: nowrap; }
.guide { border-top: 1px solid var(--line); margin-top: clamp(40px, 5vw, 86px); padding: 32px 0 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: clamp(20px, 3vw, 52px); }
.guide h2 { font-size: 1.2rem; margin-bottom: 14px; }
.guide h3 { font-size: 1rem; margin: 17px 0 5px; }
.guide p { color: var(--muted); font-size: .925rem; max-width: 75ch; }
.guide details { border-bottom: 1px solid var(--line); }
.guide summary { cursor: pointer; padding: 12px 0; }
.guide details p { padding-bottom: 14px; }
.related { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0 24px; }
.related a { min-height: 44px; display: inline-flex; align-items: center; }
@media (max-width: 960px) {
    .mode { gap: 8px; }
    .mode small { display: none; }
    .hero-copy { width: 70%; }
}
@media (max-width: 720px) {
    .atlas { padding-top: 12px; }
    .hero-copy { width: 90%; padding: 22px 18px; }
    .atlas-hero::after { background: linear-gradient(90deg, #142c53 7%, #142c53ed 44%, #142c5370); }
    .hero-copy p { max-width: 37ch; }
    .atlas-map { width: 78%; object-position: center; }
    .modes { grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0 16px; }
    .atlas .mode { min-height: 49px; padding: 8px 10px; gap: 9px; }
    .mode i { flex-basis: 26px; height: 26px; font-size: .85rem; }
    .workbench { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .results-head { scroll-margin-top: calc(var(--tt-topnav-h) + 12px); }
    .result-list { grid-template-columns: 1fr; }
}
.distributions { width: 100%; border-top: 1px solid var(--line); }
.distributions summary { padding: 10px 0; min-height: 44px; cursor: pointer; color: var(--muted); font-size: .925rem; }
.distributions .action-link { margin-right: 16px; }
@media (max-width: 720px) {
    .hero-copy { width: 100%; padding: 18px; }
    .atlas h1 { font-size: clamp(1.9rem, 7.9vw, 2.7rem); }
    .hero-copy p { margin-top: 9px; }
    #search-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
    #search-form > * { grid-column: 1 / -1; }
    #search-form:has(#category-field:not([hidden])) :is(#category-field, #country-field) { grid-column: auto; }
    .controls .hint { margin-bottom: 12px; }
}
.guide-notes p + p { margin-top: 10px; }
