/* Shared Bootstrap-compatible responsive guardrails for HITCO pages. */
/* Keep the viewport as the mobile scroll container. overflow-x:hidden on
   body otherwise creates an implicit vertical scroll container for sticky. */
@media (max-width:1024px) {
    html:has(body > .top-nav) { overflow-x:clip; }
    body:has(> .top-nav) { overflow-x:clip!important; overflow-y:visible!important; height:auto!important; }
    body > .top-nav { position:sticky!important; top:0!important; }
    body.mobile-nav-open:has(> .top-nav) { overflow:hidden!important; }
}
html {
    width: 100%;
    max-width: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    width: 100%;
    max-width: 100%;
}

/* Decorative watermarks must not create a viewport wider than the device. */
body::before { max-width: 100vw; }

.app-alert-overlay .app-alert-box {
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
}

/* Admin booking dialogs: one scrolling body with stable header/action areas. */
@media (max-width: 1024px) {
    :is(#bookingModal, #editBookingModal, #bookingDetailsModal) .modal-content {
        display: flex;
        flex-direction: column;
        min-width: 0;
        max-height: calc(100dvh - 24px);
        overflow: hidden;
    }
    :is(#bookingModal, #editBookingModal, #bookingDetailsModal) .modal-header {
        align-items: flex-start;
        gap: 12px;
        padding: 16px !important;
        flex-shrink: 0;
    }
    :is(#bookingModal, #editBookingModal, #bookingDetailsModal) .modal-header :is(h3, h5) {
        min-width: 0;
        margin: 0;
        font-size: 1.125rem;
        line-height: 1.4;
        overflow-wrap: break-word;
        word-break: normal;
    }
    :is(#bookingModal, #editBookingModal, #bookingDetailsModal) .modal-header button {
        flex: 0 0 44px;
        width: 44px;
        min-height: 44px;
        margin: 0;
    }
    :is(#bookingModal, #editBookingModal, #bookingDetailsModal) .modal-body {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        padding: 16px !important;
        overflow-y: auto;
        overscroll-behavior: contain;
        word-break: normal;
        overflow-wrap: break-word;
    }
    #bookingModalBody > div { font-size: 16px !important; }
    #bookingModalBody p { margin: 8px 0; }
    #bookingModalBody .booking-document-row { flex-wrap: wrap; }
    #bookingModalBody .booking-document-row > div:first-child { flex: 1 1 180px !important; }
    #bookingModalBody .booking-document-row img { height: auto !important; object-fit: contain !important; }
    #bookingModalBody .booking-modal-actions {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
        gap: 12px !important;
    }
    #bookingModalBody .booking-modal-actions > button {
        width: 100%;
        min-height: 44px;
        justify-content: center;
        white-space: normal;
        font-size: 16px;
    }
    #editBookingModal .form-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
        align-items: start;
        margin-bottom: 16px;
    }
    #editBookingModal .form-row > div { min-width: 0 !important; width: 100%; }
    #editBookingModal :is(input:not([type="hidden"]), select, textarea) {
        width: 100%;
        min-width: 0;
        min-height: 44px;
        font-size: 16px;
        padding: 10px 12px;
        border: 1px solid #d1d5db;
        border-radius: 8px;
        background: #fff;
    }
    #editBookingModal .modal-footer { flex-wrap: wrap; flex-shrink: 0; padding: 16px !important; }
    #editBookingModal .modal-footer > button { flex: 1 1 140px; min-height: 44px; justify-content: center; font-size: 16px; }
}

@media (max-width: 575.98px) {
    #editBookingModal .form-row { grid-template-columns: minmax(0, 1fr) !important; }
}

