/* BTB Chat widget. Same look as the prototype; every rule is scoped to the widget so the theme is untouched. */
#btb-launch, #btb-panel, #btb-lightbox {
  --brown: #422c1d;
  --brown-2: #5a3e2b;
  --sand: #ded5cf;
  --paper: #faf8f6;
  --ink: #313131;
  --muted: #6b625c;
  --line: #e6dfda;
  --font: Aptos, "Segoe UI", system-ui, -apple-system, sans-serif;
}
#btb-panel, #btb-panel *, #btb-launch { box-sizing: border-box; }
#btb-panel { font-family: var(--font); font-size: 16px; color: var(--ink); text-align: left; line-height: normal; }
#btb-panel button, #btb-launch { text-transform: none; letter-spacing: normal; min-height: 0; margin: 0; width: auto; text-shadow: none; }

#btb-launch { position: fixed; right: 20px; bottom: 20px; z-index: 2147483000; background: var(--brown); color: #fff; border: 0; border-radius: 28px; padding: 14px 20px; font: 600 15px var(--font); line-height: normal; box-shadow: 0 6px 20px rgba(0,0,0,.18); cursor: pointer; }
#btb-launch:hover { background: var(--brown-2); color: #fff; }
#btb-panel { position: fixed; right: 20px; bottom: 20px; z-index: 2147483001; width: 400px; max-width: calc(100vw - 32px); height: 640px; max-height: calc(100vh - 40px); background: #fff; border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.22); display: none; flex-direction: column; overflow: hidden; }
#btb-panel.open { display: flex; }
#btb-panel .btb-head { background: var(--brown); color: #fff; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; }
#btb-panel .btb-head b { font-size: 16px; color: #fff; }
#btb-panel .btb-head small { display: block; opacity: .8; font-size: 12px; margin-top: 2px; color: #fff; }
#btb-panel .btb-head button { background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; line-height: 1; padding: 4px 8px; box-shadow: none; }
#btb-panel .btb-log { flex: 1; overflow-y: auto; padding: 16px; background: var(--paper); }
#btb-panel .msg { margin: 0 0 12px; max-width: 88%; line-height: 1.45; font-size: 15px; color: var(--ink); }
#btb-panel .msg p { margin: 0 0 8px; font-size: 15px; line-height: 1.45; } #btb-panel .msg p:last-child { margin: 0; }
#btb-panel .msg ul { margin: 4px 0 8px; padding-left: 20px; list-style: disc; }
#btb-panel .msg li { margin: 0; }
#btb-panel .bot { background: #fff; border: 1px solid var(--line); border-radius: 12px 12px 12px 4px; padding: 10px 12px; }
#btb-panel .me { background: var(--sand); border-radius: 12px 12px 4px 12px; padding: 10px 12px; margin-left: auto; }
#btb-panel .bot a { color: var(--brown); }
#btb-panel .photos { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 0 12px; max-width: 88%; }
#btb-panel .photos a { display: block; text-decoration: none; color: var(--muted); font-size: 11px; line-height: 1.3; }
#btb-panel .photos img { width: 100%; height: auto; max-width: none; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; display: block; margin-bottom: 3px; box-shadow: none; }
#btb-panel .photos.plans { grid-template-columns: 1fr; }
#btb-panel .photos img.plan { aspect-ratio: auto; object-fit: contain; background: #fff; border: 1px solid var(--line); }
#btb-panel .photos.pairs { grid-template-columns: 1fr; }
#btb-panel .photos.pairs figure.ba { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.3; }
#btb-panel .photos.pairs figure.ba img { cursor: pointer; }
#btb-panel .photos.pairs figure.ba[data-stage="before"] .ba-after, #btb-panel .photos.pairs figure.ba[data-stage="after"] .ba-before { display: none; }
#btb-panel .ba-tog { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin-right: 6px; vertical-align: middle; }
#btb-panel .ba-tog button { border: 0; background: #fff; color: var(--ink); font: inherit; font-size: 12px; padding: 4px 10px; cursor: pointer; min-height: 28px; }
#btb-panel .ba-tog button[aria-pressed="true"] { background: var(--ink); color: #fff; font-weight: 600; }
#btb-panel .ba-tog button:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
#btb-panel .note { font-size: 12px; color: var(--muted); text-align: center; margin: 4px 0 12px; }
#btb-panel .chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
#btb-panel .chips button { border: 1px solid var(--brown); background: #fff; color: var(--brown); border-radius: 16px; padding: 6px 12px; font: 14px var(--font); line-height: normal; cursor: pointer; box-shadow: none; }
#btb-panel .chips button:hover { background: var(--sand); }
#btb-panel .typing { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
#btb-panel .btb-form { display: flex; gap: 8px; padding: 10px; margin: 0; border-top: 1px solid var(--line); background: #fff; }
#btb-panel .btb-form textarea { flex: 1; width: auto; margin: 0; resize: none; border: 1px solid var(--line); border-radius: 10px; padding: 12px; font: 16px/1.4 var(--font); color: var(--ink); background: #fff; min-height: 76px; max-height: 200px; overflow-y: auto; box-shadow: none; }
#btb-panel .pw { display: flex; gap: 6px; margin-top: 8px; }
#btb-panel .pw input { flex: 1; width: auto; margin: 0; border: 1px solid var(--line); border-radius: 8px; padding: 8px; font: 15px var(--font); color: var(--ink); background: #fff; min-height: 0; box-shadow: none; }
#btb-panel .pw button { background: var(--brown); color: #fff; border: 0; border-radius: 8px; padding: 0 14px; font: 600 14px var(--font); cursor: pointer; box-shadow: none; }
#btb-panel .btb-form textarea:focus { outline: 2px solid var(--sand); }
#btb-panel .btb-form button { background: var(--brown); color: #fff; border: 0; border-radius: 10px; padding: 0 16px; font: 600 14px var(--font); cursor: pointer; box-shadow: none; }
#btb-panel .btb-form button:disabled { opacity: .5; cursor: default; }
#btb-panel .btb-head-r { display: flex; align-items: center; gap: 6px; }
#btb-panel .btb-lang { font-size: 12px; color: rgba(255,255,255,.6); white-space: nowrap; }
#btb-panel .btb-head .btb-lang button { font: 12px var(--font); padding: 2px 3px; color: rgba(255,255,255,.75); }
#btb-panel .btb-head .btb-lang button[aria-pressed="true"] { color: #fff; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
#btb-panel .btb-ai { font-size: 12px; line-height: 1.4; color: var(--muted); background: #f3eeea; padding: 7px 14px; border-bottom: 1px solid var(--line); }
#btb-panel .btb-link { background: none; border: 0; padding: 0; font: inherit; color: var(--brown); text-decoration: underline; cursor: pointer; box-shadow: none; }
#btb-panel .btb-privacy { position: absolute; left: 0; right: 0; top: 0; bottom: 0; background: #fff; padding: 20px 20px 16px; overflow-y: auto; z-index: 2; }
#btb-panel .btb-privacy[hidden] { display: none; }
#btb-panel .btb-privacy h3 { font: 700 18px var(--font); color: var(--brown); margin: 0 0 12px; }
#btb-panel .btb-privacy ul { margin: 0 0 16px; padding-left: 20px; list-style: disc; }
#btb-panel .btb-privacy li { font-size: 14px; line-height: 1.45; margin: 0 0 8px; }
#btb-panel .btb-privacy a { color: var(--brown); }
#btb-panel .btb-privacy > button { background: var(--brown); color: #fff; border: 0; border-radius: 10px; padding: 10px 16px; font: 600 14px var(--font); cursor: pointer; box-shadow: none; }
#btb-panel .btb-thumbs { display: flex; gap: 6px; padding: 8px 10px 0; background: #fff; border-top: 1px solid var(--line); }
#btb-panel .btb-thumbs[hidden] { display: none; }
#btb-panel .btb-thumbs + .btb-form { border-top: 0; }
#btb-panel .btb-thumb { position: relative; width: 56px; height: 56px; }
#btb-panel .btb-thumb img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; display: block; max-width: none; }
#btb-panel .btb-thumb button { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--brown); color: #fff; font-size: 14px; line-height: 20px; padding: 0; cursor: pointer; box-shadow: none; }
#btb-panel .btb-form .btb-attach { background: #fff; color: var(--brown); border: 1px solid var(--line); padding: 0 10px; display: flex; align-items: center; justify-content: center; }
#btb-panel .btb-form .btb-attach:hover { background: var(--sand); }
#btb-panel .btb-mine-pics { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 6px; }
#btb-panel .btb-mine-pics img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; display: block; max-width: none; }
#btb-panel .msg.me .btb-mine-pics:last-child { margin: 0; }
/* Expand button and the large view. */
#btb-panel .btb-head .btb-size { display: flex; align-items: center; padding: 5px 6px; }
#btb-panel .btb-head button:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
#btb-panel .btb-ico-shrink, #btb-panel.btb-big .btb-ico-grow { display: none; }
#btb-panel.btb-big .btb-ico-shrink { display: block; }
#btb-panel.btb-big { right: 24px; bottom: 24px; width: min(960px, calc(100vw - 48px)); max-width: none; height: calc(100vh - 48px); max-height: none; }
#btb-panel.btb-big .msg, #btb-panel.btb-big .photos { max-width: min(88%, 720px); }
/* Save a summary. */
#btb-panel .btb-save { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); background: #f3eeea; padding: 6px 12px; border-top: 1px solid var(--line); }
#btb-panel .btb-save[hidden] { display: none; }
#btb-panel .btb-save button { border: 1px solid var(--brown); background: #fff; color: var(--brown); border-radius: 14px; padding: 3px 12px; font: 600 13px var(--font); line-height: normal; cursor: pointer; box-shadow: none; }
#btb-panel .btb-save button:hover { background: var(--sand); }
#btb-panel .btb-save button:disabled { opacity: .5; cursor: default; }
#btb-panel .btb-save + .btb-thumbs { border-top: 0; }
/* "More detail" chip under the latest reply. */
#btb-panel .chips.more { margin-top: -6px; }
#btb-panel .chips.more button { font-size: 13px; padding: 4px 10px; }
#btb-panel .chips button:focus-visible, #btb-panel .btb-card-btn:focus-visible { outline: 2px solid var(--brown); outline-offset: 2px; }
/* Cost range card. */
#btb-panel .btb-card { max-width: 88%; margin: 0 0 12px; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--brown); border-radius: 12px; padding: 12px 14px; color: var(--ink); font-size: 14px; line-height: 1.4; }
#btb-panel .btb-card p { margin: 0; }
#btb-panel .btb-card .btb-card-k { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
#btb-panel .btb-card .btb-card-t { font-size: 16px; font-weight: 700; color: var(--brown); margin: 2px 0 10px; }
#btb-panel .btb-card .btb-card-t span { font-weight: 400; color: var(--muted); }
#btb-panel .btb-card .btb-card-t span::before { content: ", "; }
#btb-panel .btb-card-fig { background: var(--paper); border-radius: 8px; padding: 8px 10px; margin: 0 0 10px; }
#btb-panel .btb-card-fig b { display: block; font-size: 26px; line-height: 1.15; color: var(--brown); }
#btb-panel .btb-card-l { display: block; font-size: 12px; color: var(--muted); }
#btb-panel .btb-card-r { display: block; font-size: 14px; color: var(--ink); margin-top: 2px; }
#btb-panel .btb-card-u { display: block; font-size: 14px; color: var(--ink); margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(0, 0, 0, 0.08); }
#btb-panel .btb-card-fig .btb-card-u b { display: inline; font-size: 16px; }
#btb-panel .btb-card-sec { margin: 0 0 10px; }
#btb-panel .btb-card-sec ul { margin: 2px 0 0; padding-left: 18px; list-style: disc; }
#btb-panel .btb-card-sec li { margin: 0; font-size: 14px; }
#btb-panel .btb-card-btn { display: block; width: 100%; background: var(--brown); color: #fff; border: 0; border-radius: 10px; padding: 11px 14px; min-height: 44px; font: 600 15px var(--font); cursor: pointer; box-shadow: none; }
#btb-panel .btb-card-btn:hover { background: var(--brown-2); }
#btb-panel .btb-card-btn:disabled { opacity: .55; cursor: default; }
#btb-panel .btb-card .btb-card-contact { font-size: 13px; text-align: center; margin-top: 8px; color: var(--muted); }
#btb-panel .btb-card .btb-card-contact a { color: var(--brown); text-decoration: underline; text-underline-offset: 2px; display: inline-block; padding: 4px 2px; }
#btb-panel .btb-card .btb-card-contact a:focus-visible { outline: 2px solid var(--brown); outline-offset: 1px; }
#btb-panel .btb-card .btb-card-note { font-size: 12px; color: var(--muted); margin-top: 8px; }
#btb-panel.btb-big .btb-card { max-width: min(88%, 460px); }
/* "Start a new conversation" after the per-conversation limit. */
#btb-panel .chips.btb-restart button { background: var(--brown); color: #fff; font-weight: 600; }
#btb-panel .chips.btb-restart button:hover { background: var(--brown-2); }
#btb-panel .photos a.btb-lb-link { cursor: zoom-in; }
#btb-panel .photos a.btb-lb-link:focus-visible { outline: 2px solid var(--brown); outline-offset: 2px; border-radius: 8px; }
/* Lightbox for BTB photos and plans: full screen over the page, the chat stays put underneath. */
#btb-lightbox { position: fixed; inset: 0; z-index: 2147483002; background: rgba(20, 14, 10, .92); display: flex; flex-direction: column; font-family: var(--font); color: #fff; box-sizing: border-box; }
#btb-lightbox[hidden] { display: none; }
#btb-lightbox * { box-sizing: border-box; }
#btb-lightbox .btb-lb-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 12px; flex: 0 0 auto; }
#btb-lightbox .btb-lb-full { color: #fff; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; padding: 8px 4px; }
#btb-lightbox .btb-lb-close { background: rgba(255, 255, 255, .15); color: #fff; border: 0; border-radius: 50%; width: 44px; height: 44px; font-size: 28px; line-height: 44px; padding: 0; margin: 0; cursor: pointer; box-shadow: none; text-shadow: none; }
#btb-lightbox .btb-lb-close:hover { background: rgba(255, 255, 255, .28); }
#btb-lightbox a:focus-visible, #btb-lightbox button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
#btb-lightbox .btb-lb-stage { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: auto; padding: 0 12px; touch-action: pan-x pan-y pinch-zoom; -webkit-overflow-scrolling: touch; }
#btb-lightbox .btb-lb-stage img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 6px; cursor: zoom-in; box-shadow: none; }
#btb-lightbox.btb-lb-plan .btb-lb-stage img { background: #fff; }
#btb-lightbox.btb-lb-zoom .btb-lb-stage { display: block; }
#btb-lightbox.btb-lb-zoom .btb-lb-stage img { max-width: none; max-height: none; margin: auto; cursor: zoom-out; }
#btb-lightbox .btb-lb-cap { flex: 0 0 auto; margin: 0; padding: 10px 16px 14px; font-size: 14px; line-height: 1.4; text-align: center; color: #fff; }
@media (max-width: 768px) {
  #btb-panel.btb-big { right: 0; bottom: 0; width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; }
}
@media (max-width: 480px) {
  #btb-panel { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
  #btb-panel .btb-head .btb-size { display: none; } /* Already full screen on a phone. */
  #btb-panel .btb-card { max-width: 100%; }
}
