/* CSS/route-planner.css
 *
 * Task surface for /onderweg. It inherits the BorderTanker tokens and keeps the
 * route, controls and ranked answer visible without turning the tool into a
 * marketing page.
 */

.route-main {
    max-width: 1220px;
    margin: 6.5em auto 0;
    padding: 1rem 1rem 3rem;
    font-family: var(--font-family-body);
    color: var(--color-text);
}

.route-workspace {
    display: grid;
    grid-template-columns: minmax(20rem, 31rem) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.route-panel,
.route-map-shell {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(var(--rgb-black), 0.09);
}

.route-panel {
    overflow: visible;
}

.route-planner-column {
    display: grid;
    gap: 1.25rem;
}

.route-form,
.route-results {
    padding: 1rem;
}

.route-panel-head {
    margin: 0;
}

.route-panel-head h1 {
    margin: 0 0 0.45rem;
    font-family: var(--font-family-title);
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    line-height: 1.08;
}

.route-panel-head p {
    margin: 0;
    max-width: 58ch;
    color: var(--color-muted);
    line-height: 1.55;
}

.route-lock {
    margin: 1rem;
    padding: 1rem;
    background: #fff7ed;
    border: 1px solid rgba(var(--rgb-primary), 0.35);
    border-radius: 8px;
}

.route-lock h2 {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
}

.route-lock p {
    margin: 0 0 0.75rem;
    line-height: 1.5;
}

.route-primary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding: 0.55rem 0.9rem;
    border-radius: 8px;
    background: var(--color-primary);
    color: #111;
    font-weight: 700;
    text-decoration: none;
}

.route-form {
    display: grid;
    gap: 1rem;
    border-bottom: 1px solid var(--color-border-subtle);
}

.route-address-grid {
    display: grid;
    gap: 0.85rem;
}

.route-field {
    display: grid;
    gap: 0.35rem;
    position: relative;
}

.route-field label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--color-muted);
}

.route-field-label-row {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.route-manage-destinations {
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--color-primary-700);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
}

.route-manage-destinations:hover:not(:disabled) {
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.route-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 2.75rem;
    gap: 0.45rem;
}

/* A stop of the driver's own has no "use my location" button beside it — you
   are not standing at a place you are only driving through. */
.route-input-row--single {
    grid-template-columns: minmax(0, 1fr);
}

/* Stops of the driver's own, between Vertrek and Bestemming. */
.route-waypoints {
    display: grid;
    gap: 0.85rem;
}

.route-waypoints:empty {
    display: none;
}

.route-remove-stop {
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--color-muted);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.route-remove-stop:hover:not(:disabled) {
    color: var(--color-text);
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.route-remove-stop:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.route-add-stop-row {
    display: flex;
}

.route-add-stop {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.1rem;
    padding: 0.3rem 0.75rem;
    border: 1px dashed var(--color-border);
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-primary-700);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.route-add-stop:hover:not(:disabled) {
    border-color: var(--color-primary);
    border-style: solid;
}

.route-add-stop:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.route-add-stop:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.route-add-stop svg {
    flex: 0 0 auto;
}

.route-field input,
.route-field select {
    width: 100%;
    min-height: 2.75rem;
    box-sizing: border-box;
    border: 1px solid var(--color-border);
    border-radius: 1em !important;
    background: var(--color-bg);
    color: var(--color-text);
    font: inherit;
}

.route-field input,
.route-field select {
    padding: 0.62rem 0.7rem;
}

.route-field input:focus-visible,
.route-field select:focus-visible,
.route-icon-btn:focus-visible,
.route-manage-destinations:focus-visible,
.route-commute-shortcuts button:focus-visible,
.route-selected-preset button:focus-visible,
.route-save-row button:focus-visible,
.route-submit:focus-visible,
.route-start-over:focus-visible,
.route-primary-link:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.route-commute-shortcuts,
.route-selected-preset {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}

.route-commute-shortcuts[hidden],
.route-selected-preset[hidden] {
    display: none;
}

.route-commute-shortcuts button,
.route-selected-preset button {
    min-width: 0;
    min-height: 2.9rem;
    display: grid;
    grid-template-columns: 1.05rem minmax(0, 1fr) 0.95rem 1.05rem;
    gap: 0.45rem;
    align-items: center;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(var(--rgb-primary), 0.35);
    border-radius: 8px;
    background: #fff7ed;
    color: var(--color-text);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.2;
    cursor: pointer;
}

.route-commute-shortcuts button:hover:not(:disabled),
.route-selected-preset button:hover:not(:disabled) {
    border-color: var(--color-primary);
    background: #fff3ea;
}

.route-commute-shortcuts button:disabled,
.route-selected-preset button:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.route-commute-shortcuts svg,
.route-selected-preset svg {
    width: 1.05rem;
    height: 1.05rem;
    color: var(--color-primary-700);
}

.route-commute-shortcuts span,
.route-selected-preset span {
    min-width: 0;
    text-align: left;
}

.route-shortcut-arrow {
    color: var(--color-muted) !important;
}

.route-selected-preset {
    grid-template-columns: minmax(0, 1fr);
}

.route-icon-btn {
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-primary-700);
    cursor: pointer;
}