@media (max-width: 1024px) {
    html, body { overflow-x: visible; }
    body.mobile-nav-open { overflow: hidden; }
    body > .top-nav + .container .content { overflow: visible !important; }
    .sidebar:not(.mobile-menu-open) { visibility: hidden; }
    .sidebar.mobile-menu-open { visibility: visible; }
    .overview-cards, .stats-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .panel-header, .report-controls, .filter-section, .management-header,
    .pagination, .action-buttons, #bookingModalActions {
        flex-wrap: wrap;
        gap: 8px;
        min-width: 0;
    }
    .filter-section > *, .report-controls > * { min-width: 0; max-width: 100%; }
    .form-row { flex-wrap: wrap; }
    .info-section, .info-item, .info-item > *, .panel-body { min-width: 0; }
    .info-item { overflow-wrap: break-word; }
    .profile-info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
    .form-row { flex-direction: column; }
    .form-row > .form-group { width: 100%; margin-inline: 0 !important; }
    .profile-info-grid, .info-section { grid-template-columns: minmax(0, 1fr); }
    .modal-content { max-height: calc(100dvh - 24px); overflow-y: auto; }
    .modal-dialog-scrollable .modal-content { overflow: hidden; }
    .modal-dialog-scrollable .modal-body { overflow-y: auto; }
    .modal-header, .modal-footer { flex-shrink: 0; }
    #bookingModalActions { display: flex; width: 100%; }
    #bookingModalActions > button { flex: 1 1 110px; width: auto; min-width: 0; margin: 0 !important; }
    #bookingDetailsModal .modal-footer { max-height: 45dvh; overflow-y: auto; }
    .gcash-header, .gcash-info-list > div { flex-wrap: wrap; min-width: 0; }
    .gcash-countdown, .payment-countdown { min-width: 0; max-width: 100%; }
    #gcashManualInput { width: 100% !important; margin: 0 0 8px !important; }
    .gcash-qr-frame img { height: auto; object-fit: contain; }
    input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px; }
    .btn-group { flex-wrap: wrap; }
    .btn, .action-btn, .filter-btn { white-space: normal; }
}

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

img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
}

img,
video {
    height: auto;
}

canvas {
    width: 100% !important;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    max-width: 100%;
    min-width: 0;
}

button,
.btn,
[role="button"] {
    max-width: 100%;
    overflow-wrap: normal;
    word-break: normal;
}

.container,
.container-fluid,
.content,
main,
section,
.row,
[class*="col-"] {
    min-width: 0;
}

.table-responsive,
.table-container,
.trips-table-container,
.management-table-container {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
}

.card,
.modal-content,
.profile-card,
.gcash-card,
.receipt-container,
.booking-summary {
    max-width: 100%;
}

/* Let flex/grid children shrink instead of forcing the page wider. */
.container > *,
.content > *,
.main-content > *,
.dashboard-grid > *,
.dashboard-panels > *,
.overview-cards > *,
.stats-cards > *,
.reservations-grid > *,
.profile-grid > *,
.form-grid > *,
.form-row > * {
    min-width: 0;
}

.modal-content,
.panel,
.card,
.profile-card {
    overflow-wrap: break-word;
}

/* Charts retain a useful touch/reading height while remaining fluid. */
.chart-card,
.chart-panel,
.chart-section,
.dashboard-panels .panel {
    min-width: 0;
}

.dashboard-panels .panel .panel-body.table-responsive {
    overflow-x: auto;
}

@media (max-width: 1024px) {
    .report-charts-grid { grid-template-columns: minmax(0, 1fr) !important; }
    /* Dashboard follows the Reports section's aligned, full-width panels. */
    #dashboard .overview-cards {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
        align-items: stretch;
        overflow: visible;
        padding-bottom: 0;
    }
    #dashboard .overview-cards > .card {
        width: 100%;
        min-width: 0;
        padding: 18px;
        gap: 12px;
        margin: 0;
        align-items: center;
    }
    #dashboard .card-icon { flex-shrink: 0; }
    #dashboard .card-content { min-width: 0; }
    #dashboard .card-label { white-space: normal; word-break: normal; }
    #dashboard .dashboard-panels {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
        align-items: stretch;
    }
    #dashboard .dashboard-panels > .panel {
        grid-column: auto;
        order: initial;
        width: 100%;
        min-width: 0;
    }
    #dashboard .panel-header { padding: 18px; }
    #dashboard .panel-body { padding: 18px; }
    .report-charts-grid > div { min-width: 0; }
    .report-charts-grid > div > div:first-child,
    .report-charts-grid > div > div:first-child > div:last-child {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        min-width: 0;
    }
    .report-chart-legend { flex-wrap: wrap; }
    .report-chart-legend > div { min-width: 0; max-width: 100%; }
    .report-chart-legend > div:first-child { flex: 1 1 220px !important; }
    .report-chart-legend > div:last-child { flex: 1 1 140px; }
}

