/* TourSetu cross-portal responsive foundation — desktop, Android and iOS */
:root { color-scheme: light; }
html { width:100%; max-width:100%; overflow-x:clip; -webkit-text-size-adjust:100%; text-size-adjust:100%; }
body { width:100%; max-width:100%; min-width:0; overflow-x:clip; }
*, *::before, *::after { box-sizing:border-box; }
img, video, canvas, svg { max-width:100%; }
iframe { max-width:100%; }
button, a, input, select, textarea, summary, [role="button"] { touch-action:manipulation; }
button, a, [role="button"], input[type="checkbox"], input[type="radio"], select { -webkit-tap-highlight-color:transparent; }
:where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) { max-width:100%; min-width:0; }
#app, #app > *, .driver-app, .main, .content, main, .page, .page-content { min-width:0; max-width:100%; }
#app img, .driver-app img { height:auto; }
@media (min-width:1024px) {
  #app { width:100%; max-width:100%; }
  #app .container, #app .dashboard-container, #app .main-content { width:min(100% - 48px, 1600px); max-width:1600px; margin-inline:auto; }
  #app .grid, #app .cards-grid, #app .dashboard-grid, #app .taxi-grid, #app .listing-grid { grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr)); }
  .driver-app .content { width:100%; max-width:1600px; margin-inline:auto; padding-inline:clamp(24px,3vw,56px); }
}
@media (max-width:1023px) { #app .container, #app .dashboard-container, #app .main-content { max-width:100%; } }
@media (max-width:768px) {
  html, body { overflow-x:hidden; }
  body { min-width:320px; }
  #app { width:100%; max-width:100%; padding-inline:0; }
  #app :where(.grid, .cards-grid, .dashboard-grid, .taxi-grid, .listing-grid, .search-grid, .filter-grid, .form-grid, .panel-grid), #app [style*="grid-template-columns"] { grid-template-columns:minmax(0,1fr) !important; }
  #app :where(.flex-row, .toolbar, .search-bar, .filter-bar, .form-actions, .dashboard-header, .section-header) { flex-wrap:wrap; min-width:0; }
  #app :where(input, select, textarea, button) { font-size:16px; }
  #app :where(input, select, textarea) { width:100%; min-width:0; }
  #app :where(button, .btn, .nav-item, .side-link, [role="button"], summary), #app .navlinks a, #app .drawer a, #app .slide-out-drawer a { min-height:44px; }
  #app :where(.card, .panel, .modal-content, .form-card) { min-width:0; max-width:100%; }
  #app :where(.modal, .modal-overlay, .modal-backdrop, [role="dialog"]) { max-width:100vw; max-height:100dvh; overflow-y:auto; overscroll-behavior:contain; }
  #app :where(.modal-content, [role="dialog"] .modal-content) { width:min(100% - 20px, 620px) !important; max-height:calc(100dvh - 24px); margin:12px auto; overflow-y:auto; padding-bottom:max(16px, env(safe-area-inset-bottom)); }
  #app :where(table) { display:block; width:100%; max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
  #app :where(pre, code, .long-text, .address, .email) { overflow-wrap:anywhere; }
  .driver-app { width:100%; max-width:100%; overflow-x:clip; }
  .driver-app .sidebar { position:sticky; top:0; width:100%; height:auto; max-height:none; padding:10px 12px; }
  .driver-app .side-nav { display:flex; flex-wrap:nowrap; overflow-x:auto; overflow-y:hidden; max-width:100%; padding-bottom:4px; -webkit-overflow-scrolling:touch; }
  .driver-app .side-link { flex:0 0 auto; min-height:44px; white-space:nowrap; }
  .driver-app .main { width:100%; margin-left:0; min-width:0; }
  .driver-app .topbar { padding-inline:14px; gap:10px; }
  .driver-app .content { width:100%; max-width:100%; padding:18px 14px calc(28px + env(safe-area-inset-bottom)); }
  .driver-app .stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .driver-app .driver-grid { grid-template-columns:minmax(0,1fr); }
  .driver-app .driver-grid .full { grid-column:1/-1; }
  .driver-app .driver-grid input, .driver-app .driver-grid select { min-height:44px; font-size:16px; }
  .driver-app .panel-head { flex-wrap:wrap; gap:10px; }
  .driver-app .panel-body { min-width:0; }
  .driver-app .btn { min-height:44px; }
  .auth-wrap, .auth-card { width:min(100% - 24px, 520px); max-width:100%; }
  .auth-card { padding:clamp(16px,4vw,26px); }
  .sidebar, .drawer, .slide-out-drawer { max-width:min(88vw,360px); }
  .drawer a, .drawer button, .slide-out-drawer a, .slide-out-drawer button { min-height:44px; }
  .wrap { width:min(100% - 28px, 720px); }
}
@media (max-width:380px) { .driver-app .stats { grid-template-columns:minmax(0,1fr); } .driver-app .topbar { padding-inline:10px; } .driver-app .content { padding-inline:10px; } }
@supports not (overflow:clip) { html, body { overflow-x:hidden; } }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto !important; animation-duration:.01ms !important; transition-duration:.01ms !important; } }


