:root {
    --paper: #F5F1E8;
    --surface: #FFFCF6;
    --ink: #203D35;
    --muted: #5D6860;
    --rust: #AD482C;
    --sage: #DEE6D8;
    --ochre: #D6B465;
    --rule: #D7D9CD;
    --control-border: #7A8276;
    --danger: #A12F29;
    --shadow: 0 12px 32px rgba(32, 61, 53, 0.09);
    --serif: Georgia, "Times New Roman", serif;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-width: 0;
    margin: 0;
    overflow-x: hidden;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.5;
}

body.modal-open {
    overflow: hidden;
}

button,
input,
select {
    font: inherit;
}

button,
summary,
select,
input[type="checkbox"],
input[type="range"] {
    cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

a {
    color: var(--rust);
    text-underline-offset: 0.2em;
}

button,
a,
input,
select,
summary,
[tabindex] {
    -webkit-tap-highlight-color: transparent;
}

:focus-visible {
    outline: 3px solid var(--rust);
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.skip-link {
    position: fixed;
    top: 8px;
    left: 16px;
    z-index: 20000;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--ink);
    color: var(--surface);
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    min-height: 72px;
    border-bottom: 1px solid var(--rule);
    background: rgba(245, 241, 232, 0.96);
}

.header-inner {
    display: flex;
    width: min(100% - 64px, 1280px);
    min-height: 72px;
    margin: 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-family: var(--serif);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
}

.wordmark-mark {
    width: 38px;
    height: 32px;
    flex: 0 0 auto;
}

.header-drive-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration-thickness: 1px;
}

.header-nav {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
}

.header-nav-link,
.header-account-btn {
    min-height: 44px;
    padding: 7px 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 750;
}

.header-nav-link:hover,
.header-account-btn:hover {
    color: var(--rust);
}

.header-account-btn {
    padding-inline: 14px;
    border: 1px solid var(--ink);
    border-radius: 999px;
}

.header-plan-badge {
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--sage);
    color: var(--ink);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.header-usage {
    color: var(--muted);
    font-size: 0.78rem;
    white-space: nowrap;
}

.page-shell {
    width: min(100% - 64px, 1280px);
    margin: 0 auto;
    padding: 32px 0 64px;
}

.opening-grid {
    display: grid;
    grid-template-columns: minmax(0, 45fr) minmax(520px, 55fr);
    gap: 48px;
    align-items: start;
}

.editorial-intro {
    min-width: 0;
    padding: 28px 0 0;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--rust);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    line-height: 1.3;
    text-transform: uppercase;
}

.editorial-intro h1 {
    max-width: 600px;
    margin: 0;
    color: var(--ink);
    font-family: var(--serif);
    font-size: clamp(2.5rem, 4.5vw, 4rem);
    font-weight: 400;
    letter-spacing: -0.035em;
    line-height: 1.05;
}

.hero-copy {
    max-width: 430px;
    margin: 24px 0 0;
    color: var(--muted);
    font-size: 1.12rem;
    line-height: 1.55;
}

.atlas-illustration {
    display: block;
    width: min(100%, 510px);
    height: 226px;
    margin: 24px 0 8px;
    object-fit: contain;
    object-position: left center;
}

.save-guide {
    display: flex;
    max-width: 470px;
    margin-top: 8px;
    padding: 14px 0 0;
    gap: 12px;
    border-top: 1px solid var(--rule);
}

.save-guide-marker {
    display: inline-flex;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ink);
    border-radius: 50%;
    background: var(--ochre);
    color: var(--ink);
    font-size: 0.85rem;
}

.save-guide h2 {
    margin: 0 0 2px;
    font-family: var(--serif);
    font-size: 1rem;
    font-weight: 700;
}

.save-guide p {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.45;
}

.planner-shell {
    min-width: 0;
    overflow: visible;
    border: 1px solid var(--rule);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.search-disclosure > summary {
    display: none;
    min-height: 64px;
    padding: 16px 24px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--ink);
    list-style: none;
}

.search-disclosure > summary::-webkit-details-marker,
.filters-disclosure > summary::-webkit-details-marker {
    display: none;
}

.search-disclosure > summary::after,
.filters-disclosure > summary::after {
    content: "+";
    font-size: 1.4rem;
    font-weight: 400;
    line-height: 1;
}

.search-disclosure[open] > summary::after,
.filters-disclosure[open] > summary::after {
    content: "−";
}

.disclosure-title {
    font-weight: 800;
}