.route-icon-btn svg,
.route-submit svg {
    width: 1.15rem;
    height: 1.15rem;
}

.route-icon-btn:disabled,
.route-submit:disabled,
.route-start-over:disabled,
.route-save-row button:disabled,
.route-field input:disabled,
.route-field select:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.route-suggestions {
    position: absolute;
    z-index: 900;
    top: calc(100% - 1.1rem);
    left: 0;
    right: 0;
    overflow: hidden;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 16px 32px rgba(var(--rgb-black), 0.14);
}

.route-suggestions button {
    display: block;
    width: 100%;
    padding: 0.72rem 0.85rem;
    border: 0;
    border-bottom: 1px solid var(--color-border-subtle);
    background: transparent;
    color: var(--color-text);
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.route-suggestions button:last-child {
    border-bottom: 0;
}

.route-suggestions button:hover,
.route-suggestions button:focus-visible {
    background: #fff3ea;
}

.route-suggestion-main {
    display: block;
    font-weight: 700;
}

.route-suggestion-sub {
    display: block;
    margin-top: 0.1rem;
    color: var(--color-muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.route-save-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    min-height: 2rem;
}

.route-save-row--loading {
    display: flex;
    flex-wrap: nowrap;
}

.route-shortcut-skeleton {
    display: block;
    width: 3em;
    flex: 0 0 3em;
    box-sizing: border-box;
    min-height: 1.9rem;
    border: 1px solid var(--color-border);
    border-radius: 1em;
    background: linear-gradient(
        90deg,
        var(--color-surface) 0%,
        rgba(var(--rgb-white), 0.98) 50%,
        var(--color-surface) 100%
    );
    background-size: 200% 100%;
    background-position: -200% 0;
    animation: route-shortcut-skeleton-wave 1.35s ease-in-out infinite;
}

@keyframes route-shortcut-skeleton-wave {
    from {
        background-position: -200% 0;
    }

    to {
        background-position: 200% 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .route-shortcut-skeleton {
        animation: none;
        background-position: 50% 0;
    }
}

.route-save-row[hidden] {
    display: none;
}

.route-save-row button {
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-text);
    min-height: 1.9rem;
    padding: 0.25rem 0.65rem;
    font-size: 0.78rem;
    cursor: pointer;
}

.route-save-row button:hover {
    border-color: var(--color-primary);
}

.route-save-row button.btn-primary {
    border-color: var(--color-primary);
    border-radius: 999px !important;
    background: var(--color-primary);
    color: #111;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.route-save-row button.btn.btn-primary:hover:not(:disabled) {
    border-color: var(--color-primary-600);
    background: var(--color-primary-600);
    transform: none !important;
}

.modal--route-destinations .modal__title {
    font-size: 1.08rem;
    font-weight: 800;
}

.route-destinations-heading {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.route-destinations-heading svg {
    flex: 0 0 auto;
    width: 1.35rem;
    height: 1.35rem;
    color: var(--color-primary);
}

.route-destinations-header-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.route-add-destination {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.route-add-destination svg {
    flex: 0 0 auto;
}

.route-destinations-list {
    display: grid;
}

.modal--route-destinations .modal__dialog:focus {
    outline: none;
}

.modal--route-destinations .modal__body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

.route-destination-list-item {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--color-border-subtle);
}

.route-destination-list-copy {
    min-width: 0;
    display: grid;
    gap: 0.2rem;
}

.route-destination-list-copy strong,
.route-destination-list-copy span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.route-destination-list-copy span {
    color: var(--color-muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.route-destination-list-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.route-destination-editor {
    min-width: 0;
    padding: 0;
}

.modal--route-destination-editor {
    z-index: 2100;
}

.modal--route-destination-editor .modal__dialog,
.modal--route-destination-editor .modal__body {
    /* Let the autocomplete list extend beyond the editor instead of being
       cut off by the modal's rounded and scrollable containers. */
    overflow: visible;
}

.modal--route-delete-destination {
    z-index: 2100;
}

.route-delete-destination-message {
    margin: 0;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.route-destination-fields {
    display: grid;
    grid-template-columns: minmax(8rem, 0.7fr) minmax(0, 1.3fr);
    gap: 0.7rem;
}

.route-destination-field {
    min-width: 0;
    display: grid;
    gap: 0.3rem;
    margin: 0;
    position: relative;
}

.route-destination-field > label {
    color: var(--color-muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.route-destination-field input {
    width: 100%;
    min-width: 0;
    min-height: 2.75rem;
    box-sizing: border-box;
    padding: 0.62rem 0.7rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-2);
    background: var(--color-bg);
    color: var(--color-text);
    font: inherit;
    font-size: 1rem;
}

.route-destination-suggestions {
    top: calc(100% + 0.25rem);
    max-height: 14rem;
    overflow-y: auto;
    z-index: 970;
}

.route-destination-suggestions button.is-active {
    background: #fff3ea;
}

.route-destination-field input:focus-visible,
.route-add-destination:focus-visible,
.route-destination-edit:focus-visible,
.route-destination-save:focus-visible,
.route-destination-undo:focus-visible,
.route-destination-delete:focus-visible,
.modal--route-destinations .modal__close:focus-visible,
.modal--route-destination-editor .modal__close:focus-visible,
.modal--route-delete-destination .modal__close:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.route-destination-editor.has-error input:invalid,
.route-destination-editor.has-error input:focus {
    border-color: #b42318;
}

.route-destination-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.65rem;
}

.route-destination-save,
.route-destination-undo,
.route-destination-delete,
.route-add-destination {
    min-height: 2.5rem;
    padding: 0.5rem 0.8rem;
    border-radius: var(--border-radius-2);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.route-destination-save[hidden],
.route-destination-undo[hidden] {
    display: none;
}

.route-destination-delete {
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
}

.route-destination-delete:hover {
    border-color: #b42318;
    color: #b42318;
}

.route-destination-save:disabled,
.route-add-destination:disabled,
.route-manage-destinations:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.route-destinations-empty {
    display: grid;
    gap: 0.25rem;
    padding: 1.25rem 0 0.35rem;
    text-align: center;
}

.route-destinations-empty[hidden] {
    display: none;
}

.route-destinations-empty span {
    color: var(--color-muted);
    font-size: 0.82rem;
}

.route-destinations-status {
    min-height: 1.25rem;
    margin: 0.75rem 0 0;
    color: var(--color-muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.route-destinations-status.is-error {
    color: #b42318;
}

.route-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0fr);
    column-gap: 0;
    transition: grid-template-columns 560ms cubic-bezier(0.16, 1, 0.3, 1),
        column-gap 560ms cubic-bezier(0.16, 1, 0.3, 1);
}

.route-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    min-height: 3rem;
    border: 0;
    border-radius: 8px;
    background: var(--color-primary);
    color: #111;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.route-submit:hover:not(:disabled) {
    background: var(--color-primary-600);
}

.route-start-over {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--color-border);
    border-radius: 1em !important;
    background: var(--color-bg);
    color: var(--color-text);
    font: inherit;
    font-weight: 700;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    cursor: pointer;
    transition: opacity 220ms ease-out,
        visibility 0s linear 560ms,
        border-color 180ms ease-out,
        background-color 180ms ease-out;
}

.route-start-over:hover:not(:disabled) {
    border-color: var(--color-primary);
    background: var(--color-surface);
}

@media (prefers-reduced-motion: reduce) {
    .route-actions,
    .route-start-over {
        transition: none;
    }
}

.route-status {
    min-height: 1.3rem;
    margin: 0;
    color: var(--color-muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.route-status:empty {
    display: none;
}

.route-status.is-error {
    color: #9f1239;
}

.route-results {
    display: grid;
    gap: 0.75rem;
}

.route-result-list {
    display: grid;
    gap: 0;
    padding: 0;
    margin: 0;
    list-style: none;
}

.route-result {
    display: grid;
    grid-template-columns: 3.15rem minmax(0, 1fr);
    gap: 0.9rem;
    padding: 1rem 0.25rem;
    border: 0;
    border-bottom: 1px solid var(--color-border-subtle);
    background: transparent;
    transition: background-color 160ms ease;
}

.route-result.is-best {
    margin-bottom: 0.35rem;
    padding: 1.05rem 1rem;
    border: 1px solid rgba(22, 101, 52, 0.18);
    border-radius: 14px;
    background: #f4f8f3;
}

.route-result:not(.is-best):hover {
    background: var(--color-surface);
}

.route-result.is-marker-highlighted {
    position: relative;
    z-index: 1;
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
    border-radius: 12px;
    background: #fff7ed;
}

.route-result.is-marker-highlighted.is-best {
    background: #f4f8f3;
}

.route-rank {
    padding-top: 0.15rem;
    display: inline-flex;
    justify-content: center;
    color: var(--color-muted);
    font-size: 1.05rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.route-rank-column {
    display: grid;
    align-content: start;
    justify-items: center;
    gap: 0.25rem;
    min-width: 0;
}

.route-rank-price {
    color: var(--color-muted);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
}

.route-result.is-best .route-rank {
    color: #166534;
    font-size: 1.2rem;
    font-weight: 800;
}

.route-result-heading {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.route-result-heading h3 {
    margin: 0;
    min-width: 0;
}

.route-brand-logo {
    width: 1.5rem;
    height: 1.5rem;
    flex: 0 0 1.5rem;
    object-fit: contain;
}

.route-result h3 {
    margin: 0;
    font-family: var(--font-family-title);
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.25;
}

.route-result-place {
    flex: 0 0 auto;
    color: var(--color-muted);
    font-size: 0.78rem;
    line-height: 1.25;
}

.route-result h3 a {
    color: var(--color-text);
    text-decoration: none;
}

.route-result h3 a:hover {
    color: var(--color-primary-700);
    text-decoration: underline;
}

.route-result h3 a:focus-visible {
    outline: 2px solid var(--color-primary-700);
    outline-offset: 3px;
    border-radius: 3px;
}

.route-result-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem 0.9rem;
    color: var(--color-muted);
    font-size: 0.76rem;
    line-height: 1.4;
}

.route-price-line {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 0.35rem 0.7rem;
    margin: 0.7rem 0 0.65rem;
}

.route-total {
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    font-weight: 900;
}

/* How much fuel the total buys — inside a fuel plan that differs per stop. */
.route-liters {
    color: var(--color-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.route-detour {
    display: grid;
    justify-items: end;
    align-self: center;
    gap: 0.1rem;
    color: var(--color-muted);
    font-size: 0.75rem;
    line-height: 1.25;
    text-align: right;
    white-space: nowrap;
}

.route-detour__distance {
    color: var(--color-text);
    font-weight: 700;
}

.route-pill {
    display: inline-flex;
    align-items: center;
    min-height: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: #166534;
    font-size: 0.76rem;
    font-weight: 800;
}

.route-result-foot__status::before {
    width: 0.42rem;
    height: 0.42rem;
    margin-right: 0.36rem;
    border-radius: 50%;
    background: currentColor;
    content: '';
}

.route-pill.is-warning {
    color: #9a3412;
}

/* Which stretch of a trip with stops of the driver's own this result is on.
   Neutral, because it is a fact about the route rather than a verdict. */
.route-pill.is-leg {
    color: var(--color-muted);
    font-weight: 600;
}

.route-result-foot__saving {
    color: var(--color-text);
    font-weight: 600;
}

.route-empty {
    display: grid;
    gap: 0.25rem;
    padding: 1rem;
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-muted);
    line-height: 1.55;
}

.route-empty strong {
    color: var(--color-text);
}

/* Fuel plan — see renderFuelPlan() in js/route-planner.js. Reuses
   .route-result-list/.route-result for each leg's stations, so a leg reads
   exactly like the flat ranked list it replaces. */
.route-fuel-plan {
    display: grid;
    gap: 0.85rem;
}

.route-fuel-plan-note {
    margin: 0;
    padding: 0.7rem 0.85rem;
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-muted);
    font-size: 0.85rem;
    line-height: 1.45;
}

.route-fuel-plan-note.is-error {
    background: #fff1f2;
    color: #9f1239;
}

/* Closes the plan, so it reads as a conclusion rather than another leg. */
.route-fuel-plan-note--arrival {
    border-top: 1px solid var(--color-border, #e5e7eb);
    border-radius: 0 0 8px 8px;
    font-weight: 700;
    color: var(--color-text);
}

.route-fuel-leg {
    display: grid;
    gap: 0.5rem;
}

.route-fuel-leg__title {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--color-text);
}

.route-navigate-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 2.85rem;
}

.route-navigate-btn.btn.btn-primary {
    border-color: #0079fd !important;
    background-color: #0079fd !important;
    color: #fff !important;
    box-shadow: 0 6px 14px rgba(0, 121, 253, 0.28),
        inset 0 1px 0 rgba(var(--rgb-white), 0.34) !important;
}

.route-navigate-btn.btn.btn-primary:hover:not(:disabled) {
    border-color: #0068dc !important;
    background-color: #0068dc !important;
    color: #fff !important;
    box-shadow: 0 10px 22px rgba(0, 121, 253, 0.34),
        inset 0 1px 0 rgba(var(--rgb-white), 0.42) !important;
}

.route-navigate-btn.btn.btn-primary:focus,
.route-navigate-btn.btn.btn-primary:focus-visible {
    color: #fff !important;
    box-shadow: 0 0 0 3px rgba(0, 121, 253, 0.32),
        0 6px 14px rgba(0, 121, 253, 0.28) !important;
}

.route-navigate-btn svg {
    flex-shrink: 0;
}

.route-map-shell {
    position: sticky;
    top: 6.2rem;
    overflow: hidden;
}

.route-map {
    width: 100%;
    height: min(76vh, 760px);
    min-height: 34rem;
    background: #e8e4db;
}

.route-popup-title {
    margin: 0 0 0.25rem;
    font-weight: 800;
}

.route-popup-body {
    margin: 0;
    color: var(--color-muted);
}

.route-popup {
    position: relative;
    min-width: 188px;
}

.route-popup-station {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding-right: 1.75em;
    color: inherit !important;
    text-decoration: none !important;
}

.route-popup-station img {
    width: 1.75em;
    height: 1.75em;
    object-fit: contain;
}

.route-popup-station > span {
    min-width: 0;
}

.route-popup-station b {
    display: block;
    color: var(--color-text);
}

.route-popup-place {
    display: block;
    color: #0000008f;
}

.route-popup-favorite-star {
    position: absolute;
    top: 0;
    right: 0;
    color: var(--color-primary, #0d6efd);
    cursor: pointer;
    transition: transform 160ms ease, color 160ms ease;
}

.route-popup-favorite-star:hover,
.route-popup-favorite-star:focus-visible {
    transform: scale(1.1);
    outline: none;
}

.route-popup-prices {
    width: 188px;
    margin-top: 0.45em;
}

.route-popup-price-link {
    text-decoration: none !important;
}

.route-popup .small-digit {
    font-size: 0.62em;
    line-height: 1;
    vertical-align: super;
}

.route-popup-summary {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.6em;
    margin: 0.65em 0 0.5em;
    flex-wrap: wrap;
}

.route-popup-summary strong {
    font-size: 1.08rem;
    color: var(--color-text);
}

.route-popup-summary span {
    color: var(--color-muted);
    font-weight: 700;
}

.route-popup-actions {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.6em;
    margin-top: 0.55em;
}

.route-popup-open-status {
    color: var(--color-text);
    font-size: 0.85rem;
    font-weight: 700;
}

.route-popup .map-popup-more-info {
    flex-shrink: 0;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    line-height: 1.25;
}

/* The measured omweg, filled in once the dotted line has been drawn. Coloured
   like that line so the sentence and the shape on the map read as one thing. */
.route-popup-detour {
    margin: 0.35rem 0 0;
    color: #b4552a;
    font-weight: 700;
}

.route-place-marker,
.route-station-marker {
    position: relative;
    display: block;
    pointer-events: auto;
}

.route-station-marker img {
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.route-place-marker {
    width: 2.35rem;
    height: 2.35rem;
    display: grid;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #1db954;
    color: #fff;
    box-shadow: 0 6px 14px rgba(var(--rgb-black), 0.22);
}

.route-place-marker.is-start {
    width: 1rem;
    height: 1rem;
    border-width: 3px;
}

.route-place-marker.is-destination {
    background: transparent;
    border-color: transparent;
    color: #111;
    box-shadow: none;
}

/* A numbered dot, the same size as the start dot's outer ring, so the driver's
   own stops read as part of the trip's spine rather than as another station. */
.route-place-marker.is-waypoint {
    width: 1.5rem;
    height: 1.5rem;
    border-width: 3px;
    background: var(--color-primary);
    color: #111;
}

.route-stop-number {
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1;
    pointer-events: none;
}

.route-place-marker svg {
    width: 1.25rem;
    height: 1.25rem;
    pointer-events: none;
}

.route-start-dot {
    display: none;
}

.route-finish-flag {
    position: relative;
    width: 1.75rem;
    height: 1.6rem;
    display: block;
    pointer-events: none;
}

.route-finish-pole {
    position: absolute;
    left: 0.2rem;
    top: 0.08rem;
    width: 0.14rem;
    height: 1.35rem;
    border-radius: 999px;
    background: #111;
}

.route-finish-cloth {
    position: absolute;
    left: 0.32rem;
    top: 0.06rem;
    width: 1.25rem;
    height: 0.88rem;
    border: 1px solid #111;
    border-radius: 0.12rem 0.18rem 0.18rem 0.05rem;
    background:
        linear-gradient(45deg, transparent 0 78%, rgba(var(--rgb-black), 0.16) 79% 100%),
        conic-gradient(
            #111 0 25%,
            #fff 0 50%,
            #111 0 75%,
            #fff 0 100%
        );
    background-size: 100% 100%, 0.42rem 0.44rem;
    box-shadow: 0 1px 2px rgba(var(--rgb-black), 0.2);
}

.route-station-marker {
    width: 41px;
    height: 41px;
}

@keyframes route-station-marker-jump {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-0.9rem);
    }
}

.route-station-marker.is-jumping {
    animation: route-station-marker-jump 0.7s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .route-station-marker.is-jumping {
        animation: none;
    }
}

.route-station-marker__rank {
    position: absolute;
    top: 0.18rem;
    left: 0.27rem;
    width: 1.25rem;
    height: 1.25rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(var(--rgb-white), 0.94);
    color: #111;
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(var(--rgb-black), 0.16);
}

.route-station-marker.is-best .route-station-marker__rank {
    color: #166534;
}

.route-station-marker.is-good .route-station-marker__rank {
    color: #9a3412;
}

.route-station-marker.is-other .route-station-marker__rank {
    color: #991b1b;
}

.route-station-marker.is-closed .route-station-marker__rank {
    color: #4b5563;
}

/* A fuel-plan leg past the first — see stationMarkerIcon() in
   js/route-planner.js — gets this small corner badge in addition to its
   rank, since each leg ranks its own stations starting at 1 again. */
.route-station-marker__leg {
    position: absolute;
    bottom: -0.15rem;
    right: -0.15rem;
    width: 1.05rem;
    height: 1.05rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #111827;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(var(--rgb-black), 0.28), 0 0 0 2px rgba(var(--rgb-white), 0.94);
}

.route-guide,
.route-caveats,
.route-faq {
    margin-top: 2.5rem;
}

.route-guide {
    display: grid;
    grid-template-columns: minmax(18rem, 0.95fr) minmax(0, 1.35fr);
    gap: 1.5rem 2rem;
    align-items: start;
}

.route-guide h2,
.route-caveats h2,
.route-faq h2 {
    margin: 0 0 0.65rem;
    font-family: var(--font-family-title);
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    line-height: 1.2;
}

.route-guide-copy p,
.route-guide-item p,
.route-caveats li,
.route-faq-item p {
    line-height: 1.65;
}

.route-guide-copy p {
    max-width: 62ch;
    margin: 0;
    color: var(--color-text);
}

.route-guide-list {
    display: grid;
    gap: 1rem;
}

.route-guide-item {
    padding-top: 1rem;
    border-top: 1px solid var(--color-border-subtle);
}

.route-guide-item h3 {
    margin: 0 0 0.35rem;
    font-size: 1.02rem;
    line-height: 1.3;
}

.route-guide-item p {
    max-width: 68ch;
    margin: 0;
    color: var(--color-muted);
}

.route-caveats {
    padding: 1rem 1.25rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
}

.route-caveats ul {
    margin: 0;
    padding-left: 1.1rem;
}

.route-caveats li {
    max-width: 76ch;
    margin-bottom: 0.65rem;
}

.route-caveats li:last-child {
    margin-bottom: 0;
}

.route-faq {
    display: grid;
    gap: 0;
}

.route-faq-item {
    border-bottom: 1px solid var(--color-border-subtle);
    padding: 0.8rem 0;
}

.route-faq-item summary {
    cursor: pointer;
    list-style-position: outside;
}

.route-faq-item summary h3 {
    display: inline;
    font-size: 1.02rem;
    font-weight: 700;
}

.route-faq-item p {
    max-width: 72ch;
    margin: 0.65rem 0 0;
}

@media (max-width: 980px) {
    .route-workspace {
        grid-template-columns: 1fr;
    }

    .route-map-shell {
        position: static;
    }

    .route-map {
        height: 58vh;
        min-height: 24rem;
    }

    .route-guide {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .route-main {
        padding-inline: 0.75rem;
    }

    .route-form,
    .route-results {
        padding: 0.85rem;
    }

    .route-commute-shortcuts {
        grid-template-columns: 1fr;
    }

    .route-destination-fields {
        grid-template-columns: 1fr;
    }

    .route-destination-list-item {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }

    .route-destination-list-actions {
        justify-content: flex-end;
    }

    .modal--route-destinations .modal__header {
        gap: 0.5rem;
    }

    .route-destinations-heading {
        flex: 1 1 auto;
    }

    .modal--route-destinations .modal__title {
        line-height: 1.2;
    }

    .route-price-line {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .route-detour {
        font-size: 0.7rem;
    }

    .route-guide,
    .route-caveats,
    .route-faq {
        margin-top: 2rem;
    }

    .route-caveats {
        padding: 0.9rem;
    }
}

@media (max-width: 390px) {
    .route-add-destination span {
        display: none;
    }

    .route-add-destination {
        width: 2.75rem;
        padding-inline: 0;
    }
}