/* Mobile-only portal polish: search controls, dashboard actions and drawers.
   All overrides are scoped to <=768px so desktop geometry remains unchanged. */
@media (max-width:768px) {
  #app { padding-inline:max(0px, env(safe-area-inset-left)) max(0px, env(safe-area-inset-right)); }
  #app :where(.card,.panel,.form-card,.search-container,.search-panel,.dashboard-card,.dashboard-section,.section-card) {
    padding:clamp(12px,3.5vw,16px);
    border-radius:14px;
  }
  #app :where(h1) { font-size:clamp(1.45rem,6vw,1.9rem); line-height:1.2; overflow-wrap:normal; }
  #app :where(h2) { font-size:clamp(1.2rem,5vw,1.55rem); line-height:1.25; }
  #app :where(h3) { font-size:clamp(1.05rem,4.2vw,1.25rem); line-height:1.3; }
  #app :where(p,.muted,.helper-text) { line-height:1.5; }
  #app :where(.dashboard-header,.section-header,.toolbar,.action-bar,.dashboard-actions,.header-actions,.action-buttons,.top-actions) { gap:10px; align-items:stretch; min-width:0; }\n  #app :where(.dashboard-actions,.header-actions,.action-buttons) { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }\n  #app :where(.dashboard-actions,.header-actions,.action-buttons) > button, #app :where(.dashboard-actions,.header-actions,.action-buttons) > a { width:100%; min-width:0; min-height:44px; }
  #app :where(.dashboard-header,.section-header) > :first-child { min-width:0; flex:1 1 100%; }
  /* Search-type selector: compact, non-wrapping pills with horizontal swipe. */
  #app div:has(> div > label > input[name="search-type"]) {
    display:flex !important; flex-wrap:wrap !important; align-items:center !important;
    justify-content:flex-start !important; gap:10px !important; padding:12px !important;
  }
  #app div:has(> label > input[name="search-type"]) {
    display:flex !important; flex:1 1 100% !important; flex-wrap:nowrap !important;
    gap:8px !important; min-width:0; max-width:100%; overflow-x:auto; overflow-y:hidden;
    padding:2px 1px 7px; -webkit-overflow-scrolling:touch; scrollbar-width:thin;
    scroll-snap-type:x proximity;
  }
  #app div:has(> label > input[name="search-type"]) > label {
    display:inline-flex !important; flex:0 0 auto !important; align-items:center;
    white-space:nowrap !important; overflow-wrap:normal !important; word-break:keep-all !important;
    min-height:44px; padding:9px 13px; border:1px solid #e5e7eb; border-radius:999px;
    background:#fff; font-size:13px !important; line-height:1.2; gap:7px !important;
    scroll-snap-align:start;
  }
  #app div:has(> label > input[name="search-type"]) > label input[type="radio"] {
    width:17px !important; height:17px; flex:0 0 17px; margin:0; accent-color:#ff9f43;
  }
  /* Dashboard action groups remain readable and thumb-friendly. */
  #app :where(div,section,header):has(> button[onclick*="confirmCustomerLogout"]),
  #app :where(div,section,header):has(> button[onclick*="renderCustomerRequests"]) {
    display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:9px !important; align-items:stretch !important; min-width:0;
  }
  #app :where(div,section,header):has(> button[onclick*="confirmCustomerLogout"]) > button,
  #app :where(div,section,header):has(> button[onclick*="renderCustomerRequests"]) > button {
    width:100% !important; min-width:0; min-height:46px !important; padding:10px 12px !important;
    white-space:normal; line-height:1.25; font-size:14px !important;
  }
  #app :where(button,.btn,[role="button"],.nav-item,.menu-item) {
    min-height:44px; max-width:100%; white-space:normal; overflow-wrap:normal;
  }
  #app :where(.modal-overlay,.modal-backdrop,[role="dialog"]) { padding:10px !important; }
  #app :where(.modal-content,[role="dialog"] .modal-content) {
    width:100% !important; max-width:620px !important; padding:16px !important;
    margin:8px auto !important; border-radius:16px;
  }
  /* Drawer surfaces use compositor-friendly transforms and respect device safe areas. */
  #app :where(.drawer,.slide-out-drawer,.sidebar,[class*="slide-drawer"],[class*="side-drawer"]) {
    max-width:min(88vw,360px); padding-top:max(14px,env(safe-area-inset-top));
    padding-bottom:max(16px,env(safe-area-inset-bottom));
    will-change:transform; backface-visibility:hidden;
    transition:transform .26s cubic-bezier(.2,.75,.25,1),opacity .2s ease,visibility .2s ease;
    -webkit-overflow-scrolling:touch; overscroll-behavior:contain;
  }
  #app :where(.drawer a,.drawer button,.slide-out-drawer a,.slide-out-drawer button,
    [class*="slide-drawer"] a,[class*="slide-drawer"] button,
    [class*="side-drawer"] a,[class*="side-drawer"] button) { min-height:44px; }
  #app :where(.drawer-backdrop,.drawer-overlay,[class*="drawer-backdrop"],[class*="drawer-overlay"]) {
    transition:opacity .2s ease,visibility .2s ease;
  }
  #app :where(.card,.panel,.search-container,.dashboard-section) > * { min-width:0; }
}
@media (max-width:420px) {
  #app :where(div,section,header):has(> button[onclick*="confirmCustomerLogout"]),
  #app :where(div,section,header):has(> button[onclick*="renderCustomerRequests"]) {
    grid-template-columns:minmax(0,1fr) !important;
  }
}
@media (prefers-reduced-motion:reduce) {
  #app :where(.drawer,.slide-out-drawer,.sidebar,[class*="slide-drawer"],[class*="side-drawer"],
    .drawer-backdrop,.drawer-overlay,[class*="drawer-backdrop"],[class*="drawer-overlay"]) { transition:none !important; }
}


