{# Accordion container #}
.rates-tables__container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rates-tables__container .accordion {
    /* border: 1px solid #bebebe; */
    border-radius: 12px;
    background: #f2f3f4;
}

{# Summary row #}
.rates-tables__container summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    cursor: pointer;
    list-style: none;
    gap: 1rem;
}

.rates-tables__container summary::-webkit-details-marker {
    display: none;
}

{# Zero out heading margins/sizing inside summary so flex layout stays intact #}
.rates-tables__container summary h2,
.rates-tables__container summary h3,
.rates-tables__container summary h4 {
    margin: 0;
    flex: 1;
    color: inherit;
}

{# Toggle icon #}
.rates-tables__container summary .menu__child-toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: #DADCE0;
    line-height: 0;
    flex-shrink: 0;
}

.rates-tables__container summary .menu__child-toggle-icon svg {
    transition: transform 0.2s ease-in-out;
}

.rates-tables__container details[open] summary .menu__child-toggle-icon svg {
    transform: rotate(-180deg);
}

{# Content panel — grid animation trick collapses to 0 height without display:none #}
.rates-tables__container .content {
    display: grid;
    grid-template-rows: 0fr;
    padding: 0 1.5rem;
    transition: grid-template-rows 0.3s ease, padding 0.3s ease;
}

.rates-tables__container .inner {
    overflow: hidden;
    margin: 0;
    opacity: 0;
    transition: opacity 0.2s ease 0.1s;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 1200px) {
    .rates-tables__container .inner {
        gap: 2rem;
    }
}

.rates-tables__container details[open] + .content .inner {
    opacity: 1;
}

.rates-tables__container details[open] + .content {
    grid-template-rows: 1fr;
    padding: 0.5rem 1.5rem 1.5rem;
}

.rates-tables__container .content *:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .rates-tables__container summary {
        padding: 0.75rem 1rem;
    }

    .rates-tables__container details[open] + .content {
        padding: 0.75rem 1rem 1rem;
    }
}

@media (prefers-reduced-motion) {
    .rates-tables__container .content,
    .rates-tables__container .inner {
        transition: none;
    }
}

{# Table wrappers #}
.rates-table__wrapper {
    width: 100%;
    overflow: hidden;
}


.rates-table__scroller {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

{# Table heading row #}
.rates-table__heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.rates-table__heading .heading-wrapper * {
    margin: 0;
}

{# Accordion-level intro #}
.rates-accordion__intro *:last-child {
    margin-bottom: 0;
}

{# Per-table and accordion-level disclaimers #}
.rates-table__disclaimer,
.rates-accordion__disclaimer {
    margin-top: 1rem;
    font-size: 0.875rem;
}
.rates-table__disclaimer h2,
.rates-accordion__disclaimer h2 {
    font-size: 1.5em;
}
.rates-table__disclaimer h3,
.rates-accordion__disclaimer h3 {
    font-size: 1.4em;
}
.rates-table__disclaimer h4,
.rates-accordion__disclaimer h4 {
    font-size: 1.3em;
}
.rates-table__disclaimer h5,
.rates-accordion__disclaimer h5 {
    font-size: 1.2em;
}
.rates-table__disclaimer h6,
.rates-accordion__disclaimer h6 {
    font-size: 1.1em;
}
.rates-table__disclaimer p,
.rates-table__disclaimer li,
.rates-accordion__disclaimer p,
.rates-accordion__disclaimer li {
    font-size: 1em;
}

.rates-table__disclaimer *:last-child,
.rates-accordion__disclaimer *:last-child {
    margin-bottom: 0;
}

{# General table styling #}
.rates-table__table {
    width: 100%;
    table-layout: fixed;
    border-spacing: 0;
    border-collapse: separate;
    border: none;
    margin: 0;
}

.rates-table__table :is(table, td, th) {
    border: none;
}

.rates-table__table th,
.rates-table__table td {
    text-align: left;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    vertical-align: middle;
}

.rates-table__table tbody td.first-col {
    /* text-align: left; */
}

.rates-table__table th *,
.rates-table__table td * {
    margin: 0;
}

.rates-table__table th *:not(li) + *,
.rates-table__table td *:not(li) + * {
    margin-top: 0.5rem;
}

{# Mobile table element styling #}
.rates-table__table th.table__mobile-header,
.rates-table__table .table__mobile-detail-row,
.rates-table__table .table__mobile-detail-body {
    display: none;
}

.rates-table__table .table__mobile-detail-row {
    flex-grow: 1;
}

@media (max-width: 767px) {
    table.rates-table__table,
    .rates-table__table tbody,
    .rates-table__table tr,
    .rates-table__table caption {
        display: flex;
        flex-direction: column;
        width: 100%;
        overflow-wrap: break-word;
    }

    .rates-table__table th.table__header,
    .rates-table__table .table__detail-row,
    .rates-table__table thead,
    .rates-table__table .table__detail-body {
        display: none;
    }

    .rates-table__table th.table__mobile-header,
    .rates-table__table tbody.transposed__mobile-body {
        display: block;
    }

    {# Comparison mobile body #}
    .rates-table__table .table__mobile-detail-row,
    .rates-table__table tbody.comparison__mobile-body {
        display: flex;
    }

    .rates-table__table tbody.comparison__mobile-body th + td {
        padding-top: 0;
    }

    /* Add in horizontal scrolling for mobile comparison chart */
    .rates-table__table tbody.comparison__mobile-body {
        flex-direction: row;
        gap: 0.5rem;
        overflow-x: scroll;
        scroll-snap-type: x mandatory;
        padding-bottom: 1rem;
    }

    .rates-table__table tr {
        width: 100%;
        flex-shrink: 0;
        scroll-snap-align: start;
    }

    /* scrollbar styling */
    .rates-table__table tbody::-webkit-scrollbar-track,
    .rates-table__table tbody::-webkit-scrollbar-thumb {
        border-radius: 8px;
    }

    .rates-table__table tbody::-webkit-scrollbar {
        height: 8px;
    }


    {# Transposed mobile body #}
    .rates-table__table tbody.transposed__mobile-body .table__mobile-detail-row {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .rates-table__table tbody.transposed__mobile-body th.table__mobile-header--first {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        flex: 100%;
    }

    .rates-table__table tbody.transposed__mobile-body th.table__mobile-header--first > span {
        /* text-align: left; */
        margin: 0;
    }

    .rates-table__table tbody.transposed__mobile-body th.table__mobile-header--first > span.label {
        flex: 0 1 50%;
        padding-right: 1rem;
    }

    .rates-table__table tbody.transposed__mobile-body th.table__mobile-header--first > span.value {
        padding-left: 1rem;
    }

    .rates-table__table tbody.transposed__mobile-body th:not(.table__mobile-header--first),
    .rates-table__table tbody.transposed__mobile-body td {
        flex: 50%;
        /* text-align: left; */
    }
}
