/* G rates catalog (agent catalog lists + detail views) and the quote builder skin. Loads after g-base.css.
   Components (.tabs, .catalog, .filters, .results, .rate-card, .price, .avail) come from g-base.css;
   this file places them in the WordPress pages and restyles the legacy builder markup that app.js drives. */

/* ---------- Catalog page frame ---------- */
.g-cat { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.g-cat-content { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.g-cat-tabsrow { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; min-width: 0; }
.g-cat-tabsrow .tabs { max-width: 100%; min-width: 0; flex: 0 1 auto; }
.g-page :is(a, button).btn-primary .i { color: #fff; }
.g-cat-note { font-size: var(--fs-md); }

/* Filter panel (form fields keep their legacy names; select2 enhances the destination select). */
.g-cat-filters .g-cat-filters-h { font-size: 15px; font-weight: 700; }
.g-cat-filters .f-chev { flex: none; }
.g-cat-filters .filters-body { margin-top: 14px; }
.g-cat-filters .field > span:first-child { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.g-cat-filters .select2-container { width: 100% !important; }
.g-cat-search { position: relative; display: block; }
.g-cat-search .i { position: absolute; left: 11px; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.g-cat-search .input { width: 100%; padding-left: 34px; }
.g-cat-filters .input, .g-cat-filters .select { width: 100%; }
.g-cat-filter-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.g-cat-filter-acts .btn-primary { flex: 1 1 auto; justify-content: center; }

/* Select2 single selects in G field style (filters and quote builder). */
:is(.g-cat-filters, .dtt-reference-builder) .select2-container--default .select2-selection--single { height: 40px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); display: flex; align-items: center; }
:is(.g-cat-filters, .dtt-reference-builder) .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 38px; padding-left: 12px; padding-right: 30px; color: var(--ink); font-size: var(--fs-md); font-weight: 500; }
:is(.g-cat-filters, .dtt-reference-builder) .select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--muted); }
:is(.g-cat-filters, .dtt-reference-builder) .select2-container--default .select2-selection--single .select2-selection__arrow { height: 38px; right: 6px; }
:is(.g-cat-filters, .dtt-reference-builder) .select2-container--focus .select2-selection--single,
:is(.g-cat-filters, .dtt-reference-builder) .select2-container--open .select2-selection--single { border-color: var(--emerald-600); box-shadow: var(--focus); }

/* Results */
.g-cat-results { min-width: 0; }
.g-cat-results-head { margin-bottom: 12px; min-height: 36px; }
.g-cat-count { font-size: var(--fs-md); font-weight: 700; color: var(--ink); }
.g-cat .rate-card .thumb { background-color: var(--mint-100); }
.g-cat .rate-card:hover { border-color: var(--mint-400); }
.g-cat-title { color: inherit; text-decoration: none; }
.g-cat-title:hover { color: var(--emerald-700); text-decoration: underline; text-underline-offset: 3px; }
.g-cat-title:focus-visible { outline: 2px solid var(--emerald-600); outline-offset: 2px; border-radius: 4px; }
.g-cat-place { margin-top: 3px; }
.g-cat-foot-end { display: grid; gap: 8px; justify-items: end; }
.g-cat-acts { display: flex; gap: 6px; }
.g-cat .avail.g-bad { color: var(--bad-fg); }
.g-cat .rate-foot .price { min-width: 0; }
.g-cat .rate-foot .price small { white-space: normal; }
/* dtt_b2b_money() figures: smaller "PHP" code, amount on one line. */
:is(.g-cat, .g-cat-detail-aside) .price { white-space: nowrap; }
.g-cat .g-cat-foot-end { min-width: 0; }
.g-cat .rate-foot .avail { white-space: normal; }
.price .cur { font-size: .62em; font-weight: 600; color: var(--muted); letter-spacing: 0; }

/* Legacy pagination as the G pager */
.g-cat .dtt-pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 16px 2px 0; margin: 0; font-size: var(--fs-sm); color: var(--muted); background: none; border: 0; box-shadow: none; }
.g-cat .dtt-pagination-links { display: flex; gap: 4px; flex-wrap: wrap; }
.g-cat .dtt-pagination-links a { min-width: 34px; height: 34px; padding: 0 10px; display: inline-grid; place-items: center; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: var(--fs-sm); box-shadow: none; }
.g-cat .dtt-pagination-links a.is-active { background: var(--emerald-700); border-color: var(--emerald-700); color: #fff; }
.g-cat .dtt-pagination-links a:hover:not(.is-active) { background: var(--mint-50); border-color: var(--mint-400); }

@media (max-width: 820px) {
  .g-cat-note { font-size: var(--fs-sm); }
  .g-cat-filters { padding: 14px 16px; }
  .g-cat-results-head { min-height: 0; }
}

/* .g-page resets give buttons and links `color: inherit` (0,1,1), which beats .btn colours: restore them here. */
.g-page :is(a, button).btn { color: var(--ink); }
.g-page :is(a, button).btn-primary { color: #fff; }
.g-page :is(a, button).btn-ghost { color: var(--emerald-700); }

/* ---------- Detail views ---------- */
.g-cat-detail { display: grid; gap: 14px; min-width: 0; }
.g-cat-detail .breadcrumb .i { width: 16px; height: 16px; }
.g-cat-detail-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.g-cat-detail-title { font-size: var(--fs-2xl); font-weight: 700; line-height: 1.15; }
.g-cat-detail-head .meta { margin-top: 4px; white-space: normal; }
.g-cat-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.g-cat-detail-main { display: grid; gap: 16px; min-width: 0; }
.g-cat-detail-sec .card-head { align-items: center; }
.g-cat-detail-sec .card-head > .i { width: 22px; height: 22px; margin: 0; }
.g-cat-detail-sec .card-head h3 { font-size: var(--fs-lg); }
.g-cat-detail-media { padding: 12px; }
.g-cat-hero { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 10px; }
.g-cat-hero.is-single { grid-template-columns: 1fr; }
.g-cat-hero-img { aspect-ratio: 16 / 8; border-radius: var(--r-md); }
.g-cat-hero .dtt-photo-thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; margin: 0; }
.g-cat .dtt-photo-thumbs img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 8px; margin: 0; }
.g-cat .dtt-photo-thumb-link { display: block; border-radius: 8px; }
.g-cat .dtt-photo-thumb-link:focus-visible { outline: 2px solid var(--emerald-600); outline-offset: 2px; }
.g-cat-kv { grid-template-columns: 150px minmax(0, 1fr); font-size: var(--fs-md); }
.g-cat-kv dd { overflow-wrap: anywhere; }
.g-cat-text { font-size: var(--fs-md); line-height: 1.6; color: var(--ink-2); max-width: 75ch; }
.g-cat-table .cell-sub { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.g-cat-table td { white-space: normal; }
.g-cat-table .dtt-photo-thumbs { display: flex; gap: 6px; }
.g-cat-table .dtt-photo-thumbs img { width: 48px; }
.g-cat-detail-aside { position: sticky; top: calc(var(--topbar-h) + 16px); display: grid; gap: 12px; }
.g-cat-detail-aside .price { font-size: 28px; }
.g-cat-detail-aside .price small { font-size: 13px; }
.g-cat-detail-acts { display: grid; gap: 8px; }
.g-cat-detail-acts > *, .g-cat-detail-acts .dtt-ferry-inquiry-detail-action > a { width: 100%; }
.g-cat-detail-note { font-size: var(--fs-sm); }
/* Legacy buttons placed in the aside (PDF download, ferry Inquire) in G button style. */
body .g-cat-detail-acts a.dtt-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; min-height: 40px; padding: 0 16px; margin: 0; border-radius: var(--r-md); border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); font: 600 var(--fs-md)/1 var(--font-text); box-shadow: none; text-decoration: none; }
body .g-cat-detail-acts a.dtt-button:hover { background: var(--mint-50); border-color: var(--mint-400); }
body .g-cat-detail-acts a.dtt-button.dtt-button-primary { background: var(--emerald-700); border-color: var(--emerald-700); color: #fff; }
body .g-cat-detail-acts a.dtt-button.dtt-button-primary:hover { background: var(--emerald-800); }
.g-cat-detail-acts .dtt-ui-icon { width: 18px; height: 18px; }
.g-cat .dtt-catalog-unpublished { margin: 0; font-size: var(--fs-sm); color: var(--ink-2); }

/* ---------- Ferries: search card + carrier cards (scoped to the agent catalog; the admin list keeps its own) ---------- */
.g-cat .dtt-ferry-search { margin: 0; padding: 16px 18px; gap: 10px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-card); }
.g-cat .dtt-ferry-search .dtt-ferry-search-label { gap: 6px; color: var(--ink-2); font-size: var(--fs-sm); font-weight: 600; }
.g-cat .dtt-ferry-search .dtt-ferry-search-label .dtt-ui-icon { width: 16px; height: 16px; color: var(--muted); }
body.logged-in .g-cat .dtt-ferry-search .dtt-ferry-search-field :is(select, input) { height: 40px; min-height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r-md); color: var(--ink); font-size: var(--fs-md); line-height: 38px; }
body.logged-in .g-cat .dtt-ferry-search .dtt-ferry-search-field select { appearance: none; padding-right: 34px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2333443a' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 10px center / 16px no-repeat; }
body.logged-in .g-cat .dtt-ferry-search .dtt-ferry-search-field :is(select, input):focus { outline: none; border-color: var(--emerald-600); box-shadow: var(--focus); }
.g-cat .dtt-ferry-search .dtt-ferry-search-swap { width: 40px; height: 40px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); color: var(--ink-2); font-size: 18px; }
.g-cat .dtt-ferry-search .dtt-ferry-search-swap:hover { background: var(--mint-50); }
body.logged-in .g-cat .dtt-ferry-search .dtt-ferry-search-submit { height: 40px; min-height: 40px; padding: 0 18px; gap: 8px; border-radius: var(--r-md); border-color: var(--emerald-700); background: var(--emerald-700); font-size: var(--fs-md); font-weight: 600; }
body.logged-in .g-cat .dtt-ferry-search .dtt-ferry-search-submit:hover { background: var(--emerald-800); border-color: var(--emerald-800); }
.g-cat .dtt-ferry-search-submit .dtt-ui-icon { width: 18px; height: 18px; }
.g-cat .dtt-ferry-search-clear { color: var(--emerald-700); font-size: var(--fs-sm); }
.g-cat :is(.dtt-ferry-search, .dtt-ferry-results) :is(a, button, summary, select, input):focus-visible { outline: 2px solid var(--emerald-600); outline-offset: 2px; }
.g-cat .dtt-ferry-results-head { margin: 0 0 12px; padding: 0; align-items: baseline; }
.g-cat .dtt-ferry-results-head h2 { margin: 0 0 2px; font-size: var(--fs-md); font-weight: 700; color: var(--ink); }
.g-cat .dtt-ferry-results-summary { color: var(--ink-2); font-size: var(--fs-sm); font-weight: 500; }
.g-cat .dtt-ferry-result-count { margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.g-cat .dtt-ferry-result-list { gap: 16px; margin: 0; }
/* Carrier card: a header row (logo tile + name) over the route rows; the per-row logo repeat is dropped. */
.g-cat .dtt-ferry-carrier { display: block; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-card); overflow: hidden; }
.g-cat .dtt-ferry-results .dtt-ferry-carrier-brand { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 0; margin: 0; padding: 12px 18px; border: 0; border-bottom: 1px solid var(--border); background: var(--surface-sunk); text-align: left; }
.g-cat .dtt-ferry-results .dtt-ferry-carrier-logo { width: 44px; height: 44px; max-width: none; max-height: none; object-fit: contain; border-radius: var(--r-sm); border: 1px solid var(--border); background: #fff; padding: 3px; }
/* The carrier name is screen-reader-only beside a logo in the legacy layout; the G header shows it. */
.g-cat .dtt-ferry-carrier-brand h3.screen-reader-text, .g-cat .dtt-ferry-carrier-name { position: static !important; width: auto !important; height: auto !important; margin: 0 !important; clip: auto !important; clip-path: none !important; overflow: visible !important; white-space: normal !important; font-size: 15px; font-weight: 700; color: var(--ink); }
@media (min-width: 1201px) {
  .g-cat .dtt-ferry-search .dtt-ferry-search-bar { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) 40px minmax(0, 1fr) minmax(0, .9fr) minmax(0, .9fr) auto; gap: 12px; }
  .g-cat .dtt-ferry-search .dtt-ferry-search-bar > * { grid-column: auto; }
  .g-cat .dtt-ferry-search .dtt-ferry-search-swap { margin: 0; transform: none; }
  .g-cat .dtt-ferry-search .dtt-ferry-search-actions { flex-direction: row; align-items: center; }
}
.g-cat .dtt-ferry-carrier-brand.is-fallback .dtt-ui-icon { width: 44px; height: 44px; padding: 10px; border-radius: var(--r-sm); background: var(--mint-100); color: var(--emerald-700); }
.g-cat .dtt-ferry-results .dtt-ferry-carrier-rows { padding: 0 18px; }
.g-cat .islas-ferry-line { display: block; }
.g-cat .islas-ferry-line + .islas-ferry-line { border-top: 1px solid var(--border); }
.g-cat .islas-ferry-line-brand { display: none; }
.g-cat .dtt-ferry-results .dtt-ferry-row { grid-template-columns: minmax(0, 1fr) 250px 170px auto; column-gap: 0; row-gap: 10px; padding: 14px 0; border: 0; }
.g-cat .dtt-ferry-results .dtt-ferry-row-title { margin: 0 0 4px; gap: 2px 8px; font-size: 15px; font-weight: 650; color: var(--ink); }
.g-cat .dtt-ferry-route-arrow { color: var(--muted); }
.g-cat .dtt-ferry-results .dtt-ferry-row-meta { flex-direction: row; gap: 4px 16px; color: var(--ink-2); font-size: var(--fs-sm); }
.g-cat .dtt-ferry-row-meta .dtt-ui-icon { width: 15px; height: 15px; color: var(--muted); }
.g-cat .dtt-ferry-row-schedule { color: var(--ink-2); flex-basis: auto; }
.g-cat .dtt-ferry-results .dtt-ferry-row-class { flex-direction: row; justify-content: flex-start; align-self: center; gap: 6px; padding: 0 12px; border: 0; text-align: left; }
.g-cat .dtt-ferry-results :is(.dtt-ferry-pax-pill, .dtt-ferry-class-badge) { min-height: 24px; height: 24px; padding: 0 10px; gap: 5px; border-radius: 7px; font-size: 12.5px; font-weight: 500; border: 1px solid #dfe3db; background: var(--neutral-bg); color: var(--neutral-fg); white-space: nowrap; }
.g-cat .dtt-ferry-pax-pill .dtt-ui-icon { width: 14px; height: 14px; }
.g-cat .dtt-ferry-results .dtt-ferry-class-badge.is-business { background: var(--info-bg); color: var(--info-fg); border-color: #cbdbeb; }
.g-cat .dtt-ferry-results .dtt-ferry-class-badge.is-standard { background: var(--mint-100); color: var(--emerald-800); border-color: var(--mint-300); }
.g-cat .dtt-ferry-results .dtt-ferry-row-price { align-self: center; align-items: flex-end; gap: 2px; min-width: 0; padding: 0 16px 0 0; border: 0; text-align: right; }
.g-cat .dtt-ferry-row-price-label { order: 2; color: var(--muted); font-size: 12px; }
.g-cat .dtt-ferry-results .dtt-ferry-row-price-amount { font: 700 20px/1.1 var(--font-display); color: var(--ink); }
.g-cat .dtt-ferry-row-note { order: 3; color: var(--warn-fg); font-size: 12px; }
.g-cat .dtt-ferry-row-fares { order: 4; font-size: 12.5px; text-align: right; }
body.logged-in .g-cat .dtt-ferry-row-fares summary { color: var(--emerald-700); font-size: 12.5px; text-align: right; }
.g-cat .dtt-ferry-row-fares li { color: var(--ink-2); }
.g-cat .dtt-ferry-results .dtt-ferry-row-action { flex-direction: row; align-items: center; justify-content: flex-end; gap: 12px; padding: 0; border: 0; }
body.logged-in .g-cat .dtt-ferry-row-action .dtt-ferry-inquire-button { width: auto; min-width: 0; height: 36px; min-height: 36px; padding: 0 14px; gap: 6px; border-radius: var(--r-md); border-color: var(--emerald-700); background: var(--emerald-700); font-size: var(--fs-sm); font-weight: 600; }
body.logged-in .g-cat .dtt-ferry-row-action .dtt-ferry-inquire-button:hover { background: var(--emerald-800); border-color: var(--emerald-800); }
.g-cat .dtt-ferry-row-action .dtt-ferry-inquire-button .dtt-ui-icon { width: 16px; height: 16px; }
.g-cat .dtt-ferry-row-view { min-height: 36px; color: var(--emerald-700); font-size: var(--fs-sm); font-weight: 600; }
@media (max-width: 1200px) {
  .g-cat .dtt-ferry-results .dtt-ferry-row { grid-template-columns: minmax(0, 1fr) auto; }
  .g-cat .dtt-ferry-results .dtt-ferry-row-class { grid-column: 1; grid-row: 2; padding: 0; }
  .g-cat .dtt-ferry-results .dtt-ferry-row-price { grid-column: 2; grid-row: 1; padding: 0; }
  .g-cat .dtt-ferry-results .dtt-ferry-row-action { grid-column: 2; grid-row: 2; }
  .g-cat-detail-grid { grid-template-columns: 1fr; }
  .g-cat-detail-aside { position: static; }
}
@media (max-width: 820px) {
  .g-cat-hero { grid-template-columns: 1fr; }
  .g-cat-hero .dtt-photo-thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .g-cat-kv { grid-template-columns: 110px minmax(0, 1fr); }
  .g-cat-detail-title { font-size: var(--fs-xl); }
  .g-cat .dtt-ferry-search { padding: 14px 16px; }
  .g-cat .dtt-ferry-results .dtt-ferry-carrier-rows { padding: 0 14px; }
  .g-cat .dtt-ferry-results .dtt-ferry-row-meta { flex-direction: column; }
}

/* ---------- Quote builder (Create Customized Tour / Edit Quotation) ----------
   CSS only: app.js owns the wizard markup. The long prefix outranks the legacy body.logged-in builder rules. */
body.g-ui.logged-in .dtt-reference-builder { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin: 0; padding: 0; background: none; color: var(--ink); font-family: var(--font-text); }
/* The top bar already shows the page title: the h1 stays for screen readers, the Save / Clear actions stay visible. */
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-heading { display: flex; justify-content: flex-end; align-items: center; min-height: 0; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-heading > div:first-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-heading-actions { display: flex; gap: 8px; margin: 0; }

/* Stepper (G .stepper look on the legacy step buttons) */
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-steps { display: flex; gap: 0; margin: 0; padding: 18px 22px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-card); overflow: visible; }
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-steps button { display: flex; align-items: center; gap: 10px; width: auto; min-width: 0; height: auto; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--ink); font: inherit; cursor: pointer; opacity: 1; position: relative; justify-content: flex-start; text-align: left; }
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-steps button:not(:last-child) { flex: 1 1 auto; }
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-steps button::after { content: ""; position: static; flex: 1 1 auto; min-width: 12px; height: 2px; margin: 0 12px 0 2px; border-radius: 2px; background: var(--border-strong); transform: none; }
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-steps button:last-child::after { content: none; }
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-steps button.is-complete::after { background: var(--emerald-600); }
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-steps button:disabled { cursor: default; }
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-steps button > b { display: grid; place-items: center; flex: none; width: 32px; height: 32px; margin: 0; border: 2px solid var(--border-strong); border-radius: 50%; background: var(--surface); color: var(--ink-2); font: 650 13px/1 var(--font-display); box-shadow: none; }
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-steps button > span { display: block; min-height: 0; padding: 0; border: 0; background: none; color: var(--ink); font-size: var(--fs-sm); font-weight: 650; line-height: 1.25; white-space: nowrap; }
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-steps button > span::after { content: none; }
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-steps button:disabled > span { color: var(--ink-2); font-weight: 550; }
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-steps button.is-complete > b { border-color: var(--emerald-700); background: var(--emerald-700) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 16px no-repeat; color: transparent; }
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-steps button.is-active > b { border-color: var(--emerald-600); background: var(--surface); color: var(--emerald-700); box-shadow: 0 0 0 4px var(--mint-100); }
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-steps button.is-active > span { color: var(--emerald-800); }
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-steps button:not(:disabled):hover > span { text-decoration: underline; text-underline-offset: 3px; }
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-steps button:focus-visible { outline: 2px solid var(--emerald-600); outline-offset: 4px; border-radius: 6px; }

/* Layout: form column + sticky price summary */
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-main { display: grid; gap: 16px; min-width: 0; grid-column: 1; }
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-section { margin: 0; padding: 20px 22px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-card); }
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-section h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; padding: 0; border: 0; color: var(--ink); font: 700 var(--fs-lg)/1.2 var(--font-display); letter-spacing: -0.01em; }
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-section h2 .dtt-builder-section-number { display: none; }
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-section h2 > .dtt-ui-icon { flex: none; width: 40px; height: 40px; padding: 10px; margin: 0; border-radius: var(--r-md); background: var(--mint-100); color: var(--emerald-700); }
body.g-ui.logged-in .dtt-reference-builder .dtt-section-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; padding: 0; border: 0; }
body.g-ui.logged-in .dtt-reference-builder .dtt-section-header h2 { margin: 0; }

