/* RelocatePH guided chat, re-tokened for "The Desk": sheet panel, cobalt rule, cobalt-wash hand-off. Selectors unchanged. */
.rph-chat { --chat-ink: var(--carbon, #1a1c21); --chat-teal: var(--cobalt, #2443b8); --chat-mango: var(--cobalt-wash, #e4e9fa); --chat-paper: var(--sheet, #fcfdfe); --chat-capiz: var(--bond, #f2f4f7); --chat-rule: var(--rule, #c5cad6); font: 400 1rem/1.5 var(--ui, system-ui, sans-serif); color: var(--chat-ink); }
.rph-chat *, .rph-chat *::before, .rph-chat *::after { box-sizing: border-box; }
.rph-chat [hidden] { display: none !important; }
.rph-chat button, .rph-chat select, .rph-chat textarea { font: inherit; letter-spacing: normal; }
.rph-chat button { cursor: pointer; }
.rph-chat svg { display: block; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.rph-chat :is(button, a, select, textarea, [tabindex]):focus-visible { outline: 3px solid var(--chat-teal); outline-offset: 3px; }
.rph-chat-title:focus { outline: none; }
.rph-chat .rph-chat-title:focus-visible { outline: 3px solid var(--chat-teal); outline-offset: 2px; }
.rph-chat .rph-chat-transcript:focus-visible { outline-offset: -4px; }

/* Launcher: a small paper plate with the route mark. */
.rph-chat-launcher { position: fixed; z-index: 90; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); display: inline-flex; align-items: center; gap: .55rem; max-width: calc(100vw - 2rem); min-height: 48px; padding: .55rem 1.1rem .55rem .7rem; border: 2px solid var(--chat-ink); border-radius: 999px; background: var(--chat-paper); color: var(--chat-ink); box-shadow: 0 4px 0 var(--chat-ink); font: 600 .9375rem/1.2 var(--ui, system-ui, sans-serif); text-align: start; }
.rph-chat-launcher svg { width: 26px; height: 26px; padding: 3px; border-radius: 7px; background: var(--chat-ink); stroke-width: 2.5; }
.rph-chat-launcher .rph-chat-route { stroke: var(--chat-paper); }
.rph-chat-launcher .rph-chat-from { fill: var(--chat-paper); stroke: none; }
.rph-chat-launcher .rph-chat-to { fill: var(--chat-mango); stroke: none; }
.rph-chat-launcher:hover { background: var(--chat-capiz); }
.rph-chat-launcher[aria-expanded="true"] { visibility: hidden; background: var(--chat-capiz); box-shadow: 0 2px 0 var(--chat-ink); }
.rph-chat .rph-chat-launcher:focus-visible { outline: 3px solid var(--chat-mango); outline-offset: 2px; box-shadow: 0 0 0 7px var(--chat-ink); }
/* Tucked over a page action: invisible and untappable, but still in the tab order and shown on keyboard focus. */
.rph-chat-launcher.is-tucked:not(:focus-visible) { opacity: 0; pointer-events: none; }

/* Panel: header, one scrolling body, a pinned footer with the composer and hand-off. */
.rph-chat-panel { position: fixed; z-index: 91; right: max(1rem, env(safe-area-inset-right)); bottom: calc(5.25rem + env(safe-area-inset-bottom)); display: grid; grid-template-rows: auto minmax(8rem, 1fr) auto; width: min(26rem, calc(100vw - 2rem)); height: min(40rem, calc(100vh - 172px)); height: min(40rem, calc(100dvh - 172px)); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; border: 2px solid var(--chat-rule); border-radius: 4px; background: var(--chat-paper); box-shadow: 0 6px 0 var(--chat-rule), 0 18px 40px rgb(26 28 33 / .18); }
.rph-chat-header { display: flex; align-items: center; gap: .5rem; padding: .7rem .75rem .7rem 1.1rem; border-bottom: 4px solid var(--chat-teal); background: var(--chat-paper); color: var(--chat-ink); }
.rph-chat .rph-chat-title { flex: 1; min-width: 0; margin: 0; overflow-wrap: anywhere; font: 700 clamp(1.15rem, 5vw, 1.5rem)/1.1 var(--display, var(--ui, system-ui, sans-serif)); font-stretch: normal; letter-spacing: -.01em; color: inherit; }
.rph-chat-close { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 2px solid var(--field, #6b7385); border-radius: 2px; background: transparent; color: var(--chat-ink); }
.rph-chat-close svg { width: 20px; height: 20px; stroke-width: 2.25; }
.rph-chat-close:hover { border-color: var(--chat-ink); background: var(--chat-mango); }
.rph-chat .rph-chat-close:focus-visible { outline-color: var(--chat-teal); }

.rph-chat-body { position: relative; overflow-y: auto; overscroll-behavior: contain; scroll-padding-block: 1rem; }
/* Language picker sits in the header so prepared topics are visible on open. */
.rph-chat-language { flex: none; min-width: 0; }
.rph-chat-language-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.rph-chat-language select { min-height: 44px; max-width: 8.5rem; padding: .4rem .5rem; border: 2px solid var(--field, #6b7385); border-radius: 2px; background: var(--chat-paper); color: var(--chat-ink); font: 600 1rem/1.2 var(--ui, system-ui, sans-serif); }
.rph-chat-language select:hover { border-color: var(--chat-ink); }
.rph-chat .rph-chat-language select:focus-visible { outline-color: var(--chat-teal); }
.rph-chat .rph-chat-mode { display: none; }
.rph-chat .rph-chat-notice { margin: .85rem 1.1rem .9rem; color: var(--carbon-2, #4c505a); font-size: .875rem; line-height: 1.5; }
.rph-chat-transcript { padding: .9rem 1.1rem 1rem; border-block: 1px solid var(--chat-rule); background: var(--chat-capiz); }
.rph-chat .rph-chat-welcome { margin: 0; font-weight: 600; }
.rph-chat-message { width: fit-content; max-width: 92%; margin-top: .75rem; padding: .7rem .85rem; border: 1px solid var(--chat-rule); border-radius: 4px 4px 4px 2px; background: var(--chat-paper); overflow-wrap: anywhere; }
.rph-chat-message-user { margin-left: auto; border-color: var(--chat-mango); border-radius: 4px 4px 2px 4px; background: var(--chat-mango); color: var(--chat-ink); font-weight: 600; }
.rph-chat .rph-chat-message p { margin: 0; white-space: pre-wrap; }
.rph-chat-speaker { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Topics: small route plates. */
.rph-chat-topics { display: flex; flex-wrap: wrap; gap: .5rem; padding: 1rem 1.1rem 1.1rem; }
.rph-chat-topics button { min-width: 0; min-height: 44px; padding: .45rem .8rem; overflow-wrap: anywhere; hyphens: auto; border: 2px solid var(--field, #6b7385); border-radius: 2px; background: var(--chat-paper); color: var(--chat-ink); font: 600 .9375rem/1.25 var(--ui, system-ui, sans-serif); text-align: start; }
.rph-chat-topics button:hover { border-color: var(--chat-teal); background: var(--chat-mango); }
.rph-chat-topics button.is-last { border-color: var(--chat-teal); background: var(--chat-mango); color: var(--chat-ink); }

.rph-chat-footer { padding: .75rem 1.1rem calc(.85rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--chat-rule); background: var(--chat-paper); }
.rph-chat-form { margin: 0; }
.rph-chat-input-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.rph-chat-entry { display: flex; align-items: flex-end; gap: .5rem; }
.rph-chat-entry textarea { flex: 1; min-width: 0; min-height: 48px; max-height: 6rem; padding: .7rem .8rem; border: 1px solid var(--field, #6b7385); border-radius: 2px; background: var(--chat-paper); color: var(--chat-ink); font-size: 1rem; line-height: 1.4; resize: none; }
.rph-chat-entry textarea::placeholder { overflow: hidden; color: var(--carbon-2, #4c505a); white-space: nowrap; text-overflow: ellipsis; }
.rph-chat-send { flex: none; min-height: 48px; padding: .5rem 1.1rem; border: 2px solid var(--chat-teal); border-radius: 2px; background: var(--chat-teal); color: var(--chat-paper); font-weight: 600; }
.rph-chat-send:hover { background: var(--cobalt-deep, #182f87); border-color: var(--cobalt-deep, #182f87); }
.rph-chat .rph-chat-status { margin: 0; font-size: .875rem; }
.rph-chat .rph-chat-status:not(:empty) { margin-top: .45rem; }
.rph-chat-status[data-error="true"] { color: var(--error, #a3241c); font-weight: 600; }
.rph-chat-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-top: .65rem; }
.rph-chat-contact { display: inline-flex; align-items: center; min-height: 44px; padding: .5rem 1.1rem; border: 2px solid var(--chat-teal); border-radius: 2px; background: var(--chat-mango); color: var(--chat-ink); font-weight: 600; text-decoration: none; }
.rph-chat-contact:hover { box-shadow: 0 3px 0 var(--chat-teal); }
.rph-chat-clear { min-height: 44px; padding: .5rem .25rem; border: 0; background: transparent; color: var(--chat-ink); font-weight: 600; text-decoration: underline; text-underline-offset: .2em; }

@media (prefers-reduced-motion: no-preference) {
  .rph-chat-launcher { transition: transform .15s, box-shadow .15s, opacity .2s; }
  .rph-chat-launcher:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--chat-ink); }
}

/* Phones: a full-width sheet under the sticky site header; the launcher hides while it is open. */
@media (max-width: 600px), (max-height: 520px) {
  .rph-chat-launcher { padding-right: 1rem; font-size: .9375rem; }
  .rph-chat-panel { top: 4.25rem; right: 0; bottom: 0; left: 0; width: auto; height: auto; border-width: 2px 0 0; border-radius: 4px 4px 0 0; box-shadow: 0 -12px 32px rgb(26 28 33 / .22); }
  .rph-chat-topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rph-chat-topics button { width: 100%; }
}
@media (max-height: 520px) {
  .rph-chat-panel { top: 0; border-width: 0; border-radius: 0; }
}
@media (forced-colors: active) {
  .rph-chat-panel, .rph-chat-message, .rph-chat-launcher, .rph-chat-contact { border: 2px solid ButtonText; }
  .rph-chat svg { stroke: ButtonText; }
}

/* Phones: icon-only launcher so it never covers page text; the label stays as its accessible name. */
@media (max-width: 480px) {
  .rph-chat-launcher { width: 52px; height: 52px; min-height: 52px; padding: 0; justify-content: center; gap: 0; }
  .rph-chat-launcher .rph-chat-launcher-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