/* Desktop-wide layout refinement — isolated from tablet/mobile geometry. */
@media (min-width: 1024px) {
  html, body { width: 100%; max-width: 100%; }
  body {
    display: block !important;
    padding: clamp(20px, 2vw, 32px) !important;
    margin: 0 !important;
  }
  #app {
    width: min(95vw, 1600px) !important;
    max-width: 1600px !important;
    margin-inline: auto !important;
  }
  #app > .container,
  #app .container,
  #app .dashboard-container,
  #app .main-content,
  #app .search-container,
  #app .search-panel,
  #app .page-content,
  #app .dashboard-content,
  #app .content,
  #app .section-container {
    width: 100%;
    max-width: 1600px;
    margin-inline: auto;
  }
  #app > .toursetu-agency-dashboard,
  #app > .hotel-dashboard-shell,
  #app > div[style*="background:#f4f7f6"] {
    width: 100% !important;
    max-width: none !important;
    margin-inline: 0 !important;
  }
  #app > div[style*="background:#f4f7f6"] > div[style*="max-width:1200px"] {
    width: 100% !important;
    max-width: 1540px !important;
  }
  #app #owner-dashboard-section {
    width: 100% !important;
    max-width: 1600px !important;
  }
  #app :where(.grid, .cards-grid, .dashboard-grid, .taxi-grid, .listing-grid,
    .search-grid, .filter-grid, .panel-grid, .stats, #customer-pkg-list) {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    align-items: stretch;
  }
  #app :where(.dashboard-header, .section-header, .toolbar, .action-bar,
    .dashboard-actions, .header-actions, .action-buttons, .top-actions,
    .form-actions, .hotel-room-card-controls) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    min-width: 0;
  }
  #app :where(.dashboard-actions, .header-actions, .action-buttons,
    .form-actions, .top-actions) > button,
  #app :where(.dashboard-actions, .header-actions, .action-buttons,
    .form-actions, .top-actions) > a {
    width: auto !important;
    min-width: max-content;
    flex: 0 1 auto;
  }
  #app :where(table) {
    width: 100%;
    max-width: 100%;
  }
  .toursetu-agency-dashboard,
  .hotel-dashboard-shell {
    width: 100% !important;
    max-width: 1600px !important;
  }
  .toursetu-agency-dashboard .agency-main-content,
  #hotel-main-content {
    flex: 1 1 0;
    min-width: 0;
    max-width: none !important;
  }
  .driver-app .main { width: 100%; min-width: 0; }
  .driver-app .content {
    width: min(100%, 1600px);
    max-width: 1600px;
    padding-inline: clamp(28px, 3vw, 56px);
  }
  .driver-app .panel-grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(320px, .9fr);
    gap: clamp(18px, 2vw, 30px);
  }
  .driver-app .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Consistent drawer motion on desktop and mobile; state remains controlled by app JS. */