.disclosure-summary {
    min-width: 0;
    margin-left: auto;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.875rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-form {
    padding: 28px 32px 32px;
}

.planner-heading {
    margin-bottom: 20px;
}

.access-summary {
    display: flex;
    margin: -2px 0 22px;
    padding: 12px 14px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid var(--rule);
    border-radius: 10px;
    background: var(--paper);
}

.access-summary p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.access-plan {
    color: var(--rust);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.text-action {
    min-height: 40px;
    padding: 4px 0;
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: var(--rust);
    font-size: 0.86rem;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 0.22em;
}

.planner-heading h2,
.route-summary h2 {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(1.75rem, 2.6vw, 2rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.route-fields {
    position: relative;
    display: grid;
    gap: 14px;
    padding-left: 28px;
}

.route-connector {
    position: absolute;
    top: 35px;
    bottom: 25px;
    left: 7px;
    width: 2px;
    background: var(--rust);
}

.route-connector::before,
.route-connector::after {
    content: "";
    position: absolute;
    left: 50%;
    width: 10px;
    height: 10px;
    border: 2px solid var(--rust);
    border-radius: 50%;
    background: var(--surface);
    transform: translateX(-50%);
}

.route-connector::before {
    top: -4px;
}

.route-connector::after {
    bottom: -4px;
    background: var(--rust);
}

.form-group {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.form-group > label,
.field-label-row > label,
.waypoints-label,
.search-sources-label,
.search-distance > label,
.filter-label,
.sort-control > span {
    color: var(--ink);
    font-size: 0.79rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    line-height: 1.35;
}

.form-group > label,
.field-label-row {
    margin-bottom: 6px;
}

.field-label-row {
    display: flex;
    min-height: 26px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--control-border);
    border-radius: 8px;
    background: #fffefb;
    color: var(--ink);
}

input[type="text"],
input[type="number"] {
    padding: 10px 13px;
}

select {
    padding: 10px 38px 10px 12px;
}

input::placeholder {
    color: #70786f;
    opacity: 1;
}

input:hover,
select:hover {
    border-color: var(--ink);
}

input:focus,
select:focus {
    border-color: var(--rust);
    outline: 3px solid rgba(173, 72, 44, 0.22);
    outline-offset: 1px;
}

.use-location-btn,
.add-waypoint-btn {
    display: inline-flex;
    min-height: 36px;
    padding: 4px 6px;
    align-items: center;
    gap: 4px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--rust);
    font-size: 0.78rem;
    font-weight: 750;
}

.use-location-btn:hover,
.add-waypoint-btn:hover {
    background: rgba(173, 72, 44, 0.08);
}

.waypoints-fieldset {
    margin: 14px 0 0 28px;
}

.waypoints-heading {
    display: flex;
    min-height: 38px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.waypoints-label span {
    color: var(--muted);
    font-weight: 500;
}

#waypointsList {
    display: grid;
    gap: 8px;
    margin-top: 4px;
}

.waypoint-item {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    gap: 8px;
}

.waypoint-input-container {
    position: relative;
    min-width: 0;
    flex: 1;
}

.waypoint-item input {
    width: 100%;
    min-height: 48px;
    padding: 10px 13px;
    border: 1px solid var(--control-border);
    border-radius: 8px;
    background: #fffefb;
}

.remove-waypoint-btn {
    min-width: 48px;
    min-height: 48px;
    padding: 8px 12px;
    border: 1px solid var(--danger);
    border-radius: 8px;
    background: transparent;
    color: var(--danger);
    font-weight: 700;
}

.query-group {
    margin-top: 18px;
}

.search-sources {
    margin-top: 18px;
}

.search-sources-label {
    margin-bottom: 8px;
}

.source-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.source-toggle {
    position: relative;
    display: inline-flex;
    min-height: 36px;
    padding: 7px 12px;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--rule);
    border-radius: 999px;
    background: transparent;
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
    transition: border-color 160ms ease, background-color 160ms ease;
}

.source-name {
    min-width: 0;
}

.source-access-note {
    margin-left: auto;
    color: var(--muted);
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 800;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.source-toggle:has(input:checked) {
    border-color: var(--ink);
    background: var(--sage);
}

.source-toggle input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.source-toggle:has(input:focus-visible) {
    outline: 3px solid var(--rust);
    outline-offset: 2px;
}

.source-dot,
.source-status-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: var(--ink);
}

.source-ebay .source-dot,
.source-facebook .source-dot {
    background: var(--rust);
}

.source-oodle .source-dot {
    background: var(--ochre);
}

.source-nextdoor .source-dot {
    background: #65775d;
}

.source-toggle-disabled {
    border-style: dashed;
    background: #ebe8df;
    color: var(--muted);
    opacity: 0.7;
}

.source-toggle-locked {
    border-style: dashed;
    background: var(--paper);
}

.source-toggle-locked .source-access-note {
    color: var(--rust);
}

.search-distance {
    display: grid;
    grid-template-columns: auto minmax(116px, 150px) auto;
    margin-top: 18px;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.9rem;
}

.search-distance select {
    min-height: 44px;
}

.search-btn,
.filter-apply-btn,
.modal-link-btn {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ink);
    border-radius: 8px;
    background: var(--ink);
    color: var(--surface);
    font-weight: 800;
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.search-btn {
    width: 100%;
    margin-top: 20px;
    padding: 12px 18px;
    font-size: 1rem;
}

.search-btn:hover:not(:disabled),
.filter-apply-btn:hover:not(:disabled),
.modal-link-btn:hover {
    border-color: #142b25;
    background: #142b25;
    box-shadow: 0 5px 14px rgba(32, 61, 53, 0.18);
}

.sample-route-action {
    display: flex;
    margin-top: 10px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.84rem;
}

.sample-route-action .text-action {
    min-height: 36px;
}

.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    left: 0;
    z-index: 1100;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--control-border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.autocomplete-item {
    padding: 11px 13px;
    border-bottom: 1px solid var(--rule);
    color: var(--ink);
}

.autocomplete-item:last-child {
    border-bottom: 0;
}

.autocomplete-item:hover,
.autocomplete-item[aria-selected="true"] {
    background: var(--sage);
}

.autocomplete-title {
    font-weight: 700;
}

.autocomplete-meta {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.8rem;
}

.location-confirmation {
    display: flex;
    margin-top: 6px;
    padding: 8px 10px;
    align-items: center;
    gap: 8px;
    border: 1px solid #667a60;
    border-radius: 8px;
    background: var(--sage);
    color: var(--ink);
    font-size: 0.82rem;
}

.confirmation-icon {
    color: var(--ink);
    font-weight: 800;
}

.confirmation-text {
    min-width: 0;
    flex: 1;
    overflow-wrap: anywhere;
}

.confirmation-clear {
    display: inline-flex;
    width: 36px;
    height: 36px;
    padding: 0;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ink);
    font-size: 1.25rem;
}

.loading {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    margin: 24px 0;
    padding: 18px 20px;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--rule);
    border-radius: 16px;
    background: var(--surface);
}

