:root {
    --bg: #111;
    --panel: #151515;
    --ink: #eaeaea;
    --muted: #a8a8a8;
    --line: #262626;
    --accent: #ff6a00;
    --accent-2: #ff842b;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --radius: 14px;

    --btn-fg: #111;
    --btn-grad-1: var(--accent);
    --btn-grad-2: var(--accent-2);
    --btn-grad-1-hover: #ff7a1f;
    --btn-grad-2-hover: #ffa366;
}

* {
    box-sizing: border-box
}

html, body {
    height: 100%
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.45 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.container {
    max-width: 820px;
    margin: 48px auto;
    padding: 0 20px
}

.header {
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line);
    padding: 0 0 14px
}

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

.logo {
    width: 28px;
    height: 28px;
    display: block
}

.titles h1 {
    margin: 0;
    font-size: 26px;
    letter-spacing: .2px;
    line-height: 1.2
}

.sub {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 14px
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px clamp(16px, 2.5vw, 24px);
}

/* Search form */
.search {
    display: flex;
    gap: 8px;
    align-items: center;
}

.field {
    flex: 1;
    min-width: 0;
    display: block;
}

.field__label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin: 0 0 6px;
}

input[type="text"] {
    width: 100%;
    background: #0f0f0f;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    letter-spacing: .2px;
    outline: none;
    height: 40px;
}

input[type="text"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 106, 0, .15);
}

.btn {
    background: #1a1a1a;
    border: 1px solid var(--line);
    color: var(--ink);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: transform .06s ease,
    border-color .15s ease,
    background .15s ease,
    box-shadow .15s ease,
    filter .15s ease;
}

.btn:hover {
    background: #202020;
    border-color: #2e2e2e
}

.btn:active {
    transform: translateY(1px)
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px #111, 0 0 0 4px rgba(255, 106, 0, .45);
}

.btn-accent {
    height: 40px;
    background: linear-gradient(180deg, var(--btn-grad-1), var(--btn-grad-2));
    border-color: transparent;
    color: var(--btn-fg);
    font-weight: 600;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .15);
    align-self: flex-end;
}

.btn-accent:hover {
    background: linear-gradient(180deg, var(--btn-grad-1-hover), var(--btn-grad-2-hover));
    box-shadow: 0 0 0 3px rgba(255, 106, 0, .18), 0 8px 24px rgba(0, 0, 0, .35);
}

.btn-accent:active {
    transform: translateY(1px);
    box-shadow: 0 0 0 2px rgba(255, 106, 0, .22) inset;
}

/* Status / error line */
.status {
    margin: 12px 0 0;
    font-size: 13px;
    color: var(--muted);
}

.status:empty {
    display: none;
}

.status.error {
    color: #ffb199;
}

/* Two-column body: details left, map right */
.layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: start;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed #1f1f1f;
}

/* Nothing to show yet: hide the separator entirely. */
.layout:not(:has(> :not([hidden]))) {
    display: none;
}

/* Give the map its own column only when there are coordinates. */
.layout:has(> .map-wrap:not([hidden])) {
    grid-template-columns: 1fr 1fr;
}

/* Results grid */
.results {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 10px 20px;
    align-items: baseline;
}

.results[hidden] {
    display: none;
}

.results dt {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    text-transform: capitalize;
}

.results dd {
    margin: 0;
    color: var(--ink);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 14px;
    letter-spacing: .2px;
    word-break: break-word;
}

/* Map */
.map-wrap[hidden] {
    display: none;
}

.map-frame {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    line-height: 0;
    background: #0f0f0f;
}

.map {
    width: 100%;
    height: 320px;
    border: 0;
    display: block;
}

.map-wrap {
    margin: 0;
}

.map-caption {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--muted);
}

.map-caption a {
    color: var(--accent);
    text-decoration: none;
}

.map-caption a:hover {
    text-decoration: underline;
}

@media (max-width: 560px) {
    .container {
        margin: 24px auto;
    }

    .search {
        flex-wrap: wrap;
    }

    .search .field {
        flex: 1 1 100%;
    }

    .btn-accent {
        flex: 1 1 100%;
        align-self: stretch;
    }

    .layout,
    .layout:has(> .map-wrap:not([hidden])) {
        grid-template-columns: 1fr;
    }

    .results {
        grid-template-columns: 1fr;
        gap: 2px 0;
    }

    .results dd {
        margin: 0 0 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .btn, .btn-accent {
        transition: none
    }
}