#app :where(.drawer, .slide-out-drawer, .sidebar,
  [class*="slide-drawer"], [class*="side-drawer"],
  .drawer-backdrop, .drawer-overlay,
  [class*="drawer-backdrop"], [class*="drawer-overlay"]) {
  transition: transform .28s cubic-bezier(.2,.75,.25,1),
    opacity .22s ease, visibility .22s ease, box-shadow .22s ease;
  will-change: transform;
}
#app :where(.drawer a, .drawer button, .slide-out-drawer a,
  .slide-out-drawer button, [class*="slide-drawer"] a,
  [class*="slide-drawer"] button) {
  transition: background-color .18s ease, color .18s ease,
    transform .18s ease, opacity .18s ease;
}
@media (prefers-reduced-motion: reduce) {
  #app :where(.drawer, .slide-out-drawer, .sidebar,
    [class*="slide-drawer"], [class*="side-drawer"],
    .drawer-backdrop, .drawer-overlay,
    [class*="drawer-backdrop"], [class*="drawer-overlay"]),
  #app :where(.drawer a, .drawer button, .slide-out-drawer a,
    .slide-out-drawer button, [class*="slide-drawer"] a,
    [class*="slide-drawer"] button) {
    transition: none !important;
    will-change: auto;
  }
}


/* Desktop SaaS layout refinement for the agency workspace. */
@media (min-width: 1024px) {
  html, body { width:100%; min-width:0; max-width:100%; }
  body { padding:0 !important; margin:0 !important; }
  #app {
    width:100% !important;
    max-width:none !important;
    margin:0 auto !important;
    padding:0 !important;
    box-sizing:border-box;
  }
  #app > .toursetu-agency-dashboard {
    width:100% !important;
    max-width:none !important;
    min-height:100vh;
    margin:0 !important;
    display:flex !important;
    align-items:stretch;
    background:#f5f7fb;
  }
  .toursetu-agency-dashboard > .agency-sidebar {
    position:sticky;
    top:0;
    align-self:flex-start;
    width:260px !important;
    min-width:260px;
    height:100vh;
    min-height:100vh;
    overflow-y:auto;
    box-shadow:4px 0 24px rgba(15,23,42,.08);
    z-index:20;
  }
  .toursetu-agency-dashboard > .agency-main-content {
    flex:1 1 0 !important;
    width:calc(100% - 260px) !important;
    max-width:none !important;
    min-width:0;
    min-height:100vh;
    padding:clamp(28px,3vw,52px) !important;
    overflow-x:hidden;
    background:#f5f7fb !important;
  }
  /* Overview: three equal KPI cards with stronger visual hierarchy. */
  #main-content > div[style*="display:grid"] {
    display:grid !important;
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:clamp(16px,1.6vw,26px) !important;
    width:100%;
  }
  #main-content > div[style*="display:grid"] > div {
    min-width:0;
    min-height:142px;
    padding:clamp(22px,2vw,32px) !important;
    border:1px solid #e8edf5;
    border-top:0 !important;
    border-radius:16px !important;
    box-shadow:0 8px 28px rgba(15,23,42,.06) !important;
    position:relative;
    overflow:hidden;
  }
  #main-content > div[style*="display:grid"] > div::before {
    content:"";
    position:absolute;
    inset:0 auto 0 0;
    width:5px;
    background:var(--agency-metric-accent,#ff9f43);
  }
  #main-content > div[style*="display:grid"] > div:nth-child(1) { --agency-metric-accent:#16a36a; }
  #main-content > div[style*="display:grid"] > div:nth-child(2) { --agency-metric-accent:#e99a28; }
  #main-content > div[style*="display:grid"] > div:nth-child(3) { --agency-metric-accent:#3978d5; }
  #main-content > div[style*="display:grid"] > div small {
    color:#64748b;
    font-size:12px;
    letter-spacing:.075em !important;
  }
  #main-content > div[style*="display:grid"] > div h2 {
    color:#17243a;
    font-size:clamp(26px,2.1vw,36px);
    font-weight:750;
    line-height:1.2;
  }
  /* Booking request cards: two-column desktop board, structured information. */
  #booking-list-area {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    align-items:stretch;
    gap:20px;
    margin-top:24px !important;
  }
  #booking-list-area > article {
    min-width:0;
    height:100%;
    box-sizing:border-box;
    margin:0 !important;
    padding:clamp(20px,1.7vw,28px) !important;
    border:1px solid #e7ebf2;
    border-left:4px solid var(--agency-booking-status,#ff9f43) !important;
    border-radius:16px !important;
    box-shadow:0 6px 22px rgba(15,23,42,.055) !important;
    display:flex;
    flex-direction:column;
  }
  #booking-list-area > article > div:first-child {
    align-items:center !important;
    flex-wrap:wrap;
  }
  #booking-list-area article [data-agency-booking-action],
  #booking-list-area article button {
    min-height:42px;
    border-radius:9px;
    font-weight:700;
  }
  #booking-list-area article [style*="grid-template-columns"] {
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:14px !important;
  }
  /* Packages and hotel stock use consistent SaaS cards. */
  #pkg-list-container,
  #agency-hotel-pkg-list {
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:20px;
    align-items:stretch;
  }
  #pkg-list-container > article,
  #agency-hotel-pkg-list > article {
    min-width:0;
    height:100%;
    box-sizing:border-box;
    margin:0 !important;
    border:1px solid #e7ebf2;
    border-left:4px solid #ff9f43 !important;
    border-radius:16px !important;
    box-shadow:0 6px 22px rgba(15,23,42,.055) !important;
  }
  /* Agency profile: three clearly separated information tiles. */
  #main-content > section[style*="border-left"] {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:18px;
    padding:24px !important;
    border:1px solid #e7ebf2 !important;
    border-left:0 !important;
    border-radius:16px !important;
    box-shadow:0 8px 28px rgba(15,23,42,.06);
  }
  #main-content > section[style*="border-left"] > div {
    min-width:0;
    padding:20px;
    border:1px solid #edf0f5;
    border-radius:12px;
    background:#f8fafc;
  }
  #main-content > section[style*="border-left"] label {
    color:#64748b !important;
    font-size:11px !important;
    letter-spacing:.06em;
    text-transform:uppercase;
  }
  #main-content > section[style*="border-left"] p {
    color:#1e293b !important;
    font-size:15px !important;
    font-weight:650;
    overflow-wrap:anywhere;
  }
  .toursetu-agency-dashboard .nav-item {
    min-height:46px;
    border-radius:10px !important;
    transition:background-color .18s ease, transform .18s ease, color .18s ease;
  }
  .toursetu-agency-dashboard .nav-item:hover {
    background:rgba(255,255,255,.1) !important;
    transform:translateX(2px);
  }
}
@media (min-width: 1440px) {
  .toursetu-agency-dashboard > .agency-sidebar {
    width:280px !important;
    min-width:280px;
    padding:30px !important;
  }
  .toursetu-agency-dashboard > .agency-main-content {
    width:calc(100% - 280px) !important;
    padding:clamp(40px,3.2vw,64px) !important;
  }
  #booking-list-area,
  #pkg-list-container,
  #agency-hotel-pkg-list { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (min-width: 1024px) and (max-width: 1199px) {
  .toursetu-agency-dashboard > .agency-sidebar {
    width:220px !important;
    min-width:220px;
    padding:20px !important;
  }
  .toursetu-agency-dashboard > .agency-main-content {
    width:calc(100% - 220px) !important;
    padding:24px !important;
  }
  #booking-list-area,
  #pkg-list-container,
  #agency-hotel-pkg-list { grid-template-columns:minmax(0,1fr); }
  #main-content > section[style*="border-left"] {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}


/* Global modal ergonomics: keep long forms scrollable on every portal/device. */
#app :where(
  .modal-content,
  .modal-dialog,
  .modal-card,
  .custom-modal-card,
  .modal-container,
  [role="dialog"],
  dialog[open]
) {
  box-sizing: border-box;
  max-height: 90vh !important;
  max-height: 90dvh !important;
  min-height: 0;
  overflow-y: auto !important;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  padding-bottom: max(20px, env(safe-area-inset-bottom)) !important;
}

