:root {
    --bam-primary: #1d4ed8;
    --bam-primary-dark: #173b9a;
    --bam-accent: #f59e0b;
    --bam-text: #172033;
    --bam-muted: #637083;
    --bam-line: #dfe5ee;
    --bam-soft: #f5f7fb;
    --bam-white: #fff;
    --bam-radius: 18px;
    --bam-shadow: 0 14px 40px rgba(30, 50, 90, .10);
}

.bam-container,
.bam-calculator,
.bam-directory {
    box-sizing: border-box;
}

.bam-page {
    color: var(--bam-text);
    padding: 34px 16px 64px;
    background: linear-gradient(180deg, #f7f9fc 0, #fff 360px);
}

.bam-container {
    width: min(1120px, 100%);
    margin: 0 auto;
}

.bam-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 26px;
    color: var(--bam-muted);
    font-size: 14px;
}

.bam-breadcrumb a {
    color: var(--bam-primary);
    text-decoration: none;
}

.bam-hero {
    max-width: 850px;
    margin-bottom: 28px;
}

.bam-hero h1,
.bam-calculator h2,
.bam-section-heading h2,
.bam-article h2,
.bam-side-card h2 {
    color: var(--bam-text);
    font-weight: 800;
    line-height: 1.16;
    letter-spacing: -.025em;
}

.bam-hero h1 {
    margin: 7px 0 13px;
    font-size: clamp(30px, 5vw, 48px);
}

.bam-hero p,
.bam-calculator__header p,
.bam-section-heading p {
    color: var(--bam-muted);
    line-height: 1.7;
}