/* Fields */
body.g-ui.logged-in .dtt-reference-builder label > span:first-child { display: block; margin: 0 0 6px; color: var(--ink-2); font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0; text-transform: none; }
body.g-ui.logged-in .dtt-reference-builder :is(input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], select:not(.select2-hidden-accessible)) { height: 40px; min-height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background-color: var(--surface); color: var(--ink); font: 500 var(--fs-md) var(--font-text); box-shadow: none; }
body.g-ui.logged-in .dtt-reference-builder :is(input, select):focus { outline: none; border-color: var(--emerald-600); box-shadow: var(--focus); }
body.g-ui.logged-in .dtt-reference-builder input[readonly] { background: var(--surface-sunk); color: var(--ink-2); }
body.g-ui.logged-in .dtt-reference-builder .dtt-grid { gap: 14px 16px; align-items: end; }

/* Day cards: "Day" field, service lines, then the add-service row (G .add-row) */
body.g-ui.logged-in .dtt-reference-builder .dtt-day-list { display: grid; gap: 18px; }
body.g-ui.logged-in .dtt-reference-builder .dtt-day-card { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
body.g-ui.logged-in .dtt-reference-builder .dtt-day-card + .dtt-day-card { padding-top: 18px; border-top: 1px solid var(--border); }
body.g-ui.logged-in .dtt-reference-builder .dtt-day-header { display: contents; }
body.g-ui.logged-in .dtt-reference-builder .dtt-day-header > label { order: 0; display: flex; align-items: center; gap: 10px; margin: 0; }
body.g-ui.logged-in .dtt-reference-builder .dtt-day-header > label > span:first-child { margin: 0; color: var(--ink); font: 700 14.5px/1 var(--font-display); }
body.g-ui.logged-in .dtt-reference-builder .dtt-day-header .dtt-day-number { width: 120px; height: 34px; min-height: 34px; }
body.g-ui.logged-in .dtt-reference-builder .dtt-day-blocks { order: 1; display: grid; gap: 10px; }
body.g-ui.logged-in .dtt-reference-builder .dtt-day-blocks:empty { display: none; }
body.g-ui.logged-in .dtt-reference-builder .dtt-day-actions { order: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 8px; margin: 0; padding: 12px 14px; border: 1px dashed var(--border-strong); border-radius: var(--r-md); background: none; }
body.g-ui.logged-in .dtt-reference-builder .dtt-day-block { margin: 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); box-shadow: none; }
body.g-ui.logged-in .dtt-reference-builder .dtt-day-block-title { display: inline-flex; align-items: center; height: 24px; margin: 0 0 12px; padding: 0 10px; border: 1px solid var(--mint-300); border-radius: 7px; background: var(--mint-100); color: var(--emerald-800); font-size: 12.5px; font-weight: 600; letter-spacing: 0; text-transform: none; }
body.g-ui.logged-in .dtt-reference-builder :is(.dtt-hotel-room-actions, .dtt-row-actions) { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 8px 12px; margin: 12px 0 0; padding: 0; border: 0; }
body.g-ui.logged-in .dtt-reference-builder .dtt-hotel-room-actions small { color: var(--muted); font-size: var(--fs-xs); }
body.g-ui.logged-in .dtt-reference-builder .dtt-repeater-row { margin: 0 0 10px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); box-shadow: none; }

