/**
 * Customer booking dashboard: [mpsb_my_bookings] and [mpsb_find_booking].
 *
 * Themes control the typography of everything a shortcode outputs, and a block
 * theme's constrained content column can be as little as 620px wide. Sizes here
 * are therefore stated explicitly rather than inherited, and every layout folds
 * instead of overflowing - the first version relied on both and was squeezed
 * into an unreadable column.
 */

.mpsb-mb {
    /* Same palette and type as the booking form (shuttle-search.css), so the
       dashboard reads as part of the same product rather than a bolt-on. */
    --mpsb-mb-primary: #f97316;
    --mpsb-mb-primary-dark: #ea580c;
    --mpsb-mb-highlight: #fff7ed;
    --mpsb-mb-ink: #0f172a;
    --mpsb-mb-soft: #64748b;
    --mpsb-mb-line: #e2e8f0;
    --mpsb-mb-surface: #f8fafc;

    box-sizing: border-box;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--mpsb-mb-ink);
    text-align: left;
}

.mpsb-mb *,
.mpsb-mb *::before,
.mpsb-mb *::after {
    box-sizing: border-box;
}

/* Full width. A block theme constrains every direct child of the content area
   to its content-size, which squeezed the dashboard into a ~620px column. The
   alignfull class on the wrapper is what those themes already honour; the rule
   below covers classic themes and any constrained parent that ignores it. */
.mpsb-mb.alignfull {
    max-width: none;

    /* width:auto, never 100%. A block theme gives .alignfull a negative margin
       on each side to break out of the padded content column; a percentage
       width resolves against that padded parent instead of the space it has
       broken out into, so the block starts hard against the left edge and
       leaves a gap the width of the padding on the right. auto fills the
       margins on both sides, which is what centres it. */
    width: auto;

    /* Breathing room so the rounded card is not glued to the screen edges
       once the viewport is narrower than the card's own maximum. */
    padding-left: 16px;
    padding-right: 16px;
}

@media (min-width: 783px) {
    .mpsb-mb.alignfull {
        padding-left: 24px;
        padding-right: 24px;
    }
}

/* The card itself, matching .mpsb_shuttle_search_card. */
.mpsb-mb__card {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px;
    border: 1px solid var(--mpsb-mb-line);
    border-top: 3px solid var(--mpsb-mb-primary);
    border-radius: 18px;
    background: #fff;
}

@media (max-width: 782px) {
    .mpsb-mb__card {
        padding: 20px 16px;
        border-radius: 14px;
    }
}

/* -------------------------------------------------------------------------
   Header: greeting and figures
   ------------------------------------------------------------------------- */

.mpsb-mb__header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--mpsb-mb-line);
}

.mpsb-mb__welcome {
    flex: 1 1 240px;
    min-width: 0;
}

.mpsb-mb__title {
    margin: 0 0 4px;
    font-size: 1.6rem;
    line-height: 1.2;
    font-weight: 700;
    color: var(--mpsb-mb-ink);
}

.mpsb-mb__greeting {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--mpsb-mb-ink);
}

.mpsb-mb__next {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--mpsb-mb-soft);
}

.mpsb-mb__stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    flex: 1 1 320px;
    margin: 0;
}

.mpsb-mb__stat {
    padding: 10px 8px;
    border: 1px solid var(--mpsb-mb-line);
    border-radius: 10px;
    background: var(--mpsb-mb-surface);
    text-align: center;
    min-width: 0;
}

.mpsb-mb__stat dt {
    margin: 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--mpsb-mb-soft);
    line-height: 1.4;
}

.mpsb-mb__stat dd {
    margin: 2px 0 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--mpsb-mb-ink);
    overflow-wrap: anywhere;
}

/* -------------------------------------------------------------------------
   Tabs
   ------------------------------------------------------------------------- */

.mpsb-mb__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.mpsb-mb__tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border: 1px solid var(--mpsb-mb-line);
    border-radius: 100px;
    background: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    color: var(--mpsb-mb-soft);
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.mpsb-mb__tab:hover {
    border-color: #cbd5e1;
    color: var(--mpsb-mb-ink);
}

.mpsb-mb__tab.is-active {
    border-color: var(--mpsb-mb-primary);
    background: var(--mpsb-mb-primary);
    color: #fff;
}

.mpsb-mb__tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 100px;
    background: var(--mpsb-mb-surface);
    font-size: 11px;
    font-weight: 700;
    color: var(--mpsb-mb-soft);
}

.mpsb-mb__tab.is-active .mpsb-mb__tab-count {
    background: rgba(255, 255, 255, .25);
    color: #fff;
}

