.planner-form .station-prefilled {
    border-color: var(--primary);
    background-color: #f0f8fb;
    box-shadow: 0 0 0 0 rgba(7, 89, 133, .24);
    animation: station-prefilled-pulse 1.7s ease-out 1;
}

.prefilled-hint {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-top: .25rem;
    color: var(--primary);
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.4;
}

.prefilled-hint span {
    display: inline-grid;
    place-items: center;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    color: #fff;
    background: var(--primary);
    font-size: .7rem;
}

@keyframes station-prefilled-pulse {
    0%, 30% { box-shadow: 0 0 0 0 rgba(7, 89, 133, .28); }
    65% { box-shadow: 0 0 0 7px rgba(7, 89, 133, 0); }
    100% { box-shadow: 0 0 0 0 rgba(7, 89, 133, 0); }
}

.planner-head h1 {
    max-width: 850px;
    font-size: clamp(2.35rem, 5vw, 4rem);
    text-wrap: balance;
}

.planner-shell {
    align-items: start;
}

.planner-search h2 {
    margin: .35rem 0 .25rem;
    line-height: 1.15;
}

.planner-search > p {
    margin: 0 0 1.25rem;
    color: var(--muted);
}

.planner-field-label {
    display: flex;
    align-items: center;
    gap: .45rem;
}

.planner-field-label svg,
.planner-submit svg,
.swap-stations svg,
.planner-result svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.swap-stations {
    gap: .4rem;
    margin: -.35rem 0 .65rem auto;
    padding: .42rem .65rem;
    border: 1px solid var(--border);
    background: #f4f8fb;
    color: var(--primary);
    font-size: .78rem;
}

.swap-stations:hover {
    border-color: var(--primary);
    background: #e6f2f7;
    filter: none;
}

.planner-submit {
    width: 100%;
    gap: .55rem;
    margin-top: .25rem;
}

.planner-helper-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    font-size: .82rem;
    font-weight: 700;
}

.planner-output {
    min-width: 0;
}

.planner-error {
    margin-top: 0;
}

.planner-result {
    overflow: hidden;
    padding: 0;
}

.planner-result-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.35rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg,#f7fbfd,#fff);
}

.planner-result-head h2,
.planner-result-head p {
    margin: 0;
}

.planner-result-head h2 {
    margin-top: .25rem;
    font-size: clamp(1.45rem,3vw,2rem);
    line-height: 1.15;
}

.planner-result-head h2 span {
    color: var(--primary);
}

.planner-result-head h2 a {
    color: var(--ink);
    text-decoration-color: rgba(7,89,133,.35);
    text-decoration-thickness: 2px;
    text-underline-offset: .14em;
    transition: color .2s ease,text-decoration-color .2s ease;
}

.planner-result-head h2 a:hover,
.planner-result-head h2 a:focus-visible {
    color: var(--primary);
    text-decoration-color: currentColor;
}

.planner-result-head p {
    margin-top: .3rem;
    color: var(--muted);
}

.result-status {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: .4rem;
    padding: .4rem .65rem;
    border-radius: 999px;
    background: #e8f8ef;
    color: #087443;
    font-size: .76rem;
    font-weight: 800;
}

.result-status i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10a663;
}

.planner-context-cards,
.planner-metrics {
    display: grid;
    gap: .75rem;
    padding: 1.25rem 1.25rem 0;
}

.context-card {
    display: flex;
    align-items: center;
    gap: .8rem;
    min-width: 0;
    padding: .9rem;
    border-radius: 13px;
}

.direction-card {
    background: #eef5ff;
    color: #174ea6;
}

.service-card {
    background: #f2efff;
    color: #5941a9;
}

.context-icon {
    display: grid;
    place-items: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255,255,255,.78);
}

.context-card small,
.context-card strong {
    display: block;
}

.context-card small {
    font-size: .75rem;
    font-weight: 750;
}

.context-card strong {
    overflow-wrap: anywhere;
    line-height: 1.25;
}

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

.planner-metric {
    display: grid;
    justify-items: center;
    min-width: 0;
    padding: 1rem .6rem;
    border-radius: 13px;
    background: #f5f8fa;
    text-align: center;
}

.planner-metric > span {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin-bottom: .45rem;
    border-radius: 50%;
    background: #e6eef3;
    color: var(--primary);
}

.planner-metric small,
.planner-metric strong {
    display: block;
}