/* Buttons: legacy .dtt-button in G .btn style */
body.g-ui.logged-in .dtt-reference-builder .dtt-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: auto; height: 40px; min-height: 40px; margin: 0; padding: 0 16px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); box-shadow: none; color: var(--ink); font: 600 var(--fs-md)/1 var(--font-text); text-decoration: none; white-space: nowrap; cursor: pointer; }
body.g-ui.logged-in .dtt-reference-builder .dtt-button:hover { background: var(--mint-50); border-color: var(--mint-400); color: var(--ink); }
body.g-ui.logged-in .dtt-reference-builder .dtt-button .dtt-ui-icon { width: 18px; height: 18px; color: currentColor; }
body.g-ui.logged-in .dtt-reference-builder .dtt-button-small { height: 34px; min-height: 34px; padding: 0 12px; font-size: var(--fs-sm); }
body.g-ui.logged-in .dtt-reference-builder .dtt-button-small .dtt-ui-icon { width: 16px; height: 16px; }
body.g-ui.logged-in .dtt-reference-builder .dtt-button-primary { border-color: var(--emerald-700); background: var(--emerald-700); color: #fff; }
body.g-ui.logged-in .dtt-reference-builder .dtt-button-primary:hover { border-color: var(--emerald-800); background: var(--emerald-800); color: #fff; }
body.g-ui.logged-in .dtt-reference-builder .dtt-button-ghost { border-color: transparent; background: transparent; color: var(--emerald-700); }
body.g-ui.logged-in .dtt-reference-builder .dtt-button-danger { border-color: transparent; background: transparent; color: var(--bad-fg); }
body.g-ui.logged-in .dtt-reference-builder .dtt-button-danger:hover { background: var(--bad-bg, #fdecea); border-color: transparent; color: var(--bad-fg); }
body.g-ui.logged-in .dtt-reference-builder .dtt-button-wide { width: 100%; }
body.g-ui.logged-in .dtt-reference-builder .dtt-button:focus-visible { outline: 2px solid var(--emerald-600); outline-offset: 2px; }

/* Previous / Next bar and footer */
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-wizard-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-card); }
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-wizard-nav [data-dtt-wizard-status] { color: var(--ink-2); font-size: var(--fs-sm); font-weight: 600; }
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-wizard-nav [data-dtt-wizard-previous][hidden] + span { margin-right: auto; }
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-footer-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0; padding: 0; border: 0; background: none; }
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-footer-actions .dtt-button { border-color: transparent; background: none; color: var(--emerald-700); padding: 0 4px; }
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-footer-actions p { margin: 0; color: var(--muted); font-size: var(--fs-sm); font-weight: 500; }
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-tip { margin: 0; padding: 14px 16px; border: 1px solid var(--mint-200); border-radius: var(--r-md); background: var(--mint-50); box-shadow: none; color: var(--ink-2); font-size: var(--fs-sm); }
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-tip h3 { margin: 0 0 6px; color: var(--ink); font: 700 var(--fs-md)/1.3 var(--font-display); }
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-tip ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
body.g-ui.logged-in .dtt-reference-builder .dtt-pax-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 14px 0 0; padding: 12px 14px; border: 1px solid var(--mint-200); border-radius: var(--r-md); background: var(--mint-50); color: var(--ink); font-size: var(--fs-md); }
body.g-ui.logged-in .dtt-reference-builder .dtt-pax-total span { color: var(--ink-2); font-size: var(--fs-sm); }