/* -------------------------------------------------------------------------
   Booking cards
   ------------------------------------------------------------------------- */

.mpsb-mb__list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.mpsb-mb-card {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--mpsb-mb-line);
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}

.mpsb-mb-card[hidden] {
    display: none;
}

.mpsb-mb-card.is-cancelled {
    opacity: .7;
}

/* Date block, styled like the stub of a ticket. */
.mpsb-mb-card__date {
    display: flex;
    flex: 0 0 82px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: 16px 8px;
    border-right: 1px dashed var(--mpsb-mb-line);
    background: var(--mpsb-mb-surface);
}

.mpsb-mb-card__day {
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    color: var(--mpsb-mb-primary);
}

.mpsb-mb-card__month {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--mpsb-mb-ink);
}

.mpsb-mb-card__year {
    font-size: 11px;
    color: var(--mpsb-mb-soft);
}

.mpsb-mb-card__body {
    flex: 1 1 auto;
    min-width: 0;
    padding: 14px 16px;
}

.mpsb-mb-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.mpsb-mb-card__title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--mpsb-mb-ink);
    overflow-wrap: anywhere;
}

.mpsb-mb-card__badges {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.mpsb-mb-card__status {
    flex: 0 0 auto;
    padding: 3px 10px;
    border-radius: 100px;
    background: #f1f5f9;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: capitalize;
    color: #475569;
    white-space: nowrap;
}

/* Why this trip cost nothing, and that the holder actually boarded. */
.mpsb-mb-card__tag {
    flex: 0 0 auto;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
}

.mpsb-mb-card__tag--pass {
    background: var(--mpsb-mb-highlight);
    color: var(--mpsb-mb-primary-dark);
}

.mpsb-mb-card__tag--boarded {
    background: #dcfce7;
    color: #15803d;
}

.mpsb-mb-card__fact-value--code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: .06em;
}

.mpsb-mb-status--completed { background: #ecfdf5; color: #047857; }
.mpsb-mb-status--processing,
.mpsb-mb-status--pending,
.mpsb-mb-status--on-hold { background: #fff7ed; color: #b45309; }
.mpsb-mb-status--cancelled,
.mpsb-mb-status--failed,
.mpsb-mb-status--refunded { background: #fef2f2; color: #b91c1c; }

/* Route: two stops joined by a connector. */
.mpsb-mb-route {
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
}

.mpsb-mb-route__leg {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding-left: 2px;
    margin: 0;
}

.mpsb-mb-route__leg:first-child {
    padding-bottom: 14px;
}

.mpsb-mb-route__leg:first-child::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 14px;
    bottom: 2px;
    width: 2px;
    background: var(--mpsb-mb-line);
}

.mpsb-mb-route__dot {
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    margin-top: 3px;
    border: 2px solid var(--mpsb-mb-line);
    border-radius: 50%;
    background: #fff;
}

.mpsb-mb-route__leg--end .mpsb-mb-route__dot {
    border-color: var(--mpsb-mb-primary);
    background: var(--mpsb-mb-primary);
}

.mpsb-mb-route__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.35;
}

.mpsb-mb-route__text strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--mpsb-mb-ink);
    overflow-wrap: anywhere;
}

.mpsb-mb-route__text span {
    font-size: 12px;
    color: var(--mpsb-mb-soft);
    overflow-wrap: anywhere;
}

/* Facts strip. */
.mpsb-mb-card__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
}

.mpsb-mb-card__facts li {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin: 0;
    min-width: 0;
}

.mpsb-mb-card__fact-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--mpsb-mb-soft);
}

.mpsb-mb-card__fact-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--mpsb-mb-ink);
}

.mpsb-mb-card__fact-value--price {
    color: var(--mpsb-mb-primary);
}

.mpsb-mb-card__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 11px;
    border-top: 1px solid #f1f5f9;
}

.mpsb-mb-card__ref {
    font-size: 12px;
    font-weight: 600;
    color: var(--mpsb-mb-soft);
}

.mpsb-mb-card__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mpsb-mb-cancel {
    padding: 7px 14px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    color: #b91c1c;
    cursor: pointer;
}

