/**
 * Fare detail panels below the itinerary: baggage, conditions, price.
 *
 * Each topic is its own segment — muted header strip, quiet body, hairline
 * frame — so the three columns read as cards rather than floating labels.
 * Colour is spent only where it means something: icons, refund tone, total.
 */

.tbo-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
    gap: 12px;
    /* Start, not stretch: equal-height columns left a void above the price total. */
    align-items: start;
    font-size: 13px;
}

.tbo-details__section {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--color-border-subtle);
    border-radius: 16px;
    background: var(--color-surface-raised);
}

/* Direct heading = panel chrome. Privileges nests its own title and is left alone. */
.tbo-details__section > .tbo-details__heading {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 0;
    padding: 11px 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    border-bottom: 1px solid var(--color-border-subtle);
    background: color-mix(in srgb, var(--color-surface-muted) 65%, var(--color-surface-raised));
}

.tbo-details__section > .tbo-details__heading .tbo-icon {
    width: 1.2em;
    height: 1.2em;
    color: var(--primary);
}

.tbo-details__section--good > .tbo-details__heading .tbo-icon {
    color: var(--tt-good);
}

.tbo-details__section--warn > .tbo-details__heading .tbo-icon {
    color: var(--tt-warn);
}

.tbo-details__section--price > .tbo-details__heading .tbo-icon {
    color: var(--primary-dark);
}

.tbo-details__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    padding: 14px;
}

.tbo-details__group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.tbo-details h5 {
    margin: 0;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.tbo-details__rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
}

.tbo-details__row {
    display: flex;
    gap: 12px;
    align-items: baseline;
    justify-content: space-between;
}

.tbo-details__row dt {
    display: flex;
    gap: 7px;
    align-items: center;
    min-width: 0;
    color: var(--color-text-secondary);
}

.tbo-details__row dt .tbo-icon {
    width: 1.05em;
    height: 1.05em;
    color: var(--color-text-muted);
}

.tbo-details__row dd {
    flex: 0 0 auto;
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    color: var(--color-text);
}

.tbo-details__row--muted dd {
    font-weight: 500;
    color: var(--color-text-muted);
}

/* Charge summary sits in a soft inset so it separates from airline notes. */
.tbo-details__rows--charges {
    gap: 7px;
    padding: 10px 11px;
    border-radius: 11px;
    background: color-mix(in srgb, var(--color-surface-muted) 72%, transparent);
}

/* Total: accent strip flush under the breakdown — same right edge as fare lines. */
.tbo-details__section--price .tbo-details__body {
    gap: 10px;
    padding-bottom: 0;
}

.tbo-details__rows--total {
    gap: 0;
    margin: 0 -14px 0;
    padding: 12px 14px;
    border-top: 1px solid var(--tt-accent-line);
    background: color-mix(in srgb, var(--primary) 9%, var(--color-surface-raised));
}

.tbo-details__row--total {
    gap: 10px;
    align-items: baseline;
}

.tbo-details__row--total dt {
    font-weight: 600;
    color: var(--color-text);
}

.tbo-details__row--total dd {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--color-text);
}

/* Which flight carries which allowance, when the legs disagree. */

.tbo-details__leg-bags {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 11px;
    margin: 0;
    list-style: none;
    border-radius: 11px;
    background: color-mix(in srgb, var(--color-surface-muted) 72%, transparent);
}

.tbo-details__leg-bags li {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    justify-content: space-between;
    font-size: 12px;
    color: var(--color-text-secondary);
}

.tbo-details__leg-bags li span:last-child {
    font-weight: 600;
    color: var(--color-text);
}

/* Fare rules, in the airline's own words. */

.tbo-details__notes {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.tbo-details__notes li {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    align-items: baseline;
    line-height: 1.4;
}

.tbo-details__note-route {
    padding: 1px 6px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--color-text-secondary);
    border-radius: 999px;
    background: var(--color-surface-muted);
}

.tbo-details__note-who {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.tbo-details__note {
    margin: 0;
    font-size: 11.5px;
    line-height: 1.45;
    color: var(--color-text-muted);
}

.tbo-details__note--foot {
    padding-top: 2px;
}

:root[data-theme="dark"] .tbo-details__rows--total {
    background: color-mix(in srgb, var(--primary) 14%, var(--color-surface-raised));
}

@media (max-width: 720px) {
    .tbo-details {
        gap: 10px;
    }

    .tbo-details__section {
        border-radius: 14px;
    }

    .tbo-details__body {
        padding: 13px;
    }

    .tbo-details__rows--total {
        margin-left: -13px;
        margin-right: -13px;
        padding: 11px 13px;
    }

    .tbo-details__row--total dd {
        font-size: 15px;
    }
}