/* Price summary card (G .summary) */
body.g-ui.logged-in .dtt-reference-builder .dtt-builder-summary { grid-column: 2; grid-row: 1 / span 3; position: sticky; top: calc(var(--topbar-h) + 16px); display: grid; gap: 0; margin: 0; padding: 18px 22px 20px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-card); }
body.g-ui.logged-in .dtt-reference-builder .dtt-summary-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 8px; padding: 0; border: 0; }
body.g-ui.logged-in .dtt-reference-builder .dtt-summary-heading h2 { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--ink); font: 700 var(--fs-lg)/1.2 var(--font-display); }
body.g-ui.logged-in .dtt-reference-builder .dtt-summary-heading h2 .dtt-ui-icon { display: none; }
body.g-ui.logged-in .dtt-reference-builder .dtt-summary-heading > span { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border: 1px solid #dfe3db; border-radius: 7px; background: var(--neutral-bg); color: var(--neutral-fg); font-size: 12px; font-weight: 600; }
body.g-ui.logged-in .dtt-reference-builder .dtt-summary-lines { display: grid; gap: 0; margin: 0; padding: 0; border: 0; }
body.g-ui.logged-in .dtt-reference-builder .dtt-summary-lines > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0; padding: 7px 0; border: 0; background: none; font-size: var(--fs-md); }
body.g-ui.logged-in .dtt-reference-builder .dtt-summary-lines > div > span { color: var(--ink-2); font-weight: 400; }
body.g-ui.logged-in .dtt-reference-builder .dtt-summary-lines > div > strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
body.g-ui.logged-in .dtt-reference-builder .dtt-summary-lines > .dtt-summary-subtotal { margin-top: 4px; padding-top: 11px; border-top: 1px solid var(--border); }
body.g-ui.logged-in .dtt-reference-builder .dtt-summary-lines > .dtt-summary-subtotal > span { color: var(--ink); font-weight: 600; }
body.g-ui.logged-in .dtt-reference-builder .dtt-summary-lines > label { display: grid; grid-template-columns: 1fr 130px; align-items: center; gap: 12px; margin: 4px 0; }
body.g-ui.logged-in .dtt-reference-builder .dtt-summary-lines > label > span:first-child { margin: 0; color: var(--ink-2); font-size: var(--fs-md); font-weight: 400; }
body.g-ui.logged-in .dtt-reference-builder .dtt-summary-lines > label input { width: 100%; text-align: right; font-weight: 600; }
body.g-ui.logged-in .dtt-reference-builder .dtt-summary-lines > .dtt-live-total { align-items: baseline; margin: 8px 0 0; padding: 14px 0 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: none; }
body.g-ui.logged-in .dtt-reference-builder .dtt-summary-lines > .dtt-live-total > span { color: var(--ink); font-size: var(--fs-md); font-weight: 650; }
body.g-ui.logged-in .dtt-reference-builder .dtt-summary-lines > .dtt-live-total > strong { color: var(--ink); font: 700 24px/1.1 var(--font-display); letter-spacing: -0.02em; text-align: right; }
body.g-ui.logged-in .dtt-reference-builder .dtt-summary-note { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0 0; padding: 12px 14px; border: 1px solid var(--mint-200); border-radius: var(--r-md); background: var(--mint-50); color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.45; }
body.g-ui.logged-in .dtt-reference-builder .dtt-summary-note .dtt-ui-icon { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--emerald-700); }
body.g-ui.logged-in .dtt-reference-builder .dtt-summary-actions { display: grid; gap: 8px; margin: 16px 0 0; }