/* Keep action rows visible while the modal's form content scrolls. */
#app :where(
  .modal-footer,
  .modal-actions,
  .modal-buttons,
  .modal__footer,
  [data-modal-footer]
) {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 0 max(20px, env(safe-area-inset-bottom));
  margin-top: 16px;
  background: inherit;
}

/* Full-screen backdrops must not clip the scrollable dialog at short heights. */
#app :where(.modal-overlay, .modal-backdrop, .custom-modal-overlay) {
  max-height: 100vh;
  max-height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  #app :where(
    .modal-content,
    .modal-dialog,
    .modal-card,
    .custom-modal-card,
    .modal-container,
    [role="dialog"],
    dialog[open]
  ) {
    width: min(100% - 16px, 620px);
    max-width: 100%;
    max-height: 90vh !important;
    max-height: 90dvh !important;
    margin-inline: auto;
    padding-bottom: max(20px, env(safe-area-inset-bottom)) !important;
  }

  #app :where(.modal-footer, .modal-actions, .modal-buttons, .modal__footer, [data-modal-footer]) {
    gap: 8px;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
}


/* Customer marketplace: consistent image-led cards across Packages, Hotels and Taxis. */
#customer-pkg-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    align-items: stretch;
    gap: 22px;
}
#customer-pkg-list > .marketplace-card,
#customer-pkg-list > .result-card {
    min-width: 0;
    height: 100%;
}
#customer-pkg-list .marketplace-card-media {
    height: 190px;
    min-height: 190px;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(135deg, #dbeafe 0%, #e7f7ef 52%, #fff0df 100%);
    color: #176b58;
}
#customer-pkg-list .marketplace-card-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
#customer-pkg-list .marketplace-package-media {
    flex-direction: column;
    gap: 8px;
    background:
        radial-gradient(circle at 82% 18%, rgba(255,255,255,.8) 0 7%, transparent 7.5%),
        linear-gradient(145deg, #dceef5 0%, #e9f5e9 48%, #ffe7c9 100%);
}
#customer-pkg-list .marketplace-package-media span:first-child {
    font-size: 54px;
    filter: drop-shadow(0 8px 10px rgba(32,76,69,.15));
}
#customer-pkg-list .marketplace-package-media span:last-child {
    max-width: 90%;
    color: #244d49;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
    text-shadow: 0 1px 0 rgba(255,255,255,.7);
}
#customer-pkg-list .marketplace-card-content {
    flex: 1 1 auto;
    min-width: 0;
}
#customer-pkg-list .result-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e7edf0 !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 24px rgba(20,45,60,.07) !important;
}
#customer-pkg-list .result-card > .marketplace-card-content,
#customer-pkg-list .result-card > div:not(.marketplace-card-media) {
    min-width: 0;
}
#customer-pkg-list .result-card button {
    min-height: 46px;
}
.marketplace-confirmation-overlay {
    position: fixed;
    inset: 0;
    z-index: 100020;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
    background: rgba(15, 23, 42, .72);
    backdrop-filter: blur(5px);
}
.marketplace-confirmation-card {
    width: min(520px, 100%);
    max-height: min(90vh, 760px);
    overflow-y: auto;
    box-sizing: border-box;
    padding: clamp(22px, 4vw, 32px);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(15,23,42,.28);
    color: #183548;
}
.marketplace-confirmation-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #e8f7ee;
    color: #16834a;
    font-size: 30px;
    font-weight: 900;
}
.marketplace-confirmation-card h2 { margin: 18px 0 8px; font-size: 22px; }
.marketplace-confirmation-card > p { color: #64748b; line-height: 1.6; }
.marketplace-confirmation-details { margin: 20px 0; display: grid; gap: 0; }
.marketplace-confirmation-details > div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 11px 0;
    border-bottom: 1px solid #edf1f4;
}
.marketplace-confirmation-details dt { color: #64748b; font-size: 13px; }
.marketplace-confirmation-details dd { margin: 0; text-align: right; font-size: 13px; font-weight: 800; overflow-wrap: anywhere; }
.marketplace-confirmation-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.marketplace-confirmation-actions button {
    flex: 1 1 160px;
    min-height: 46px;
    padding: 11px 16px;
    border: 0;
    border-radius: 11px;
    background: #087f5b;
    color: #fff;
    font-weight: 800;
}
.marketplace-confirmation-actions button.secondary {
    background: #f1f5f9;
    color: #34495a;
}
@media (max-width: 560px) {
    #customer-pkg-list { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    #customer-pkg-list .marketplace-card-media { height: 180px; min-height: 180px; }
    .marketplace-confirmation-details > div { align-items: flex-start; }
}


/* Ensure the marketplace's inline base grid stays responsive on narrow screens. */
#customer-pkg-list {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)) !important;
    gap: 22px !important;
}
@media (max-width: 560px) {
    #customer-pkg-list {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 16px !important;
    }
}


