.chat-launcher { position:fixed; right:24px; bottom:calc(20px + env(safe-area-inset-bottom)); z-index:40; min-height:52px; display:flex; align-items:center; gap:10px; padding:12px 22px; background:var(--secondary); border:1px solid #fff; color:var(--primary-dark); border-radius:30px; font:600 14px var(--font-body); box-shadow:0 8px 30px #09156835; cursor:pointer; }
.chat-launcher svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.7; }
.chat-invite { position:fixed; right:24px; bottom:calc(88px + env(safe-area-inset-bottom)); z-index:40; width:275px; max-width:calc(100vw - 32px); display:flex; align-items:center; gap:6px; padding:8px 8px 8px 16px; border:1px solid var(--border); border-radius:16px; background:#fff; box-shadow:0 8px 28px #09156820; }
.chat-invite[hidden] { display:none; }
.chat-invite button { border:0; background:none; color:var(--text); font:13px/1.5 var(--font-body); cursor:pointer; }
.chat-invite button:first-child { flex:1; text-align:left; min-height:44px; }
.chat-invite button:last-child { width:44px; height:44px; flex-shrink:0; font-size:22px; border-radius:50%; }
.chat-dialog { position:fixed; inset:auto 24px calc(20px + env(safe-area-inset-bottom)) auto; margin:0; width:420px; max-width:calc(100vw - 32px); height:680px; max-height:calc(100dvh - 40px - env(safe-area-inset-bottom)); padding:0; border:1px solid var(--border); border-radius:24px; color:var(--text); background:#fff; box-shadow:0 24px 90px #09156840; overflow:hidden; }
.chat-dialog[open] { display:flex; flex-direction:column; }
.chat-dialog::backdrop { background:#09156835; }
.chat-head { display:flex; align-items:center; justify-content:space-between; gap:12px; background:var(--primary); color:#fff; padding:20px 22px; flex-shrink:0; }
.chat-head h2 { color:#fff; font:600 18px/1.4 var(--font-head); letter-spacing:-.02em; }
.chat-head p { font-size:11px; margin-top:4px; }
.chat-head button { width:44px; height:44px; flex-shrink:0; border:1px solid #ffffff80; border-radius:50%; color:#fff; background:none; font-size:24px; cursor:pointer; }
.chat-toolbar { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:8px 16px; background:#f6f7fb; border-bottom:1px solid var(--border); flex-shrink:0; }
.chat-toolbar span { font-size:10px; color:var(--text-2); }
.chat-toolbar button { padding:7px 3px; min-height:36px; background:none; border:0; font:600 10px var(--font-body); color:var(--primary); cursor:pointer; text-decoration:underline; }
.chat-history { flex:1; min-height:60px; overflow-y:auto; overscroll-behavior:contain; padding:20px; scroll-padding:15px; }
.chat-message { font:13px/1.7 var(--font-body); border-radius:3px 16px 16px; padding:14px 16px; background:var(--primary-tint); margin-bottom:16px; }
.chat-message p { white-space:pre-line; overflow-wrap:anywhere; margin:0; }
.chat-author { display:block; font-size:10px; font-weight:600; margin-bottom:6px; color:var(--primary); }
.chat-user { margin-left:35px; background:var(--primary); color:#fff; border-radius:16px 16px 3px 16px; }
.chat-user .chat-author { color:#fff; }
.chat-links { display:grid; gap:8px; margin-top:14px; }
.chat-links a { display:block; padding:11px 14px; min-height:44px; border-radius:12px; font-size:12px; line-height:1.5; text-decoration:none; color:var(--primary-dark); background:var(--secondary); font-weight:600; }
.chat-links a+a { background:#fff; border:1px solid #7b87a2; color:var(--primary); }
.chat-suggestions { flex-shrink:0; display:flex; flex-wrap:wrap; gap:6px; padding:10px 16px 0; border-top:1px solid var(--border); }
.chat-suggestions button { padding:7px 12px; min-height:36px; border:1px solid #7b87a2; border-radius:22px; background:#fff; color:var(--primary); font:11px var(--font-body); cursor:pointer; }
.chat-suggestions button:hover { background:var(--primary-tint); }
.chat-form { flex-shrink:0; padding:10px 16px 12px; }
.chat-form label { display:block; font-size:11px; color:var(--text-2); margin-bottom:5px; }
.chat-form>div { display:flex; gap:8px; }
.chat-form input { min-width:0; width:100%; flex:1; padding:11px 12px; border:1px solid #7b87a2; border-radius:12px; font:16px var(--font-body); background:#fff; color:var(--text); }
.chat-form input::placeholder { color:#626b7b; font-size:12px; }
.chat-form button { width:46px; min-height:46px; flex-shrink:0; border:0; border-radius:50%; background:var(--primary); color:#fff; font-size:26px; cursor:pointer; }
.chat-note { flex-shrink:0; padding:10px 16px; background:#f6f7fb; border-top:1px solid var(--border); color:var(--text-2); font:10px/1.6 var(--font-body); }
@media(max-width:700px) {
  .chat-launcher { right:12px; min-height:50px; padding:10px 16px; font-size:12px; }
  .chat-invite { right:16px; bottom:calc(82px + env(safe-area-inset-bottom)); }
  .chat-dialog { right:16px; bottom:calc(16px + env(safe-area-inset-bottom)); max-height:calc(100dvh - 32px - env(safe-area-inset-bottom)); }
  .chat-head { padding:16px 18px; }
  .chat-head h2 { font-size:16px; }
  .chat-history { padding:16px; }
}
@media(max-height:550px) {
  .chat-head { padding-block:8px; }
  .chat-toolbar,.chat-note { display:none; }
  .chat-form { padding-block:6px; }
  .chat-suggestions { padding-top:6px; }
}