/* Review step */
body.g-ui.logged-in .dtt-reference-builder .dtt-review-intro { margin: -8px 0 14px; color: var(--ink-2); font-size: var(--fs-md); }
body.g-ui.logged-in .dtt-reference-builder .dtt-review-grid { gap: 12px; }
body.g-ui.logged-in .dtt-reference-builder .dtt-review-card { margin: 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); box-shadow: none; }
body.g-ui.logged-in .dtt-reference-builder .dtt-review-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; padding: 0 0 8px; border-bottom: 1px solid var(--border); }
body.g-ui.logged-in .dtt-reference-builder .dtt-review-card-heading h3 { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--ink); font: 700 var(--fs-md)/1.3 var(--font-display); }
body.g-ui.logged-in .dtt-reference-builder .dtt-review-card-heading h3 .dtt-ui-icon { width: 18px; height: 18px; color: var(--emerald-700); }
body.g-ui.logged-in .dtt-reference-builder .dtt-review-card-heading button { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 8px; border: 0; border-radius: var(--r-sm); background: none; box-shadow: none; color: var(--emerald-700); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
body.g-ui.logged-in .dtt-reference-builder .dtt-review-card-heading button:hover { background: var(--mint-50); }
body.g-ui.logged-in .dtt-reference-builder .dtt-review-card-heading button .dtt-ui-icon { width: 15px; height: 15px; }
body.g-ui.logged-in .dtt-reference-builder .dtt-review-card-content { color: var(--ink); font-size: var(--fs-sm); }
body.g-ui.logged-in .dtt-reference-builder .dtt-review-confirmation { margin: 14px 0 0; padding: 14px 16px; border: 1px solid var(--mint-200); border-radius: var(--r-md); background: var(--mint-50); box-shadow: none; }
body.g-ui.logged-in .dtt-reference-builder .dtt-review-confirmation .dtt-button { height: auto; min-height: 40px; padding-block: 8px; white-space: normal; text-align: center; line-height: 1.3; }
body.g-ui.logged-in .dtt-reference-builder .dtt-review-confirmation input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--emerald-700); }
/* A long value (email) drops whole onto its own line instead of breaking mid-word; Save keeps one line. */
body.g-ui.logged-in .dtt-reference-builder .dtt-review-card { min-width: 0; }
body.g-ui.logged-in .dtt-reference-builder .dtt-review-card-content > div { flex-wrap: wrap; row-gap: 2px; }
body.g-ui.logged-in .dtt-reference-builder .dtt-review-card-content { grid-template-columns: minmax(0, 1fr); }
/* Values wrap to their own line before a word (an e-mail address) is split. */
body.g-ui.logged-in .dtt-reference-builder .dtt-review-card-content strong { max-width: 100%; margin-left: auto; overflow-wrap: break-word; text-align: right; }
/* Card titles stay on one line ("Client Information"); the Edit button gives up its padding first. */
body.g-ui.logged-in .dtt-reference-builder .dtt-review-card-heading h3 { min-width: 0; white-space: nowrap; }
body.g-ui.logged-in .dtt-reference-builder .dtt-review-card-heading button { flex: none; padding-inline: 4px; }
body.g-ui.logged-in .dtt-reference-builder .dtt-review-confirmation { flex-wrap: wrap; }
/* The policy button may wrap at phone width instead of widening the review step. */
body.g-ui.logged-in .dtt-reference-builder .dtt-policy-consent { min-width: 0; }
body.g-ui.logged-in .dtt-reference-builder .dtt-policy-consent > [data-dtt-policy-open],
#dtt-main .dtt-reference-builder .dtt-policy-consent > [data-dtt-policy-open].dtt-button { max-width: 100%; height: auto; min-height: 40px; padding-block: 8px; white-space: normal; line-height: 1.3; }
/* Hotel room thumbnail (destination photo, a different crop per room) and offer inclusions. */
.g-cat-room-thumb { display: block; width: 64px; height: 48px; border-radius: 8px; background: var(--mint-100) var(--img) var(--pos, 50% 50%) / 260% no-repeat; }
.g-cat-list { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: var(--fs-md); color: var(--ink-2); }
.g-cat-detail-sec p { margin: 0 0 8px; font-size: var(--fs-md); line-height: 1.6; color: var(--ink-2); max-width: 75ch; }
body.g-ui.logged-in .dtt-reference-builder .dtt-review-confirmation > .dtt-button { flex: 0 0 auto; min-height: 44px; margin-left: auto; padding-inline: 22px; white-space: nowrap; }