.loading p {
    margin: 0;
}

.spinner {
    width: 22px;
    height: 22px;
    border: 2px solid var(--rule);
    border-top-color: var(--rust);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-step {
    color: var(--muted);
    font-size: 0.86rem;
}

.progress-bar-container {
    grid-column: 1 / -1;
    height: 3px;
    overflow: hidden;
    border-radius: 3px;
    background: var(--rule);
}

.progress-bar {
    width: 0;
    height: 100%;
    border-radius: 3px;
    background: var(--rust);
    transition: width 180ms ease;
}

.message-section:not(:empty) {
    margin: 24px 0;
}

.error-message,
.info-message {
    padding: 14px 18px;
    border: 1px solid var(--rule);
    border-left-width: 4px;
    border-radius: 8px;
    background: var(--surface);
}

.error-message {
    border-left-color: var(--danger);
    color: #7f211d;
}

.info-message {
    border-left-color: var(--ink);
    color: var(--ink);
}

.message-action {
    margin-left: 6px;
    min-height: 24px;
    padding: 2px 0;
    cursor: pointer;
}

.account-plan-note {
    margin: 4px 0 0;
    color: var(--rust);
    font-size: 0.82rem;
    font-weight: 700;
}

.usage-limit-note {
    margin: 12px 0 0;
    color: var(--ink);
    font-size: 0.86rem;
    font-weight: 700;
}

.results-container {
    display: none;
    margin-top: 24px;
}

.results-container.active {
    display: block;
}

.result-access-footer {
    display: flex;
    margin-top: 20px;
    padding: 16px 18px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    color: var(--muted);
    font-size: 0.88rem;
}

.result-access-footer strong {
    color: var(--ink);
}

.result-access-footer button {
    flex: 0 0 auto;
}

.site-footer {
    max-width: 1440px;
    margin: 20px auto 0;
    padding: 22px clamp(18px, 4vw, 54px) 34px;
    border-top: 1px solid var(--line, #b8aa8b);
    color: var(--muted, #6f695d);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    font-size: 0.85rem;
}

.site-footer nav { display: flex; gap: 18px; }
.site-footer a { color: inherit; text-underline-offset: 3px; }

@media (max-width: 540px) {
    .site-footer { align-items: flex-start; flex-direction: column; }
}

/* Account and pricing surfaces share the editorial geometry of listing details. */
.launch-modal {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: grid;
    overflow-y: auto;
    padding: 28px;
    place-items: center;
    background: rgba(22, 40, 35, 0.72);
}

.launch-modal-card {
    width: min(100%, 640px);
    max-height: calc(100dvh - 56px);
    overflow-y: auto;
    border: 1px solid var(--rule);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 24px 80px rgba(18, 37, 31, 0.26);
}

.launch-modal-card-wide {
    width: min(100%, 900px);
}

.launch-modal-header {
    display: flex;
    padding: 24px 26px 18px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--rule);
}

.launch-modal-header .eyebrow {
    margin-bottom: 5px;
}

.launch-modal-header h2 {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(1.7rem, 4vw, 2.25rem);
    font-weight: 400;
    letter-spacing: -0.025em;
    line-height: 1.08;
}

.launch-modal-close {
    display: inline-flex;
    width: 44px;
    min-height: 44px;
    padding: 0;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--control-border);
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
    font-size: 1.6rem;
    line-height: 1;
}

.launch-modal-close:hover {
    background: var(--sage);
}

.launch-intro {
    margin: 0;
    padding: 20px 26px 0;
    color: var(--muted);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    padding: 22px 26px;
}

.price-card {
    position: relative;
    display: flex;
    min-width: 0;
    padding: 22px;
    flex-direction: column;
    border: 1px solid var(--rule);
    border-radius: 12px;
    background: var(--paper);
}

.price-card-featured {
    border-color: var(--ink);
    background: var(--sage);
}

.price-card-kicker {
    margin: 0 0 5px;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 750;
}

.price-card h3 {
    margin: 0;
    font-family: var(--serif);
    font-size: 1.55rem;
}

.price {
    min-height: 52px;
    margin: 10px 0 12px;
    color: var(--muted);
}

.price span {
    color: var(--ink);
    font-family: var(--serif);
    font-size: 2rem;
}

.price small {
    font-size: 0.8rem;
}

.price-card ul {
    margin: 0 0 22px;
    padding: 0;
    list-style: none;
}

.price-card li {
    position: relative;
    margin: 0;
    padding: 8px 0 8px 20px;
    border-top: 1px solid rgba(93, 104, 96, 0.2);
    font-size: 0.86rem;
}

.price-card li::before {
    content: "•";
    position: absolute;
    left: 2px;
    color: var(--rust);
}

.price-action {
    width: 100%;
    margin-top: auto;
}

.price-card-note {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.74rem;
    line-height: 1.4;
}

.pricing-fine-print {
    margin: 0;
    padding: 0 26px 24px;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.45;
}

.magic-link-form,
#signedInAccount {
    padding: 22px 26px 26px;
}