.bam-eyebrow {
    display: inline-block;
    color: var(--bam-primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.bam-calculator {
    width: min(1120px, 100%);
    margin: 30px auto;
    padding: clamp(22px, 4vw, 34px);
    color: var(--bam-text);
    background: var(--bam-white);
    border: 1px solid var(--bam-line);
    border-radius: var(--bam-radius);
    box-shadow: var(--bam-shadow);
}

.bam-calculator--compact {
    margin-top: 24px;
    margin-bottom: 32px;
}

.bam-calculator__header {
    max-width: 760px;
    margin-bottom: 22px;
}

.bam-calculator__header h2 {
    margin: 6px 0 8px;
    font-size: clamp(24px, 4vw, 34px);
}

.bam-calculator__header p {
    margin: 0;
}

.bam-form__cities,
.bam-form__details {
    display: grid;
    gap: 14px;
    align-items: end;
}

.bam-form__cities {
    grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
}

.bam-form__details {
    grid-template-columns: minmax(140px, .7fr) minmax(140px, .7fr) minmax(210px, 1fr);
    margin-top: 15px;
}

.bam-field {
    display: grid;
    gap: 7px;
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: #3c485c;
}

.bam-field select,
.bam-field input,
.bam-table-search input {
    width: 100%;
    min-height: 48px;
    box-sizing: border-box;
    margin: 0;
    padding: 10px 13px;
    color: var(--bam-text);
    background: #fff;
    border: 1px solid #cbd4e1;
    border-radius: 11px;
    font: inherit;
    font-size: 15px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.bam-field select:focus,
.bam-field input:focus,
.bam-table-search input:focus {
    border-color: var(--bam-primary);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, .12);
}

.bam-swap {
    width: 46px;
    height: 46px;
    margin-bottom: 1px;
    padding: 0;
    color: var(--bam-primary);
    background: #eef3ff;
    border: 1px solid #cedbfd;
    border-radius: 50%;
    font-size: 23px;
    line-height: 1;
    cursor: pointer;
}

.bam-swap:hover {
    background: #dfe8ff;
}

.bam-submit {
    min-height: 49px;
    padding: 11px 20px;
    color: #fff;
    background: linear-gradient(135deg, var(--bam-primary), var(--bam-primary-dark));
    border: 0;
    border-radius: 11px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 9px 22px rgba(29, 78, 216, .22);
}

.bam-submit:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.bam-form__error {
    margin: 12px 0 0;
    padding: 10px 12px;
    color: #a61b1b;
    background: #fff1f1;
    border-radius: 8px;
    font-size: 14px;
}

.bam-results {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.bam-result-card {
    min-height: 136px;
    padding: 22px;
    background: #fff;
    border: 1px solid var(--bam-line);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(35, 51, 83, .07);
}

.bam-result-card > span,
.bam-result-card small {
    display: block;
    color: var(--bam-muted);
}

.bam-result-card > span {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.bam-result-card strong {
    display: block;
    margin: 9px 0 7px;
    color: var(--bam-primary-dark);
    font-size: clamp(24px, 4vw, 33px);
    line-height: 1.15;
}

.bam-result-card small {
    font-size: 12px;
    line-height: 1.5;
}

.bam-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 28px;
    align-items: start;
}

.bam-article,
.bam-side-card,
.bam-table-section {
    background: #fff;
    border: 1px solid var(--bam-line);
    border-radius: var(--bam-radius);
    box-shadow: 0 8px 28px rgba(35, 51, 83, .06);
}

.bam-article {
    padding: clamp(22px, 4vw, 36px);
}

.bam-article--wide {
    margin-top: 28px;
}

.bam-article h2 {
    margin: 30px 0 12px;
    font-size: clamp(21px, 3vw, 28px);
}

.bam-article h2:first-child {
    margin-top: 0;
}

.bam-article p {
    color: #46536a;
    font-size: 16px;
    line-height: 1.8;
}

.bam-side-card {
    position: sticky;
    top: 24px;
    padding: 23px;
}

.bam-side-card h2 {
    margin: 0 0 15px;
    font-size: 20px;
}

.bam-link-list {
    margin: 0 0 15px;
    padding: 0;
    list-style: none;
}

.bam-link-list li + li {
    border-top: 1px solid #edf0f5;
}

.bam-link-list a {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    color: #25324a;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
}

.bam-link-list a span {
    color: var(--bam-muted);
    white-space: nowrap;
    font-weight: 500;
}

.bam-text-link,
.bam-detail-link {
    color: var(--bam-primary);
    font-weight: 800;
    text-decoration: none;
}

.bam-info-table-wrap,
.bam-route-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.bam-info-table,
.bam-route-table {
    width: 100%;
    border-collapse: collapse;
    color: #354159;
}

.bam-info-table th,
.bam-info-table td,
.bam-route-table th,
.bam-route-table td {
    padding: 13px 14px;
    text-align: left;
    border-bottom: 1px solid #e7ebf1;
}

.bam-info-table th,
.bam-route-table th {
    color: #27344b;
    background: #f7f9fc;
    font-size: 13px;
}

.bam-info-table th {
    width: 38%;
}

.bam-faq details {
    border-top: 1px solid #e5e9f0;
}

.bam-faq summary {
    padding: 15px 0;
    font-weight: 800;
    cursor: pointer;
}

.bam-faq details p {
    margin-top: 0;
}

.bam-disclaimer {
    margin: 24px 0 0;
    color: var(--bam-muted);
    font-size: 13px;
    line-height: 1.6;
}

.bam-table-section {
    margin-top: 28px;
    padding: clamp(18px, 3vw, 30px);
}

.bam-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.bam-section-heading h2 {
    margin: 4px 0 0;
    font-size: clamp(23px, 3vw, 31px);
}

.bam-section-heading p {
    max-width: 520px;
    margin: 0;
}

.bam-table-search {
    width: min(240px, 100%);
}

.bam-route-table {
    min-width: 680px;
}

.bam-route-table tbody tr:hover {
    background: #fafbfe;
}

.bam-route-table td small {
    display: block;
    margin-top: 3px;
    color: var(--bam-muted);
    font-size: 11px;
}

.bam-directory {
    width: min(1120px, 100%);
    margin: 34px auto;
}

.bam-popular-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
}

.bam-popular-grid a {
    display: grid;
    gap: 6px;
    min-height: 94px;
    padding: 17px;
    color: var(--bam-text);
    background: #fff;
    border: 1px solid var(--bam-line);
    border-radius: 14px;
    text-decoration: none;
    box-shadow: 0 7px 20px rgba(35, 51, 83, .05);
}

.bam-popular-grid a:hover,
.bam-city-grid a:hover {
    border-color: #a9bff8;
    transform: translateY(-2px);
}

.bam-popular-grid span {
    color: var(--bam-muted);
    font-size: 13px;
}

.bam-section-heading--cities {
    margin-top: 42px;
}

.bam-city-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 9px;
}

.bam-city-grid a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 10px;
    color: #25324a;
    background: #fff;
    border: 1px solid var(--bam-line);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.bam-city-grid a span {
    display: inline-grid;
    width: 25px;
    height: 25px;
    place-items: center;
    flex: 0 0 25px;
    color: var(--bam-primary);
    background: #edf2ff;
    border-radius: 7px;
    font-size: 10px;
}

@media (max-width: 920px) {
    .bam-content-grid {
        grid-template-columns: 1fr;
    }
    .bam-side-card {
        position: static;
    }
    .bam-popular-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .bam-city-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .bam-page {
        padding-inline: 11px;
    }
    .bam-form__cities,
    .bam-form__details,
    .bam-results {
        grid-template-columns: 1fr;
    }
    .bam-swap {
        margin: -2px auto;
        transform: rotate(90deg);
    }
    .bam-section-heading {
        display: grid;
        align-items: start;
    }
    .bam-table-search {
        width: 100%;
    }
    .bam-popular-grid,
    .bam-city-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .bam-result-card {
        min-height: auto;
    }
}

@media (max-width: 390px) {
    .bam-city-grid,
    .bam-popular-grid {
        grid-template-columns: 1fr;
    }
}
