/* RWD — the chat assistant (public/assets/js/chat.js).
   Bottom-right. On phones it sits above the action bar (--bar-h) and the
   open panel takes the screen; on desktop it is a 380px card. The desktop
   Enquire tab lives on the right edge at 62% height, so a bottom corner
   leaves it clear. */

.rc{ --rc-ink:#0B0B0C; --rc-gold:#B08D57; --rc-green:#76BC21; --rc-paper:#F6F6F2; --rc-line:#E3E3DC;
  /* Above page content, which stacks up to 3000 (the homepage hero and the
     project carousel), below the 9999 preloader. */
  position:fixed; right:22px; bottom:22px; z-index:4000;
  font:400 15px/1.5 var(--body, system-ui, sans-serif); color:var(--rc-ink) }

/* Held back during the homepage intro and brought in with the header and
   the Enquire tab, on the same curve (chrome.css, html.key-intro). */
.rc{ transition:transform .78s cubic-bezier(.22,.61,.36,1), opacity .5s ease }
html.booting .rc, html.key-intro .rc{
  transform:translateY(140%); opacity:0; visibility:hidden; pointer-events:none; transition:none }

.rc-launch{ position:relative; display:grid; place-items:center; width:60px; height:60px; margin-left:auto; padding:0;
  border:1.5px solid var(--rc-gold); border-radius:50%; cursor:pointer; background:#fff;
  box-shadow:0 10px 30px rgba(0,0,0,.18); transition:transform .2s ease }
/* A soft gold ring that breathes a few times, then stops. */
.rc-launch::after{ content:""; position:absolute; inset:-1.5px; border-radius:50%;
  border:2px solid var(--rc-gold); opacity:0; animation:rc-ring 2.6s ease-out 3s 4; pointer-events:none }
@keyframes rc-ring{ 0%{ opacity:.55; transform:scale(1) } 100%{ opacity:0; transform:scale(1.45) } }
.rc-launch:hover{ transform:translateY(-2px) scale(1.04) }
.rc-launch:focus-visible{ outline:3px solid var(--rc-gold); outline-offset:3px }
.rc-launch svg{ width:28px; height:28px; fill:var(--rc-gold) }
.rc.is-open .rc-launch{ display:none }

