.commute-page .main-content, #commute-app { min-width: 0; }
.fare-reference h2, .fare-reference-guide h2 { font-size: 1.1rem; margin: 0 0 8px; }
.fare-reference > p { font-size: .82rem; line-height: 1.65; }
.fare-reference-table { min-width: 520px; font-size: .82rem; }
.fare-reference-option { margin: 0 0 8px; }
.fare-reference-option:last-child { margin-bottom: 0; }
.fare-reference-option strong { margin-inline-end: 8px; }
.fare-reference-option small { display: block; max-width: 32ch; color: var(--muted); line-height: 1.6; }
.fare-reference .table-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.commute-page [hidden] { display: none !important; }
.commute-intro { padding: clamp(16px, 2.5vw, 22px); border: 1px solid var(--panel-border); border-left: 3px solid var(--accent); border-radius: var(--radius); background: linear-gradient(110deg, var(--accent-soft), transparent 80%); }
.commute-intro h1 { margin: 4px 0 8px; font-size: clamp(1.3rem, 2.6vw, 1.75rem); line-height: 1.4; letter-spacing: -.025em; }
.commute-intro > p { max-width: 72ch; line-height: 1.65; font-size: .85rem; margin-bottom: 0; }
.commute-intro > .eyebrow { font-size: .68rem; margin-bottom: 8px; }
.commute-facts { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; font-size: .75rem; color: var(--muted); }
.commute-facts span { display: inline-flex; align-items: center; gap: 8px; }
.commute-facts span::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--brand-orange); }
body[data-lang="bn"] .commute-intro .eyebrow { letter-spacing: 0; }
.commute-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.commute-tabs a { padding: 10px 14px; border: 1px solid var(--panel-border); border-radius: 10px; font-size: .85rem; }
.commute-tabs a[aria-current] { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }
.commute-workspace { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.15fr); gap: 12px; align-items: start; }
.commute-form { display: grid; gap: 12px; }
.commute-form > .eyebrow { margin-bottom: -8px; }
.commute-endpoints { display: grid; gap: 10px; }
.commute-empty { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; min-height: 260px; padding: 22px; border: 1px dashed var(--panel-border); border-radius: var(--radius); background: linear-gradient(150deg, var(--surface-muted), transparent); }
.commute-empty > p { max-width: 42ch; line-height: 1.8; font-size: .9rem; margin-bottom: 0; }
.commute-empty .eyebrow { margin: 16px 0 8px; }
.commute-route-mark { color: var(--brand-orange); padding: 12px 22px; border: 1px solid var(--panel-border); border-radius: 100px; font-size: 1.6rem; font-weight: 700; letter-spacing: .15em; background: var(--brand-orange-soft); }
.commute-field { display: grid; gap: 5px; font-size: .85rem; min-width: 0; color: var(--muted); position: relative; align-self: start; }
.commute-field:focus-within { z-index: 30; }
.commute-stop-field > label { display: block; font: inherit; color: inherit; }
.commute-form .commute-suggestions { position: absolute; top: 100%; left: 0; z-index: 40; width: max(100%, 280px); max-width: calc(100vw - 48px); margin-top: 6px; max-height: min(260px, 40vh); overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--panel-border); background: var(--panel-strong); border-radius: 10px; box-shadow: var(--shadow); }
.commute-suggestions[hidden] { display: none !important; }
.commute-endpoints > .commute-stop-field:last-child .commute-suggestions { left: auto; right: 0; }
.commute-suggestion { padding: 12px; line-height: 1.7; cursor: pointer; border-bottom: 1px solid var(--panel-border); overflow-wrap: anywhere; }
.commute-suggestion:last-child { border-bottom: 0; }
.commute-suggestion:hover, .commute-suggestion[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.commute-field input, .commute-field select, .commute-field textarea { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid var(--panel-border); border-radius: 8px; background: var(--surface-input); color: var(--text); font: inherit; }
.commute-field input:not([type="checkbox"]), .commute-field select { min-height: 40px; }
.commute-field textarea { min-height: 64px; resize: vertical; }
.commute-field input:focus-visible, .commute-field select:focus-visible, .commute-field textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.commute-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.commute-form > .commute-actions > .primary { flex: 1; }
.commute-button { padding: 9px 12px; min-height: 40px; border: 1px solid var(--panel-border); border-radius: 8px; background: var(--surface-muted); color: var(--text); font: inherit; font-size: .85rem; cursor: pointer; }
.commute-button.primary { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); font-weight: 700; }
.commute-button:active { transform: translateY(1px); }
.commute-button:hover { border-color: var(--accent); }
.commute-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.commute-button:disabled { opacity: .45; cursor: not-allowed; }
.commute-button.commute-swap { display: inline-flex; align-items: center; justify-content: center; width: 44px; min-height: 44px; padding: 10px; flex: 0 0 44px; }
.commute-swap svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.commute-check { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; align-items: start; line-height: 1.7; cursor: pointer; }
.commute-check input[type="checkbox"] { width: 18px; height: 18px; margin: 3px 0 0; padding: 0; accent-color: var(--accent); }
.commute-check input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.commute-check > span { min-width: 0; }
.commute-message { margin: 0; line-height: 1.65; font-size: .78rem; color: var(--muted); }
.commute-message.error { color: var(--danger); }
.commute-results { display: grid; gap: 10px; min-width: 0; }
.commute-results h2, .journey-workspace h2, .commute-form h2 { margin: 0 0 8px; font-size: 1.075rem; line-height: 1.5; }
.fare-card { padding: 12px; border: 1px solid var(--panel-border); background: var(--panel); border-radius: var(--radius); min-width: 0; overflow-wrap: anywhere; }
.fare-card h3 { margin: 0 0 8px; font-size: .95rem; line-height: 1.6; }
.fare-card p { margin: 6px 0; font-size: .85rem; line-height: 1.65; }
.fare-amount { display: block; color: var(--accent); font-size: 2rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.fare-warning { padding: 10px 12px; background: var(--accent-soft); border-left: 3px solid var(--warning); border-radius: 6px; font-size: .85rem; }
.fare-sources { display: flex; flex-wrap: wrap; gap: 8px 12px; margin: 8px 0; font-size: .78rem; }
.fare-sources a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.fare-stops { padding-inline-start: 24px; line-height: 1.8; font-size: .85rem; }
.fare-stops li { padding: 5px 0; }
.fare-card summary { padding: 10px 0; cursor: pointer; line-height: 1.6; }
.journey-list { display: grid; gap: 8px; list-style: none; padding: 0; margin: 12px 0; }
.journey-step { border-left: 3px solid var(--accent); }
.journey-step .commute-actions { margin-top: 10px; }
.journey-step .commute-button { font-size: .8rem; padding: 8px 10px; }
.journey-step .commute-icon-button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 10px; }
.commute-icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.journey-total { padding: 12px; background: var(--accent-soft); border-top: 3px solid var(--brand-orange); border-radius: 10px; margin: 10px 0; font-size: .85rem; line-height: 1.65; }
.journey-total strong { font-size: 1.15rem; display: block; margin-bottom: 4px; }
.journey-step pre { white-space: pre-wrap; font: inherit; line-height: 1.8; }
.journey-modal { width: min(760px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); padding: 0; color: var(--text); background: var(--panel-strong); border: 1px solid var(--panel-border); border-radius: 18px; box-shadow: var(--shadow); }
.journey-modal::backdrop { background: rgba(3, 12, 24, .65); }
.journey-modal-shell { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: calc(100dvh - 44px); }
.journey-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--panel-border); }
.journey-modal-header h2 { margin: 0; font-size: 1.05rem; line-height: 1.6; }
.journey-modal .commute-icon-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 10px; }
.journey-modal-content { padding: 16px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.journey-modal-actions { padding: 12px 16px; border-top: 1px solid var(--panel-border); max-height: 28dvh; overflow-y: auto; }
.journey-instructions { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.9; user-select: text; }
.journey-image-preview figure { margin: 0 0 20px; }
.journey-image-preview img { display: block; width: 100%; height: auto; border-radius: 10px; }
.journey-image-preview figcaption { padding-top: 8px; text-align: center; color: var(--muted); font-size: .8rem; }
.fare-source-preview { background: #fff; overflow: auto; }
.fare-source-preview img { display: block; width: 100%; height: auto; }
.fare-source-preview img[hidden] { display: none; }
.fare-source-preview.is-zoomed img { width: auto; min-width: 100%; max-width: none; }
.fare-source-preview .muted { color: #50627b; }
/* Only animate newly requested results, never delay the initial page content. */
@media (prefers-reduced-motion: no-preference) {
    .commute-results > .fare-card { animation: commute-reveal 200ms ease-out backwards; }
    .commute-results > .fare-card:nth-child(2) { animation-delay: 25ms; }
    .commute-results > .fare-card:nth-child(3) { animation-delay: 50ms; }
    .journey-modal[open] { animation: commute-reveal 160ms ease-out; }
    .journey-modal[open]::backdrop { animation: commute-backdrop 140ms ease-out; }
    .commute-suggestion { transition: background-color 100ms ease; }
    .commute-suggestions:not([hidden]) { animation: dropdown-arrive 140ms ease-out; transform-origin: top; }
    .commute-button { transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease; }
    .commute-button svg { transition: transform 160ms ease; }
    .commute-button:not(:disabled):active { transform: scale(.97); }
    .fare-card { transition: border-color 160ms ease, box-shadow 160ms ease; }
    .fare-source-preview img, .journey-image-preview img { animation: commute-backdrop 180ms ease-out; }
    @keyframes dropdown-arrive {
        from { opacity: .5; transform: translateY(-4px) scaleY(.98); }
        to { opacity: 1; transform: translateY(0) scaleY(1); }
    }
    @keyframes commute-reveal {
        from { opacity: .75; transform: translateY(4px); }
        to { opacity: 1; transform: translateY(0); }
    }
    @keyframes commute-backdrop { from { opacity: 0; } to { opacity: 1; } }
}
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
    .commute-button:not(:disabled):hover { transform: translateY(-1px); }
    .commute-icon-button:not(:disabled):hover svg { transform: scale(1.1); }
    .fare-card:hover { border-color: var(--accent); }
}
.commute-source h2 { margin-bottom: 16px; }
.commute-source .journey-links { line-height: 1.8; }
.commute-source summary { color: var(--muted); cursor: pointer; font-size: .85rem; line-height: 1.8; }
.commute-source[open] summary { color: var(--text); padding-bottom: 18px; border-bottom: 1px solid var(--panel-border); }
.commute-source-content { padding-top: 12px; font-size: .85rem; }
.metro-resources { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: .8rem; line-height: 1.7; margin: 0; }
.metro-resources a { color: var(--muted); padding: 5px 0; border-bottom: 1px solid transparent; }
.metro-resources a:hover { color: var(--accent); border-color: var(--accent); }
.metro-overview { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.metro-overview > * { min-width: 0; scroll-margin-top: 20px; }
.metro-fare-panel { border-top: 3px solid var(--accent); }
.tool-panel-heading h2 { font-size: 1.05rem; line-height: 1.5; margin: 0; }
.tool-panel-heading > .muted { font-size: .8rem; line-height: 1.65; margin: 6px 0 12px; }
.is-embedded { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.is-embedded .commute-form { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; gap: 12px; }
.is-embedded .commute-endpoints { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.is-embedded .commute-field { font-size: .8rem; }
.is-embedded .commute-check { font-size: .75rem; }
.is-embedded .commute-message { font-size: .72rem; }
.is-embedded .commute-form > .commute-actions > .primary { flex: 0 1 auto; min-height: 36px; padding: 8px 18px; font-size: .8rem; }
.is-embedded .commute-button.commute-swap { width: 36px; min-height: 36px; flex-basis: 36px; padding: 7px; }
.is-embedded .commute-swap svg { width: 20px; height: 20px; }
.is-embedded .fare-card { background: var(--surface-muted); padding: 14px; }
.is-embedded .fare-card h3 { font-size: .85rem; }
.is-embedded .fare-card > p { font-size: .8rem; }
.is-embedded .fare-amount { font-size: 1.75rem; }
.is-embedded .fare-stops { max-height: 200px; overflow-y: auto; }
.metro-fare-note { padding-top: 10px; margin: 10px 0 0; border-top: 1px solid var(--panel-border); font-size: .72rem; color: var(--muted); line-height: 1.7; }
@media (min-width: 900px) {
    .journey-workspace > .commute-form { position: sticky; top: 20px; }
}
@media (max-width: 900px) {
    .metro-overview { grid-template-columns: minmax(0, 1fr); }
}
@media (pointer: coarse) {
    .commute-field input, .commute-field select, .commute-field textarea { font-size: 16px; }
}
@media (max-width: 760px) {
    .commute-workspace { grid-template-columns: minmax(0, 1fr); }
    .commute-tabs a { font-size: .8rem; padding: 9px 11px; }
    .fare-amount { font-size: 1.7rem; }
    .commute-empty { min-height: 180px; padding: 16px; }
    .commute-route-mark { font-size: 1.2rem; }
    .commute-intro > p { font-size: .85rem; }
    .commute-facts { gap: 8px 14px; font-size: .72rem; }
}