/* Customer Popular Packages: three-column desktop grid, matching taxi listing density. */
#customer-pkg-list {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    align-items: stretch;
}
#customer-pkg-list > .toursetu-package-card {
    width: 100%;
    min-width: 0;
    min-height: 100%;
}
#customer-pkg-list > .toursetu-package-card .marketplace-card-media {
    height: 170px;
    min-height: 170px;
}
#customer-pkg-list > .toursetu-package-card .marketplace-card-content {
    padding: 18px !important;
}
#customer-pkg-list > .toursetu-package-card .marketplace-card-content h3 {
    font-size: 17px;
    line-height: 1.35;
}
#customer-pkg-list > .toursetu-package-card .marketplace-card-content > div {
    overflow-wrap: anywhere;
}
@media (max-width: 980px) {
    #customer-pkg-list {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}
@media (max-width: 560px) {
    #customer-pkg-list {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 16px !important;
    }
    #customer-pkg-list > .toursetu-package-card .marketplace-card-media {
        height: 180px;
        min-height: 180px;
    }
}

/* Make hotel cancellation-policy consent controls easy to see and tap. */
#modal-agree-terms,
#hotel-cancel-policy-check {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    min-height: 18px;
    flex: 0 0 18px;
    margin: 2px 0 0 !important;
    cursor: pointer;
    accent-color: #087f5b;
}
#modal-agree-terms:focus-visible,
#hotel-cancel-policy-check:focus-visible {
    outline: 3px solid rgba(8,127,91,.28);
    outline-offset: 3px;
}


