/* The agent portal's look, implemented from docs/agent_portal_redesign.html (the design prototype).
   ui/style.css and the Tailwind build are still loaded for the shared pieces (calendar, operation-feedback notices, date-range
   filter, support chat); everything the portal draws itself uses the `ap-` classes below, so nothing here can leak into, or be
   overridden by, the older stylesheet. Light theme only: the older shared components have no dark variant. */

body[data-portal="agent"] {
  --ap-bg: #f5f5fb; --ap-surface: #ffffff; --ap-surface-2: #f0f0f9; --ap-ink: #1a1f36; --ap-ink-2: #464c6c; --ap-muted: #667085; --ap-line: #e3e4f0;
  --ap-brand: #4f46e5; --ap-brand-ink: #3730a3; --ap-brand-soft: #eceeff; --ap-on-brand: #ffffff;
  --ap-ok: #14703a; --ap-ok-bg: #e6f5ec; --ap-warn: #8a5200; --ap-warn-bg: #fcf0d9; --ap-bad: #b0281d; --ap-bad-bg: #fcebe9; --ap-idle: #596079; --ap-idle-bg: #eceef5;
  --ap-shadow: 0 1px 2px rgba(26,31,54,.06), 0 4px 16px rgba(26,31,54,.05);
  --ap-shadow-lg: 0 2px 4px rgba(26,31,54,.05), 0 16px 40px rgba(26,31,54,.10);
  --ap-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --ap-font: 'Instrument Sans', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --ap-r-lg: 16px; --ap-r-md: 10px; --ap-r-sm: 6px;
  /* the shared components (calendar, guest selector) read the older accent variables: point them at the portal's indigo */
  --search-primary: #4f46e5; --search-primary-dark: #3730a3; --search-primary-soft: #eceeff;
  --search-primary-soft-2: #e0e2ff; --search-primary-soft-border: #cfd2f6;

  margin: 0;
  background: var(--ap-bg);
  color: var(--ap-ink);
  font-family: var(--ap-font);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
  overflow-x: hidden;
}
body[data-portal="agent"] *, body[data-portal="agent"] *::before, body[data-portal="agent"] *::after { box-sizing: border-box; }
body[data-portal="agent"] button, body[data-portal="agent"] input, body[data-portal="agent"] select, body[data-portal="agent"] textarea { font: inherit; color: inherit; }
body[data-portal="agent"] button { cursor: pointer; }
body[data-portal="agent"] h1, body[data-portal="agent"] h2, body[data-portal="agent"] h3, body[data-portal="agent"] h4 { margin: 0; font-weight: 500; text-wrap: balance; }
body[data-portal="agent"] p { margin: 0; text-wrap: pretty; }
body[data-portal="agent"] :focus-visible { outline: 2px solid var(--ap-brand); outline-offset: 2px; border-radius: var(--ap-r-sm); }
body[data-portal="agent"] [hidden] { display: none !important; }

.ap-num { font-variant-numeric: tabular-nums; }
.ap-nw { white-space: nowrap; }
.ap-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ap-small { font-size: 12.5px; color: var(--ap-muted); }
.ap-ico { flex: none; width: 1em; height: 1em; }
.ap-ico svg, .ap-iconbox svg { width: 100%; height: 100%; display: block; }

/* ── first paint: nothing of the portal shows until boot.js has confirmed the session (no flash before sign-in) ── */
html:not(.ap-ready) #ap-app { visibility: hidden; }
#ap-splash {
  position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; background: #f5f5fb;
}
html.ap-ready #ap-splash { display: none; }
#ap-splash .ap-spin {
  width: 30px; height: 30px; border-radius: 50%; border: 3px solid #e3e4f0; border-top-color: #4f46e5; animation: ap-rot .8s linear infinite;
}
@keyframes ap-rot { to { transform: rotate(360deg); } }

/* ── top bar ── */
.ap-wrap { max-width: 1240px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.ap-top {
  position: sticky; top: 0; z-index: 30; padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--ap-surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--ap-line);
}
.ap-bar { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.ap-brand { display: flex; align-items: center; gap: 10px; flex: none; min-width: 0; }
.ap-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--ap-brand); display: grid; place-items: center; color: var(--ap-on-brand); flex: none; }
.ap-mark svg { width: 20px; height: 20px; }
.ap-brand b { font-family: var(--ap-display); font-size: 21px; font-weight: 600; letter-spacing: -.01em; display: block; line-height: 1.1; white-space: nowrap; }
.ap-brand small { display: block; color: var(--ap-muted); font-size: 12px; }
.ap-nav { display: flex; gap: 4px; align-self: stretch; }
.ap-nav button {
  display: flex; align-items: center; gap: 8px; padding: 0 14px; color: var(--ap-ink-2); background: none; border: 0; font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; white-space: nowrap;
}
.ap-nav button:hover { color: var(--ap-ink); }
.ap-nav button[aria-current="page"] { color: var(--ap-brand-ink); border-bottom-color: var(--ap-brand); }
.ap-nav button svg { width: 16px; height: 16px; }
.ap-spacer { flex: 1; }
.ap-tools { display: flex; align-items: center; gap: 8px; position: relative; }
.ap-iconbtn {
  position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--ap-r-md); border: 1px solid var(--ap-line);
  background: var(--ap-surface); color: var(--ap-ink-2); transition: background-color .15s, scale .12s; padding: 0;
}
.ap-iconbtn:hover { background: var(--ap-surface-2); }
.ap-iconbtn:active { scale: .96; }
.ap-iconbtn svg { width: 18px; height: 18px; }
.ap-pillbtn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--ap-line);
  background: var(--ap-brand-soft); color: var(--ap-brand-ink); font-weight: 600; transition: scale .12s;
}
.ap-pillbtn:active { scale: .97; }
.ap-pillbtn svg { width: 17px; height: 17px; }
.ap-me { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px 0 4px; border: 1px solid transparent; border-radius: 999px; background: none; font-weight: 600; }
.ap-me:hover, .ap-me.ap-open { border-color: var(--ap-line); }
.ap-me .ap-nm { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-me > svg { width: 16px; height: 16px; color: var(--ap-muted); }
.ap-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ap-ink); color: var(--ap-surface); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.ap-menu {
  position: absolute; right: 0; top: 48px; min-width: 240px; background: var(--ap-surface); border: 1px solid var(--ap-line); border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,.18); padding: 6px; z-index: 40;
}
.ap-menu .ap-mh { padding: 10px 12px 8px; border-bottom: 1px solid var(--ap-line); margin-bottom: 4px; }
.ap-menu .ap-mh b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 8px; font-weight: 500; }
.ap-menu button:hover { background: var(--ap-surface-2); }
.ap-menu button.ap-danger { color: var(--ap-bad); }
.ap-mtabs { display: none; }