@media (max-width: 767.98px) {
    #dashboard .overview-cards { grid-template-columns: minmax(0, 1fr); }
    .profile-info { grid-template-columns: minmax(0, 1fr); }
    #reports .overview-cards { flex-direction: column; }
    .booking-details-grid { grid-template-columns: minmax(0, 1fr) !important; }
    .booking-details-grid > * { min-width: 0; }
    .manage-notification-dropdown {
        position: fixed;
        top: 68px;
        left: 10px;
        right: 10px;
        width: auto;
        max-height: calc(100dvh - 88px);
    }
}

.chart-card canvas,
.chart-panel canvas,
.chart-section canvas,
.dashboard-panels canvas {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
}

.booking-code,
.booking-id,
.reference-number,
.email,
td,
.info-row,
.gcash-info-list {
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 767.98px) {
    .row {
        --bs-gutter-x: 1rem;
    }

    .form-row,
    .form-grid,
    .filter-section,
    .management-header,
    .modal-footer,
    .action-buttons {
        max-width: 100%;
    }

    .form-row,
    .form-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .toast-notification,
    .toast-container,
    .notification-dropdown {
        right: 10px !important;
        left: 10px !important;
        width: auto !important;
        max-width: none !important;
        transform: translateY(-140%) !important;
    }

    .toast-notification.show,
    .toast-container.show,
    .notification-dropdown.show {
        transform: translateY(0) !important;
    }

    button,
    .btn,
    input[type="button"],
    input[type="submit"],
    input[type="reset"] {
        min-height: 44px;
    }

    .modal {
        padding: 10px !important;
    }

    .modal-dialog,
    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        margin-inline: 0 !important;
    }

    /* Keep scrolling local to data-heavy controls, never on the page. */
    .table-responsive,
    .table-container,
    .trips-table-container,
    .management-table-container {
        width: 100% !important;
        max-width: 100% !important;
        margin-inline: 0 !important;
    }

    .table-responsive table,
    .table-container table,
    .trips-table-container table,
    .management-table-container table {
        width: max-content;
        min-width: 680px;
    }

    .content,
    main.content,
    .main-content {
        min-width: 0;
        max-width: 100%;
    }

    .management-header,
    .filter-section,
    .report-controls,
    .date-filter,
    .toolbar,
    .search-filter,
    .profile-actions,
    .card-footer {
        gap: 10px !important;
        flex-wrap: wrap;
    }

    .management-header > *,
    .filter-section > *,
    .report-controls > *,
    .date-filter > *,
    .toolbar > *,
    .search-filter > * {
        min-width: 0;
        max-width: 100%;
    }

    .overview-cards,
    .stats-cards,
    .dashboard-grid,
    .dashboard-panels,
    .reservations-grid,
    .profile-grid,
    .profile-info-grid,
    .card-details,
    .details-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .chart-card,
    .chart-panel,
    .chart-section,
    .dashboard-panels .panel {
        width: 100%;
        min-height: 280px;
    }

    /* Inline-styled profile dialogs are constrained here without changing JS. */
    #edit-profile-modal,
    #change-password-modal,
    #profile-picture-modal,
    #edit-modal,
    .reservation-details-modal {
        padding: 12px !important;
        overflow-y: auto !important;
    }

    #edit-profile-modal > div,
    #change-password-modal > div,
    #profile-picture-modal > div,
    #edit-modal > div,
    .reservation-details-modal .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        max-height: calc(100dvh - 24px) !important;
        margin: auto !important;
        padding: 18px 14px !important;
        overflow-y: auto !important;
    }

    .reservation-details-modal .info-grid,
    .reservation-details-modal .info-row,
    .reservation-modal .form-grid,
    .reservation-modal .form-row {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-inline: 14px !important;
    }

    .modal-footer {
        align-items: stretch;
    }

    .modal-footer > button,
    .modal-footer > .btn {
        flex: 1 1 140px;
    }

    /* Seat logic is untouched; only its visual viewport becomes swipeable. */
    .seat-selection,
    .seat-layout-wrapper,
    .seat-map-wrapper {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-inline: contain;
    }

    .seat,
    .seat-button {
        min-width: 44px;
        min-height: 44px;
        touch-action: manipulation;
    }
}