.magic-link-form label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.82rem;
    font-weight: 800;
}

.magic-link-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.magic-link-row input {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid var(--control-border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
}

.form-status {
    min-height: 1.35em;
    margin: -14px 26px 0;
    color: var(--muted);
    font-size: 0.82rem;
}

#signedInAccount .form-status {
    margin: 12px 0 0;
}

.form-status.is-error {
    color: var(--danger);
}

/* Turnstile renders a fixed 300 px iframe; inset it like the form above it
   and keep it inside the card on the narrowest screens. */
.turnstile-widget {
    max-width: 100%;
    padding: 0 26px 18px;
    overflow-x: auto;
}

.turnstile-widget:empty {
    display: none;
}

.account-footnote {
    margin: 10px 26px 24px;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.45;
}

#signedInAccount .account-footnote {
    margin: 14px 0 0;
}

.account-identity,
.usage-heading,
.usage-row,
.account-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.account-email {
    margin: 0;
    color: var(--ink);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.account-plan {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.account-plan span {
    color: var(--rust);
    font-weight: 850;
}

.usage-card {
    margin-top: 20px;
    padding: 18px;
    border: 1px solid var(--rule);
    border-radius: 10px;
    background: var(--paper);
}

.usage-heading {
    margin-bottom: 16px;
}

.usage-heading h3 {
    margin: 0;
    font-family: var(--serif);
    font-size: 1.12rem;
}

.usage-heading span,
.usage-reset {
    color: var(--muted);
    font-size: 0.72rem;
}

.usage-row {
    align-items: baseline;
    font-size: 0.82rem;
}

.usage-row strong {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}

.usage-meter {
    height: 5px;
    margin: 7px 0 14px;
    overflow: hidden;
    border-radius: 99px;
    background: var(--rule);
}

.usage-meter span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--rust);
}

.account-actions {
    margin-top: 18px;
    justify-content: flex-start;
}

body.results-mode .opening-grid {
    display: block;
}

body.results-mode .editorial-intro {
    display: none;
}

body.results-mode .planner-shell {
    box-shadow: none;
}

body.results-mode .search-disclosure > summary {
    display: flex;
}

body.results-mode .search-disclosure[open] > summary {
    border-bottom: 1px solid var(--rule);
}

.route-summary {
    display: flex;
    padding: 8px 0 20px;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 1px solid var(--rule);
}

.route-summary .eyebrow {
    margin-bottom: 6px;
}

.route-summary-copy {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.edit-search-btn,
.export-btn,
.filter-clear-btn,
.modal-nav-btn,
.view-switcher button {
    display: inline-flex;
    min-height: 44px;
    padding: 8px 14px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ink);
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    font-weight: 750;
}

.edit-search-btn:hover,
.export-btn:hover,
.filter-clear-btn:hover,
.modal-nav-btn:hover:not(:disabled) {
    background: var(--sage);
}

.results-header {
    display: flex;
    padding: 18px 0;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.results-summary {
    min-width: 0;
    flex: 1;
}

.results-stats {
    color: var(--ink);
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.source-statuses {
    display: flex;
    margin-top: 6px;
    flex-wrap: wrap;
    gap: 4px 16px;
}

.source-status-line {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 0.82rem;
}

.source-status-searching span:last-child {
    font-style: italic;
}

.results-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: end;
    gap: 8px;
}

.sort-control {
    display: grid;
    gap: 4px;
}

.sort-control select {
    min-width: 180px;
    min-height: 44px;
}

.filters-disclosure {
    margin-bottom: 24px;
    border: 1px solid var(--rule);
    border-radius: 12px;
    background: rgba(255, 252, 246, 0.66);
}

.filters-disclosure > summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 52px;
    padding: 10px 16px;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    font-weight: 800;
    list-style: none;
}

.filters-summary {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filters-disclosure[open] > summary {
    border-bottom: 1px solid var(--rule);
}

.filters-bar {
    display: grid;
    grid-template-columns: 1.1fr 1.25fr 1.35fr auto;
    padding: 18px;
    align-items: start;
    gap: 20px;
}

.filters-group {
    display: grid;
    min-width: 0;
    gap: 8px;
}

.filter-label span {
    color: var(--rust);
    font-variant-numeric: tabular-nums;
}

.filter-inputs {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    color: var(--muted);
}

.filter-inputs label {
    min-width: 0;
}

.filter-inputs input {
    min-width: 0;
    min-height: 44px;
}

#maxDistance {
    width: 100%;
    accent-color: var(--rust);
}

.filter-help {
    margin: 0;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.35;
}