/* the TAC bell keeps its script-owned ids and classes; only its look changes */
.ap-top .tac-notif-wrapper { position: relative; }
.ap-top .tac-notif-bell-btn {
  position: relative; width: 40px; height: 40px; padding: 0; display: grid; place-items: center; border-radius: var(--ap-r-md);
  border: 1px solid var(--ap-line); background: var(--ap-surface); color: var(--ap-ink-2);
}
.ap-top .tac-notif-bell-btn:hover { background: var(--ap-surface-2); }
.ap-top .tac-notif-bell-btn svg { width: 18px; height: 18px; }
.ap-top .tac-notif-badge {
  top: -5px; right: -5px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--ap-bad); font-size: 11px; line-height: 18px;
  display: grid; place-items: center; padding: 0 4px;
}
.ap-top .tac-notif-dropdown {
  top: 48px; width: min(340px, calc(100vw - 32px)); border: 1px solid var(--ap-line); border-radius: 12px; box-shadow: 0 18px 50px rgba(0,0,0,.18);
  padding: 6px; background: var(--ap-surface);
}
.ap-top .tac-notif-header { padding: 10px 12px 8px; color: var(--ap-ink); font-weight: 700; background: var(--ap-surface); border-bottom: 1px solid var(--ap-line); }
.ap-top .tac-notif-mark-all { color: var(--ap-brand-ink); font-size: 12.5px; }
.ap-top .tac-notif-item { border-radius: 8px; border-bottom: 0; margin-top: 2px; }
.ap-top .tac-notif-item:hover { background: var(--ap-surface-2); }
.ap-top .tac-notif-item.unread { background: var(--ap-brand-soft); }

/* ── page ── */
.ap-page { padding-block: 26px 56px; }
.ap-view { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.ap-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ap-head h1 { font-family: var(--ap-display); font-size: clamp(28px, 3.4vw, 38px); letter-spacing: -.015em; line-height: 1.1; }
.ap-head p { color: var(--ap-ink-2); margin-top: 4px; }
.ap-card { background: var(--ap-surface); border: 1px solid var(--ap-line); border-radius: var(--ap-r-lg); box-shadow: var(--ap-shadow); }
.ap-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--ap-r-md);
  border: 1px solid var(--ap-line); background: var(--ap-surface); color: var(--ap-ink); font-weight: 600; transition: background-color .15s, scale .12s; text-decoration: none;
}
.ap-btn:hover { background: var(--ap-surface-2); }
.ap-btn:active { scale: .97; }
.ap-btn.ap-pri { background: var(--ap-brand); border-color: var(--ap-brand); color: var(--ap-on-brand); }
.ap-btn.ap-pri:hover { background: var(--ap-brand-ink); }
.ap-btn.ap-danger { color: var(--ap-bad); }
.ap-btn.ap-danger:hover { background: var(--ap-bad-bg); }
.ap-btn.ap-danger-solid { background: var(--ap-bad); border-color: var(--ap-bad); color: #fff; }
.ap-btn.ap-sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.ap-btn:disabled { opacity: .45; cursor: not-allowed; scale: 1; }
.ap-btn svg { width: 16px; height: 16px; flex: none; }
.ap-pill { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.ap-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.ap-p-ok { background: var(--ap-ok-bg); color: var(--ap-ok); }
.ap-p-warn { background: var(--ap-warn-bg); color: var(--ap-warn); }
.ap-p-bad { background: var(--ap-bad-bg); color: var(--ap-bad); }
.ap-p-idle { background: var(--ap-idle-bg); color: var(--ap-idle); }
.ap-p-brand { background: var(--ap-brand-soft); color: var(--ap-brand-ink); }
.ap-pill.ap-wrapok { white-space: normal; }

/* ── search bar ── */
.ap-search {
  position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, 1.2fr) minmax(0, 1.4fr) auto; align-items: center;
  box-shadow: var(--ap-shadow-lg);
}
.ap-fld { padding: 12px 18px; border-left: 1px solid var(--ap-line); display: flex; flex-direction: column; gap: 2px; min-width: 0; position: relative; }
.ap-fld:first-child { border-left: 0; }
.ap-fld > label { font-size: 12.5px; font-weight: 600; color: var(--ap-muted); margin: 0; }
.ap-fld .input-control {
  display: flex; align-items: center; gap: 8px; min-width: 0; height: 36px; border: 0; background: transparent; padding: 0; cursor: pointer; box-shadow: none; border-radius: 0;
}
.ap-fld .input-icon { display: grid; place-items: center; width: 18px; height: 18px; color: var(--ap-brand); flex: none; }
.ap-fld .input-icon svg { width: 18px; height: 18px; }
.ap-fld .input-control input {
  flex: 1; min-width: 0; width: 100%; height: 36px; border: 0 !important; background: transparent; padding: 0; font-size: 15.5px; font-weight: 600; color: var(--ap-ink);
  text-overflow: ellipsis; cursor: pointer; box-shadow: none; outline: none;
}
.ap-fld .input-control input::placeholder { color: var(--ap-muted); font-weight: 400; }
.ap-fld .input-control-chevron { display: grid; place-items: center; width: 16px; height: 16px; color: var(--ap-muted); flex: none; }
.ap-fld .input-control-chevron svg { width: 16px; height: 16px; }
.ap-go {
  margin: 10px; height: 50px; padding: 0 24px; border: 0; border-radius: var(--ap-r-md); background: var(--ap-brand); color: var(--ap-on-brand); font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background-color .15s, scale .12s;
}
.ap-go:hover:not(:disabled) { background: var(--ap-brand-ink); }
.ap-go:active:not(:disabled) { scale: .97; }
.ap-go:disabled { opacity: .5; cursor: not-allowed; }
.ap-go svg { width: 18px; height: 18px; }
.ap-chiprow { display: flex; flex-wrap: wrap; gap: 6px; }
.ap-chiprow:empty { display: none; }
.ap-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 4px 6px 4px 10px; border-radius: 999px; background: var(--ap-brand-soft); color: var(--ap-brand-ink); }
.ap-chip button { border: 0; background: none; color: inherit; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; padding: 0; font-size: 16px; line-height: 1; }
.ap-chip button:hover { background: color-mix(in srgb, var(--ap-brand) 18%, transparent); }

