:root {
  --alary-dark-teal: #7c5a43;
  --alary-teal: #d26f55;
  --alary-green: #d8b07c;
  --alary-crimson: #b35f47;
  --alary-blush: #e2c18f;
  --alary-grey: #f6efe7;
  --alary-black: #2f2722;
  --alary-paper: #fffaf3;
  --alary-border: #eadbc6;
  --alary-muted: #7a695a;
  --alary-blue: #4a70af;
  --alary-vv-height: 100dvh;
  --alary-vv-top: 0px;
}
* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; }
body { margin: 0; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; background: var(--alary-grey); color: var(--alary-black); }
.demo-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 32px; background: linear-gradient(145deg, #fbf5ee 0%, var(--alary-grey) 100%); }
.demo-page section { width: min(850px, 100%); }
.environment-badge { display:inline-block; margin: 2px 0 8px; padding: 5px 9px; border: 1px solid var(--alary-border); border-radius: 999px; background: rgba(255,255,255,.72); color: var(--alary-dark-teal); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.eyebrow { font-size: 11px; letter-spacing: .22em; font-weight: 700; color: var(--alary-crimson); }
h1 { font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; font-size: clamp(52px, 8vw, 96px); font-weight: 400; line-height: .94; margin: 14px 0 22px; max-width: 760px; }
.lede { max-width: 660px; font-size: 18px; line-height: 1.65; color: #5f6662; }
.primary { border: 0; background: linear-gradient(180deg, var(--alary-teal) 0%, var(--alary-crimson) 100%); color: white; padding: 14px 22px; border-radius: 999px; font-weight: 650; letter-spacing: .03em; cursor: pointer; box-shadow: 0 10px 24px rgba(179,95,71,.18); }
.sr-only { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; border:0!important; }
.hidden { display: none !important; }

.chat-launcher { position: fixed; right: 24px; bottom: 24px; width: 64px; height: 64px; border-radius: 50%; border: 1px solid rgba(255,255,255,.32); color: #fff; background: linear-gradient(180deg, var(--alary-teal) 0%, var(--alary-crimson) 100%); box-shadow: 0 14px 34px rgba(179,95,71,.28); cursor: pointer; z-index: 2147483000; display:grid; place-items:center; touch-action: manipulation; }
.chat-launcher img { width: 34px; height: 34px; object-fit: contain; }
.chat-panel { position: fixed; right: 24px; bottom: 100px; width: min(410px, calc(100vw - 24px)); height: min(690px, calc(100vh - 124px)); height: min(690px, calc(100dvh - 124px)); border: 1px solid var(--alary-border); border-radius: 12px; background: var(--alary-paper); box-shadow: 0 28px 90px rgba(35,31,32,.2); display: grid; grid-template-rows: auto auto minmax(0,1fr) auto auto; overflow: hidden; z-index: 2147482999; }
.chat-header { display: grid; grid-template-columns: 52px minmax(0,1fr) auto auto; align-items: center; gap: 10px; padding: 13px 15px; background: linear-gradient(135deg, var(--alary-teal) 0%, var(--alary-crimson) 100%); color: white; border-bottom: 3px solid var(--alary-blush); }
.chat-header { grid-row:1; }
.connectivity-banner { grid-row:2; }
.conversation-scroll { grid-row:3; }
.chat-form { grid-row:4; }
.chat-panel > footer { grid-row:5; }
.brand-lockup { width: 42px; height: 42px; object-fit: contain; object-position: center; }
.header-copy { min-width:0; }
.header-copy strong { display: block; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; font-size: 20px; font-weight: 400; letter-spacing: .02em; }
.header-copy small { display: block; opacity: .9; margin-top: 2px; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; white-space:nowrap; }
.icon-button, .header-text-button { min-height:44px; min-width:44px; touch-action:manipulation; }
.icon-button { border: 0; background: transparent; color: white; font-size: 28px; cursor: pointer; padding:4px; }
.header-text-button { border: 1px solid rgba(255,255,255,.45); background: rgba(255,255,255,.08); color: #fff; border-radius: 999px; padding: 6px 10px; font-size: 10px; cursor: pointer; white-space: nowrap; }
.header-text-button:hover { background: rgba(255,255,255,.16); }
.connectivity-banner { padding:7px 12px; background:#fff2d8; border-bottom:1px solid #ecd4a6; color:#684d25; font-size:11px; line-height:1.4; text-align:center; }

.conversation-scroll { min-height:0; overflow-y:auto; overflow-x:hidden; display:flex; flex-direction:column; background:var(--alary-paper); overscroll-behavior:contain; -webkit-overflow-scrolling:touch; scroll-padding-bottom:18px; }
.messages { flex:0 0 auto; min-height:0; padding: 16px 14px; overflow:visible; display: flex; flex-direction: column; gap: 9px; background: var(--alary-paper); }
.message-wrap { display:flex; flex-direction:column; max-width:88%; }
.message-wrap.user { align-self:flex-end; align-items:flex-end; }
.message-wrap.bot { align-self:flex-start; align-items:flex-start; }
.message-wrap .msg { max-width:100%; }
.msg { max-width: 88%; padding: 11px 13px; border-radius: 10px; line-height: 1.5; font-size: 14px; white-space: pre-line; overflow-wrap:anywhere; }
.msg.bot { background: #fff4e8; border: 1px solid #f0dcc4; border-bottom-left-radius: 2px; color: var(--alary-black); }
.msg.user { background: linear-gradient(135deg, var(--alary-teal) 0%, var(--alary-crimson) 100%); color: #fff; align-self: flex-end; border-bottom-right-radius: 2px; }
.time-divider { align-self:center; margin:3px 0; padding:3px 8px; border-radius:999px; background:rgba(124,90,67,.07); color:var(--alary-muted); font-size:9px; letter-spacing:.02em; }
.message-feedback { display:flex; align-items:center; gap:5px; margin:4px 4px 0; font-size:10px; color:var(--alary-muted); }
.message-feedback button { border:0; background:transparent; min-width:32px; min-height:32px; padding:2px 3px; cursor:pointer; font-size:12px; opacity:.72; }
.message-feedback button:hover { opacity:1; transform:translateY(-1px); }
.message-feedback.received { transition: opacity .35s ease; color: var(--alary-muted); }
.inline-retry { margin-top:6px; min-height:38px; padding:7px 12px; border:1px solid var(--alary-border); border-radius:999px; background:#fff; color:var(--alary-dark-teal); font-weight:650; cursor:pointer; }
.typing-indicator { display:flex; align-items:center; gap:4px; min-width:54px; min-height:38px; }
.typing-indicator span { width:6px; height:6px; border-radius:50%; background:var(--alary-muted); opacity:.35; animation:alaryTyping 1.1s infinite ease-in-out; }
.typing-indicator span:nth-child(2){animation-delay:.15s}.typing-indicator span:nth-child(3){animation-delay:.3s}
@keyframes alaryTyping { 0%,70%,100%{transform:translateY(0);opacity:.3}35%{transform:translateY(-3px);opacity:.8} }

.quick-actions { display:block; padding: 0 14px 10px; background: var(--alary-paper); }
.quick-action-list { display:flex; flex-wrap:wrap; gap:7px; }
.quick-actions button, .action-row button { min-height:42px; border: 1px solid var(--alary-border); background: #fff; color: var(--alary-dark-teal); padding: 8px 12px; border-radius: 999px; font-size: 12px; cursor: pointer; touch-action:manipulation; }
.quick-actions button:hover, .action-row button:hover { border-color: var(--alary-teal); background: #fff5ea; }
.quick-actions-toggle { display:none; width:100%; justify-content:center; align-items:center; font-weight:650; }

#dynamicPanel { flex:0 0 auto; min-height:0; max-height:none; overflow:visible; padding:0 14px 14px; background:var(--alary-paper); }
.action-card { border: 1px solid var(--alary-border); border-top: 3px solid var(--alary-blush); border-radius: 8px; padding: 13px; margin-bottom: 10px; background: #fff; box-shadow: 0 6px 20px rgba(35,31,32,.05); }
.action-card > strong { display: block; margin-bottom: 4px; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; font-weight: 400; font-size: 18px; }
.card-note { display: block; color: var(--alary-muted); font-size: 11px; line-height:1.45; margin-bottom: 9px; }
.action-card label { display:block; margin-top:8px; color:var(--alary-dark-teal); font-size:11px; font-weight:650; }
.action-card input, .action-card textarea { width: 100%; border: 1px solid var(--alary-border); border-radius: 6px; padding: 11px; margin: 5px 0 2px; background: #fff; color:var(--alary-black); font:inherit; font-size:16px; }
.action-card textarea { resize:vertical; min-height:92px; line-height:1.4; }
.action-card input:focus, .action-card textarea:focus { outline:none; border-color:var(--alary-teal); box-shadow:0 0 0 2px rgba(210,111,85,.12); }
.action-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.action-row .action-primary { background: var(--alary-blue); color: white; border-color: var(--alary-blue); border-radius: 999px; font-weight:650; }
.action-row .action-secondary { border-radius:999px; }
.action-row button:disabled, .chat-form button:disabled { opacity:.62; cursor:wait; }
.slots button { min-width: 78px; }
.text-button { min-height:40px; border: 0; background: transparent; color: var(--alary-teal); text-decoration: underline; padding: 8px 0 0; cursor: pointer; font-size: 11px; }
.tour-selection-summary { padding:11px; margin-bottom:10px; border-radius:8px; background:#fff7ed; border:1px solid #f0dcc4; }
.tour-selection-summary .tour-kicker, .tour-status-pill { display:inline-block; margin-bottom:5px; padding:3px 7px; border-radius:999px; background:#f6e1c8; color:var(--alary-dark-teal); font-size:9px; font-weight:750; letter-spacing:.06em; text-transform:uppercase; }
.tour-selection-summary strong { display:block; font-family:system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; font-size:18px; font-weight:400; }
.tour-selection-summary span:last-child { display:block; margin-top:4px; color:var(--alary-muted); font-size:11px; }
.tour-confirmation-card { border-top-color:#91b899; }
.tour-confirmation-card > strong { font-size:20px; }
.tour-meta { display:block; margin-top:4px; color:var(--alary-muted); font-size:11px; line-height:1.4; }
.manage-tour-link { display: inline-flex; align-items:center; min-height:40px; margin-top: 5px; color: var(--alary-teal); font-size: 11px; text-decoration: underline; }
.issue-success { border-top-color:#91b899; }

.chat-form { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--alary-border); background: #fff; position:relative; z-index:2; }
.chat-form input { min-width:0; border: 1px solid var(--alary-border); border-radius: 6px; padding: 11px 12px; outline: none; font-size:16px; }
.chat-form input:focus { border-color: var(--alary-teal); box-shadow: 0 0 0 2px rgba(210,111,85,.12); }
.chat-form button { min-height:44px; border: 0; border-radius: 999px; background: linear-gradient(180deg, var(--alary-teal) 0%, var(--alary-crimson) 100%); color: white; font-weight: 650; padding: 0 18px; cursor: pointer; touch-action:manipulation; }
footer { display:flex; align-items:center; justify-content:center; gap:7px; flex-wrap:wrap; font-size: 9px; line-height:1.35; text-align: center; color: var(--alary-muted); padding: 0 12px 9px; background: #fff; }
footer strong { font-weight:650; }
.footer-link { border:0; background:transparent; color:var(--alary-teal); text-decoration:underline; font:inherit; cursor:pointer; padding:4px; }
.footer-tools{display:inline-flex;align-items:center;justify-content:center;gap:4px;flex-wrap:wrap}

@media (max-width: 520px) {
  html.alary-chat-open, html.alary-chat-open body { overflow: hidden !important; overscroll-behavior: none; touch-action:pan-x pan-y; }
  .demo-page { min-height: 100dvh; padding: 16px; }
  .chat-launcher { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: 60px; height: 60px; }
  .alary-chat-open .chat-launcher { display: none; }
  .chat-panel {
    top: var(--alary-vv-top, 0px);
    right: 0;
    bottom: auto;
    left: 0;
    width: 100vw;
    max-width: none;
    height: var(--alary-vv-height, 100dvh);
    max-height: var(--alary-vv-height, 100dvh);
    border: 0;
    border-radius: 0;
    box-shadow:none;
    grid-template-rows: auto auto minmax(0,1fr) auto auto;
  }
  .chat-header {
    grid-template-columns: 40px minmax(0,1fr) auto 44px;
    gap: 7px;
    padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
  }
  .brand-lockup { width: 34px; height: 34px; }
  .header-copy strong { font-size: 18px; }
  .header-copy small { font-size: 8px; letter-spacing:.08em; }
  .header-text-button { min-height:40px; min-width:auto; padding:5px 9px; font-size:9px; }
  .icon-button { min-height:44px; min-width:44px; font-size:27px; line-height:1; }
  .conversation-scroll { scroll-padding-bottom:24px; }
  .messages { padding:10px 10px; gap:8px; }
  .message-wrap { max-width:94%; }
  .message-wrap.user { margin-right:2px; }
  .msg { padding:10px 11px; font-size:14px; line-height:1.45; }
  .quick-actions { padding:0 10px 7px; }
  .quick-action-list { gap:6px; }
  .quick-actions button, .action-row button { min-height:44px; padding:9px 11px; font-size:12px; }
  .quick-actions.compacted .quick-actions-toggle { display:flex; }
  .quick-actions.compacted .quick-action-list { display:none; padding-top:6px; }
  .quick-actions.compacted.expanded .quick-action-list { display:flex; }
  #dynamicPanel { max-height:none; overflow:visible; padding:0 10px 18px; }
  .action-card { width:100%; max-width:100%; padding:11px; margin:0 0 12px; overflow:hidden; }
  .action-card:last-child { margin-bottom:6px; }
  .action-card label, .action-card input, .action-card textarea, .action-row { min-width:0; max-width:100%; }
  .action-card > strong { font-size:17px; }
  .slots { display:grid; grid-template-columns:1fr; gap:7px; }
  .slots button { width:100%; min-height:46px; text-align:center; }
  .action-row:not(.slots) { display:grid; grid-template-columns:1fr 1fr; }
  .action-row:not(.slots) button { width:100%; }
  .booking-card .action-row { grid-template-columns:1fr 1fr; }
  .chat-panel > footer { grid-row:4; padding:4px 12px 3px; }
  .chat-form { grid-row:5; gap:8px; padding:8px 12px calc(10px + env(safe-area-inset-bottom)); border-top:1px solid var(--alary-border); }
  .chat-form input { height:46px; min-height:46px; max-height:46px; padding:10px 12px; font-size:16px; border-radius:10px; align-self:center; }
  .chat-form button { min-width:76px; height:46px; min-height:46px; max-height:46px; padding:0 14px; align-self:center; }
  footer { font-size:8.5px; }
  .connectivity-banner { font-size:10px; }
}

@media (max-width: 360px) {
  .header-copy small { display:none; }
  .header-text-button { padding-left:7px; padding-right:7px; }
  .chat-header { grid-template-columns:36px minmax(0,1fr) auto 42px; }
  .brand-lockup { width:31px; height:31px; }
  .chat-form button { min-width:68px; }
}

@media (prefers-reduced-motion: reduce) {
  .typing-indicator span { animation:none; opacity:.55; }
}

/* v0.16 privacy acknowledgement and contact disclosure */
.privacy-gate{grid-row:3/6;grid-column:1;min-width:0;width:100%;min-height:0;z-index:20;overflow-y:auto;overflow-x:hidden;display:flex;align-items:flex-start;justify-content:center;padding:22px 18px;background:var(--alary-paper);-webkit-overflow-scrolling:touch}
.chat-panel.privacy-active .conversation-scroll,.chat-panel.privacy-active .chat-form,.chat-panel.privacy-active>footer{display:none!important}.chat-panel.privacy-active .privacy-gate{grid-row:3/6;grid-column:1}
.chat-panel.privacy-active{grid-template-columns:minmax(0,1fr)}
.privacy-card{width:100%;max-width:360px;margin:auto 0;background:#fff;border:1px solid var(--alary-border);border-top:3px solid var(--alary-blush);border-radius:12px;padding:20px;box-shadow:0 12px 34px rgba(35,31,32,.08)}
.privacy-kicker{display:inline-block;margin-bottom:6px;color:var(--alary-teal);font-size:10px;font-weight:750;letter-spacing:.1em;text-transform:uppercase}
.privacy-card h2{margin:0 0 12px;font-family:system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;font-size:25px;font-weight:400;color:var(--alary-black)}
.privacy-card p{margin:0 0 12px;color:#594b41;font-size:13px;line-height:1.55}
.privacy-card .privacy-caution{padding:10px;border-radius:8px;background:#fff7ed;border:1px solid #f0dcc4;font-size:11px}
.privacy-check{display:grid!important;grid-template-columns:22px 1fr;gap:9px;align-items:start;margin:14px 0!important;color:var(--alary-black)!important;font-size:12px!important;font-weight:500!important;line-height:1.45}
.privacy-check input{width:22px!important;height:22px!important;margin:0!important;padding:0!important;accent-color:var(--alary-teal)}
.privacy-check a,.privacy-links a{color:var(--alary-teal);text-decoration:underline}
.privacy-continue{width:100%;min-height:46px;border:0;border-radius:999px;background:linear-gradient(180deg,var(--alary-teal),var(--alary-crimson));color:#fff;font-weight:700;cursor:pointer}
.privacy-continue:disabled{opacity:.45;cursor:not-allowed}
.privacy-links{display:flex;justify-content:center;gap:14px;margin-top:10px;font-size:10px}
.contact-consent-note{display:block;margin:10px 0 3px;padding-top:8px;border-top:1px solid #f0e6db;color:var(--alary-muted);font-size:9.5px;line-height:1.45}
footer a.footer-link{display:inline;border:0;background:transparent;color:var(--alary-teal);text-decoration:underline;padding:0;cursor:pointer}

@media(max-width:520px){
  .privacy-gate{padding:14px 12px calc(18px + env(safe-area-inset-bottom));}
  .privacy-card{max-width:none;margin:0;padding:16px 15px}
  .privacy-card h2{font-size:23px}
  .privacy-card p{font-size:12px}
  .privacy-check{font-size:12px!important}
}

/* v0.17 progressive capture and always-available tour action */
.chat-form .persistent-tour{grid-column:1/-1;min-height:38px;height:38px;border:1px solid var(--alary-border);background:#fff7ed;color:var(--alary-dark-teal);font-size:12px;font-weight:700;letter-spacing:.01em;box-shadow:none}
.chat-form .persistent-tour:hover{border-color:var(--alary-teal);background:#fff1df}
.progressive-capture-card{border-top-color:var(--alary-teal)}
.progressive-capture-card .optional-label{font-weight:500;color:var(--alary-muted);font-size:9px;margin-left:3px}
.name-capture-card .card-note,.phone-capture-card .card-note{font-size:12px}
@media(max-width:520px){.chat-form .persistent-tour{height:40px;min-height:40px}}


/* v0.19.9 - explicit leasing chat launcher */
.chat-launcher {
  width: auto !important;
  min-width: 176px;
  height: 64px !important;
  padding: 7px 16px 7px 10px !important;
  border-radius: 999px !important;
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  white-space: nowrap;
  text-align: left;
}

.chat-launcher > img {
  width: 42px !important;
  height: 42px !important;
  flex: 0 0 42px;
  object-fit: contain;
}

.chat-launcher .launcher-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}

.chat-launcher .launcher-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.15;
}

.chat-launcher .launcher-subtitle {
  margin-top: 3px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.1;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

@media (max-width: 520px) {
  .chat-launcher {
    min-width: 166px;
    height: 58px !important;
    padding: 6px 14px 6px 9px !important;
    gap: 9px;
  }

  .chat-launcher > img {
    width: 38px !important;
    height: 38px !important;
    flex-basis: 38px;
  }

  .chat-launcher .launcher-title {
    font-size: 14px;
  }

  .chat-launcher .launcher-subtitle {
    font-size: 10px;
  }
}

/* v0.22.1 - never cover an open chat with the floating launcher.
   This must follow the explicit launcher rule that uses display:flex!important. */
html.alary-chat-open .chat-launcher {
  display: none !important;
}