.filter-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
}

.filter-checkboxes label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.82rem;
}

.filter-checkboxes input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--ink);
}

.filter-actions {
    display: flex;
    align-self: end;
    gap: 8px;
}

.filter-apply-btn,
.filter-clear-btn {
    min-height: 44px;
    padding: 8px 14px;
    white-space: nowrap;
}

.mobile-results-nav {
    display: none;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(360px, 5fr);
    align-items: start;
    gap: 24px;
}

.map-column,
.list-view {
    min-width: 0;
}

.map-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

#map {
    width: 100%;
    height: clamp(480px, 48vw, 620px);
    overflow: hidden;
    border: 1px solid var(--rule);
    border-radius: 16px;
    background: var(--sage);
    box-shadow: var(--shadow);
}

.listings-panel {
    display: grid;
    min-width: 0;
    gap: 12px;
}

.listing-card {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--rule);
    border-radius: 16px;
    background: var(--surface);
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.listing-card:hover,
.listing-card:focus-within {
    border-color: var(--rust);
    background: #fffaf1;
    box-shadow: 0 8px 18px rgba(32, 61, 53, 0.08);
}

.listing-card.selected,
.listing-card[aria-selected="true"] {
    border-color: var(--rust);
    background: #fbefe5;
    box-shadow: inset 4px 0 0 var(--rust);
}

.listing-image-container {
    position: relative;
    width: 120px;
    height: 120px;
    overflow: hidden;
    align-self: start;
    background: #ebe8df;
}

.listing-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.listing-image-placeholder,
.modal-image-placeholder {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    background: #eae6dc;
    color: var(--muted);
}

.listing-image-placeholder-icon {
    font-size: 1.6rem;
    line-height: 1;
    opacity: 0.75;
}

.listing-image-placeholder-text {
    font-size: 0.75rem;
    font-weight: 750;
}

.listing-content {
    min-width: 0;
    padding: 12px 14px;
}

.listing-header {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    gap: 12px;
}

.listing-title {
    display: -webkit-box;
    min-width: 0;
    margin: 0;
    flex: 1;
    overflow: hidden;
    color: var(--ink);
    font-size: 1.06rem;
    font-weight: 700;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.listing-price,
.modal-price {
    color: var(--rust);
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.listing-price {
    flex: 0 0 auto;
    font-size: 1.08rem;
}

.listing-meta,
.modal-meta {
    display: flex;
    margin-top: 8px;
    flex-wrap: wrap;
    gap: 5px;
}

.meta-badge,
.locate-chip {
    display: inline-flex;
    min-height: 24px;
    padding: 3px 8px;
    align-items: center;
    border-radius: 999px;
    background: #ece9e0;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 750;
    line-height: 1.25;
}

.badge-source {
    padding-left: 0;
    background: transparent;
    color: var(--muted);
}

.badge-distance,
.badge-approx {
    background: #f2e4c0;
    color: #704b0d;
}

.badge-score,
.badge-located {
    background: var(--sage);
    color: var(--ink);
}

.affiliate-notice {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 0.81rem;
}

.badge-pending,
.badge-as-of {
    border: 1px dashed var(--control-border);
    background: transparent;
}

.badge-city-only,
.badge-loose {
    background: #e9e7e0;
    color: #4e5751;
}

.listing-distance,
.listing-location {
    margin-top: 6px;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 0.81rem;
    line-height: 1.35;
}

.listing-distance {
    color: #7b351f;
    font-weight: 700;
}

.listing-actions {
    display: flex;
    min-height: 36px;
    margin-top: 6px;
    align-items: end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.listing-details,
.secondary-btn {
    display: inline-flex;
    min-height: 44px;
    padding: 7px 11px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ink);
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    font-size: 0.81rem;
    font-weight: 750;
}

.listing-details:hover,
.secondary-btn:hover {
    background: var(--sage);
}

.listing-link {
    color: var(--rust);
    font-size: 0.81rem;
    font-weight: 750;
}

.shortlist-toggle {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--rule);
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 1.25rem;
    line-height: 1;
}

.shortlist-toggle:hover,
.shortlist-toggle[aria-pressed="true"],
.shortlist-toggle.shortlist-on {
    border-color: var(--rust);
    background: #f7e8d9;
    color: var(--rust);
}

.match-notice {
    display: flex;
    padding: 10px 12px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid var(--rule);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.8rem;
}

.match-notice-none {
    border-color: #be8a6a;
    background: #f8eadf;
    color: #713822;
}

.match-toggle,
.locate-chip-action {
    padding: 4px;
    border: 0;
    background: transparent;
    color: var(--rust);
    font: inherit;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.locate-chip {
    gap: 5px;
    background: var(--sage);
    color: var(--ink);
}

.locate-chip-busy::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--rust);
    animation: locate-pulse 1.2s ease-in-out infinite;
}

@keyframes locate-pulse {
    0%, 100% { opacity: 0.25; }
    50% { opacity: 1; }
}

.dr-card-removing {
    opacity: 0;
}

.listing-card.is-selected {
    border-color: var(--rust);
    background: #fbefe5;
    box-shadow: inset 4px 0 0 var(--rust);
}

.listing-card.is-saved:not(.is-selected) {
    border-color: #a77727;
    background: #fffaf0;
}