/* popovers (the calendar, guest selector and amenity list are script-driven; their ids and inner classes are kept) */
body[data-portal="agent"] #calendar-container,
body[data-portal="agent"] #guest-selector-container,
body[data-portal="agent"] #amenities-selector-container {
  background: var(--ap-surface); border: 1px solid var(--ap-line); border-radius: var(--ap-r-lg); box-shadow: 0 18px 50px rgba(0,0,0,.18); padding: 16px; z-index: 50;
}
body[data-portal="agent"] #calendar-container { position: absolute; top: calc(100% + 8px); left: 0; margin: 0; width: 340px; max-width: calc(100vw - 32px); min-width: 0; }
body[data-portal="agent"] #guest-selector-container { position: absolute; top: calc(100% + 8px); left: 0; margin: 0; width: min(340px, calc(100vw - 32px)); min-width: 0; }
body[data-portal="agent"] #amenities-selector-container { position: absolute; top: calc(100% + 8px); left: 0; margin: 0; width: min(340px, calc(100vw - 32px)); padding: 12px; }
.ap-amen-list { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.ap-amen-title { font-size: 12px; font-weight: 700; color: var(--ap-muted); text-transform: uppercase; letter-spacing: .04em; padding: 8px 6px 4px; }
.ap-amen-opt { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 8px; cursor: pointer; }
.ap-amen-opt:hover { background: var(--ap-surface-2); }
.ap-amen-opt input { width: 18px; height: 18px; accent-color: var(--ap-brand); }
.ap-amen-empty { color: var(--ap-muted); text-align: center; padding: 14px 0; }
.ap-amen-foot { display: flex; gap: 8px; padding-top: 10px; margin-top: 8px; border-top: 1px solid var(--ap-line); }
.ap-amen-foot .ap-btn { flex: 1; min-height: 38px; }

body[data-portal="agent"] .calendar-header { border-bottom-color: var(--ap-line); }
body[data-portal="agent"] .calendar-header h3 { font-family: var(--ap-display); font-size: 18px; color: var(--ap-ink); font-weight: 600; }
body[data-portal="agent"] .calendar-nav-btn { color: var(--ap-brand); border-radius: 8px; width: 34px; height: 34px; display: grid; place-items: center; padding: 0; }
body[data-portal="agent"] .calendar-nav-btn:hover { background: var(--ap-brand-soft); }
body[data-portal="agent"] .calendar-nav-btn svg { width: 18px; height: 18px; }
body[data-portal="agent"] .calendar-weekday { color: var(--ap-muted); }
body[data-portal="agent"] .calendar-day { border-radius: 8px; font-variant-numeric: tabular-nums; }
body[data-portal="agent"] .calendar-day:hover:not(.disabled):not(.empty) { background: var(--ap-brand-soft); border-color: var(--ap-brand); }
body[data-portal="agent"] .calendar-day.check-in, body[data-portal="agent"] .calendar-day.check-out { background: var(--ap-brand); border-color: var(--ap-brand-ink); color: #fff; }
body[data-portal="agent"] .calendar-day.in-range { background: var(--ap-brand-soft); color: var(--ap-brand-ink); }
body[data-portal="agent"] .calendar-footer { border-top-color: var(--ap-line); }
body[data-portal="agent"] #calendar-container strong { color: var(--ap-brand-ink) !important; }
body[data-portal="agent"] .guest-selector-row { border-color: var(--ap-line); }
body[data-portal="agent"] .guest-selector-btn { border-radius: 50%; border-color: var(--ap-line); }
body[data-portal="agent"] .guest-selector-btn:hover:not(:disabled) { border-color: var(--ap-brand); color: var(--ap-brand); }
body[data-portal="agent"] .guest-selector-apply-btn { background: var(--ap-brand); border-radius: var(--ap-r-md); font-weight: 700; }
body[data-portal="agent"] .guest-selector-apply-btn:hover { background: var(--ap-brand-ink); }

/* ── results ── */
.ap-reshead { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.ap-reshead h2 { font-family: var(--ap-display); font-size: 28px; }
.ap-sel { height: 40px; border: 1px solid var(--ap-line); border-radius: var(--ap-r-md); background: var(--ap-surface); padding: 0 12px; color: var(--ap-ink); font-weight: 500; max-width: 100%; }
.ap-sortlab { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ap-muted); font-weight: 600; }
#results { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ap-loading, .ap-empty { padding: 28px; text-align: center; color: var(--ap-muted); }
.ap-hotel { overflow: hidden; }
.ap-h-top { display: grid; grid-template-columns: 220px minmax(0, 1fr) auto; gap: 20px; padding: 16px; align-items: stretch; }
.ap-h-media { position: relative; border-radius: 12px; overflow: hidden; min-height: 140px; background: var(--ap-surface-2); border: 1px solid var(--ap-line); }
.ap-h-media .hotel-card-image-slot { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; border: 0; border-radius: 0; display: grid; place-items: center; align-content: center; gap: 4px; color: var(--ap-muted); text-align: center; background: radial-gradient(120% 90% at 20% 0%, var(--ap-brand-soft), transparent 60%), var(--ap-surface-2); }
.ap-h-media .hotel-card-image-icon { width: 28px; height: 28px; display: block; margin: 0 auto; }
.ap-h-media .hotel-card-image-icon svg { width: 28px; height: 28px; }
.ap-h-media .hotel-card-image-caption { display: block; font-size: 12px; font-weight: 600; }
.ap-h-media .hotel-card-image { width: 100%; height: 100%; object-fit: cover; display: block; }
.ap-h-media .hotel-card-badge {
  position: absolute; left: 10px; bottom: 10px; display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 600; color: var(--ap-ink-2);
  background: var(--ap-surface); padding: 3px 9px; border-radius: 999px; border: 1px solid var(--ap-line);
}
.ap-h-media .hotel-card-badge svg { width: 13px; height: 13px; }
.ap-h-info { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding-top: 4px; }
.ap-h-info h3 { font-family: var(--ap-display); font-size: 26px; line-height: 1.1; letter-spacing: -.01em; overflow-wrap: anywhere; }
.ap-loc { display: inline-flex; align-items: center; gap: 6px; color: var(--ap-ink-2); font-size: 13.5px; }
.ap-loc svg { width: 15px; height: 15px; color: var(--ap-brand); }
.ap-facts { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.ap-facts li { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ap-ink-2); background: var(--ap-surface-2); padding: 5px 11px 5px 9px; border-radius: 999px; }
.ap-facts li svg { width: 15px; height: 15px; color: var(--ap-brand); flex: none; }
.ap-h-price { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 10px; text-align: right; min-width: 190px; }
.ap-h-price small { display: block; color: var(--ap-muted); font-size: 12.5px; }
.ap-h-price b { font-family: var(--ap-display); font-size: 30px; font-weight: 500; letter-spacing: -.01em; line-height: 1.15; }
.ap-rooms { border-top: 1px solid var(--ap-line); background: var(--ap-surface-2); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.ap-room { background: var(--ap-surface); border: 1px solid var(--ap-line); border-radius: 12px; display: grid; grid-template-columns: 240px minmax(0, 1fr); overflow: hidden; }
.ap-r-side { padding: 14px; border-right: 1px solid var(--ap-line); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ap-r-side h4 { font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.ap-r-side .dbook-room-image-slot { position: relative; width: 100%; height: 130px; border-radius: 10px; overflow: hidden; background: radial-gradient(120% 90% at 20% 0%, var(--ap-brand-soft), transparent 60%), var(--ap-surface-2); border: 1px solid var(--ap-line); display: grid; place-items: center; align-content: center; color: var(--ap-muted); text-align: center; }
.ap-r-side .dbook-room-image-slot img { width: 100%; height: 100%; object-fit: cover; }
.ap-r-side .dbook-room-image-icon svg { width: 26px; height: 26px; }
.ap-r-side .dbook-room-image-caption { display: block; font-size: 12px; font-weight: 600; }
.ap-r-side .dbook-room-image-nav { position: absolute; top: 50%; translate: 0 -50%; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); color: var(--ap-ink); font-size: 18px; line-height: 1; display: grid; place-items: center; padding: 0; }
.ap-r-side .dbook-room-image-nav-prev { left: 6px; }
.ap-r-side .dbook-room-image-nav-next { right: 6px; }
.ap-r-amen { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.ap-r-amen li { font-size: 12px; font-weight: 600; color: var(--ap-ink-2); background: var(--ap-surface-2); padding: 3px 9px; border-radius: 999px; }
.ap-more { align-self: flex-start; border: 0; background: none; padding: 0; color: var(--ap-brand-ink); font-weight: 600; font-size: 13px; }
.ap-more:hover { text-decoration: underline; }
.ap-r-more { display: flex; flex-direction: column; gap: 8px; }
.ap-r-more p { font-size: 13px; color: var(--ap-ink-2); }
.ap-rate { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--ap-line); align-items: center; }
.ap-rate:last-child { border-bottom: 0; }
.ap-rate b.ap-rn { display: block; font-size: 15.5px; font-weight: 700; margin-bottom: 6px; overflow-wrap: anywhere; }
.ap-meta { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.ap-left { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ap-warn); }
.ap-left svg { width: 14px; height: 14px; }
.ap-rate .ap-note { font-size: 12.5px; color: var(--ap-muted); margin-top: 8px; }
.ap-rate .ap-note.ap-bad { color: var(--ap-bad); font-weight: 600; }
.ap-rprice { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 160px; }
.ap-rprice b { font-family: var(--ap-display); font-size: 24px; font-weight: 500; line-height: 1.2; }
.ap-rprice span { font-size: 12px; color: var(--ap-muted); }
.ap-rprice .ap-btn { margin-top: 6px; }
.ap-trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; color: var(--ap-muted); font-size: 13px; font-weight: 600; padding-top: 8px; }
.ap-trust span { display: inline-flex; align-items: center; gap: 8px; }
.ap-trust svg { width: 16px; height: 16px; color: var(--ap-brand); }

/* ── stat strip, tables, cards ── */
.ap-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; }
.ap-strip > div { padding: 16px 20px; border-left: 1px solid var(--ap-line); min-width: 0; }
.ap-strip > div:first-child { border-left: 0; }
.ap-strip .ap-v { font-family: var(--ap-display); font-size: 30px; font-weight: 500; line-height: 1.1; overflow-wrap: anywhere; }
.ap-strip .ap-k { color: var(--ap-ink-2); font-size: 13px; }
.ap-strip .ap-s { color: var(--ap-muted); font-size: 12px; }
.ap-tablewrap { overflow-x: auto; position: relative; }
.ap-table { width: 100%; border-collapse: collapse; min-width: 980px; }
.ap-table th { font-size: 12.5px; color: var(--ap-muted); font-weight: 600; text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--ap-line); white-space: nowrap; background: var(--ap-surface); }
.ap-table td { padding: 13px 16px; border-bottom: 1px solid var(--ap-line); vertical-align: middle; }
.ap-table tbody tr:last-child td { border-bottom: 0; }
.ap-table tbody tr:hover td { background: var(--ap-surface-2); }
.ap-table td.ap-r, .ap-table th.ap-r { text-align: right; }
.ap-table td .ap-sub, .ap-mcard .ap-sub { display: block; color: var(--ap-muted); font-size: 12px; }
.ap-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 600; color: var(--ap-brand-ink); }
.ap-mcards { display: none; }
.ap-foot { display: flex; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--ap-line); color: var(--ap-muted); font-size: 13px; flex-wrap: wrap; }
.ap-pager { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--ap-line); }
.ap-pager button { min-width: 36px; height: 36px; padding: 0 10px; border: 1px solid var(--ap-line); background: var(--ap-surface); border-radius: var(--ap-r-md); font-weight: 600; color: var(--ap-ink-2); }
.ap-pager button:hover:not(:disabled) { background: var(--ap-surface-2); }
.ap-pager button.ap-on { background: var(--ap-brand); border-color: var(--ap-brand); color: #fff; }
.ap-pager button:disabled { opacity: .4; cursor: not-allowed; }
.ap-state { padding: 36px 24px; text-align: center; color: var(--ap-muted); }
.ap-state b { display: block; color: var(--ap-ink); font-size: 16px; margin-bottom: 4px; }
.ap-state.ap-err b { color: var(--ap-bad); }
.ap-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--ap-line); }
.ap-mcard { padding: 14px 16px; border-bottom: 1px solid var(--ap-line); display: flex; flex-direction: column; gap: 8px; }
.ap-mcard:last-child { border-bottom: 0; }
.ap-mcard .ap-row1 { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.ap-mcard .ap-row2 { display: flex; justify-content: space-between; gap: 10px; align-items: flex-end; }
.ap-mcard .ap-money { font-family: var(--ap-display); font-size: 22px; font-weight: 500; }

/* ── TAC ── */
.ap-h2 { font-family: var(--ap-display); font-size: 26px; margin-bottom: 10px; }
.ap-tac-row { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(4, minmax(0, 1fr)); align-items: stretch; border-top: 1px solid var(--ap-line); }
.ap-tac-row:first-child { border-top: 0; }
.ap-tac-row > div { padding: 16px 18px; border-left: 1px solid var(--ap-line); min-width: 0; }
.ap-tac-row > div:first-child { border-left: 0; }
.ap-tac-row h3 { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.ap-tac-row .ap-k { font-size: 12px; color: var(--ap-muted); font-weight: 600; }
.ap-tac-row .ap-v { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.ap-tac-row .ap-v small { display: block; font-weight: 500; font-size: 12.5px; color: var(--ap-muted); }
.ap-tac-row .ap-note { font-size: 12.5px; color: var(--ap-muted); margin-top: 6px; }
.ap-tacbar { height: 6px; border-radius: 3px; background: var(--ap-surface-2); overflow: hidden; margin-top: 6px; }
.ap-tacbar i { display: block; height: 100%; background: var(--ap-brand); border-radius: 3px; }
.ap-filterbar { padding: 14px 18px; }
body[data-portal="agent"] #mytac-filterbar { border-radius: var(--ap-r-lg); }

/* ── dialogs (booking form, TAC request, generic message, receipt) ── */
.ap-scrim {
  display: none; position: fixed; inset: 0; z-index: 1100; background: rgba(15,17,28,.5); backdrop-filter: blur(2px);
  place-items: center; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); overflow-y: auto;
}
.ap-scrim.active { display: grid; }
#modal-overlay.ap-scrim { z-index: 1200; }
.ap-dlg {
  width: min(520px, 100%); max-height: calc(100dvh - 48px); background: var(--ap-surface); border: 1px solid var(--ap-line); border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0,0,0,.35); display: flex; flex-direction: column; overflow: hidden;
}
.ap-dlg.ap-wide { width: min(780px, 100%); }
.ap-dlg.ap-mid { width: min(640px, 100%); }
.ap-d-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--ap-line); }
.ap-d-h h2, .ap-d-h h3 { font-family: var(--ap-display); font-size: 26px; line-height: 1.15; font-weight: 500; }
.ap-d-h p { color: var(--ap-ink-2); font-size: 13.5px; margin-top: 2px; overflow-wrap: anywhere; }
.ap-d-b { padding: 18px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; min-height: 0; }
.ap-d-f { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--ap-line); background: var(--ap-surface-2); flex-wrap: wrap; }
.ap-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; margin: 0; padding: 14px 16px; border: 1px solid var(--ap-line); border-radius: 12px; background: var(--ap-surface-2); }
.ap-kv.ap-kv3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ap-kv dt { font-size: 12px; color: var(--ap-muted); font-weight: 600; }
.ap-kv dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.ap-kv .ap-full { grid-column: 1 / -1; }
.ap-sec { display: flex; flex-direction: column; gap: 12px; }
.ap-sec > h4 { font-size: 13px; font-weight: 700; color: var(--ap-muted); text-transform: uppercase; letter-spacing: .05em; display: flex; align-items: center; gap: 8px; }
.ap-sec > h4::after { content: ""; flex: 1; height: 1px; background: var(--ap-line); }
.ap-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ap-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ap-ink-2); min-width: 0; }
.ap-field input, .ap-field select, .ap-field textarea {
  min-height: 44px; border: 1px solid var(--ap-line); border-radius: var(--ap-r-md); padding: 0 12px; background: var(--ap-surface); color: var(--ap-ink); font-weight: 400; font-size: 15px; width: 100%;
}
.ap-field textarea { min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.ap-field input:focus, .ap-field select:focus, .ap-field textarea:focus { border-color: var(--ap-brand); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ap-brand) 20%, transparent); }
.ap-field.ap-invalid input, .ap-field.ap-invalid select { border-color: var(--ap-bad); }
.ap-field .ap-ro { min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px dashed var(--ap-line); border-radius: var(--ap-r-md); font-weight: 600; color: var(--ap-ink); }
.ap-field .ap-ro svg { width: 16px; height: 16px; color: var(--ap-brand); flex: none; }
.ap-field .ap-hint { font-weight: 400; color: var(--ap-muted); font-size: 12.5px; }
.ap-field .ap-err { font-weight: 600; font-size: 12.5px; color: var(--ap-bad); min-height: 0; }
.ap-field .ap-err:empty { display: none; }
.ap-count { align-self: flex-end; font-size: 12px; font-weight: 400; color: var(--ap-muted); }
.ap-req { color: var(--ap-bad); }
.ap-break { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; margin: 0; font-size: 14px; }
.ap-break dt { color: var(--ap-ink-2); min-width: 0; overflow-wrap: anywhere; }
.ap-break dd { margin: 0; text-align: right; font-weight: 600; }
.ap-break .ap-tot { border-top: 1px solid var(--ap-line); padding-top: 10px; font-size: 15px; color: var(--ap-ink); font-weight: 700; align-self: end; }
.ap-break .ap-tot + dd { border-top: 1px solid var(--ap-line); padding-top: 10px; font-family: var(--ap-display); font-size: 26px; font-weight: 500; line-height: 1.1; }
.ap-callout { padding: 11px 13px; border-radius: var(--ap-r-md); font-size: 13.5px; font-weight: 600; }
.ap-callout.ap-ok { background: var(--ap-ok-bg); color: var(--ap-ok); }
.ap-callout.ap-idle { background: var(--ap-surface-2); color: var(--ap-ink-2); }
.ap-callout.ap-bad { background: var(--ap-bad-bg); color: var(--ap-bad); }
.ap-callout.ap-warn { background: var(--ap-warn-bg); color: var(--ap-warn); }
.ap-sugg { list-style: none; margin: 0; padding: 6px; border: 1px solid var(--ap-line); border-radius: var(--ap-r-md); max-height: 220px; overflow-y: auto; }
.ap-sugg button { width: 100%; text-align: left; border: 0; background: none; padding: 10px; border-radius: 8px; display: flex; justify-content: space-between; gap: 8px; }
.ap-sugg button:hover { background: var(--ap-brand-soft); }
.ap-sugg .ap-none { padding: 12px; color: var(--ap-muted); font-size: 13px; }
.ap-selected { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--ap-line); border-radius: var(--ap-r-md); background: var(--ap-surface-2); font-weight: 600; }