.mpsb-mb-cancel:hover { background: #fef2f2; }
.mpsb-mb-cancel[disabled] { opacity: .6; cursor: default; }

.mpsb-mb-card__msg { font-size: 12px; color: var(--mpsb-mb-soft); }
.mpsb-mb-card__msg.is-error { color: #b91c1c; }

/* -------------------------------------------------------------------------
   Empty states, notices, lookup form
   ------------------------------------------------------------------------- */

.mpsb-mb__empty {
    padding: 34px 24px;
    border: 1px dashed var(--mpsb-mb-line);
    border-radius: 14px;
    background: var(--mpsb-mb-surface);
    text-align: center;
}

.mpsb-mb__empty-icon { font-size: 30px; line-height: 1; }

.mpsb-mb__empty-title {
    margin: 10px 0 4px;
    font-size: 17px;
    font-weight: 700;
    color: var(--mpsb-mb-ink);
}

.mpsb-mb__empty-text {
    margin: 0 auto;
    max-width: 34rem;
    font-size: 14px;
    color: var(--mpsb-mb-soft);
}

.mpsb-mb__empty-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 16px 0 0;
}

.mpsb-mb__btn {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid var(--mpsb-mb-primary);
    border-radius: 8px;
    background: var(--mpsb-mb-primary);
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
}

.mpsb-mb__btn:hover { background: var(--mpsb-mb-primary-dark); color: #fff; }

.mpsb-mb__btn--ghost {
    border-color: var(--mpsb-mb-line);
    background: #fff;
    color: var(--mpsb-mb-ink);
}

.mpsb-mb__btn--ghost:hover { background: var(--mpsb-mb-surface); color: var(--mpsb-mb-ink); }

.mpsb-mb__btn--locked {
    border-color: var(--mpsb-mb-line);
    background: #fff;
    color: var(--mpsb-mb-soft);
}

.mpsb-mb__btn--locked:hover { background: var(--mpsb-mb-surface); color: var(--mpsb-mb-ink); }

.mpsb-mb__pro {
    display: inline-block;
    margin-left: 7px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--mpsb-mb-primary);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .08em;
    color: #fff;
    vertical-align: 1px;
}

/* ---------------------------------------------------------- Travel passes */

.mpsb-mb-passes {
    margin-bottom: 26px;
}

.mpsb-mb-passes__title {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 700;
    color: var(--mpsb-mb-ink);
}

.mpsb-mb-passes__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.mpsb-mb-pass {
    padding: 18px;
    border: 1px solid var(--mpsb-mb-line);
    border-top: 3px solid var(--mpsb-mb-primary);
    border-radius: 12px;
    background: #fff;
}

/* A spent or suspended pass stays on the page — the holder still needs its
   usage history — but it must not read as something they can travel on. */
.mpsb-mb-pass.is-inactive {
    border-top-color: #cbd5e1;
    background: var(--mpsb-mb-surface);
}

.mpsb-mb-pass__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.mpsb-mb-pass__type {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--mpsb-mb-primary-dark);
}

.mpsb-mb-pass__chip {
    padding: 3px 10px;
    border-radius: 100px;
    background: #dcfce7;
    font-size: 11px;
    font-weight: 700;
    color: #15803d;
    white-space: nowrap;
}

.mpsb-mb-pass.is-inactive .mpsb-mb-pass__chip {
    background: #f1f5f9;
    color: #64748b;
}

.mpsb-mb-pass__route {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 700;
    color: var(--mpsb-mb-ink);
}

.mpsb-mb-pass__route i {
    font-style: normal;
    color: var(--mpsb-mb-primary);
}

.mpsb-mb-pass__code {
    padding: 12px 14px;
    border: 1px dashed #fdba74;
    border-radius: 10px;
    background: var(--mpsb-mb-highlight);
    text-align: center;
}

.mpsb-mb-pass__code-label {
    display: block;
    margin-bottom: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: #b45309;
}

.mpsb-mb-pass__code-value {
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: .12em;
    color: var(--mpsb-mb-ink);
    overflow-wrap: anywhere;
}

.mpsb-mb-pass__facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
    margin: 16px 0 0;
}

.mpsb-mb-pass__facts dt {
    margin: 0 0 2px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--mpsb-mb-soft);
}

.mpsb-mb-pass__facts dd {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--mpsb-mb-ink);
    overflow-wrap: anywhere;
}

.mpsb-mb-pass__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--mpsb-mb-line);
}

.mpsb-mb-pass__actions .mpsb-mb__btn {
    padding: 8px 16px;
    font-size: 13px;
}

.mpsb-mb__none {
    margin: 0;
    padding: 26px 16px;
    border: 1px dashed var(--mpsb-mb-line);
    border-radius: 12px;
    text-align: center;
    font-size: 14px;
    color: var(--mpsb-mb-soft);
}