@media (max-width: 1440px) {
  body.g-ui.logged-in .dtt-reference-builder .dtt-builder-steps { padding: 16px 18px; }
  body.g-ui.logged-in .dtt-reference-builder .dtt-builder-steps button { gap: 8px; }
  body.g-ui.logged-in .dtt-reference-builder .dtt-builder-steps button > b { width: 28px; height: 28px; }
}
@media (max-width: 1200px) {
  body.g-ui.logged-in .dtt-reference-builder .dtt-builder-layout { grid-template-columns: minmax(0, 1fr); }
  body.g-ui.logged-in .dtt-reference-builder .dtt-builder-summary { grid-column: 1; grid-row: auto; position: static; }
  body.g-ui.logged-in .dtt-reference-builder .dtt-builder-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 14px; }
  body.g-ui.logged-in .dtt-reference-builder .dtt-builder-steps button:nth-child(3)::after { content: none; }
}
@media (max-width: 820px) {
  /* Phones: the G vertical step list. */
  body.g-ui.logged-in .dtt-reference-builder .dtt-builder-steps { grid-template-columns: 1fr; gap: 10px; padding: 14px 16px; }
  body.g-ui.logged-in .dtt-reference-builder .dtt-builder-steps button::after { content: none; }
  body.g-ui.logged-in .dtt-reference-builder .dtt-builder-steps button > span { white-space: normal; }
  body.g-ui.logged-in .dtt-reference-builder .dtt-builder-section { padding: 16px; }
  body.g-ui.logged-in .dtt-reference-builder .dtt-builder-heading { justify-content: stretch; }
  body.g-ui.logged-in .dtt-reference-builder .dtt-builder-heading-actions { width: 100%; }
  body.g-ui.logged-in .dtt-reference-builder .dtt-builder-heading-actions .dtt-button { flex: 1; }
  body.g-ui.logged-in .dtt-reference-builder .dtt-builder-wizard-nav { flex-wrap: wrap; }
  body.g-ui.logged-in .dtt-reference-builder .dtt-builder-wizard-nav [data-dtt-wizard-status] { order: -1; width: 100%; text-align: center; }
  body.g-ui.logged-in .dtt-reference-builder .dtt-builder-wizard-nav .dtt-button { flex: 1; }
  body.g-ui.logged-in .dtt-reference-builder .dtt-day-actions .dtt-button { flex: 1 1 calc(50% - 4px); }
}
/* Offers show a travel window in the price slot: smaller, on one line. */
#catalog-special-offers .price { font-size: 16px; white-space: nowrap; }