.listing-loading {
    display: grid;
    gap: 12px;
}

.listing-skeleton {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    min-height: 120px;
    overflow: hidden;
    border: 1px solid var(--rule);
    border-radius: 16px;
    background: var(--surface);
}

.listing-skeleton > span,
.listing-skeleton i {
    display: block;
    background: linear-gradient(90deg, #e8e4da 20%, #f5f1e8 45%, #e8e4da 70%);
    background-size: 220% 100%;
    animation: atlas-skeleton 1.35s ease-in-out infinite;
}

.listing-skeleton > div {
    display: grid;
    padding: 16px;
    align-content: start;
    gap: 12px;
}

.listing-skeleton i {
    height: 13px;
    border-radius: 5px;
}

.listing-skeleton i:nth-child(2) {
    width: 62%;
}

.listing-skeleton i:nth-child(3) {
    width: 78%;
}

@keyframes atlas-skeleton {
    to { background-position: -220% 0; }
}

.empty-state {
    padding: 48px 24px;
    border: 1px solid var(--rule);
    border-radius: 16px;
    background: var(--surface);
    text-align: center;
}

.empty-state h3 {
    margin: 0;
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 400;
}

.empty-state p {
    max-width: 440px;
    margin: 8px auto 20px;
    color: var(--muted);
    font-size: 0.9rem;
}

.dr-popup {
    min-width: 240px;
    font-family: var(--sans);
}

.dr-popup-heading {
    display: flex;
    margin-bottom: 8px;
    align-items: flex-start;
    gap: 8px;
}

.dr-popup-thumb {
    position: relative;
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    overflow: hidden;
    border-radius: 6px;
    background: #eae6dc;
}

.dr-popup-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dr-popup-thumb-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 750;
    text-align: center;
}

.dr-popup-title {
    min-width: 0;
    flex: 1;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 750;
    line-height: 1.3;
}

.dr-popup-price {
    margin-bottom: 7px;
    color: var(--rust);
    font-size: 1.2rem;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.dr-popup-badges {
    display: flex;
    margin-bottom: 7px;
    flex-wrap: wrap;
    gap: 5px;
}

.dr-popup-distance,
.dr-popup-location {
    margin-bottom: 7px;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 0.8rem;
}

.dr-popup-distance {
    color: #7b351f;
    font-weight: 700;
}

.dr-popup-link {
    display: inline-flex;
    min-height: 40px;
    padding: 7px 11px;
    align-items: center;
    gap: 5px;
    border-radius: 7px;
    background: var(--ink);
    color: var(--surface);
    font-size: 0.78rem;
    font-weight: 750;
    text-decoration: none;
}

.leaflet-popup-content-wrapper {
    border: 1px solid var(--rule);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.leaflet-popup-content {
    color: var(--ink);
}

.leaflet-control-zoom,
.leaflet-bar {
    overflow: hidden;
    border: 0 !important;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(32, 61, 53, 0.18);
}

.leaflet-control-zoom a:hover {
    background: var(--sage) !important;
    color: var(--ink) !important;
}

.leaflet-control-scale {
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 252, 246, 0.92);
}

.leaflet-control-scale-line {
    border-color: var(--ink);
    color: var(--ink);
}

.custom-listing-marker {
    transition: transform 160ms ease;
}

.custom-listing-marker:hover {
    z-index: 1000 !important;
    transform: scale(1.12);
}

.dr-pin {
    display: flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
}

.dr-pin-solid {
    background: var(--ink);
    border: 3px solid var(--surface);
    border-radius: 50% 50% 50% 0;
    box-shadow: 0 3px 10px rgba(32, 61, 53, 0.28);
    cursor: pointer;
    transform: rotate(-45deg);
}

.dr-pin-solid .dr-pin-glyph {
    font-size: 14px;
    transform: rotate(45deg);
}

.dr-pin-ghost {
    width: 56px;
    height: 30px;
    padding: 0 7px;
    gap: 4px;
    border: 2px dashed currentColor;
    border-radius: 999px;
    background: rgba(255, 252, 246, 0.84);
    color: var(--ink);
    box-shadow: 0 1px 4px rgba(32, 61, 53, 0.2);
}

.dr-pin-ghost .dr-pin-glyph {
    opacity: 0.75;
}

.dr-pin-label {
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
}

.dr-pin-saved {
    border-color: var(--ink);
    background: var(--ochre);
    color: var(--ink);
}

.dr-pin-selected {
    box-shadow: 0 0 0 4px rgba(173, 72, 44, 0.35), 0 3px 10px rgba(32, 61, 53, 0.3);
}

.dr-pin-solid.dr-pin-selected {
    transform: rotate(-45deg) scale(1.14);
}

.dr-pin-ghost.dr-pin-selected {
    transform: scale(1.14);
}

.dr-route-endpoint {
    display: flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--surface);
    border-radius: 50%;
    background: var(--ink);
    box-shadow: 0 2px 8px rgba(32, 61, 53, 0.3);
    color: var(--surface);
    font-size: 0.75rem;
    font-weight: 800;
}

.dr-route-end {
    background: var(--rust);
}

.dr-cluster {
    background: transparent;
}

