/* Lookup bar */

.lookup-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

#inputIP {
    flex: 1 1 280px;
    padding: 12px 14px;
    font-family: var(--mono);
    font-size: 0.95rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
}

#inputIP::placeholder {
    color: var(--muted);
}

#inputIP:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

/* Info sections: location on the left, network + intelligence stacked on the right */

/* Items stretch to fill their grid areas, so the location card (spanning both
   rows) and the two stacked cards share the same top and bottom edges. */
.sections {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
    margin-bottom: 20px;
}

.card-location {
    grid-row: span 2;
}

@media (max-width: 760px) {
    .sections {
        grid-template-columns: minmax(0, 1fr);
    }

    .card-location {
        grid-row: auto;
    }
}

.card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 13px 14px;
}

.card h2 {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 8px;
    padding-bottom: 7px;
    border-bottom: 1px solid var(--border);
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
}

.card .icon {
    width: 13px;
    height: 13px;
    color: var(--accent);
    flex-shrink: 0;
}

.card dl,
.card dd {
    margin: 0;
}

.card dl {
    margin-bottom: 10px;
}

/* Pinned to the bottom of the card when the card is stretched. */
.card-note {
    margin: auto 0 0;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 0.74rem;
    line-height: 1.45;
    color: var(--muted);
}

.row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0;
    font-size: 0.82rem;
    line-height: 1.4;
}

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

.row-value {
    font-family: var(--mono);
    color: var(--text);
    text-align: right;
    overflow-wrap: anywhere;
}

/* Connection intelligence status icons (descriptive, not safe/unsafe) */
.row-value.has-status {
    flex-shrink: 0;
    white-space: nowrap;
}

.flag-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 7px;
    border-radius: 50%;
    vertical-align: middle;
}

.flag-dot-accent {
    background: var(--accent);
}

.flag-dot-amber {
    background: var(--amber);
}

.flag-dot-neutral {
    background: var(--muted);
}

.flag-dot-unknown {
    border: 1.5px solid var(--muted);
}

/* Map */

.map-note {
    margin: 0;
    padding: 8px 12px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    font-size: 0.74rem;
    color: var(--muted);
}

.map-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

#map {
    width: 100%;
    height: clamp(240px, 45vw, 360px);
    background: var(--surface);
}

#map .leaflet-tile-pane {
    filter: var(--map-filter);
}

#map .leaflet-control-zoom a,
#map .leaflet-control-attribution {
    background: var(--surface) !important;
    color: var(--text-dim) !important;
    border-color: var(--border) !important;
}

#map .leaflet-control-attribution a {
    color: var(--accent) !important;
}

@media (max-width: 480px) {
    .lookup-bar {
        flex-direction: column;
        align-items: stretch;
    }

    #inputIP {
        flex: 0 0 auto;
    }
}
