#rso-bot-root, #rso-bot-root * { box-sizing: border-box; }
  #rso-bot-root {
    --ink:      #1C2A2A;
    --paper:    #EAF2FB;
    --teal:     #2563A8;
    --teal-dk:  #17395E;
    --teal-tint:#DCE9F7;
    --sand:     #D9A768;
    --sand-tint:#F6EBD8;
    --line:     #E2DCCB;
    --danger:   #B4483A;
    font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--ink);
  }
  #rso-bot-root .rso-brand {
    font-family: 'Fraunces', Georgia, serif;
  }

  /* ---------- Launcher ---------- */
  .rso-launcher {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 999998;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--teal);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 14px 20px 14px 16px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(28,42,42,0.28);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
  }
  .rso-launcher:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(28,42,42,0.34); }
  .rso-launcher .rso-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--sand);
    box-shadow: 0 0 0 0 rgba(217,167,104,0.6);
    animation: rso-pulse 2.2s infinite;
    flex: none;
  }
  @keyframes rso-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(217,167,104,0.55); }
    70%  { box-shadow: 0 0 0 9px rgba(217,167,104,0); }
    100% { box-shadow: 0 0 0 0 rgba(217,167,104,0); }
  }
  .rso-launcher svg { flex: none; }
  .rso-launcher img.rso-launcher-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1E74A9;
    flex: none;
    object-fit: cover;
    object-position: center;
  }
  .rso-launcher.rso-hidden { display: none; }

  /* ---------- Bot avatar ---------- */
  .rso-bot-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    width: 100%;
  }
  .rso-bot-row .rso-msg.bot { margin-left: 0; }
  .rso-bot-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    background: #1E74A9;
    flex: 0 0 32px;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
  }

  /* ---------- Panel ---------- */
  .rso-panel {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 999999;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 600px;
    max-height: calc(100vh - 44px);
    background: var(--paper);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(20,30,30,0.32);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }
  .rso-panel.rso-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }

  .rso-header {
    background: var(--teal-dk);
    color: #fff;
    padding: 18px 18px 16px;
    flex: none;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .rso-header img.rso-logo {
    width: 46px;
    height: 46px;
    flex: none;
    border-radius: 50%;
    background: #fff;
    object-fit: contain;
    padding: 2px;
  }
  .rso-header-text { min-width: 0; }
  .rso-header h2 {
    margin: 0 0 2px;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.25;
  }
  .rso-header p {
    margin: 0;
    font-size: 12.5px;
    color: #CFE3E0;
  }
  .rso-close {
    position: absolute;
    top: 14px; right: 14px;
    background: rgba(255,255,255,0.14);
    border: none;
    color: #fff;
    width: 26px; height: 26px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    display: flex; align-items: center; justify-content: center;
  }
  .rso-close:hover { background: rgba(255,255,255,0.26); }

  .rso-progress {
    display: flex;
    gap: 5px;
    padding: 10px 18px;
    background: var(--teal-tint);
    flex: none;
  }
  .rso-progress span {
    height: 4px;
    flex: 1;
    border-radius: 2px;
    background: #C9DEDA;
    transition: background 0.25s ease;
  }
  .rso-progress span.rso-done { background: var(--teal); }

  .rso-thread {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .rso-msg {
    max-width: 84%;
    padding: 10px 13px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.45;
    animation: rso-rise 0.22s ease;
  }
  @keyframes rso-rise {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .rso-msg.bot {
    background: var(--teal-tint);
    color: var(--teal-dk);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
  }
  .rso-msg.user {
    background: var(--sand-tint);
    color: #5C3E17;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
  }
  .rso-msg.summary { max-width: 100%; }
  .rso-msg.summary dl {
    margin: 6px 0 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 10px;
    font-size: 13px;
  }
  .rso-msg.summary dt { color: var(--teal-dk); font-weight: 600; }
  .rso-msg.summary dd { margin: 0; }

  .rso-typing {
    display: inline-flex;
    gap: 4px;
    padding: 12px 14px;
    background: var(--teal-tint);
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
  }
  .rso-typing i {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--teal);
    opacity: 0.5;
    animation: rso-bounce 1.1s infinite ease-in-out;
  }
  .rso-typing i:nth-child(2) { animation-delay: 0.15s; }
  .rso-typing i:nth-child(3) { animation-delay: 0.3s; }
  @keyframes rso-bounce { 0%,60%,100% { transform: translateY(0); opacity:0.5; } 30% { transform: translateY(-4px); opacity:1; } }

  .rso-inputbar {
    flex: none;
    border-top: 1px solid var(--line);
    padding: 12px 14px 14px;
    background: var(--paper);
  }
  .rso-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
  }
  .rso-choice-btn {
    border: 1.5px solid var(--teal);
    color: var(--teal-dk);
    background: #fff;
    padding: 8px 13px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
  }
  .rso-choice-btn:hover { background: var(--teal); color: #fff; }

  .rso-textrow {
    display: flex;
    gap: 8px;
    align-items: center;
  }
  .rso-textrow input, .rso-textrow textarea {
    flex: 1;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--ink);
    resize: none;
  }
  .rso-textrow input:focus, .rso-textrow textarea:focus {
    outline: none;
    border-color: var(--teal);
  }
  .rso-send {
    background: var(--teal);
    border: none;
    color: #fff;
    width: 38px; height: 38px;
    border-radius: 50%;
    cursor: pointer;
    flex: none;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s ease;
  }
  .rso-send:hover { background: var(--teal-dk); }
  .rso-send:disabled { background: #B9C6C4; cursor: not-allowed; }

  .rso-field-error {
    color: var(--danger);
    font-size: 12px;
    margin: -4px 0 6px 2px;
  }

  .rso-fineprint {
    font-size: 11px;
    color: #7C7362;
    text-align: center;
    margin-top: 8px;
  }
  .rso-fineprint a { color: var(--teal-dk); }

  @media (max-width: 460px) {
    .rso-panel { right: 8px; left: 8px; bottom: 8px; width: auto; height: calc(100vh - 88px); }
    .rso-launcher { right: 14px; bottom: 14px; }
  }
.rso-launcher,.rso-close,.rso-choice-btn,.rso-send{touch-action:manipulation;}