.dr-cluster-inner {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--surface);
    border-radius: 50%;
    background: var(--ink);
    box-shadow: 0 3px 10px rgba(32, 61, 53, 0.25);
    color: var(--surface);
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.dr-cluster-ghost .dr-cluster-inner {
    border: 2px dashed var(--ink);
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 0 0 5px rgba(222, 230, 216, 0.8);
}

.dr-cluster-popup-title {
    margin-bottom: 4px;
    color: var(--ink);
    font-weight: 800;
}

.dr-cluster-popup-body {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.82rem;
}

.dr-cluster-popup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dr-cluster-action {
    min-height: 40px;
    padding: 6px 10px;
    border: 1px solid var(--ink);
    border-radius: 6px;
    background: var(--ink);
    color: var(--surface);
    font-size: 0.78rem;
    font-weight: 750;
}

.dr-cluster-action-quiet {
    background: transparent;
    color: var(--ink);
}

.dr-mile-marker {
    background: transparent;
    text-align: center;
}

.dr-mile-marker span {
    display: inline-block;
    padding: 2px 6px;
    border: 1px solid var(--ink);
    border-radius: 8px;
    background: rgba(255, 252, 246, 0.94);
    color: var(--ink);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    white-space: nowrap;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    padding: 32px;
    overflow-y: auto;
    background: rgba(18, 34, 29, 0.78);
}

.modal-content {
    width: min(100%, 920px);
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid var(--rule);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 24px 64px rgba(9, 21, 17, 0.3);
}

.modal-header,
.modal-footer {
    display: flex;
    padding: 18px 24px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.modal-header {
    border-bottom: 1px solid var(--rule);
}

.modal-header h2 {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 400;
    line-height: 1.2;
}

.modal-close {
    display: inline-flex;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    padding: 0;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--rule);
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
    font-size: 1.8rem;
    line-height: 1;
}

.modal-body {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    padding: 24px;
    align-items: start;
    gap: 28px;
}

.modal-image-container {
    display: flex;
    min-height: 320px;
    max-height: 560px;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #eae6dc;
}

.modal-image-container img {
    display: block;
    max-width: 100%;
    max-height: 560px;
    object-fit: contain;
}

.modal-image-placeholder {
    min-height: 320px;
}

.modal-details {
    min-width: 0;
}

.modal-price {
    margin-bottom: 12px;
    font-size: 1.8rem;
}

.modal-location,
.modal-condition,
.modal-description {
    margin-top: 14px;
    overflow-wrap: anywhere;
    color: var(--muted);
}

.modal-description {
    white-space: pre-wrap;
}

.modal-note {
    margin-top: 14px;
    padding: 10px 12px;
    border-left: 3px solid var(--rust);
    border-radius: 6px;
    background: #eee9de;
    color: var(--muted);
    font-size: 0.85rem;
}

.modal-link-btn {
    width: 100%;
    margin-top: 20px;
    padding: 10px 16px;
}

.modal-footer {
    justify-content: flex-end;
    border-top: 1px solid var(--rule);
}

.modal-nav-btn:disabled {
    opacity: 0.42;
}

