.near {
    --near-accent: var(--color-primary, var(--brand, #cb1533));
    --near-line: var(--color-border, var(--line, #262626));
    --near-muted: var(--color-text-secondary, var(--muted, #a6a6a6));
    --near-alert: var(--brand-text, var(--color-primary, #cb1533));
    display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 28px;
    margin: 0 0 16px; min-width: 0;
}
.near-place { flex: 1 1 300px; max-width: 520px; min-width: 0; }
.near-place > label { display: block; margin: 0 0 5px; }
.near-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.near-row input[type=text] { flex: 1 1 140px; width: auto; min-width: 0; margin: 0; }
.near-row button { flex: 0 0 auto; margin: 0; cursor: pointer; white-space: nowrap; }
@media (max-width: 520px) { .near-row input[type=text] { flex-basis: 100%; } }
.near-failed { margin: 5px 0 0; color: var(--near-alert); }

.near-steps { flex: 0 1 320px; min-width: 0; margin: 0; padding: 0; border: 0; }
.near-steps legend { padding: 0; margin: 0 0 5px; font-weight: 600; }
.near-track { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.near-step { position: relative; display: block; min-width: 0; min-height: 40px; }
.near-step input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.near-step label { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0;
                   color: var(--near-muted); font-weight: inherit; white-space: nowrap; cursor: pointer; }
.near-step label::before { content: ""; box-sizing: border-box; width: 14px; height: 14px; border-radius: 50%;
                           border: 2px solid var(--near-line); }
.near-step + .near-step::before { content: ""; position: absolute; top: 6px; right: calc(50% + 7px);
                                  width: calc(100% - 14px); height: 2px; background: var(--near-line); }
.near-step:has(input:checked)::before,
.near-step:has(~ .near-step input:checked)::before { background: var(--near-accent); }
.near-step:has(input:checked) label::before,
.near-step:has(~ .near-step input:checked) label::before { border-color: var(--near-accent); background: var(--near-accent); }
.near-step:has(input:checked) label { color: inherit; font-weight: 600; }
.near-step:has(input:focus-visible) label::before { outline: 2px solid currentColor; outline-offset: 2px; }

.near-sort { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.near-sort a { text-decoration: none; }
.near .ghost { font-family: inherit; color: inherit; background: none; }
.near .near-on, .near .ghost[aria-pressed=true] { border-color: var(--near-accent); background: var(--near-accent);
                                                  color: var(--brand-on, #fff); }

.near-km { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tag.near-km { color: var(--amber, #f0b429); }
