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

.results-heading {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px 24px;
}

.results-heading h2,
.results-heading .share-search {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.results-heading .share-search {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--accent-strong);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.results-heading .share-search:hover {
    transform: none;
}

.results-heading .share-search:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.coordinate-details summary {
    width: fit-content;
    color: var(--accent-strong);
    cursor: pointer;
    font-weight: 600;
}

.coordinate-details summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.coordinate-details .proximity-fields {
    margin: 14px 0 0;
}

.search-controls {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 14px;
}

.search-controls > div {
    width: 150px;
    max-width: calc((100% - 14px) / 2);
}

.search-controls input,
.search-controls button {
    min-height: 48px;
}

.location-methods {
    display: flex;
    align-items: flex-end;
    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: #86efac;
    border-color: #15803d;
    color: #052e16;
    font-weight: 700;
    box-shadow: 0 3px 8px rgba(21, 128, 61, 0.18);
}

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

.proximity-shell .location-primary[data-active="true"] {
    background: #facc15;
    border-color: #a16207;
    color: #422006;
}

.proximity-shell .location-primary[data-active="true"]:hover:not(:disabled) {
    background: #fde047;
}

.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 .bt-transfer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    max-width: 100%;
    min-height: 48px;
    padding: 8px 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    box-shadow: none;
    transform: none;
}

.bt-transfer img,
.bt-transfer .feature-nav-badge,
.bt-transfer .switch-track {
    flex-shrink: 0;
}

.bt-transfer .switch-track {
    width: 44px;
    height: 26px;
    padding: 3px;
    border-radius: 20px;
    background: #64748b;
}

.bt-transfer .switch-track::before {
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
}

.bt-transfer[aria-checked="true"] .switch-track { background: #15803d; }
.bt-transfer[aria-checked="true"] .switch-track::before { transform: translateX(18px); }
.bt-transfer:focus-visible { outline: 3px solid var(--accent); 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;
}

.results-placeholder {
    padding: 32px 20px;
    text-align: center;
    color: var(--muted);
}

.results-placeholder p {
    margin: 0;
}

.repeaterbook-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.repeaterbook-link img {
    display: block;
    width: 120px;
    height: auto;
    padding: 4px;
    border-radius: 4px;
    background: white;
}

.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-primary: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);
    }
}