.mpsb-mb__notice {
    margin: 0 0 16px;
    padding: 13px 16px;
    border: 1px solid var(--mpsb-mb-line);
    border-radius: 10px;
    background: var(--mpsb-mb-surface);
    font-size: 14px;
    color: var(--mpsb-mb-soft);
}

.mpsb-mb__notice--error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.mpsb-mb__form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 22px;
    padding: 18px;
    border: 1px solid var(--mpsb-mb-line);
    border-radius: 14px;
    background: var(--mpsb-mb-surface);
}

.mpsb-mb__field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1 1 190px;
    min-width: 0;
}

.mpsb-mb__field label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--mpsb-mb-soft);
}

.mpsb-mb__field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--mpsb-mb-line);
    border-radius: 8px;
    background: #fff;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    color: var(--mpsb-mb-ink);
}

.mpsb-mb__field input:focus {
    border-color: var(--mpsb-mb-primary);
    outline: 2px solid rgba(249, 115, 22, .18);
    outline-offset: 1px;
}

.mpsb-mb__submit {
    flex: 0 0 auto;
    padding: 11px 22px;
    border: 0;
    border-radius: 8px;
    background: var(--mpsb-mb-primary);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: #fff;
    cursor: pointer;
}

.mpsb-mb__submit:hover { background: var(--mpsb-mb-primary-dark); }

/* -------------------------------------------------------------------------
   Wide cards: the route and the trip details sit side by side instead of
   stacking down the left edge and leaving the right half of the card empty.
   ------------------------------------------------------------------------- */

@media (min-width: 860px) {
    .mpsb-mb-card__main {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
        gap: 28px;
        align-items: start;
    }

    .mpsb-mb-route,
    .mpsb-mb-card__facts {
        margin-bottom: 0;
    }

    .mpsb-mb-card__facts {
        gap: 16px 28px;
        padding: 14px 18px;
        border-radius: 12px;
        background: var(--mpsb-mb-surface);
    }

    .mpsb-mb-card__facts li {
        flex: 0 1 auto;
        min-width: 74px;
    }

    .mpsb-mb-card__foot {
        margin-top: 16px;
    }
}

/* -------------------------------------------------------------------------
   Narrow containers
   ------------------------------------------------------------------------- */

@media (max-width: 700px) {
    .mpsb-mb__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mpsb-mb__header { align-items: flex-start; }
}

@media (max-width: 520px) {
    .mpsb-mb-card { flex-direction: column; }

    /* The stub becomes a strip across the top rather than a squeezed column. */
    .mpsb-mb-card__date {
        flex: 0 0 auto;
        flex-direction: row;
        align-items: baseline;
        justify-content: flex-start;
        gap: 6px;
        padding: 10px 16px;
        border-right: 0;
        border-bottom: 1px dashed var(--mpsb-mb-line);
    }

    .mpsb-mb-card__day { font-size: 20px; }

    .mpsb-mb-card__top { flex-direction: column; gap: 6px; }
    .mpsb-mb-card__facts { gap: 8px 16px; }
    .mpsb-mb__form { flex-direction: column; align-items: stretch; }
    .mpsb-mb__submit { width: 100%; }
}
/* Dynamic passenger snapshot. Kept inside the existing booking card rather
   than introducing a second visual language. */
.mpsb-mb-passengers{margin:16px 0 0;border:1px solid #e1e7f0;border-radius:10px;background:#f8fafc}
.mpsb-mb-passengers>summary{cursor:pointer;padding:11px 14px;color:#25324b;font-weight:700;list-style-position:inside}
.mpsb-mb-passengers[open]>summary{border-bottom:1px solid #e1e7f0}
.mpsb-mb-passengers__list{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px;padding:12px}
.mpsb-mb-passengers__person{padding:11px 12px;border:1px solid #e5eaf2;border-radius:8px;background:#fff}
.mpsb-mb-passengers__person strong,.mpsb-mb-passengers__person span,.mpsb-mb-passengers__person small{display:block}
.mpsb-mb-passengers__person span{margin-top:2px;color:#d4550c;font-size:12px;font-weight:700}
.mpsb-mb-passengers__person small{margin-top:4px;color:#64748b;line-height:1.4}

/* Pro chat entry point. Free owns only this compact locked presentation; the
   active panel and its data remain entirely inside the Pro add-on. */
.mpsb-mb-chat-locked{gap:7px}
.mpsb-mb-chat-pro{display:inline-flex;align-items:center;justify-content:center;min-height:20px;padding:2px 7px;border-radius:999px;background:#fff1e8;color:#d4550c;font-size:10px;font-weight:800;letter-spacing:.06em;line-height:1}