.planner-metric small {
    color: var(--muted);
    font-size: .74rem;
    font-weight: 750;
}

.planner-metric strong {
    margin-top: .15rem;
    font-size: 1.2rem;
    line-height: 1.2;
}

.time-metric { background: #edf4ff; }
.time-metric > span { background: #3b82f6; color: #fff; }
.time-metric strong { color: #174ea6; }
.fare-metric { background: #eafaf2; }
.fare-metric > span { background: #10a663; color: #fff; }
.fare-metric strong { color: #087443; }
.stations-metric { background: #fff6e5; }
.stations-metric > span { background: #f59e0b; color: #fff; }
.stations-metric strong { color: #9a5b00; }
.segments-metric { background: #f2efff; }
.segments-metric > span { background: #6d5bd0; color: #fff; }
.segments-metric strong { color: #5941a9; }

.planner-route-panel,
.planner-details-panel {
    margin: 1.25rem;
    padding: 1.15rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #f9fbfc;
}

.planner-route-panel h3,
.planner-details-panel h3 {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0 0 1rem;
    font-size: 1.05rem;
}

.planner-route-panel h3 svg,
.planner-details-panel h3 svg {
    color: var(--primary);
}

.planner-route-list {
    margin: 0;
}

.planner-route-list li {
    min-height: 70px;
}

.planner-route-list li > span {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    border-color: #ef4444;
}

.planner-route-list li:not(:last-child) > span::after {
    left: 3px;
    height: 58px;
    background: #ef4444;
}

.planner-route-list li.is-origin > span {
    border-color: #10a663;
    background: #10a663;
    box-shadow: 0 0 0 4px rgba(16,166,99,.14);
}

.planner-route-list li.is-destination > span {
    border-color: #ef4444;
    background: #ef4444;
    box-shadow: 0 0 0 4px rgba(239,68,68,.12);
}

.planner-route-list small {
    color: var(--primary);
    font-weight: 800;
}

.planner-route-list em {
    display: block;
    margin-top: .18rem;
    color: var(--muted);
    font-size: .75rem;
    font-style: normal;
}

.planner-detail-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    margin: 0;
}

.planner-detail-list div {
    display: grid;
    grid-template-columns: minmax(110px,.7fr) 1.3fr;
    gap: .75rem;
    padding: .65rem 0;
    border-bottom: 1px solid var(--border);
}

.planner-detail-list dt {
    color: var(--muted);
    font-size: .82rem;
}

.planner-detail-list dd {
    font-weight: 750;
}

.planner-data-note {
    margin-top: 1rem;
    padding: .85rem 1rem;
    border-left: 4px solid;
    border-radius: 8px;
}

.planner-data-note p {
    margin: .15rem 0 0;
    font-size: .86rem;
}

.published-note {
    border-color: #10a663;
    background: #eafaf2;
    color: #075e37;
}

.estimated-note {
    border-color: #f59e0b;
    background: #fff7e6;
    color: #855000;
}

.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    margin-top: 1rem;
}

.planner-empty {
    display: grid;
    justify-items: center;
    min-height: 420px;
    align-content: center;
}

.planner-empty-icon {
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    margin-bottom: 1rem;
    border-radius: 50%;
    background: #e6f2f7;
    color: var(--primary);
}

.planner-empty-icon svg {
    width: 52px;
    height: 52px;
    fill: none;
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (min-width: 480px) {
    .planner-context-cards { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (min-width: 700px) {
    .planner-detail-list { grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 1.25rem; }
}

@media (min-width: 700px) and (max-width: 999px) {
    .planner-shell { grid-template-columns: minmax(0,1fr); }
}

@media (min-width: 1000px) {
    .planner-shell { grid-template-columns: minmax(280px,.8fr) minmax(0,1.4fr); }
}

@media (min-width: 1100px) {
    .planner-metrics { grid-template-columns: repeat(4,minmax(0,1fr)); }
    .planner-search { position: sticky; top: 105px; }
}

@media (max-width: 420px) {
    .planner-context-cards,
    .planner-metrics { grid-template-columns: 1fr; }
    .planner-result-head,.planner-context-cards,.planner-metrics { padding-right: 1rem; padding-left: 1rem; }
    .planner-route-panel,.planner-details-panel { margin-right: .75rem; margin-left: .75rem; padding: 1rem; }
    .planner-detail-list div { grid-template-columns: 1fr; gap: .15rem; }
    .result-actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .planner-form .station-prefilled { animation: none; }
}
