/**
 * Custom booking — invoice Item Detail table (extends booking-flow.css).
 */

.tpm-cb--invoice .tpm-cb-invoice {
    max-width: none;
    width: 100%;
}

.tpm-flow-alert--ok {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.tpm-cb-invoice__card {
    margin: 0 0 20px;
}

.tpm-cb-invoice__card.tpm-flow-form {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.tpm-cb-detail__title {
    margin: 0 0 12px;
    padding-bottom: 0;
    border-bottom: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #64748b;
}

.tpm-cb-detail__table-wrap {
    width: 100%;
    margin-bottom: 0;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.tpm-cb-detail__table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: fixed;
}

.tpm-cb-detail__table th {
    padding: 7px 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
    text-align: left;
    background: #f1f5f9;
    border-bottom: 1px solid #cbd5e1;
    border-right: 1px solid #e2e8f0;
    white-space: nowrap;
}

.tpm-cb-detail__table th:last-child {
    border-right: 0;
}

.tpm-cb-detail__table td {
    padding: 0;
    vertical-align: middle;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
}

.tpm-cb-detail__table td:last-child {
    border-right: 0;
}

.tpm-cb-detail__table tbody tr:last-child td {
    border-bottom: 1px solid #cbd5e1;
}

.tpm-cb-detail__table tfoot td,
.tpm-cb-detail__table tfoot th {
    padding: 8px;
    vertical-align: middle;
    background: #f1f5f9;
    border-top: 1px solid #94a3b8;
    border-bottom: 0;
    border-right: 1px solid #e2e8f0;
}

.tpm-cb-detail__table tfoot td:last-child,
.tpm-cb-detail__table tfoot th:last-child {
    border-right: 0;
}

.tpm-cb-detail__table tfoot .tpm-cb-detail__total-label {
    text-align: right;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--tpm-flow-ink, #0f172a);
    padding-right: 12px !important;
}

.tpm-cb-detail__total-value {
    text-align: right !important;
    white-space: nowrap;
    background: #eef2f7 !important;
}

.tpm-cb-detail__total-value strong {
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--tpm-flow-ink, #0f172a);
}

.tpm-cb-detail__total-act {
    background: #f1f5f9 !important;
}

.tpm-cb-detail__table tbody tr:hover td {
    background: #f8fafc;
}

.tpm-cb-detail__col-no {
    width: 36px;
    padding: 0 6px !important;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #64748b;
    background: #f8fafc;
}

.tpm-cb-detail__col-item {
    width: 36%;
}

.tpm-cb-detail__col-date {
    width: 148px;
}

.tpm-cb-detail__col-qty {
    width: 64px;
}

.tpm-cb-detail__col-price {
    width: 112px;
}

.tpm-cb-detail__col-sub {
    width: 128px;
    padding: 0 8px !important;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--tpm-flow-ink, #0f172a);
    letter-spacing: -0.01em;
    background: #f8fafc;
}

.tpm-cb-detail__col-act {
    width: 36px;
    text-align: center;
    padding: 0 !important;
    background: #f8fafc;
}

.tpm-cb-detail__table thead .tpm-cb-detail__col-qty,
.tpm-cb-detail__table thead .tpm-cb-detail__col-price,
.tpm-cb-detail__table thead .tpm-cb-detail__col-sub {
    text-align: right;
}

.tpm-cb-detail__table thead .tpm-cb-detail__col-no,
.tpm-cb-detail__table thead .tpm-cb-detail__col-act {
    text-align: center;
}

.tpm-cb-detail__table tbody .tpm-cb-detail__col-qty,
.tpm-cb-detail__table tbody .tpm-cb-detail__col-price {
    text-align: right;
}

.tpm-cb-detail__table tbody .tpm-cb-detail__col-sub {
    text-align: right;
}

.tpm-cb-detail__table input[type="text"],
.tpm-cb-detail__table input[type="date"],
.tpm-cb-detail__table input[type="number"],
.tpm-cb-detail__table textarea {
    width: 100%;
    min-height: 34px;
    height: 34px;
    padding: 4px 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
    font: inherit;
    font-size: 13px;
    line-height: 1.3;
    color: inherit;
    box-sizing: border-box;
    box-shadow: none;
    transition: background 0.1s ease, box-shadow 0.1s ease;
}

.tpm-cb-detail__table textarea {
    min-height: 34px;
    max-height: 34px;
    resize: none;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.tpm-cb-detail__table .tpm-cb-detail__col-qty input,
.tpm-cb-detail__table .tpm-cb-detail__col-price input {
    text-align: right;
    font-variant-numeric: tabular-nums;
    padding-left: 4px;
    padding-right: 8px;
}

.tpm-cb-item-picker {
    position: relative;
    min-width: 0;
    height: 100%;
}

.tpm-cb-field {
    display: block;
    min-width: 0;
    height: 100%;
}

.tpm-cb-field__icon,
.tpm-cb-field__label,
.tpm-cb-subtotal__label {
    display: none;
}

.tpm-cb-subtotal {
    display: block;
    text-align: inherit;
}

.tpm-cb-item-picker textarea {
    cursor: pointer;
    background: transparent;
    font-weight: 500;
}

.tpm-cb-detail__table input:hover,
.tpm-cb-detail__table textarea:hover {
    background: #fff;
}

.tpm-cb-detail__table input:focus,
.tpm-cb-detail__table textarea:focus {
    outline: none;
    background: #fff;
    box-shadow: inset 0 0 0 2px var(--tpm-flow-accent, #0e7490);
}

.tpm-cb-detail__add {
    width: auto;
}

.tpm-cb-invoice__actions .tpm-flow-btn {
    width: auto;
    min-width: 160px;
}

@media (max-width: 860px) {
    .tpm-cb-invoice > .tpm-flow__head {
        margin-bottom: 12px;
    }

    .tpm-cb-invoice > .tpm-flow__head .tpm-flow__title {
        margin: 0 0 4px;
        font-size: 22px;
        line-height: 1.2;
    }

    .tpm-cb-invoice > .tpm-flow__head .tpm-flow__lead {
        margin: 0;
        font-size: 13px;
        line-height: 1.4;
    }

    .tpm-cb-invoice__card.tpm-flow-form {
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .tpm-cb-detail__title {
        margin: 0 0 8px;
        padding-bottom: 0;
        font-size: 11px;
        letter-spacing: 0.08em;
        border-bottom: 0;
    }

    .tpm-cb-detail__table-wrap {
        overflow: visible;
        margin-bottom: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .tpm-cb-detail__table,
    .tpm-cb-detail__table thead,
    .tpm-cb-detail__table tbody,
    .tpm-cb-detail__table tfoot,
    .tpm-cb-detail__table tr,
    .tpm-cb-detail__table th,
    .tpm-cb-detail__table td {
        display: block;
        width: 100%;
        border: 0;
        background: transparent;
    }

    .tpm-cb-detail__table tbody tr:hover td {
        background: transparent;
    }

    .tpm-cb-detail__table {
        table-layout: auto;
        min-width: 0;
        border-collapse: separate;
        border-spacing: 0;
        border-top: 0;
    }

    .tpm-cb-detail__table thead {
        display: none;
    }

    /* Premium compact line-item card — no clipped text */
    .tpm-cb-detail__table .tpm-cb-detail__row {
        position: relative;
        display: grid;
        grid-template-columns: minmax(0, 1.35fr) minmax(4.25rem, 0.65fr) minmax(0, 1.1fr);
        grid-template-areas:
            "item item act"
            "date qty price"
            "sub  sub  sub";
        gap: 8px;
        align-items: stretch;
        margin: 0 0 10px;
        padding: 12px;
        border: 1px solid #e5eaf0;
        border-radius: 16px;
        background: #fff;
        box-shadow:
            0 1px 2px rgba(15, 23, 42, 0.04),
            0 8px 20px rgba(15, 23, 42, 0.03);
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    .tpm-cb-detail__table .tpm-cb-detail__row td {
        display: block;
        padding: 0 !important;
        border: 0 !important;
        min-width: 0;
        width: auto;
        max-width: 100%;
        overflow: visible;
        background: transparent !important;
    }

    .tpm-cb-detail__table .tpm-cb-detail__row td::before {
        display: none !important;
        content: none !important;
    }

    .tpm-cb-detail__table .tpm-cb-detail__row .tpm-cb-field {
        display: flex;
        align-items: center;
        gap: 7px;
        min-height: 40px;
        padding: 0 10px;
        border: 0;
        border-radius: 12px;
        background: #f4f7fa;
        box-sizing: border-box;
    }

    .tpm-cb-detail__table .tpm-cb-detail__row .tpm-cb-field--item {
        align-items: flex-start;
        min-height: 44px;
        padding: 10px 12px;
        background: #f1f5f9;
    }

    .tpm-cb-detail__table .tpm-cb-detail__row .tpm-cb-field--item .tpm-cb-field__icon {
        margin-top: 2px;
    }

    .tpm-cb-detail__table .tpm-cb-detail__row .tpm-cb-field__icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        width: 16px;
        height: 16px;
        color: #64748b;
        opacity: 1;
    }

    .tpm-cb-detail__table .tpm-cb-detail__row .tpm-cb-field__icon svg {
        display: block;
        width: 15px;
        height: 15px;
    }

    .tpm-cb-detail__table .tpm-cb-detail__row .tpm-cb-field__label {
        display: none;
    }

    .tpm-cb-detail__table .tpm-cb-detail__row .tpm-cb-field--date .tpm-cb-field__label,
    .tpm-cb-detail__table .tpm-cb-detail__row .tpm-cb-field--qty .tpm-cb-field__label,
    .tpm-cb-detail__table .tpm-cb-detail__row .tpm-cb-field--price .tpm-cb-field__label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .tpm-cb-detail__table .tpm-cb-detail__row input[type="text"],
    .tpm-cb-detail__table .tpm-cb-detail__row input[type="date"],
    .tpm-cb-detail__table .tpm-cb-detail__row input[type="number"],
    .tpm-cb-detail__table .tpm-cb-detail__row textarea {
        flex: 1 1 auto;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 0 !important;
        height: auto !important;
        margin: 0;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        background-image: none !important;
        box-shadow: none !important;
        outline: none !important;
        font-size: 16px;
        line-height: 1.3;
        box-sizing: border-box;
        -webkit-appearance: none !important;
        appearance: none !important;
    }

    .tpm-cb-detail__table .tpm-cb-detail__row input[type="date"] {
        min-width: 0;
        font-size: 13px !important;
        font-weight: 600;
        color: var(--tpm-flow-ink, #0f172a);
        font-variant-numeric: tabular-nums;
    }

    .tpm-cb-detail__table .tpm-cb-detail__row input[type="date"]::-webkit-calendar-picker-indicator {
        display: none !important;
        width: 0;
        height: 0;
        opacity: 0;
        -webkit-appearance: none;
    }

    .tpm-cb-detail__table .tpm-cb-detail__row input[type="date"]::-webkit-date-and-time-value {
        text-align: left;
        margin: 0;
        padding: 0;
    }

    .tpm-cb-detail__table .tpm-cb-detail__row input[type="number"]::-webkit-outer-spin-button,
    .tpm-cb-detail__table .tpm-cb-detail__row input[type="number"]::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

    .tpm-cb-detail__table .tpm-cb-detail__row input[type="number"] {
        -moz-appearance: textfield;
        appearance: textfield;
        font-size: 14px !important;
        font-weight: 700;
        color: var(--tpm-flow-ink, #0f172a);
        font-variant-numeric: tabular-nums;
        text-align: left;
    }

    .tpm-cb-detail__table .tpm-cb-detail__row input:focus,
    .tpm-cb-detail__table .tpm-cb-detail__row textarea:focus {
        border: 0 !important;
        box-shadow: none !important;
        outline: none !important;
        background: transparent !important;
    }

    .tpm-cb-detail__table .tpm-cb-detail__row .tpm-cb-field:focus-within {
        background: #eef6f8;
        box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--tpm-flow-accent, #0e7490) 55%, #cbd5e1);
    }

    .tpm-cb-detail__table .tpm-cb-detail__row textarea {
        display: block;
        min-height: 2.7em !important;
        max-height: 2.7em !important;
        font-size: 14px !important;
        font-weight: 600;
        line-height: 1.35;
        color: var(--tpm-flow-ink, #0f172a);
        white-space: normal !important;
        overflow: hidden;
        text-overflow: clip;
        resize: none;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .tpm-cb-detail__table .tpm-cb-detail__col-no {
        display: none !important;
    }

    .tpm-cb-detail__table .tpm-cb-detail__col-item {
        grid-area: item;
        min-width: 0;
    }

    .tpm-cb-detail__table .tpm-cb-detail__col-date {
        grid-area: date;
        min-width: 0;
    }

    .tpm-cb-detail__table .tpm-cb-detail__col-qty {
        grid-area: qty;
        min-width: 0;
    }

    .tpm-cb-detail__table .tpm-cb-detail__col-qty::before {
        display: none !important;
        content: none !important;
    }

    .tpm-cb-detail__table .tpm-cb-detail__col-price {
        grid-area: price;
        min-width: 0;
    }

    .tpm-cb-detail__table .tpm-cb-detail__col-qty .tpm-cb-field,
    .tpm-cb-detail__table .tpm-cb-detail__col-price .tpm-cb-field,
    .tpm-cb-detail__table .tpm-cb-detail__col-date .tpm-cb-field {
        width: 100%;
        min-width: 0;
    }

    .tpm-cb-detail__table .tpm-cb-detail__col-qty input,
    .tpm-cb-detail__table .tpm-cb-detail__col-price input {
        width: 100%;
        max-width: none;
        text-align: left;
    }

    .tpm-cb-detail__table .tpm-cb-detail__col-sub {
        grid-area: sub;
        justify-self: stretch;
        align-self: stretch;
        width: auto;
        text-align: right;
        background: transparent !important;
        margin-top: 2px;
        padding-top: 8px !important;
        border-top: 1px solid #eef2f6 !important;
    }

    .tpm-cb-detail__table .tpm-cb-detail__col-sub .tpm-cb-subtotal {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: baseline;
        gap: 12px;
        width: 100%;
        min-height: 0;
        padding: 0;
        box-sizing: border-box;
    }

    .tpm-cb-detail__table .tpm-cb-detail__col-sub .tpm-cb-subtotal__label {
        display: block;
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: #94a3b8;
        line-height: 1;
    }

    .tpm-cb-detail__table .tpm-cb-detail__col-sub strong {
        font-size: 15px;
        font-weight: 700;
        white-space: nowrap;
        font-variant-numeric: tabular-nums;
        color: var(--tpm-flow-accent, #0e7490);
        line-height: 1.15;
        letter-spacing: -0.02em;
    }

    .tpm-cb-detail__table .tpm-cb-detail__col-act {
        grid-area: act;
        align-self: start;
        justify-self: end;
        display: flex;
        width: auto;
        margin: 0;
        background: transparent !important;
    }

    .tpm-cb-detail__table .tpm-cb-detail__col-act::before {
        display: none;
    }

    .tpm-cb-detail__table .tpm-cb-detail__remove {
        width: 40px;
        height: 40px;
        margin: 0;
        border: 0;
        border-radius: 12px;
        background: #f4f7fa;
        color: #94a3b8;
    }

    .tpm-cb-detail__table .tpm-cb-detail__remove:hover,
    .tpm-cb-detail__table .tpm-cb-detail__remove:focus-visible {
        color: var(--tpm-flow-danger, #dc2626);
        background: #fef2f2;
    }

    .tpm-cb-detail__add {
        margin: 4px 0 0;
        min-height: 40px;
        padding: 8px 12px;
        font-size: 13px;
        width: auto;
        border-radius: 12px;
    }

    .tpm-cb-detail__table tfoot {
        margin-top: 2px;
        border-top: 0;
    }

    .tpm-cb-detail__table tfoot .tpm-cb-detail__total-row {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 12px;
        margin: 0;
        padding: 10px 4px 0;
        border: 0;
        background: transparent;
    }

    .tpm-cb-detail__table tfoot .tpm-cb-detail__total-label,
    .tpm-cb-detail__table tfoot .tpm-cb-detail__total-value {
        width: auto;
        padding: 0 !important;
        background: transparent !important;
        border: 0;
    }

    .tpm-cb-detail__table tfoot .tpm-cb-detail__total-label {
        font-size: 11px;
        letter-spacing: 0.08em;
        text-align: left;
    }

    .tpm-cb-detail__table tfoot .tpm-cb-detail__total-value {
        text-align: right !important;
        margin-left: auto;
    }

    .tpm-cb-detail__table tfoot .tpm-cb-detail__total-value strong {
        font-size: 17px;
        letter-spacing: -0.02em;
        color: var(--tpm-flow-accent, #0e7490);
    }

    .tpm-cb-detail__table tfoot .tpm-cb-detail__total-act {
        display: none;
    }

    .tpm-cb-invoice__actions {
        margin-top: 10px;
    }

    .tpm-cb-invoice__actions .tpm-flow-btn {
        width: 100%;
        min-height: 44px;
    }

    .tpm-cb-modal {
        padding: 12px;
        align-items: flex-end;
    }

    .tpm-cb-modal__dialog {
        width: 100%;
        max-height: min(88vh, 720px);
        border-radius: 16px 16px 12px 12px;
    }

    .tpm-cb-modal__input {
        font-size: 16px;
    }

    /* Order summary — compact receipt cards on mobile */
    .tpm-cb-summary-table {
        margin: 0 0 12px;
        padding: 10px 12px 8px;
        border-radius: 12px;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    }

    .tpm-cb-summary-table__head {
        margin-bottom: 8px;
    }

    .tpm-cb-summary-table__title {
        font-size: 11px;
        letter-spacing: 0.08em;
    }

    .tpm-cb-summary-table__count {
        font-size: 12px;
    }

    .tpm-cb-summary-table__wrap {
        overflow: visible;
    }

    .tpm-cb-summary-table__table,
    .tpm-cb-summary-table__table thead,
    .tpm-cb-summary-table__table tbody,
    .tpm-cb-summary-table__table tfoot,
    .tpm-cb-summary-table__table tbody tr,
    .tpm-cb-summary-table__table tbody th,
    .tpm-cb-summary-table__table tbody td {
        display: block;
        width: 100%;
    }

    .tpm-cb-summary-table__table {
        table-layout: auto;
        min-width: 0;
        /* separate: row borders must not collapse onto each tfoot cell */
        border-collapse: separate !important;
        border-spacing: 0;
    }

    .tpm-cb-summary-table__table thead {
        display: none;
    }

    .tpm-cb-summary-table__table tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto auto;
        grid-template-areas:
            "item item item sub"
            "date qty price sub";
        gap: 2px 8px;
        align-items: center;
        margin: 0 0 6px;
        padding: 8px 10px;
        border: 1px solid var(--tpm-flow-line, #e2e8f0);
        border-radius: 10px;
        background: #fff;
        box-sizing: border-box;
    }

    .tpm-cb-summary-table__table tbody td {
        display: block;
        width: auto;
        padding: 0;
        border: 0;
        border-bottom: 0;
        text-align: left !important;
        min-width: 0;
    }

    .tpm-cb-summary-table__table tbody td::before {
        display: none;
    }

    .tpm-cb-summary-table__table .tpm-cb-summary-table__col-no {
        display: none !important;
    }

    .tpm-cb-summary-table__table .tpm-cb-summary-table__col-item {
        grid-area: item;
    }

    .tpm-cb-summary-table__col-item .tpm-cb-summary-table__item-name {
        display: block;
        font-size: 13px;
        font-weight: 600;
        line-height: 1.3;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .tpm-cb-summary-table__table .tpm-cb-summary-table__col-date {
        grid-area: date;
        font-size: 11px;
        line-height: 1.3;
        color: var(--tpm-flow-muted, #64748b);
    }

    .tpm-cb-summary-table__table .tpm-cb-summary-table__col-qty {
        grid-area: qty;
        font-size: 11px;
        line-height: 1.3;
        color: var(--tpm-flow-muted, #64748b);
        white-space: nowrap;
        text-align: left !important;
    }

    .tpm-cb-summary-table__table .tpm-cb-summary-table__col-qty::before {
        content: "×";
        display: inline;
        margin-right: 1px;
        font-weight: 600;
    }

    .tpm-cb-summary-table__table .tpm-cb-summary-table__col-price {
        grid-area: price;
        font-size: 11px;
        line-height: 1.3;
        color: var(--tpm-flow-muted, #64748b);
        white-space: nowrap;
        text-align: left !important;
    }

    .tpm-cb-summary-table__table .tpm-cb-summary-table__col-sub {
        grid-area: sub;
        align-self: center;
        justify-self: end;
        font-size: 13px;
        font-weight: 700;
        line-height: 1.2;
        white-space: nowrap;
        font-variant-numeric: tabular-nums;
        color: var(--tpm-flow-accent, #0e7490);
        text-align: right !important;
    }

    .tpm-cb-summary-table__table tfoot {
        display: block;
        width: 100%;
    }

    .tpm-cb-summary-table__table tfoot tr {
        display: flex;
        position: relative;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        width: 100%;
        margin-top: 6px;
        padding: 12px 2px 2px;
        border: 0 !important;
        background: transparent;
        box-shadow: none;
    }

    /* Single full-width separator — never per-cell (collapse paints tr borders on cells). */
    .tpm-cb-summary-table__table tfoot tr::before {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        height: 1px;
        background: var(--tpm-flow-line, #e2e8f0);
        pointer-events: none;
    }

    .tpm-cb-summary-table__table tfoot th,
    .tpm-cb-summary-table__table tfoot td {
        display: block;
        flex: 0 1 auto;
        width: auto !important;
        max-width: none;
        padding: 0 !important;
        border: 0 !important;
        border-top: 0 !important;
        border-bottom: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        text-align: left;
    }

    .tpm-cb-summary-table__table tfoot th::before,
    .tpm-cb-summary-table__table tfoot td::before,
    .tpm-cb-summary-table__table tfoot th::after,
    .tpm-cb-summary-table__table tfoot td::after {
        content: none !important;
        display: none !important;
        border: 0 !important;
    }

    .tpm-cb-summary-table__table tfoot th:empty,
    .tpm-cb-summary-table__table tfoot td:empty {
        display: none !important;
    }

    .tpm-cb-summary-table__total-label {
        text-align: left;
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .tpm-cb-summary-table__total-value {
        text-align: right;
        font-size: 15px;
        color: var(--tpm-flow-accent, #0e7490);
    }

    /* Details step — compact head + traveler form */
    .tpm-cb-invoice > .tpm-flow__head {
        margin-bottom: 12px;
    }

    .tpm-cb-invoice > .tpm-flow__head .tpm-flow__title {
        margin: 0 0 4px;
        font-size: 22px;
        line-height: 1.2;
    }

    .tpm-cb-invoice > .tpm-flow__head .tpm-flow__lead {
        font-size: 13px;
        line-height: 1.4;
    }

    .tpm-cb-invoice > .tpm-flow-form {
        padding: 12px;
        border-radius: 12px;
    }

    .tpm-cb-invoice > .tpm-flow-form .tpm-flow-form__row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .tpm-cb-invoice > .tpm-flow-form .tpm-flow-field {
        margin-bottom: 12px;
    }

    .tpm-cb-invoice > .tpm-flow-form .tpm-flow-field label {
        margin-bottom: 4px;
        font-size: 12px;
    }

    .tpm-cb-invoice > .tpm-flow-form .tpm-flow-field input[type='text'],
    .tpm-cb-invoice > .tpm-flow-form .tpm-flow-field input[type='email'],
    .tpm-cb-invoice > .tpm-flow-form .tpm-flow-field input[type='tel'],
    .tpm-cb-invoice > .tpm-flow-form .tpm-flow-field select,
    .tpm-cb-invoice > .tpm-flow-form .tpm-flow-field textarea {
        padding: 10px 12px;
        border-radius: 8px;
        font-size: 16px;
        line-height: 1.3;
    }

    .tpm-cb-invoice > .tpm-flow-form .tpm-flow-field textarea {
        min-height: 68px;
    }

    .tpm-cb-invoice > .tpm-flow-form .tpm-flow-phone {
        gap: 8px;
    }

    .tpm-cb-invoice > .tpm-flow-form .tpm-flow-actions {
        gap: 8px;
        margin-top: 2px;
    }

    .tpm-cb-invoice > .tpm-flow-form .tpm-flow-actions .tpm-flow-btn {
        min-height: 44px;
        width: 100%;
    }

    .tpm-cb-invoice > .tpm-flow-alert {
        margin-bottom: 10px;
        padding: 10px 12px;
    }
}

/* Centered product picker modal --------------------------------------- */

body.tpm-cb-modal-open {
    overflow: hidden;
}

.tpm-cb-modal[hidden] {
    display: none !important;
}

.tpm-cb-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tpm-cb-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.tpm-cb-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    max-height: min(72vh, 640px);
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
    overflow: hidden;
}

.tpm-cb-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 10px;
}

.tpm-cb-modal__title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.tpm-cb-modal__x {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.tpm-cb-modal__search {
    padding: 0 18px 12px;
}

.tpm-cb-modal__input {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--tpm-flow-line, #e2e8f0);
    border-radius: 10px;
    font: inherit;
    box-sizing: border-box;
}

.tpm-cb-modal__input:focus {
    outline: 2px solid rgba(14, 116, 144, 0.25);
    border-color: var(--tpm-flow-accent, #0e7490);
}

.tpm-cb-modal__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 0 10px 14px;
}

.tpm-cb-modal__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tpm-cb-modal__item {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.tpm-cb-modal__item:hover {
    background: #f8fafc;
}

.tpm-cb-modal__item-name {
    font-weight: 600;
    font-size: 14px;
}

.tpm-cb-modal__item-price {
    color: var(--tpm-flow-muted, #64748b);
    font-size: 13px;
    white-space: nowrap;
}

.tpm-cb-modal__empty {
    margin: 0;
    padding: 24px 12px;
    text-align: center;
    color: var(--tpm-flow-muted, #64748b);
    font-size: 14px;
}

.tpm-cb-modal__dialog--date,
.tpm-cb-modal__dialog--pax {
    width: min(400px, 100%);
    max-height: none;
}

.tpm-cb-modal__dialog--date .tpm-cb-modal__body,
.tpm-cb-modal__dialog--pax .tpm-cb-modal__body {
    overflow: visible;
    padding: 0 16px 18px;
}

/* Calendar step ------------------------------------------------------- */

.tpm-cb-cal {
    padding: 4px 2px 0;
}

.tpm-cb-cal__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.tpm-cb-cal__label {
    font-size: 15px;
    font-weight: 700;
    color: var(--tpm-flow-ink, #0f172a);
}

.tpm-cb-cal__nav-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--tpm-flow-line, #e2e8f0);
    border-radius: 10px;
    background: #fff;
    color: #334155;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.tpm-cb-cal__nav-btn:hover {
    border-color: var(--tpm-flow-accent, #0e7490);
    color: var(--tpm-flow-accent, #0e7490);
}

.tpm-cb-cal__dow {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 4px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--tpm-flow-muted, #64748b);
}

.tpm-cb-cal__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.tpm-cb-cal__day {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1;
    min-height: 40px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--tpm-flow-ink, #0f172a);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

button.tpm-cb-cal__day:hover {
    background: #ecfeff;
    color: var(--tpm-flow-accent, #0e7490);
}

.tpm-cb-cal__day--empty {
    visibility: hidden;
    pointer-events: none;
}

.tpm-cb-cal__day--disabled {
    color: #cbd5e1;
    cursor: default;
}

.tpm-cb-cal__day.is-today:not(.is-selected) {
    box-shadow: inset 0 0 0 1.5px #99f6e4;
}

.tpm-cb-cal__day.is-selected {
    background: var(--tpm-flow-accent, #0e7490);
    color: #fff;
}

/* Participants step --------------------------------------------------- */

.tpm-cb-pax {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 4px 4px 0;
    text-align: center;
}

.tpm-cb-pax__product {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--tpm-flow-ink, #0f172a);
}

.tpm-cb-pax__date {
    margin: 0;
    font-size: 13px;
    color: var(--tpm-flow-muted, #64748b);
}

.tpm-cb-pax__stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 8px 0 0;
}

.tpm-cb-pax__btn {
    width: 48px;
    height: 48px;
    border: 1px solid var(--tpm-flow-line, #e2e8f0);
    border-radius: 14px;
    background: #fff;
    color: var(--tpm-flow-ink, #0f172a);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.tpm-cb-pax__btn:hover {
    border-color: var(--tpm-flow-accent, #0e7490);
    color: var(--tpm-flow-accent, #0e7490);
}

.tpm-cb-pax__value {
    min-width: 64px;
    font-size: 36px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: var(--tpm-flow-accent, #0e7490);
}

.tpm-cb-pax__hint {
    margin: 0;
    font-size: 12px;
    color: var(--tpm-flow-muted, #64748b);
}

.tpm-cb-pax__chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 4px;
}

.tpm-cb-pax__chip {
    min-width: 40px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--tpm-flow-line, #e2e8f0);
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.tpm-cb-pax__chip.is-active,
.tpm-cb-pax__chip:hover {
    border-color: var(--tpm-flow-accent, #0e7490);
    background: #ecfeff;
    color: var(--tpm-flow-accent, #0e7490);
}

.tpm-cb-pax__confirm {
    display: block;
    width: 100%;
    margin-top: 8px;
    min-height: 46px;
    padding: 12px 16px;
    border: 0;
    border-radius: 12px;
    background: var(--tpm-flow-accent, #0e7490);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.tpm-cb-pax__confirm:hover {
    filter: brightness(0.96);
}

.tpm-cb-results--inline {
    display: none !important;
}

.tpm-cb-detail__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: 2px 0;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #94a3b8;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.12s ease, background 0.12s ease;
}

.tpm-cb-detail__remove svg {
    display: block;
    flex-shrink: 0;
}

.tpm-cb-detail__remove:hover {
    color: var(--tpm-flow-danger, #dc2626);
    background: #fef2f2;
}

.tpm-cb-detail__add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 10px 0 0;
    min-height: 32px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
}

.tpm-cb-detail__add-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
}

.tpm-cb-detail__add-icon svg {
    display: block;
}

.tpm-cb-detail__total,
.tpm-cb-lines__total {
    display: none;
}

.tpm-cb-invoice__actions {
    margin-top: 14px;
    padding-top: 0;
}

.tpm-cb-summary-table {
    margin: 0 0 22px;
    padding: 18px 20px 16px;
    border: 1px solid var(--tpm-flow-line, #e2e8f0);
    border-radius: 16px;
    background:
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.tpm-cb-summary-table__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.tpm-cb-summary-table__title {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--tpm-flow-ink, #0f172a);
}

.tpm-cb-summary-table__count {
    margin: 0;
    font-size: 13px;
    color: var(--tpm-flow-muted, #64748b);
}

.tpm-cb-summary-table__wrap {
    width: 100%;
}

.tpm-cb-summary-table__table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.tpm-cb-summary-table__table thead th {
    padding: 0 10px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--tpm-flow-muted, #64748b);
    text-align: left;
    border-bottom: 1px solid var(--tpm-flow-line, #e2e8f0);
}

.tpm-cb-summary-table__table tbody td {
    padding: 12px 10px;
    vertical-align: top;
    border-bottom: 1px solid #eef2f7;
    font-size: 14px;
    color: var(--tpm-flow-ink, #0f172a);
}

.tpm-cb-summary-table__table tbody tr:last-child td {
    border-bottom: 0;
}

.tpm-cb-summary-table__col-no {
    width: 48px;
    color: var(--tpm-flow-muted, #64748b);
}

.tpm-cb-summary-table__col-item {
    width: 34%;
}

.tpm-cb-summary-table__item-name {
    display: block;
    font-weight: 600;
    line-height: 1.35;
}

.tpm-cb-summary-table__col-date {
    width: 18%;
    color: #475569;
}

.tpm-cb-summary-table__col-qty {
    width: 8%;
    text-align: right;
}

.tpm-cb-summary-table__col-price,
.tpm-cb-summary-table__col-sub {
    width: 16%;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.tpm-cb-summary-table__table thead .tpm-cb-summary-table__col-qty,
.tpm-cb-summary-table__table thead .tpm-cb-summary-table__col-price,
.tpm-cb-summary-table__table thead .tpm-cb-summary-table__col-sub {
    text-align: right;
}

/* Desktop: per-cell top border merges into one line under border-collapse.
   Mobile overrides below must zero these — otherwise flex cells show short segments. */
.tpm-cb-summary-table__table tfoot tr {
    border-top: 0;
}

.tpm-cb-summary-table__table tfoot th,
.tpm-cb-summary-table__table tfoot td {
    padding-top: 14px;
    border-top: 2px solid var(--tpm-flow-ink, #0f172a);
    border-bottom: 0;
    vertical-align: middle;
}

.tpm-cb-summary-table__total-label {
    text-align: right;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--tpm-flow-ink, #0f172a);
}

.tpm-cb-summary-table__total-value {
    text-align: right;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    color: var(--tpm-flow-accent, #0e7490);
}

.tpm-flow-check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 14px;
    line-height: 1.45;
}

.tpm-flow-check input {
    margin-top: 3px;
}

/*
 * Mobile TOTAL (must stay AFTER desktop summary-table rules).
 * Desktop cell border-top becomes two short black segments when tfoot is flex.
 * Use one row ::before line instead; force border-collapse:separate so tr borders
 * cannot collapse onto cells either.
 */
@media (max-width: 860px) {
    .tpm-flow--custom-booking .tpm-cb-summary-table__table,
    .tpm-flow--payment .tpm-cb-summary-table__table,
    .tpm-cb--invoice .tpm-cb-summary-table__table,
    .tpm-cb-summary-table__table {
        border-collapse: separate !important;
        border-spacing: 0 !important;
    }

    .tpm-flow--custom-booking .tpm-cb-summary-table__table tfoot,
    .tpm-flow--payment .tpm-cb-summary-table__table tfoot,
    .tpm-cb--invoice .tpm-cb-summary-table__table tfoot,
    .tpm-cb-summary-table__table tfoot {
        display: block !important;
        width: 100% !important;
    }

    .tpm-flow--custom-booking .tpm-cb-summary-table__table tfoot tr,
    .tpm-flow--payment .tpm-cb-summary-table__table tfoot tr,
    .tpm-cb--invoice .tpm-cb-summary-table__table tfoot tr,
    .tpm-cb-summary-table__table tfoot tr,
    .tpm-cb-summary-table__table tfoot tr.tpm-cb-summary-table__total-row {
        display: flex !important;
        position: relative !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 12px !important;
        width: 100% !important;
        margin-top: 6px !important;
        padding: 12px 2px 2px !important;
        border: 0 !important;
        border-top: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    .tpm-flow--custom-booking .tpm-cb-summary-table__table tfoot tr::before,
    .tpm-flow--payment .tpm-cb-summary-table__table tfoot tr::before,
    .tpm-cb--invoice .tpm-cb-summary-table__table tfoot tr::before,
    .tpm-cb-summary-table__table tfoot tr::before,
    .tpm-cb-summary-table__table tfoot tr.tpm-cb-summary-table__total-row::before {
        content: "" !important;
        position: absolute !important;
        left: 0 !important;
        right: 0 !important;
        top: 0 !important;
        height: 1px !important;
        background: var(--tpm-flow-line, #e2e8f0) !important;
        pointer-events: none !important;
    }

    .tpm-flow--custom-booking .tpm-cb-summary-table__table tfoot th,
    .tpm-flow--custom-booking .tpm-cb-summary-table__table tfoot td,
    .tpm-flow--payment .tpm-cb-summary-table__table tfoot th,
    .tpm-flow--payment .tpm-cb-summary-table__table tfoot td,
    .tpm-cb--invoice .tpm-cb-summary-table__table tfoot th,
    .tpm-cb--invoice .tpm-cb-summary-table__table tfoot td,
    .tpm-cb-summary-table__table tfoot th,
    .tpm-cb-summary-table__table tfoot td,
    .tpm-cb-summary-table__table tfoot .tpm-cb-summary-table__total-label,
    .tpm-cb-summary-table__table tfoot .tpm-cb-summary-table__total-value {
        display: block !important;
        flex: 0 1 auto !important;
        width: auto !important;
        padding: 0 !important;
        border: 0 !important;
        border-width: 0 !important;
        border-style: none !important;
        border-color: transparent !important;
        border-top: 0 !important;
        border-bottom: 0 !important;
        box-shadow: none !important;
        outline: 0 !important;
        background: transparent !important;
        background-image: none !important;
    }

    .tpm-cb-summary-table__table tfoot th::before,
    .tpm-cb-summary-table__table tfoot td::before,
    .tpm-cb-summary-table__table tfoot th::after,
    .tpm-cb-summary-table__table tfoot td::after {
        content: none !important;
        display: none !important;
        border: 0 !important;
    }

    .tpm-cb-summary-table__table tfoot th:empty,
    .tpm-cb-summary-table__table tfoot td:empty {
        display: none !important;
    }
}

