:root{
    --ink:#1b1a24;
    --paper:#f6f3ee;
    --wine:#7a1f3d;
    --wine-deep:#59152c;
    --gold:#c9a24b;
    --line:#e7e0d4;
    --bubble-user:#2c2a35;
    --bubble-agent:#ffffff;
    --success:#2f6f4f;
  }
*{box-sizing:border-box;}
/* ---- Launcher ---- */
  .launcher{
    position:fixed; right:22px; bottom:22px; z-index:2147483000;
    width:64px; height:64px; border-radius:50%;
    background:linear-gradient(160deg, var(--wine), var(--wine-deep));
    box-shadow:0 8px 22px rgba(0,0,0,.35), 0 0 0 3px rgba(201,162,75,.35);
    display:flex; align-items:center; justify-content:center;
    cursor:pointer; border:none; padding:0;
    transition:transform .18s ease;
  }
.launcher:hover{ transform:scale(1.06); }
.launcher img, .launcher svg{ width:44px; height:44px; border-radius:50%; }
.launcher .pulse{
    position:absolute; inset:-3px; border-radius:50%;
    border:2px solid var(--gold); opacity:.6;
    animation:pulse 2.4s ease-out infinite;
  }
@keyframes pulse{ 0%{transform:scale(.9); opacity:.7;}
100%{transform:scale(1.5); opacity:0;}
}

  /* ---- Chat panel ---- */
  .panel{
    position:fixed; right:16px; bottom:96px; z-index:2147483000;
    width:340px; max-width:calc(100vw - 40px);
    height:min(560px, 82vh); max-height:min(560px, 82vh);
    background:var(--bubble-agent);
    border-radius:16px;
    box-shadow:0 20px 60px rgba(0,0,0,.45);
    display:flex; flex-direction:column;
    overflow:hidden;
    font-family:-apple-system, 'Helvetica Neue', Arial, sans-serif;
    transform:translateY(16px) scale(.97); opacity:0; pointer-events:none;
    transition:all .22s ease;
    z-index:50;
  }
.panel.open{ transform:translateY(0) scale(1); opacity:1; pointer-events:auto; }
.panel-head{
    background:linear-gradient(120deg, var(--wine-deep), var(--wine));
    color:#f6ece0; padding:14px 16px; display:flex; align-items:center; gap:10px;
  }
.panel-head .avatar-sm{ width:38px; height:38px; border-radius:50%; overflow:hidden; flex:none; background:#3a1524; }
.panel-head .who{ line-height:1.25; }
.panel-head .who b{ font-size:13.5px; display:block; }
.panel-head .who span{ font-size:11px; color:#e6c9a8; display:flex; align-items:center; gap:5px; }
.dot{ width:7px; height:7px; border-radius:50%; background:#5be08a; display:inline-block; }
.panel-close{ margin-left:auto; background:none; border:none; color:#e6c9a8; font-size:18px; cursor:pointer; line-height:1; }
.chat-body{
    flex:1; overflow-y:auto; background:#fbf9f5; display:flex; flex-direction:column;
    scrollbar-width:thin; scrollbar-color:#c9a24b #efe9dc;
  }
.chat-body::-webkit-scrollbar{ width:8px; }
.chat-body::-webkit-scrollbar-track{ background:#efe9dc; }
.chat-body::-webkit-scrollbar-thumb{ background:#c9a24b; border-radius:8px; }
.msgs{
    padding:16px; display:flex; flex-direction:column; gap:12px;
  }
.msg{ max-width:88%; font-size:14px; line-height:1.55; padding:10px 13px; border-radius:14px; white-space:pre-wrap; }
.msg.agent{ background:#fff; border:1px solid var(--line); color:#2a2732; align-self:flex-start; border-bottom-left-radius:4px; }
.msg.user{ background:var(--bubble-user); color:#f4f0e8; align-self:flex-end; border-bottom-right-radius:4px; }
.typing{ align-self:flex-start; display:flex; gap:4px; padding:10px 12px; }
.typing span{ width:6px; height:6px; border-radius:50%; background:#b8b0c0; animation:tb 1.1s infinite ease-in-out; }
.typing span:nth-child(2){ animation-delay:.15s;}
.typing span:nth-child(3){ animation-delay:.3s;}
@keyframes tb{ 0%,60%,100%{ transform:translateY(0); opacity:.5;}
30%{ transform:translateY(-4px); opacity:1;}
}

  .choices{ display:flex; flex-direction:column; gap:6px; padding:0 14px 12px; background:#fbf9f5; }
.back-btn{
    display:flex !important; align-items:center; gap:6px; align-self:flex-start; margin:8px 14px 0;
    background:#fff !important; border:1px solid var(--line); color:var(--wine-deep) !important; font-size:12px;
    padding:6px 12px; border-radius:16px; cursor:pointer; font-family:inherit;
  }
.back-btn:hover{ background:#fbeee4 !important; border-color:var(--gold); }
.choices button{
    text-align:left; background:#fff !important; border:1px solid var(--line); color:var(--wine-deep) !important;
    font-size:12.5px; padding:9px 11px; border-radius:10px; cursor:pointer; font-family:inherit;
    transition:.15s;
  }
.choices button:hover{ background:#fbeee4 !important; border-color:var(--gold); }
.pay-card{
    margin:2px 14px 12px; background:#fff; border:1px solid var(--gold); border-radius:12px; padding:12px;
    font-size:12px; color:#3a3540;
  }
.pay-card .row{ display:flex; justify-content:space-between; margin:3px 0; }
.pay-card .total{ font-weight:700; color:var(--wine-deep); border-top:1px dashed var(--line); margin-top:6px; padding-top:6px; }
.pay-btn{
    display:block; width:100%; margin-top:10px; padding:10px; border:none; border-radius:8px;
    background:var(--wine) !important; color:#fff; font-weight:700; font-size:12.5px; cursor:pointer; letter-spacing:.02em;
  }
.pay-btn:hover{ background:var(--wine-deep) !important; }
.pay-note{ text-align:center; color:#8a8390; font-size:10.5px; margin-top:6px; }
.composer{ display:flex; gap:8px; padding:10px; border-top:1px solid var(--line); background:#fff; }
.composer input{
    flex:1; border:1px solid var(--line); border-radius:20px; padding:9px 13px; font-size:12.5px; font-family:inherit;
    outline:none;
  }
.composer input:focus{ border-color:var(--gold); }
.composer button{
    background:var(--wine); color:#fff; border:none; border-radius:20px; padding:0 16px; font-size:12px; cursor:pointer;
  }
footer{
    margin-top:22px; font-family:-apple-system, sans-serif; color:#8a8390; font-size:11px; text-align:center;
  }