/* Landing page: wrap the fixed header cleanly instead of squeezing links. */
@media (max-width: 600px) {
    body:has(.hero) .top-nav {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        justify-items: center;
        gap: 6px;
        padding: 8px 10px !important;
    }

    body:has(.hero) .top-nav .logo img {
        width: 38px;
        height: 38px;
    }

    body:has(.hero) .top-nav .logo-text h2 {
        font-size: 1rem;
    }

    body:has(.hero) .nav-menu {
        width: 100%;
        justify-content: center;
        gap: 2px !important;
    }

    body:has(.hero) .nav-menu li {
        min-width: 0;
    }

    body:has(.hero) .nav-menu li a {
        min-height: 38px;
        padding: 6px 8px !important;
        font-size: 0.78rem !important;
        white-space: nowrap;
    }

    body:has(.hero) .hero {
        min-height: calc(100svh - 96px);
        margin-top: 96px;
        padding-top: 24px;
    }

    body:has(.hero) .hero-content {
        width: 100%;
        padding: 32px 16px;
    }

    body:has(.hero) .hero-content h1 {
        font-size: clamp(2rem, 12vw, 2.7rem) !important;
    }

    body:has(.hero) .cta-buttons,
    body:has(.hero) .cta-btn {
        width: 100%;
    }

    body:has(.hero) .cta-btn {
        justify-content: center;
        min-height: 48px;
    }

    body:has(.hero) .features,
    body:has(.hero) .contact {
        padding: 52px 14px;
    }

    body:has(.hero) .feature-card {
        min-height: 0;
        padding: 30px 18px 38px;
    }

    body:has(.hero) .feature-card.is-expanded {
        width: calc(100vw - 20px) !important;
        max-height: calc(100dvh - 20px) !important;
        padding: 32px 18px 44px !important;
    }
}