/* Explicit customer agency-package layout: mirror the compact independent-taxi grid.
   The view marker is set by renderPackageCards(), preventing other marketplace tabs
   from inheriting these dimensions. */
#app #customer-pkg-list[data-view="agency-packages"] {
    display: grid !important;
    width: 100% !important;
    max-width: none !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    gap: 20px !important;
}
#app #customer-pkg-list[data-view="agency-packages"] > article.toursetu-package-card {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 100% !important;
    margin: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}
#app #customer-pkg-list[data-view="agency-packages"] > article.toursetu-package-card > .marketplace-card-media {
    flex: 0 0 158px !important;
    height: 158px !important;
    min-height: 158px !important;
    max-height: 158px !important;
}
#app #customer-pkg-list[data-view="agency-packages"] > article.toursetu-package-card > .marketplace-card-content {
    display: flex;
    flex: 1 1 auto !important;
    flex-direction: column;
    min-width: 0;
    padding: 16px !important;
}
#app #customer-pkg-list[data-view="agency-packages"] > article.toursetu-package-card .marketplace-card-content h3 {
    font-size: 16px !important;
    line-height: 1.35 !important;
    overflow-wrap: anywhere;
}
#app #customer-pkg-list[data-view="agency-packages"] > article.toursetu-package-card .marketplace-card-content button {
    min-height: 40px !important;
    padding: 9px 12px !important;
    font-size: 12px !important;
    letter-spacing: .04em;
}
@media (max-width: 760px) {
    #app #customer-pkg-list[data-view="agency-packages"] {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 16px !important;
    }
}
@media (max-width: 520px) {
    #app #customer-pkg-list[data-view="agency-packages"] {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 14px !important;
    }
    #app #customer-pkg-list[data-view="agency-packages"] > article.toursetu-package-card > .marketplace-card-media {
        flex-basis: 180px !important;
        height: 180px !important;
        min-height: 180px !important;
        max-height: 180px !important;
    }
}