/* Text in the price slot (offer travel dates, "On request"): a small note, never the big figure. */
.price.price-text { font-size: var(--fs-md); font-weight: 650; white-space: normal; overflow-wrap: anywhere; }
.g-cat-detail-aside .price.price-text { font-size: var(--fs-lg); }
.g-cat-detail-aside { min-width: 0; }
/* "‹ All hotels": chevron on the text's centre line. */
.g-cat-detail .breadcrumb a { display: inline-flex; align-items: center; gap: 4px; }
/* An odd last thumbnail spans both columns, so no empty cell is left. */
@media (min-width: 821px) {
  .g-cat-hero .dtt-photo-thumbs > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .g-cat-hero .dtt-photo-thumbs > :last-child:nth-child(odd) img { aspect-ratio: 2 / 1; }
}
/* Quotations list tiles (5) on phones: "All" spans the row, so 1 + 2 + 2 and no lone Declined tile. */
@media (max-width: 820px) {
  body.g-ui .dtt-screen-quotations .dtt-quote-kpis > :first-child { grid-column: 1 / -1; }
}

/* Top bar: a long page title ("Supplier: Coral Triangle Tours & Transfers") takes the shortcut links' room
   on laptop widths; anything longer still ends in an ellipsis with the full title in its tooltip. */
@media (min-width: 1025px) and (max-width: 1700px) {
  .topbar:has(.page-title.is-long) .quicklinks { display: none; }
}
