.proximity-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.location-methods {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px 24px;
    margin-bottom: 18px;
}

.location-choice {
    width: min(100%, 260px);
}

.location-methods h2,
.location-methods label {
    margin: 0 0 8px;
    font-size: 1.1rem;
    line-height: 24px;
    letter-spacing: -0.02em;
}

.proximity-shell .location-primary {
    width: 100%;
    min-height: 48px;
    background: #f59e0b;
    border-color: #b45309;
    color: #422006;
    font-weight: 700;
    box-shadow: 0 3px 8px rgba(180, 83, 9, 0.18);
}

.proximity-shell .location-primary:hover:not(:disabled) {
    background: #fbbf24;
}

.proximity-shell .location-primary:focus-visible {
    outline: 3px solid #92400e;
    outline-offset: 3px;
}

.zip-row {
    display: grid;
    width: min(100%, 360px);
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 14px;
}

.zip-row button,
.zip-row input {
    height: 48px;
}

.zip-label {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.zip-label label {
    margin: 0;
}

.proximity-shell .panel {
    min-width: 0;
}

.proximity-shell .location-status {
    padding: 16px 20px;
    border: 2px solid #d97706;
    border-left-width: 6px;
    border-radius: 12px;
    background: #fff3d6;
    color: #78350f;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
}

.proximity-shell .location-status[data-source="zip"] {
    padding: 8px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 400;
}

.proximity-shell .location-status[data-source="zip"] .location-switch {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 500;
}

.proximity-shell .location-switch {
    display: inline;
    padding: 0;
    border: 0;
    border-radius: 2px;
    background: transparent;
    color: #78350f;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    transform: none;
}

.proximity-shell .location-switch:hover {
    color: #431407;
}

.proximity-shell .location-switch:focus-visible {
    outline: 3px solid #92400e;
    outline-offset: 4px;
}

.proximity-shell .hero-title {
    margin-bottom: 14px;
}

.proximity-shell #app-explanation p {
    margin: 0;
    line-height: 1.5;
}

.proximity-results {
    margin-top: 20px;
}

.proximity-results h2 {
    margin-bottom: 0;
}

.proximity-results .details-code {
    cursor: help;
    text-decoration: underline dotted;
    text-underline-offset: 4px;
}

.details-code:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -3px;
}

.details-tooltip {
    position: fixed;
    z-index: 1000;
    width: 320px;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    padding: 18px 20px;
    border: 1px solid #c8dce8;
    border-radius: 16px;
    background: #fffef9;
    color: #213547;
    box-shadow: 0 8px 28px rgba(18, 61, 89, 0.18);
    font-size: 16px;
    line-height: 1.5;
    white-space: normal;
}

.details-tooltip::before {
    content: '';
    position: absolute;
    left: var(--arrow-left);
    top: -7px;
    width: 12px;
    height: 12px;
    background: #fffef9;
    border-top: 1px solid #c8dce8;
    border-left: 1px solid #c8dce8;
    transform: translateX(-50%) rotate(45deg);
}

.details-tooltip[data-placement="above"]::before {
    top: auto;
    bottom: -7px;
    transform: translateX(-50%) rotate(225deg);
}

.details-tooltip-heading {
    display: block;
    color: var(--accent-strong);
    font-size: 18px;
    margin-bottom: 12px;
}

.details-tooltip ul {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
}

.details-tooltip li + li {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e8edf0;
}

.details-tooltip li strong {
    display: block;
    font-size: 13px;
    color: #5b6b78;
}

.proximity-results .table-scroll {
    max-height: 680px;
    overflow: auto;
}

.proximity-results .sort-button {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    padding: 0;
    margin: 0;
    transform: none;
    cursor: pointer;
}

.proximity-results .sort-button:hover {
    text-decoration: underline;
}

.proximity-results .sort-button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
}

.proximity-shell button:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

.proximity-shell .hint:empty {
    display: none;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

@media (max-width: 600px) {
    .proximity-fields {
        grid-template-columns: 1fr;
    }
}

@media (prefers-color-scheme: dark) {
    .proximity-shell .location-status {
        background: var(--warning-bg);
        color: var(--warning-ink);
        border-color: var(--warning-border);
    }

    .proximity-shell .location-switch {
        color: var(--warning-ink);
    }

    .proximity-shell .location-switch:hover {
        background: transparent;
        color: #fff0cc;
    }

    .proximity-shell .location-primary:focus-visible,
    .proximity-shell .location-switch:focus-visible {
        outline-color: var(--accent);
    }

    .details-tooltip,
    .details-tooltip::before {
        background: #192b39;
        border-color: #56758b;
        color: var(--ink);
    }

    .details-tooltip {
        box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
    }

    .details-tooltip li + li {
        border-color: var(--border);
    }

    .details-tooltip li strong {
        color: var(--muted);
    }
}