/* receipt */
.ap-confirm-h { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 22px 20px; background: var(--ap-ok-bg); text-align: center; border-bottom: 1px solid var(--ap-line); }
.ap-confirm-h.ap-bad { background: var(--ap-bad-bg); }
.ap-tick { width: 56px; height: 56px; border-radius: 50%; background: var(--ap-ok); color: #fff; display: grid; place-items: center; }
.ap-tick svg { width: 30px; height: 30px; }
.ap-confirm-h h2 { font-family: var(--ap-display); font-size: 30px; color: var(--ap-ok); font-weight: 500; }
.ap-confirm-h.ap-bad h2 { color: var(--ap-bad); }
.ap-confirm-h .ap-small { color: var(--ap-ink-2); }
.ap-ticket { border: 1px solid var(--ap-line); border-radius: 14px; overflow: hidden; background: var(--ap-surface); }
.ap-ticket-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; background: var(--ap-surface-2); border-bottom: 1px dashed var(--ap-line); flex-wrap: wrap; }
.ap-ticket-top .ap-lab { font-size: 12px; font-weight: 600; color: var(--ap-muted); display: block; }
.ap-ticket-top b { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 24px; letter-spacing: .08em; }
.ap-ticket-act { display: flex; gap: 8px; align-items: center; }
.ap-copy { border: 1px solid var(--ap-line); background: var(--ap-surface); border-radius: 8px; min-height: 32px; padding: 0 10px; font-size: 12.5px; font-weight: 600; }
.ap-copy:hover { background: var(--ap-surface-2); }
.ap-stay { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 18px; }
.ap-stay .ap-when small { display: block; font-size: 12px; font-weight: 600; color: var(--ap-muted); }
.ap-stay .ap-when b { display: block; font-family: var(--ap-display); font-size: 22px; font-weight: 500; line-height: 1.2; }
.ap-stay .ap-when span { font-size: 12.5px; color: var(--ap-muted); }
.ap-stay .ap-when.ap-out { text-align: right; }
.ap-stay .ap-nights { display: grid; justify-items: center; gap: 2px; color: var(--ap-brand-ink); font-size: 12.5px; font-weight: 700; }
.ap-stay .ap-nights::before, .ap-stay .ap-nights::after { content: ""; width: 1px; height: 12px; background: var(--ap-line); }
.ap-ticket .ap-kv { border: 0; border-top: 1px solid var(--ap-line); border-radius: 0; background: var(--ap-surface); }
.ap-total { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; border-top: 1px solid var(--ap-line); background: var(--ap-brand-soft); }
.ap-total .ap-lab { font-size: 12.5px; font-weight: 600; color: var(--ap-brand-ink); display: block; }
.ap-total b { font-family: var(--ap-display); font-size: 32px; font-weight: 500; letter-spacing: -.01em; line-height: 1.1; color: var(--ap-ink); }
.ap-note-box { padding: 12px 14px; border: 1px solid var(--ap-line); border-radius: 12px; background: var(--ap-surface-2); font-size: 13.5px; color: var(--ap-ink-2); }
.ap-note-box b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ap-muted); margin-bottom: 2px; }