.rc-panel{ display:none; flex-direction:column; width:380px; height:min(600px, calc(100vh - 44px));
  background:#fff; border-radius:14px; overflow:hidden; box-shadow:0 18px 60px rgba(0,0,0,.28) }
.rc.is-open .rc-panel{ display:flex }

.rc-head{ display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:14px 16px 14px 18px; background:var(--rc-ink); color:#fff }
/* ---- the nudge: a small white card beside the icon ---- */
.rc-nudge{ position:absolute; right:0; bottom:74px; display:flex; align-items:flex-start;
  width:250px; background:#fff; border:1px solid #E8DCC4; border-radius:14px;
  box-shadow:0 12px 34px rgba(0,0,0,.16);
  opacity:0; transform:translateY(8px); transition:opacity .35s ease, transform .35s ease }
.rc-nudge.show{ opacity:1; transform:none }
.rc-nudge::after{ content:""; position:absolute; right:22px; bottom:-7px; width:12px; height:12px;
  background:#fff; border-right:1px solid #E8DCC4; border-bottom:1px solid #E8DCC4; transform:rotate(45deg) }
.rc.is-open .rc-nudge{ display:none }
.rc-nudge-msg{ flex:1; display:grid; gap:3px; padding:12px 4px 12px 14px; border:0; background:none;
  text-align:left; cursor:pointer; color:var(--rc-ink); font:inherit }
.rc-nudge-msg b{ font-weight:600; font-size:14px; line-height:1.35 }
.rc-nudge-msg small{ font-size:12.5px; color:var(--rc-gold); font-weight:600 }
.rc-live{ display:inline-flex; align-items:center; gap:6px; font-size:10.5px; font-weight:700;
  letter-spacing:.12em; text-transform:uppercase; color:#6C6860 }
.rc-live i{ width:7px; height:7px; border-radius:50%; background:var(--rc-green);
  box-shadow:0 0 0 0 rgba(118,188,33,.5); animation:rc-live 2s infinite }
@keyframes rc-live{ 0%{ box-shadow:0 0 0 0 rgba(118,188,33,.5) } 70%{ box-shadow:0 0 0 6px rgba(118,188,33,0) } 100%{ box-shadow:0 0 0 0 rgba(118,188,33,0) } }
.rc-nudge-x{ flex:none; width:30px; height:30px; margin:6px 6px 0 0; border:0; border-radius:50%;
  background:transparent; color:#7C7C78; font-size:18px; line-height:1; cursor:pointer }
.rc-nudge-x:hover, .rc-nudge-x:focus-visible{ background:var(--rc-paper); outline:none }

/* Desktop: the header is the handle for moving the window. */
@media (min-width:901px){
  /* Beside the icon rather than above it, clear of the Enquire / Site
     visit tabs on the right edge. */
  .rc-nudge{ right:76px; bottom:0 }
  .rc-nudge::after{ right:-7px; bottom:22px; border:0; border-right:1px solid #E8DCC4; border-top:1px solid #E8DCC4 }
  .rc-head{ cursor:grab; user-select:none; touch-action:none }
  .rc.is-dragging .rc-head{ cursor:grabbing }
  .rc.is-dragging .rc-panel{ box-shadow:0 24px 70px rgba(0,0,0,.35) }
  .rc-panel.rc-moved{ position:fixed; right:auto; bottom:auto }
}
.rc-head b{ display:block; font:500 17px/1.2 var(--disp, Georgia, serif) }
.rc-head small{ display:block; margin-top:3px; font-size:12px; color:#bdbdb6 }
.rc-close{ width:36px; height:36px; border:0; border-radius:50%; background:transparent; color:#fff;
  font-size:26px; line-height:1; cursor:pointer }
.rc-close:hover, .rc-close:focus-visible{ background:rgba(255,255,255,.12); outline:none }

.rc-log{ flex:1; overflow-y:auto; padding:16px; background:var(--rc-paper);
  display:flex; flex-direction:column; gap:10px; overscroll-behavior:contain }
.rc-msg{ max-width:86%; padding:10px 13px; border-radius:14px; white-space:pre-wrap; overflow-wrap:anywhere }
.rc-msg p{ margin:0 }
.rc-assistant{ align-self:flex-start; background:#fff; border:1px solid var(--rc-line); border-bottom-left-radius:4px }
.rc-user{ align-self:flex-end; background:var(--rc-ink); color:#fff; border-bottom-right-radius:4px }
.rc-note{ align-self:stretch; max-width:none; background:#FBF7EF; border:1px solid #E8DCC4; font-size:14px }
.rc-links{ display:flex; flex-wrap:wrap; gap:8px 16px; margin-top:6px !important }
.rc-links a, .rc-foot a{ color:inherit; font-weight:600; text-decoration:underline; text-underline-offset:2px }

.rc-typing{ display:flex; gap:4px; padding:14px }
.rc-typing span{ width:7px; height:7px; border-radius:50%; background:#9a9a93; animation:rc-dot 1.2s infinite ease-in-out }
.rc-typing span:nth-child(2){ animation-delay:.15s }
.rc-typing span:nth-child(3){ animation-delay:.3s }
@keyframes rc-dot{ 0%, 80%, 100%{ opacity:.3; transform:none } 40%{ opacity:1; transform:translateY(-3px) } }

.rc-chips{ display:flex; flex-wrap:wrap; gap:8px; padding:0 16px 12px; background:var(--rc-paper) }
.rc-chips[hidden]{ display:none }
.rc-chips button{ padding:8px 12px; border:1px solid var(--rc-gold); border-radius:999px; background:#fff;
  color:var(--rc-ink); font:500 13px/1.2 var(--body, system-ui, sans-serif); cursor:pointer }
.rc-chips button:hover, .rc-chips button:focus-visible{ background:var(--rc-gold); color:#fff; outline:none }

.rc-cb{ align-self:stretch; display:grid; gap:10px; padding:14px; background:#fff;
  border:1px solid var(--rc-line); border-radius:12px }
.rc-cb-h{ margin:0; font-weight:600 }
.rc-cb label{ display:grid; gap:4px; font-size:12px; letter-spacing:.06em; text-transform:uppercase; color:#6C6860 }
.rc-cb input{ padding:10px 12px; border:1px solid var(--rc-line); border-radius:8px; font:400 15px/1.3 var(--body, system-ui, sans-serif); color:var(--rc-ink) }
.rc-cb input:focus{ outline:2px solid var(--rc-gold); outline-offset:0; border-color:transparent }
.rc-cb button{ padding:12px; border:0; border-radius:8px; background:var(--rc-green); color:#fff;
  font:600 14px/1 var(--body, system-ui, sans-serif); cursor:pointer }
.rc-cb button:disabled{ opacity:.6; cursor:default }

.rc-form{ display:flex; align-items:flex-end; gap:8px; padding:10px 12px; border-top:1px solid var(--rc-line); background:#fff }
.rc-form textarea{ flex:1; resize:none; max-height:120px; padding:10px 12px; border:1px solid var(--rc-line); border-radius:10px;
  font:400 15px/1.4 var(--body, system-ui, sans-serif); color:var(--rc-ink) }
.rc-form textarea:focus{ outline:2px solid var(--rc-gold); outline-offset:0; border-color:transparent }
.rc-form button{ flex:none; width:42px; height:42px; border:0; border-radius:50%; background:var(--rc-ink); cursor:pointer;
  display:grid; place-items:center }
.rc-form button:disabled{ opacity:.45; cursor:default }
.rc-form button svg{ width:19px; height:19px; fill:#fff }
.rc-foot{ margin:0; padding:0 14px 10px; background:#fff; font-size:11.5px; color:#7C7C78 }
.rc-sr{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap }

@media (max-width:900px){
  .rc{ right:14px; bottom:calc(var(--bar-h, 58px) + 14px) }
  .rc-launch{ width:54px; height:54px }
  .rc-nudge{ bottom:66px; width:230px }
  .rc.is-open{ inset:0; right:0; bottom:0 }
  /* Out of the way while the phone menu is open. */
  body:has(.mobile-menu.open) .rc{ display:none }
  .rc-panel{ width:100%; height:100%; border-radius:0 }
}
@media (prefers-reduced-motion:reduce){
  .rc-launch{ transition:none }
  .rc-launch::after, .rc-live i{ animation:none }
  .rc-nudge{ transition:none }
  .rc-typing span{ animation:none; opacity:.7 }
}
