/* Last-loaded mobile geometry. Presentation only; hidden/permission states stay authoritative. */
@media (max-width: 768px) {
  html body:not(.wp-admin) { --rj-mobile-gap:8px; --rj-mobile-inset:12px; }
  html body:not(.wp-admin)>main { min-inline-size:0; padding-inline:12px; }
  html body:not(.wp-admin) :is(.rj-search,.rj-workspace,.rj-mg-panel,.rj-my-bookings,.rj-vault,.rj-member-admin,.rj-self,.rj-self-service,.rj-access-admin,.rjm) { min-inline-size:0; max-inline-size:100%; box-sizing:border-box; }
  html body:not(.wp-admin) :is(.rj-mg-form,.rj-my-range,.rj-member-filter,.rj-builder-fields,.rj-fields,.rj-record-ticket-options,.rj-ticket-scope)>* { min-inline-size:0; max-inline-size:100%; box-sizing:border-box; }
  html body:not(.wp-admin) :is(.rj-record-native,.rj-mg-result pre,.rj-passenger-bank-source) { max-inline-size:100%; overflow:auto; }

  /* Ordinary action rows wrap; tables and calendars keep their own scrolling and grid. */
  html body:not(.wp-admin) :is(main,dialog,#rj-workspace-records) :is(.rj-builder-buttons,.rj-penalty-actions,.rj-api-manifest-buttons,.rj-dc-actions,.rj-member-actions,.rj-member-sign-actions,.rj-flight-actions,.rj-bag-actions,.rj-bag-receipt-actions,.rj-bag-result-actions,.rj-bag-toolbar,.rj-cs-actions,.rj-dc-share-tools,.rj-er-actions,.rj-er-choices,.rj-flight-share-actions,.rj-nc-actions,.rj-passenger-bank-row-actions,.rj-passenger-bank-tools,.rj-passenger-review-actions,.rj-passenger-review-toolbar,.rj-pc-actions,.rj-r-bank-actions,.rj-r-result-actions,.rj-r-ssr-tools,.rj-record-actions,.rj-record-ticket-tools,.rj-record-tools,.rj-ticket-exports,.wait-actions) {
    display:flex!important; flex-wrap:wrap!important; align-items:stretch!important;
    gap:8px!important; overflow:visible!important; min-inline-size:0!important; max-inline-size:100%!important;
  }
  html body:not(.wp-admin) :is(main,dialog,#rj-workspace-records) [data-rj-ui-action]:not([hidden]) {
    box-sizing:border-box!important; min-inline-size:0!important; max-inline-size:100%!important;
    min-block-size:44px!important; min-height:44px!important; block-size:auto!important; height:auto!important;
    max-block-size:none!important; max-height:none!important; padding:10px 12px!important;
    white-space:normal!important; overflow-wrap:anywhere!important; word-break:normal!important; line-height:1.45!important;
  }
  html body:not(.wp-admin) :is(main,dialog,#rj-workspace-records) [data-rj-ui-caption]::after {
    min-inline-size:0; white-space:normal!important; overflow-wrap:anywhere!important; line-height:1.45!important;
  }
  html body:not(.wp-admin) :is(main,dialog,#rj-workspace-records) :is(.rj-builder-buttons,.rj-penalty-actions,.rj-api-manifest-buttons,.rj-dc-actions,.rj-member-actions,.rj-member-sign-actions,.rj-bag-actions,.rj-bag-receipt-actions,.rj-bag-result-actions,.rj-bag-toolbar,.rj-cs-actions,.rj-dc-share-tools,.rj-er-actions,.rj-er-choices,.rj-nc-actions,.rj-passenger-bank-row-actions,.rj-passenger-bank-tools,.rj-passenger-review-actions,.rj-passenger-review-toolbar,.rj-pc-actions,.rj-r-bank-actions,.rj-r-ssr-tools,.rj-record-actions,.rj-record-ticket-tools,.rj-record-tools,.rj-ticket-exports,.wait-actions)>:is(button,a.button,[data-rj-ui-action]):not([hidden]) {
    flex:1 1 128px!important; inline-size:auto!important; width:auto!important; margin-inline:0!important;
  }
  /* Icon-only controls remain deliberate, compact touch targets, with existing accessible names. */
  html body:not(.wp-admin) :is(main,dialog,#rj-workspace-records) [data-rj-ui-icon-only]:not([hidden]),
  html body:not(.wp-admin) .rj-flight .rj-flight-actions>[data-rj-ui-icon-only]:not([hidden]) {
    flex:0 0 44px!important; inline-size:44px!important; width:44px!important;
    min-inline-size:44px!important; min-width:44px!important; max-inline-size:44px!important; max-width:44px!important;
    block-size:44px!important; height:44px!important; min-block-size:44px!important; min-height:44px!important;
    padding:0!important;
  }
  html body:not(.wp-admin) :is(dialog,[role=dialog],#rj-workspace-records) button[data-rj-ui-icon-only=close]:not([hidden]) {
    flex:0 0 44px!important; inline-size:44px!important; width:44px!important; min-inline-size:44px!important; min-width:44px!important;
    max-inline-size:44px!important; max-width:44px!important; block-size:44px!important; height:44px!important;
    min-block-size:44px!important; min-height:44px!important; max-height:44px!important; padding:0!important;
  }

  /* Explicit portal dialogs only: a stable header and an independently scrollable content area. */
  html body:not(.wp-admin) :is(dialog.rj-reservation,dialog.rj-flight-share-dialog,dialog.rj-bag-dialog,dialog.rj-coupon-modal,dialog.rj-date-change-modal,dialog.rj-email-recipient,dialog.rj-api-manifest-dialog,dialog.rj-nc-dialog,dialog.rj-passenger-bank-modal,dialog.rj-passenger-review-modal,dialog.rj-upgrade,dialog.rj-passport-correction-modal,dialog.rj-flight-picker,dialog.rj-pnr-dialog,dialog.rj-penalty-share-dialog,dialog.rjm-share-dialog,dialog.rj-note-dialog)[open] {
    display:flex!important; flex-direction:column!important; box-sizing:border-box!important;
    inline-size:calc(100% - 16px)!important; width:calc(100% - 16px)!important;
    min-inline-size:0!important; max-inline-size:calc(100% - 16px)!important; max-width:calc(100% - 16px)!important;
    max-block-size:calc(100dvh - 16px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px))!important;
    max-height:calc(100dvh - 16px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px))!important;
    inset:0!important; transform:none!important; margin:auto!important; padding:0!important; overflow:hidden!important; border-radius:14px!important;
  }
  html body:not(.wp-admin) :is(dialog,[role=dialog]) :is(.rj-r-body,.rj-bag-body,.rj-cs-body,#rj-date-change,.rj-er-body,.rj-api-manifest-body,.rj-nc-body,.rj-passenger-bank-body,.rj-passenger-review-body,.rj-upgrade-body,.rj-pc-body,.rj-picker-rows,.rj-pnr-detail,.rj-note-body) {
    box-sizing:border-box!important; flex:1 1 auto; min-block-size:0; min-inline-size:0; max-inline-size:100%;
    overflow:auto; overscroll-behavior:contain; padding:12px!important; scroll-padding-block:12px;
  }
  html body:not(.wp-admin) :is(dialog.rj-reservation,dialog.rj-flight-share-dialog,dialog.rj-bag-dialog,dialog.rj-coupon-modal,dialog.rj-date-change-modal,dialog.rj-email-recipient,dialog.rj-api-manifest-dialog,dialog.rj-nc-dialog,dialog.rj-passenger-bank-modal,dialog.rj-passenger-review-modal,dialog.rj-upgrade,dialog.rj-passport-correction-modal,dialog.rj-flight-picker,dialog.rj-pnr-dialog,dialog.rj-penalty-share-dialog,dialog.rjm-share-dialog,dialog.rj-note-dialog)>:is(header,.rj-dc-header) {
    box-sizing:border-box!important; position:relative!important; inset:auto!important; flex:0 0 auto!important;
    display:flex!important; align-items:center!important; justify-content:space-between!important; gap:8px!important;
    padding:10px 12px!important; min-inline-size:0; z-index:2;
  }
  html body:not(.wp-admin) :is(dialog,[role=dialog]) :is(header,.rj-dc-header)>:is(h2,h3) {
    min-inline-size:0!important; flex:1 1 auto; margin:0!important; font-size:17px!important; line-height:1.5!important; overflow-wrap:anywhere;
  }
  html body:not(.wp-admin) :is(dialog,[role=dialog]) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea) {
    box-sizing:border-box; min-inline-size:0; max-inline-size:100%;
  }
  html body:not(.wp-admin) :is(dialog,[role=dialog]) :is(.rj-r-grid,.rj-nc-grid,.rj-pc-fields,.rj-cs-fields,.rj-passenger-bank-grid,.rj-api-manifest-fields,.rj-bag-grid) { grid-template-columns:minmax(0,1fr)!important; }
  html body:not(.wp-admin) :is(.rj-r-summary,.rj-nc-ticket,.rj-pc-summary,.rj-dc-reference,.rj-passenger-review-pnr) { overflow-wrap:anywhere; }
  html body:not(.wp-admin) :is(dialog,#rj-workspace-records) :is(.rj-r-footer,.rj-r-result-actions,.rj-flight-share-actions),
  html body:not(.wp-admin) :is(dialog,#rj-workspace-records):is(.rjm-share-dialog,.rj-penalty-share-dialog)>footer {
    box-sizing:border-box!important; flex:0 0 auto!important; display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important; gap:8px!important;
    padding:10px 12px calc(10px + env(safe-area-inset-bottom,0px))!important;
    margin:0!important; inline-size:100%!important; min-inline-size:0!important; overflow:visible!important;
    background:#f5f9fb; border-block-start:1px solid #d7e6ed; align-items:stretch!important;
  }
  html body:not(.wp-admin) :is(dialog,#rj-workspace-records) .rj-r-footer { grid-template-columns:repeat(2,minmax(0,1fr))!important; position:sticky; inset-block-end:-12px; z-index:1; }
  html body:not(.wp-admin) :is(dialog,#rj-workspace-records) :is(.rj-r-footer,.rj-r-result-actions,.rj-flight-share-actions):has(>button:not([hidden])~button:not([hidden])):not(:has(>button:not([hidden])~button:not([hidden])~button:not([hidden]))) { grid-template-columns:repeat(2,minmax(0,1fr))!important; }
  html body:not(.wp-admin) :is(dialog,#rj-workspace-records) :is(.rj-r-footer,.rj-r-result-actions,.rj-flight-share-actions):not(:has(>button:not([hidden])~button:not([hidden]))) { grid-template-columns:minmax(0,1fr)!important; }
  html body:not(.wp-admin) :is(dialog,#rj-workspace-records) :is(.rj-r-footer,.rj-r-result-actions,.rj-flight-share-actions)>button:not([hidden]),
  html body:not(.wp-admin) :is(dialog,#rj-workspace-records):is(.rjm-share-dialog,.rj-penalty-share-dialog)>footer>button:not([hidden]) {
    box-sizing:border-box!important; flex:initial!important; order:initial!important; inline-size:100%!important; width:100%!important;
    min-inline-size:0!important; min-width:0!important; max-inline-size:none!important; max-width:none!important;
    block-size:auto!important; height:auto!important; min-block-size:48px!important; min-height:48px!important;
    max-block-size:none!important; max-height:none!important; margin:0!important; padding:8px 6px!important;
    white-space:normal!important; overflow-wrap:anywhere!important; line-height:1.45!important;
  }
  /* Sharing dialogs show the full action captions; retain compact icons elsewhere. */
  html body:not(.wp-admin) :is(dialog,#rj-workspace-records) .rj-flight-share-actions>button[data-rj-ui-icon-only]:not([hidden]),
  html body:not(.wp-admin) :is(dialog,#rj-workspace-records):is(.rjm-share-dialog,.rj-penalty-share-dialog)>footer>button[data-rj-ui-icon-only]:not([hidden]) {
    font-size:13px!important; line-height:1.45!important; gap:5px!important; overflow:visible!important;
  }
  html body:not(.wp-admin) .rj-flight-share-dialog>.rj-flight-share-text { flex:1 1 auto; min-block-size:64px; overflow:auto; max-inline-size:calc(100% - 24px); margin:8px 12px; padding:12px; }
  html body:not(.wp-admin) .rj-flight-share-dialog>.rj-flight-share-notice { flex:0 0 auto; margin:8px 12px; font-size:13px; line-height:1.6; }
  html body:not(.wp-admin) .rjm-share-dialog>textarea { box-sizing:border-box; flex:1 1 auto; min-block-size:100px; inline-size:calc(100% - 24px); width:calc(100% - 24px); margin:12px; resize:none; }
  html body:not(.wp-admin) :is(dialog,#rj-workspace-records).rjm-share-dialog>footer { grid-template-columns:repeat(2,minmax(0,1fr))!important; }
  html body:not(.wp-admin) .rj-penalty-share-dialog>textarea { flex:1 1 auto; min-block-size:60px; max-block-size:50dvh; margin:0 12px; inline-size:calc(100% - 24px); resize:none; }
  html body:not(.wp-admin) .rj-penalty-share-dialog>:is(h3,p) { flex:0 0 auto; margin:8px 12px; line-height:1.5; }
  html body:not(.wp-admin) .rj-penalty-share-dialog>button { align-self:flex-end; margin:8px 12px!important; flex-shrink:0!important; }
  html body:not(.wp-admin) :is(.rj-r-result-actions,.rj-flight-share-actions,dialog.rjm-share-dialog>footer,dialog.rj-penalty-share-dialog>footer)>:is(p,span):not([hidden]) { grid-column:1/-1; overflow-wrap:anywhere; }
  html body:not(.wp-admin) :is(.rj-bag-actions,.rj-cs-actions,.rj-pc-actions,.rj-nc-actions,.rj-passenger-review-actions) { position:sticky; inset-block-end:-12px; z-index:1; background:#fff; padding-block:10px!important; border-block-start:1px solid #d7e6ed; }

  /* Record lookup and search keep the primary lookup compact, with full-width fields. */
  html body:not(.wp-admin) #rj-workspace-records .rj-record-header:has(#rj-record-reference) .rj-ticket-find,
  html body:not(.wp-admin) #rj-workspace-records .rj-record-header:has(#rj-record-reference) .rj-record-lookup-form { display:flex!important; flex-wrap:wrap!important; overflow:visible!important; inline-size:100%!important; min-inline-size:0!important; }
  html body:not(.wp-admin) #rj-workspace-records .rj-record-header:has(#rj-record-reference) :is(.rj-ticket-find,.rj-record-lookup-form)>label { flex:1 1 100%!important; width:100%!important; inline-size:100%!important; min-width:0!important; }
  html body:not(.wp-admin) #rj-workspace-records .rj-record-header:has(#rj-record-reference) :is(.rj-ticket-find,.rj-record-lookup-form)>button[data-rj-ui-action]:not([hidden]) { flex:1 1 120px!important; width:auto!important; inline-size:auto!important; min-width:0!important; }
  html body:not(.wp-admin) #rj-workspace-records .rj-record-header:has(#rj-record-reference) { display:grid!important; grid-template-columns:repeat(2,minmax(0,1fr))!important; gap:8px!important; overflow:visible!important; }
  html body:not(.wp-admin) #rj-workspace-records .rj-record-header:has(#rj-record-reference) .rj-record-lookup-form { display:grid!important; grid-template-columns:minmax(0,1fr) 48px!important; grid-column:1/-1!important; align-items:end!important; }
  html body:not(.wp-admin) #rj-workspace-records .rj-record-header:has(#rj-record-reference) .rj-ticket-find { display:grid!important; grid-template-columns:repeat(2,minmax(0,1fr))!important; grid-column:1/-1!important; }
  html body:not(.wp-admin) #rj-workspace-records .rj-record-header:has(#rj-record-reference) .rj-ticket-find>button[data-rj-ui-action]:not([hidden]) { inline-size:100%!important; width:100%!important; max-width:100%!important; max-inline-size:100%!important; }
  html body:not(.wp-admin) #rj-workspace-records .rj-record-header:has(#rj-record-reference) .rj-record-ticket-options:not([hidden]) { display:flex!important; grid-column:1/-1!important; min-inline-size:0; }
  html body:not(.wp-admin) #rj-workspace-records .rj-record-header:has(#rj-record-reference) .rj-ticket-amount-toggle:not([hidden]) { inline-size:100%!important; width:100%!important; min-inline-size:0!important; }
  html body:not(.wp-admin) #rj-workspace-records .rj-record-header:has(#rj-record-reference) .rj-record-lookup-form>button[data-rj-ui-icon-only=search]:not([hidden]),
  html body:not(.wp-admin) .rj-search #rj-search-form .rj-search-action .rj-submit[data-rj-ui-icon-only=search] {
    flex:0 0 48px!important; width:48px!important; inline-size:48px!important; min-width:48px!important; min-inline-size:48px!important;
    max-width:48px!important; max-inline-size:48px!important; height:48px!important; block-size:48px!important;
    min-height:48px!important; max-height:48px!important; margin:0!important; padding:0!important;
  }
  html body:not(.wp-admin) .rj-search #rj-search-form .rj-search-action { min-inline-size:0!important; min-block-size:48px!important; align-self:end; }
  html body:not(.wp-admin) :is(dialog,#rj-workspace-records).rj-reservation .rj-r-contact-toolbar>.rj-r-ticket-toolbar:not([hidden]) {
    display:grid!important; grid-template-columns:repeat(2,minmax(0,1fr))!important; gap:8px!important; inline-size:100%!important;
  }
  html body:not(.wp-admin) :is(dialog,#rj-workspace-records).rj-reservation .rj-r-contact-toolbar .rj-r-ticket-toolbar>.rj-ticket-exports:not([hidden]) { display:contents!important; }
  html body:not(.wp-admin) :is(dialog,#rj-workspace-records).rj-reservation .rj-r-ticket-toolbar>:is(.rj-ticket-amount-toggle,.rj-r-control-share,.rj-r-note) { grid-column:1/-1; inline-size:100%!important; width:100%!important; }
  html body:not(.wp-admin) :is(dialog,#rj-workspace-records).rj-reservation .rj-r-ticket-toolbar .rj-ticket-exports>.rj-ticket-scope { grid-column:1/-1; min-inline-size:0; }
  html body:not(.wp-admin) :is(dialog,#rj-workspace-records).rj-reservation .rj-r-ticket-toolbar .rj-ticket-exports>[data-ticket-export]:not([hidden]) {
    inline-size:100%!important; width:100%!important; max-inline-size:100%!important; max-width:100%!important; min-inline-size:0!important;
    min-height:44px!important; height:auto!important; max-height:none!important; font-size:13px!important; line-height:1.45!important; padding:10px!important;
  }
  html body:not(.wp-admin) .rj-api-manifest-dialog .rj-manifest-recipient-chip>.rj-manifest-recipient-remove {
    flex:0 0 44px!important; width:44px!important; min-width:44px!important; max-width:44px!important; height:44px!important; min-height:44px!important; padding:0!important;
  }
  html body:not(.wp-admin) :is(.rj-my-range,.rj-member-filter) { display:flex!important; flex-wrap:wrap!important; overflow:visible!important; }
  html body:not(.wp-admin) :is(.rj-my-range,.rj-member-filter)>label { flex:1 1 180px!important; }
  html body:not(.wp-admin) :is(.rj-my-range,.rj-member-filter)>button { flex:1 1 120px!important; }
  html body:not(.wp-admin) :is(.rj-city-dialog,.rj-pax-dialog) { box-sizing:border-box; max-inline-size:calc(100% - 16px)!important; max-block-size:calc(100dvh - 16px)!important; overflow:auto; }
  html body:not(.wp-admin) .rj-pax-dialog .rj-counter>button { min-inline-size:44px!important; min-block-size:44px!important; }
  html body:not(.wp-admin) .rj-city-dialog .rj-city-option { min-block-size:44px!important; height:auto!important; white-space:normal!important; }
  html body:not(.wp-admin) .rj-city-dialog .rj-city-option>span { white-space:normal!important; }
  html body:not(.wp-admin) .rj-search #rj-search-form .rj-date-row { grid-template-columns:44px minmax(0,1fr) 44px!important; }
  html body:not(.wp-admin) .rj-search #rj-search-form .rj-date-row>.rj-day-step { inline-size:44px!important; width:44px!important; min-inline-size:44px!important; max-inline-size:44px!important; max-width:44px!important; min-block-size:44px!important; }
  html body:not(.wp-admin) :is(.rj-access-admin .rj-access-save,.rj-email-recipient .rj-er-cancel) { min-block-size:44px!important; min-height:44px!important; }
  html body:not(.wp-admin) :is(.rj-access-admin button,.rj-access-admin .rj-access-choice select,.rj-access-admin .rj-access-tabs a) { box-sizing:border-box; min-block-size:44px!important; height:auto!important; white-space:normal!important; overflow-wrap:anywhere; }
  html body:not(.wp-admin) .rj-access-admin .rj-access-role-check { min-block-size:44px; }
  html body:not(.wp-admin) :is(.rj-self-actions,.rj-ar-actions,.rj-ar-toolbar,.rj-note-filters,.rjm-controls) { display:flex; flex-wrap:wrap; gap:8px; min-inline-size:0; }
  html body:not(.wp-admin) :is(.rj-self-actions,.rj-ar-actions,.rj-note-filters,.rjm-controls)>:is(button,a):not([hidden]) { flex:1 1 120px; min-inline-size:0; max-inline-size:100%; box-sizing:border-box; min-block-size:44px; white-space:normal; overflow-wrap:anywhere; }
  html body:not(.wp-admin)>.rj-site-header #rj-header-nav .rj-header-menu .rj-account-menu-items :is(a.button,button):not([hidden]) {
    block-size:auto!important; height:auto!important; min-block-size:44px!important; min-height:44px!important;
    max-block-size:none!important; max-height:none!important; white-space:normal!important; overflow-wrap:anywhere!important;
  }
  html body:not(.wp-admin)>.rj-site-header #rj-header-nav .rj-header-menu [data-rj-ui-caption]::after { min-inline-size:0; white-space:normal!important; overflow-wrap:anywhere!important; }
  html body:not(.wp-admin)>.rj-site-header #rj-header-nav .rj-header-menu>.rj-account-menu-items>.rj-header-language { grid-column:1/-1; }
  html body:not(.wp-admin) :is(main,dialog,#rj-workspace-records) [hidden][hidden] { display:none!important; }
}


/* WebKit can include a native select's long option label in its parent scroll width.
   Clip only that label wrapper; keep focus outlines and the native picker intact. */
@media(max-width:768px){html body:not(.wp-admin) :is(.rj-access-picker>label,.rj-ticket-scope){overflow:clip;overflow-clip-margin:6px}html body:not(.wp-admin) :is(.rj-access-picker>label,.rj-ticket-scope) select:focus-visible{outline-offset:-3px}}

/* The print-only completion dialog follows the same balanced mobile action grid. */
@media(max-width:768px){html body:not(.wp-admin) dialog.rj-ticket-print-modal{max-block-size:calc(100dvh - 16px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px))!important}html body:not(.wp-admin) dialog.rj-ticket-print-modal>footer{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch}html body:not(.wp-admin) dialog.rj-ticket-print-modal>footer>button:not([hidden]){align-self:stretch!important;inline-size:100%!important;width:100%!important;margin:0!important}}