@media (max-width: 430px) {
    .top-nav {
        max-width: 100vw;
    }

    .top-nav .logo,
    .top-nav .logo-text,
    .top-nav .nav-right {
        min-width: 0;
    }

    .top-nav .logo-text h2,
    .top-nav .logo-text h3,
    .top-nav .logo-text p {
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .form-wrapper,
    .login-wrapper,
    .receipt-wrapper {
        padding-inline: 10px !important;
    }

    form,
    .login-container,
    .receipt-container,
    .gcash-card,
    .card,
    .panel,
    .profile-card {
        padding-inline: 14px !important;
    }

    .gcash-qr-frame,
    .gcash-qr-frame img,
    .qr-code,
    .qr-code img {
        width: min(100%, 240px) !important;
        height: auto !important;
    }

    .gcash-info-list div,
    .info-row {
        align-items: flex-start !important;
        gap: 6px;
        flex-wrap: wrap;
    }

    .login-wrapper,
    .form-wrapper {
        min-height: 100svh;
        align-items: center;
    }

    .login-container,
    .form-container,
    .register-container {
        width: 100% !important;
        max-width: 100% !important;
        margin-inline: 0 !important;
    }

    .login-container input:not([type="checkbox"]):not([type="radio"]),
    .login-container button,
    .form-container input:not([type="checkbox"]):not([type="radio"]),
    .form-container select,
    .form-container textarea,
    .form-container button {
        width: 100%;
    }

    .error-message,
    .validation-message,
    .invalid-feedback,
    .alert {
        white-space: normal !important;
        overflow-wrap: anywhere;
    }

    .chart-card,
    .chart-panel,
    .chart-section,
    .dashboard-panels .panel {
        min-height: 250px;
    }
}

@media (max-width: 359.98px) {
    .top-nav {
        padding-inline: 8px !important;
    }

    .top-nav .logo-text h2 {
        font-size: 1rem !important;
    }

    .top-nav .avatar {
        display: none !important;
    }

    .mobile-menu-toggle,
    .navbar-toggler {
        flex-basis: 42px !important;
        width: 42px !important;
        height: 42px !important;
    }

    .content,
    main.content,
    .main-content {
        padding-inline: 10px !important;
    }

    .card,
    .panel,
    .profile-card,
    .login-container,
    .form-container {
        border-radius: 10px !important;
        padding-inline: 12px !important;
    }

    body:has(.hero) .nav-menu li a {
        padding-inline: 6px !important;
        font-size: 0.72rem !important;
    }
}

/* Driver/passenger application shell: final mobile sizing authority.
   These selectors are intentionally scoped to the dashboard shell so they do
   not override Bootstrap's .container sizing on login and booking forms. */
@media (max-width: 1024px) {
    /* Anchor passenger popups to the full header, not the offset bell. */
    .top-nav .nav-right,
    .top-nav .shared-note-wrap,
    .top-nav .passenger-notification-wrapper {
        position: static;
    }

    .top-nav :is(.shared-note-menu, .passenger-notification-dropdown) {
        position: absolute;
        top: calc(100% + 8px);
        left: 12px;
        right: 12px;
        width: min(380px, calc(100vw - 24px));
        margin-inline: auto;
        max-height: min(420px, calc(100dvh - 100px));
        display: flex;
        flex-direction: column;
        transform: none;
    }

    .top-nav :is(.shared-note-menu, .passenger-notification-dropdown)[hidden] {
        display: none;
    }

    .top-nav :is(.shared-note-head, .passenger-notification-header) {
        flex-shrink: 0;
        gap: 8px;
    }

    .top-nav :is(#sharedPassengerNotificationList, .passenger-notification-list) {
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    body:has(> .top-nav + .container) {
        min-width: 0;
        }

    body > .top-nav {
        width: 100%;
        max-width: 100vw;
        min-height: 64px;
        padding: 8px 12px !important;
        flex-wrap: nowrap;
    }

    body > .top-nav .nav-left,
    body > .top-nav .nav-right,
    body > .top-nav .logo,
    body > .top-nav .user-info {
        min-width: 0;
        flex-shrink: 1;
    }

    body > .top-nav .logo-text {
        min-width: 0;
        max-width: min(42vw, 180px);
    }

    body > .top-nav .logo-text h2,
    body > .top-nav .logo-text p {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body > .top-nav .nav-right {
        flex: 0 1 auto;
        justify-content: flex-end;
    }

    body > .top-nav + .container {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: calc(100dvh - 64px);
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    body > .top-nav + .container > .content,
    body > .top-nav + .container > main,
    body > .top-nav + .container .content {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 18px 14px 28px !important;
        }

    body > .top-nav + .container .section,
    body > .top-nav + .container .section-header,
    body > .top-nav + .container .management-header,
    body > .top-nav + .container .welcome-banner,
    body > .top-nav + .container .profile-container,
    body > .top-nav + .container .profile-card,
    body > .top-nav + .container .card,
    body > .top-nav + .container .panel {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-inline: 0 !important;
    }

    body > .top-nav + .container .section-header h1 {
        font-size: clamp(1.5rem, 8vw, 2rem) !important;
        line-height: 1.15;
        overflow-wrap: normal;
    }

    body > .top-nav + .container .section-header p,
    body > .top-nav + .container .welcome-content p {
        font-size: 0.95rem;
        overflow-wrap: anywhere;
    }

    body > .top-nav + .container .profile-actions,
    body > .top-nav + .container .card-footer {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: stretch !important;
    }

    body > .top-nav + .container .profile-actions > *,
    body > .top-nav + .container .card-footer > * {
        flex: 1 1 160px;
        width: auto !important;
        max-width: 100% !important;
        margin-inline: 0 !important;
    }

    /* Size the controls themselves; give search the whole horizontal row. */
    body > .top-nav + .container .management-header {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }

    body > .top-nav + .container .filter-section,
    .schedule-toolbar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
        gap: 12px;
        width: 100%;
        min-width: 0;
        flex: 1 1 100%;
        align-items: stretch;
    }

    body > .top-nav + .container .filter-section > *,
    .schedule-toolbar > * {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        margin-inline: 0;
        min-height: 44px;
        font-size: 16px;
    }

    .filter-section > .search-input,
    .filter-section > input[type="search"],
    .schedule-toolbar > input {
        grid-column: 1 / -1;
    }

    .management-header > .add-btn {
        flex: 0 0 auto;
        width: auto;
        min-height: 44px;
    }

    body > .top-nav + .container .table-container,
    body > .top-nav + .container .trips-table-container,
    body > .top-nav + .container .management-table-container {
        width: 100% !important;
        max-width: 100% !important;
        max-height: none;
        border-radius: 10px;
        overflow-x: auto !important;
        overflow-y: visible !important;
    }

    body > .top-nav + .container table {
        font-size: 0.9rem;
    }

    body > .top-nav + .container th,
    body > .top-nav + .container td {
        padding: 11px 12px !important;
        white-space: nowrap;
    }

    body > .top-nav + .container .action-btn,
    body > .top-nav + .container .view-details-btn,
    body > .top-nav + .container .cta-button {
        min-height: 44px;
        touch-action: manipulation;
    }

    body > .top-nav + .container .profile-card {
        grid-template-columns: minmax(0, 1fr) !important;
        overflow: hidden;
    }

    body > .top-nav + .container .profile-header,
    body > .top-nav + .container .profile-info {
        padding: 22px 16px !important;
    }
}

@media (max-width: 389.98px) {
    body > .top-nav .logo-text p,
    body > .top-nav .greeting {
        display: none !important;
    }

    body > .top-nav .logo img {
        width: 38px !important;
        height: 38px !important;
    }

    body > .top-nav .avatar {
        width: 36px !important;
        height: 36px !important;
    }

    body > .top-nav + .container > .content,
    body > .top-nav + .container > main,
    body > .top-nav + .container .content {
        padding-inline: 10px !important;
    }
}

/* Keep mobile navigation controls square even inside full-width form layouts. */
@media (max-width: 1024px) {
    .top-nav .mobile-menu-toggle,
    .top-nav .navbar-toggler,
    .passenger-back-btn,
    .reservation-back-btn {
        box-sizing: border-box !important;
        flex: 0 0 44px !important;
        width: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        height: 44px !important;
        min-height: 44px !important;
        max-height: 44px !important;
        padding: 0 !important;
        margin: 0 !important;
        line-height: 1 !important;
        touch-action: manipulation;
    }
    .top-nav .mobile-menu-toggle:focus-visible,
    .top-nav .navbar-toggler:focus-visible {
        outline: 3px solid #87ceeb;
        outline-offset: 2px;
    }
}

.login-return-link,
#start-over-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    touch-action: manipulation;
}

/* Match the home page's centered card grid on the admin mobile summaries. */
@media (max-width: 767.98px) {
    .admin-interface :is(#dashboard, #reports) .overview-cards {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
        align-items: stretch;
        overflow: visible;
        padding-bottom: 0;
    }
    .admin-interface :is(#dashboard, #reports) .overview-cards > :is(.card, .summary-card) {
        width: 100%;
        min-width: 0;
        margin: 0;
        padding: 14px 10px !important;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        gap: 8px !important;
        text-align: center !important;
        border-radius: 16px !important;
    }
    .admin-interface #dashboard .card-content,
    .admin-interface #reports .summary-card > div:last-child {
        width: 100%;
        min-width: 0;
        overflow-wrap: anywhere;
    }
    .admin-interface #dashboard .card-label {
        font-size: 13px;
        line-height: 1.4;
        margin: 0;
        min-height: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .admin-interface #dashboard .card-content { gap: 4px; }
    .admin-interface #dashboard .card-value { margin: 0; font-size: 24px; line-height: 1.2; }
    .admin-interface #dashboard .card-icon,
    .admin-interface #reports .summary-card > div:first-child {
        width: 48px !important;
        height: 48px !important;
        font-size: 20px !important;
    }
    .admin-interface #reports .summary-card small { display: block; line-height: 1.35; }
    .admin-interface #reports .summary-card small:first-child {
        min-height: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .admin-interface #reports .summary-card > div:first-child { flex-shrink: 0; }
    .admin-interface #reports .summary-card:last-child { grid-column: 1 / -1; }
    .admin-interface #reports .summary-card:last-child small:first-child { min-height: 0; }
    .admin-interface #reports .summary-card h2 { margin: 4px 0 !important; font-size: 22px !important; line-height: 1.2; }
}