/* Cross-page desktop and mobile overflow protection for public and authenticated views. */
@media (min-width:1024px) {
  html, body { width:100%; max-width:100%; }
  #app.ts-dashboard-active, body.ts-dashboard-active #app { width:100% !important; max-width:100vw !important; }
  #app.ts-dashboard-active > [data-ts-dashboard-root] { width:100% !important; max-width:none !important; }
  #app :where(.dashboard-grid,.cards-grid,.stats-grid,.stat-grid,.panel-grid,.driver-grid) {
    grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));
  }
}
@media (max-width:768px) {
  html, body { max-width:100%; overflow-x:clip; }
  #app.ts-dashboard-active, body.ts-dashboard-active #app { width:100% !important; max-width:100vw !important; }
  #app.ts-dashboard-active > [data-ts-dashboard-root] { width:100% !important; max-width:100% !important; }
  #app :where(.dashboard-grid,.cards-grid,.stats-grid,.stat-grid,.panel-grid,.driver-grid,.search-grid,.filter-grid,.form-grid) {
    grid-template-columns:minmax(0,1fr) !important;
  }
  #app :where(.dashboard-header,.section-header,.toolbar,.filter-bar,.search-bar,.form-actions) {
    min-width:0; flex-wrap:wrap; gap:10px;
  }
  #app :where(.card,.panel,.stat-card,.dashboard-card) { min-width:0; max-width:100%; overflow-wrap:anywhere; }
  #app :where(table) { display:block; width:100%; max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
  #app :where(img,video,canvas,svg,iframe) { max-width:100%; }
}