@media (max-width: 1099px) {
    .opening-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .editorial-intro {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
        align-items: end;
        column-gap: 32px;
        padding-top: 12px;
    }

    .editorial-intro .eyebrow,
    .editorial-intro h1,
    .editorial-intro .hero-copy,
    .editorial-intro .save-guide {
        grid-column: 1;
    }

    .atlas-illustration {
        grid-column: 2;
        grid-row: 1 / span 4;
        height: 190px;
        margin: 0;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .list-view {
        grid-row: 1;
    }

    .map-column {
        grid-row: 2;
    }

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

@media (max-width: 767px) {
    html {
        scroll-behavior: auto;
    }

    .header-inner,
    .page-shell {
        width: min(100% - 32px, 1280px);
    }

    .site-header,
    .header-inner {
        min-height: 64px;
    }

    .page-shell {
        padding-top: 20px;
    }

    .wordmark {
        font-size: 1.22rem;
    }

    .wordmark-mark {
        width: 34px;
        height: 28px;
    }

    .header-nav {
        gap: 10px;
    }

    .header-nav-link,
    .header-usage {
        display: none;
    }

    .header-plan-badge {
        margin-left: auto;
    }

    .editorial-intro {
        display: block;
        padding: 0;
    }

    .editorial-intro h1 {
        font-size: clamp(2.5rem, 13vw, 3.5rem);
    }

    .hero-copy {
        margin-top: 16px;
        font-size: 1rem;
    }

    .atlas-illustration {
        width: 100%;
        height: 116px;
        margin: 20px 0 8px;
        object-fit: cover;
    }

    .save-guide {
        margin-top: 8px;
    }

    .search-form {
        padding: 24px;
    }

    .launch-modal {
        padding: 0;
        place-items: stretch;
    }

    .launch-modal-card,
    .launch-modal-card-wide {
        width: 100%;
        min-height: 100dvh;
        max-height: none;
        border: 0;
        border-radius: 0;
    }

    .pricing-grid {
        grid-template-columns: 1fr;
    }

    .result-access-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .route-fields {
        padding-left: 24px;
    }

    .waypoints-fieldset {
        margin-left: 24px;
    }

    .field-label-row {
        align-items: flex-end;
    }

    .use-location-btn {
        max-width: 150px;
        text-align: right;
    }

    .search-distance {
        grid-template-columns: auto minmax(108px, 1fr);
    }

    .search-distance > span {
        grid-column: 1 / -1;
    }

    body.results-mode .search-disclosure > summary {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .route-summary {
        align-items: flex-start;
    }

    .route-summary .edit-search-btn {
        display: none;
    }

    .results-header {
        align-items: flex-end;
        flex-direction: column;
    }

    .results-summary,
    .results-actions {
        width: 100%;
    }

    .results-actions {
        align-items: end;
    }

    .sort-control {
        min-width: 0;
        flex: 1;
    }

    .sort-control select {
        min-width: 0;
    }

    .filters-bar {
        grid-template-columns: 1fr;
    }

    .filter-actions {
        align-self: stretch;
    }

    .filter-actions button {
        flex: 1;
    }

    .mobile-results-nav {
        display: flex;
        min-height: 48px;
        margin-bottom: 16px;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .view-switcher {
        display: inline-grid;
        grid-template-columns: 1fr 1fr;
        padding: 3px;
        border: 1px solid var(--control-border);
        border-radius: 10px;
        background: var(--surface);
    }

    .view-switcher button {
        min-height: 40px;
        border: 0;
    }

    .view-switcher button[aria-pressed="true"] {
        background: var(--ink);
        color: var(--surface);
    }

    .mobile-results-nav > a {
        color: var(--ink);
        font-size: 0.9rem;
        font-weight: 750;
    }

    .content-grid {
        display: block;
    }

    #resultsSection[data-results-view="list"] #mapView,
    #resultsSection[data-view="list"] #mapView,
    #resultsSection.view-list #mapView {
        display: none;
    }

    #resultsSection[data-results-view="map"] #listView,
    #resultsSection[data-view="map"] #listView,
    #resultsSection.view-map #listView {
        display: none;
    }

    #map {
        height: 55dvh;
        min-height: 280px;
    }

    .listing-card {
        grid-template-columns: 104px minmax(0, 1fr);
    }

    .listing-image-container {
        width: 104px;
        height: 120px;
    }

    .listing-header {
        display: block;
    }

    .listing-price {
        margin-top: 3px;
    }

    .modal {
        padding: 0;
    }

    .modal-content {
        min-height: 100dvh;
        margin: 0;
        border: 0;
        border-radius: 0;
    }

    .modal-body {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .modal-image-container,
    .modal-image-placeholder {
        min-height: 240px;
    }

    .modal-footer {
        position: sticky;
        bottom: 0;
        background: var(--surface);
    }
}

@media (max-width: 420px) {
    body.results-mode .search-disclosure > summary {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    body.results-mode .search-disclosure .disclosure-summary {
        display: none;
    }

    .header-drive-link {
        display: none;
    }

    .header-plan-badge {
        display: none;
    }

    .header-account-btn {
        min-height: 40px;
        padding-inline: 11px;
        font-size: 0.8rem;
    }

    .search-form {
        padding: 20px;
    }

    .route-fields {
        padding-left: 20px;
    }

    .waypoints-fieldset {
        margin-left: 20px;
    }

    .source-toggle {
        padding-inline: 10px;
    }

    .source-access-note {
        flex-basis: 100%;
        margin-left: 25px;
    }

    .access-summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .launch-modal-header,
    .launch-intro,
    .pricing-grid,
    .pricing-fine-print,
    .magic-link-form,
    .turnstile-widget,
    #signedInAccount {
        padding-inline: 20px;
    }

    .magic-link-row {
        grid-template-columns: 1fr;
    }

    .magic-link-row .search-btn {
        width: 100%;
    }

    .usage-heading,
    .usage-row {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .usage-row strong {
        margin-left: 0;
    }

    .usage-reset {
        flex-basis: 100%;
    }

    .results-actions {
        flex-wrap: wrap;
    }

    .sort-control {
        flex-basis: 100%;
    }

    .export-btn {
        width: 100%;
    }

    .listing-card {
        grid-template-columns: 88px minmax(0, 1fr);
    }

    .listing-image-container {
        width: 88px;
        height: 108px;
    }

    .listing-content {
        padding: 10px;
    }

    .listing-title,
    .listing-price {
        font-size: 0.98rem;
    }

    .listing-meta {
        margin-top: 5px;
    }

    .filter-inputs {
        grid-template-columns: 1fr;
    }

    .filter-inputs > span {
        display: none;
    }

    .modal-header,
    .modal-footer {
        padding-inline: 16px;
    }

    .modal-footer button {
        flex: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* Magic-link confirmation page (/auth/confirm): one centred card that reuses
   the app's tokens and primary button. */
.confirm-page {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.confirm-card {
    width: 100%;
    max-width: 440px;
    padding: 32px 28px;
    border: 1px solid var(--rule);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.confirm-card h1 {
    margin: 0 0 10px;
    font-family: var(--serif);
    font-size: 1.9rem;
    font-weight: 400;
    line-height: 1.15;
}

.confirm-lead {
    margin: 0;
    color: var(--muted);
}

.confirm-status {
    min-height: 1.35em;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.confirm-recover-line {
    margin: 8px 0 0;
}

.confirm-recover {
    color: var(--rust);
    font-weight: 800;
    text-underline-offset: 0.22em;
}