/* the generic message dialog (showModal / showModalWithIcon): same markup, new look */
.modal-container { width: min(520px, 100%); max-width: none; max-height: calc(100dvh - 48px); background: var(--ap-surface); border: 1px solid var(--ap-line); border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.35); overflow: hidden; display: flex; flex-direction: column; opacity: 1; transform: none; }
.modal-container > .modal-header, .modal-container > .modal-footer { flex: none; }
.modal-container > .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.ap-receipt { display: flex; flex-direction: column; gap: 14px; }
.modal-header { padding: 20px 24px 16px; border-bottom: 1px solid var(--ap-line); text-align: left; position: relative; }
.modal-header.success { background: var(--ap-ok-bg); text-align: center; }
.modal-header.error { background: var(--ap-bad-bg); }
.modal-success-icon { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 50%; background: var(--ap-ok); color: #fff; display: grid; place-items: center; box-shadow: none; }
.modal-success-icon svg { width: 28px; height: 28px; }
.modal-title { margin: 0; font-family: var(--ap-display); font-size: 26px; font-weight: 500; color: var(--ap-ink); line-height: 1.15; }
.modal-title.success { color: var(--ap-ok); }
.modal-title.error { color: var(--ap-bad); }
.modal-body { padding: 18px 24px; line-height: 1.55; color: var(--ap-ink-2); }
.modal-body-content { white-space: pre-line; }
.modal-body-content:has(.ap-receipt) { white-space: normal; }
.modal-container:has(.ap-receipt) { width: min(720px, 100%); }
.modal-container:has(.ap-receipt) .modal-header { background: var(--ap-ok-bg); border-bottom-color: var(--ap-line); padding: 26px 22px 18px; text-align: center; }
.modal-container:has(.ap-receipt) .modal-title { color: var(--ap-ok); font-size: 30px; }
.modal-container:has(.ap-receipt) .modal-body { padding: 18px 24px; }
.modal-footer { padding: 14px 24px; border-top: 1px solid var(--ap-line); background: var(--ap-surface-2); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.modal-button { min-height: 40px; padding: 0 20px; border: 1px solid var(--ap-line); border-radius: var(--ap-r-md); font-weight: 600; background: var(--ap-surface); color: var(--ap-ink); cursor: pointer; transition: background-color .15s; }
.modal-button.primary { background: var(--ap-brand); border-color: var(--ap-brand); color: #fff; }
.modal-button.primary:hover { background: var(--ap-brand-ink); }
.modal-button.secondary { background: var(--ap-surface); color: var(--ap-ink); }
.modal-button.secondary:hover { background: var(--ap-surface-2); }
#modal-button.agent-support-send-btn { background-color: var(--ap-brand); }
.booking-details { margin: 0; }
.booking-details.error { background: var(--ap-warn-bg); color: var(--ap-warn); padding: 14px 16px; border-radius: 12px; border-left: 4px solid #e0a23a; font-weight: 500; }
.error-suggestions { margin-top: 14px; padding: 12px 14px; background: var(--ap-surface-2); border-radius: 10px; font-size: 14px; }
.error-suggestions ul { margin: 8px 0 0; padding-left: 20px; }
.hotel-support-popover-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--ap-line); background: var(--ap-surface); font-size: 20px; line-height: 1; }

/* ── tablet ── */
@media (max-width: 1060px) {
  .ap-search { grid-template-columns: 1fr 1fr; }
  .ap-fld { border-left: 0; border-top: 1px solid var(--ap-line); }
  .ap-fld:nth-child(1), .ap-fld:nth-child(2) { border-top: 0; }
  .ap-fld:nth-child(2), .ap-fld:nth-child(4) { border-left: 1px solid var(--ap-line); }
  .ap-go { grid-column: 1 / -1; }
  .ap-nav { display: none; }
  .ap-mtabs { display: flex; gap: 6px; padding: 8px 0 10px; overflow-x: auto; scrollbar-width: none; }
  .ap-mtabs::-webkit-scrollbar { display: none; }
  .ap-mtabs button { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; color: var(--ap-ink-2); font-weight: 600; border: 1px solid var(--ap-line); background: var(--ap-surface); white-space: nowrap; }
  .ap-mtabs button svg { width: 15px; height: 15px; }
  .ap-mtabs button[aria-current="page"] { background: var(--ap-brand); border-color: var(--ap-brand); color: var(--ap-on-brand); }
  .ap-tac-row { grid-template-columns: 1fr 1fr; }
  .ap-tac-row > div:first-child { grid-column: 1 / -1; }
  .ap-tac-row > div:nth-child(2), .ap-tac-row > div:nth-child(4) { border-left: 0; }
  .ap-tac-row > div:nth-child(n+2) { border-top: 1px solid var(--ap-line); }
  .ap-h-top { grid-template-columns: 200px minmax(0, 1fr); }
  .ap-h-price { grid-column: 1 / -1; flex-direction: row; align-items: flex-end; text-align: left; }
}

/* ── phone ── */
@media (max-width: 760px) {
  .ap-page { padding-block: 18px 40px; }
  .ap-view { gap: 16px; }
  .ap-bar { gap: 10px; min-height: 58px; }
  .ap-brand small { display: none; }
  .ap-brand b { font-size: 18px; }
  .ap-pillbtn span, .ap-me .ap-nm, .ap-me > svg { display: none; }
  .ap-pillbtn { width: 40px; padding: 0; justify-content: center; }
  .ap-me { padding: 0; height: auto; }
  .ap-tools { gap: 6px; }
  .ap-menu, .ap-top .tac-notif-dropdown { position: fixed; top: calc(58px + env(safe-area-inset-top, 0px)); right: 12px; left: 12px; width: auto; min-width: 0; }
  .ap-search { grid-template-columns: 1fr 1fr; }
  .ap-fld { padding: 10px 14px; }
  .ap-fld:nth-child(3), .ap-fld:nth-child(4) { grid-column: 1 / -1; border-left: 0; }
  .ap-fld .input-control input { font-size: 15px; }
  .ap-go { margin: 12px; height: 48px; }
  body[data-portal="agent"] #calendar-container { position: fixed; left: 12px; right: 12px; top: auto; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: auto; max-width: none; max-height: 82dvh; overflow-y: auto; box-shadow: 0 0 0 100vmax rgba(15,17,28,.45), 0 18px 50px rgba(0,0,0,.3); }
  body[data-portal="agent"] #guest-selector-container, body[data-portal="agent"] #amenities-selector-container { left: 0; right: 0; width: auto; }
  .ap-reshead h2 { font-size: 24px; }
  .ap-sortlab { width: 100%; }
  .ap-sortlab .ap-sel { flex: 1; }
  .ap-h-top { grid-template-columns: 1fr; gap: 12px; padding: 12px; }
  .ap-h-media { min-height: 170px; }
  .ap-h-info h3 { font-size: 22px; }
  .ap-h-price { flex-direction: row; align-items: flex-end; justify-content: space-between; text-align: left; min-width: 0; flex-wrap: wrap; }
  .ap-h-price b { font-size: 26px; }
  .ap-rooms { padding: 10px; }
  .ap-room { grid-template-columns: 1fr; }
  .ap-r-side { border-right: 0; border-bottom: 1px solid var(--ap-line); }
  .ap-rate { grid-template-columns: 1fr; padding: 14px; }
  .ap-rprice { align-items: stretch; text-align: left; min-width: 0; }
  .ap-rprice .ap-btn { width: 100%; min-height: 44px; }
  .ap-pill { white-space: normal; text-align: left; }
  .ap-strip { grid-template-columns: 1fr 1fr; }
  .ap-strip > div { padding: 14px 16px; }
  .ap-strip > div:nth-child(3) { border-left: 0; }
  .ap-strip > div:nth-child(n+3) { border-top: 1px solid var(--ap-line); }
  .ap-strip .ap-v { font-size: 24px; }
  .ap-tablewrap.ap-bk-table { display: none; }
  .ap-mcards { display: flex; flex-direction: column; }
  .ap-tac-row > div { padding: 14px 16px; }
  .ap-head { align-items: stretch; }
  .ap-head .ap-btn { width: 100%; }
  /* dialogs become bottom sheets */
  .ap-scrim { padding: 0; place-items: end stretch; }
  .ap-dlg, .ap-dlg.ap-wide, .ap-dlg.ap-mid { width: 100%; max-height: calc(100dvh - 24px); border-radius: 20px 20px 0 0; }
  .ap-d-h { padding: 16px 18px; }
  .ap-d-h h2, .ap-d-h h3 { font-size: 22px; }
  .ap-d-b { padding: 16px 18px; gap: 16px; }
  .ap-d-f { padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .ap-d-f .ap-btn { flex: 1 1 140px; min-height: 46px; }
  .ap-grid2 { grid-template-columns: 1fr; }
  .ap-kv, .ap-kv.ap-kv3 { grid-template-columns: 1fr 1fr; }
  .ap-field input, .ap-field select { font-size: 16px; } /* 16px stops iOS zooming into the field */
  .ap-field textarea { font-size: 16px; }
  .ap-stay { grid-template-columns: 1fr 1fr; }
  .ap-stay .ap-nights { grid-column: 1 / -1; grid-row: 2; display: flex; justify-content: center; gap: 8px; }
  .ap-stay .ap-nights::before, .ap-stay .ap-nights::after { width: 24px; height: 1px; }
  .ap-total b { font-size: 28px; }
  .modal-container { width: 100%; max-height: calc(100dvh - 24px); border-radius: 20px 20px 0 0; }
  #modal-overlay.ap-scrim { padding: 0; place-items: end stretch; }
  .modal-header, .modal-body, .modal-footer { padding-left: 18px; padding-right: 18px; }
  .modal-footer { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .modal-footer .modal-button { flex: 1 1 120px; min-height: 46px; }
}
@media (max-width: 380px) {
  .ap-kv, .ap-kv.ap-kv3 { grid-template-columns: 1fr; }
  .ap-search { grid-template-columns: 1fr; }
  .ap-fld:nth-child(2) { border-left: 0; border-top: 1px solid var(--ap-line); }
}
@media (prefers-reduced-motion: reduce) { body[data-portal="agent"] * { transition: none !important; animation-duration: .01ms !important; } }

/* ── additions: list/empty helpers, the shared date-range filter, room rate column ── */
.ap-sugg.ap-none { border: 1px solid var(--ap-line); border-radius: var(--ap-r-md); padding: 12px; margin: 0; color: var(--ap-muted); font-size: 13px; list-style: none; max-height: none; }
.ap-room-plans { min-width: 0; }
.ap-filterbar .blist-filterbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.ap-filterbar .blist-filter-group { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ap-filterbar .blist-filter-label { font-size: 12.5px; font-weight: 600; color: var(--ap-muted); }
.ap-filterbar .blist-select, .ap-filterbar .blist-input { height: 40px; min-width: 160px; border: 1px solid var(--ap-line); border-radius: var(--ap-r-md); background: var(--ap-surface); padding: 0 12px; color: var(--ap-ink); }
@media (max-width: 760px) {
  .ap-filterbar .blist-filter-group { flex: 1 1 140px; }
  .ap-filterbar .blist-select, .ap-filterbar .blist-input { width: 100%; font-size: 16px; }
}

/* the older stylesheet pads and frames these containers for its own table; the portal's cards do that now */
body[data-portal="agent"] #bookings-view, body[data-portal="agent"] #tac-view, body[data-portal="agent"] #search-view { padding: 0; }
body[data-portal="agent"] #bookings-list, body[data-portal="agent"] #tac-relationships-list { overflow: visible; border: 0; border-radius: 0; background: none; box-shadow: none; padding: 0; }
