@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;500;600;700&display=swap');

:root {
  --sw-navy:        #0A1628;
  --sw-navy-mid:    #122035;
  --sw-navy-lift:   #1a2f4a;
  --sw-gold:        #C8971E;
  --sw-gold-light:  #E8B84B;
  --sw-gold-strong: rgba(200,151,30,0.28);
  --sw-subtle:      rgba(255,255,255,0.07);
  --sw-font-d: 'Cormorant Garamond', Georgia, serif;
  --sw-font-u: 'Nunito', sans-serif;
  --sw-ease:   cubic-bezier(0.32, 0.72, 0, 1);
}

.sw-card {
  position: fixed; bottom: 28px; right: 28px; z-index: 9500;
  display: flex; align-items: center; gap: 13px;
  padding: 13px 18px 13px 13px;
  background: var(--sw-navy);
  border-radius: 18px;
  border: 1px solid rgba(200,151,30,0.22);
  box-shadow: 0 10px 40px rgba(10,22,40,0.55), 0 2px 8px rgba(10,22,40,0.3);
  cursor: pointer; user-select: none;
  animation: sw-card-rise 0.65s var(--sw-ease) 1s both;
  transition: transform 0.26s ease, box-shadow 0.26s ease, border-color 0.26s ease, opacity 0.22s ease;
}
.sw-card::before {
  content: ''; position: absolute; inset: -10px; border-radius: 28px;
  background: radial-gradient(ellipse, rgba(200,151,30,0.07) 0%, transparent 70%);
  z-index: -1; animation: sw-halo 3.5s ease-in-out infinite;
}
@keyframes sw-card-rise {
  from { opacity: 0; transform: translateY(24px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes sw-halo {
  0%,100% { opacity: 0.5; transform: scale(1); }
  50%     { opacity: 1;   transform: scale(1.08); }
}
.sw-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(10,22,40,0.6), 0 0 28px var(--sw-gold-strong);
  border-color: rgba(200,151,30,0.55);
}
.sw-card.sw-hidden { opacity: 0; pointer-events: none; transform: translateY(8px) scale(0.94); }

.sw-av-sm { width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0; overflow: hidden; border: 1.5px solid rgba(200,151,30,0.3); }
.sw-av-lg { width: 58px; height: 58px; border-radius: 17px; flex-shrink: 0; overflow: hidden; border: 1.5px solid rgba(200,151,30,0.38); }
.sw-av-sm img, .sw-av-lg img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; display: block; }

.sw-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; flex-shrink: 0; position: relative; animation: sw-dot-pulse 2.8s ease-in-out infinite; }
.sw-live-dot::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; background: rgba(74,222,128,0.28); animation: sw-ring-pulse 2.8s ease-in-out infinite; }
@keyframes sw-dot-pulse  { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.8;transform:scale(.88)} }
@keyframes sw-ring-pulse { 0%,100%{opacity:0;transform:scale(1)} 50%{opacity:1;transform:scale(1.7)} }

.sw-card-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sw-card-name { font-family: var(--sw-font-d); font-size: 20px; font-weight: 600; color: var(--sw-gold); letter-spacing: 0.01em; line-height: 1; }
.sw-card-sub  { font-size: 11.5px; font-weight: 400; color: rgba(255,255,255,0.48); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 178px; transition: color 0.3s ease; }

.sw-backdrop { position: fixed; inset: 0; background: rgba(10,22,40,0.42); backdrop-filter: blur(3px); z-index: 9600; opacity: 0; pointer-events: none; transition: opacity 0.35s ease; }
.sw-backdrop.sw-open { opacity: 1; pointer-events: all; }

.sw-panel {
  position: fixed; top: 0; right: 0;
  width: 385px; height: 100vh; z-index: 9700;
  display: flex; flex-direction: column;
  background: var(--sw-navy);
  border-left: 1px solid rgba(200,151,30,0.14);
  border-radius: 22px 0 0 22px;
  box-shadow: -10px 0 48px rgba(10,22,40,0.6);
  transform: translateX(100%);
  transition: transform 0.48s var(--sw-ease);
  overflow: hidden;
  font-family: var(--sw-font-u);
}
.sw-panel.sw-open { transform: translateX(0); }
.sw-panel::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent 0%, rgba(200,151,30,0.7) 50%, transparent 100%); z-index: 10; }
.sw-panel::before { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0; background-image: repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(255,255,255,0.013) 40px, rgba(255,255,255,0.013) 41px), repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(255,255,255,0.007) 40px, rgba(255,255,255,0.007) 41px); }

.sw-panel-head { flex-shrink: 0; padding: 30px 24px 20px; position: relative; z-index: 1; border-bottom: 1px solid var(--sw-subtle); }
.sw-head-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; }
.sw-head-identity { display: flex; align-items: center; gap: 16px; }
.sw-head-name { font-family: var(--sw-font-d); font-size: 28px; font-weight: 600; color: var(--sw-gold); line-height: 1; margin-bottom: 6px; }
.sw-head-live { display: flex; align-items: center; gap: 6px; }
.sw-hld { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; animation: sw-dot-pulse 2.8s ease-in-out infinite; }
.sw-hlt { font-size: 10.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: rgba(255,255,255,0.35); }

.sw-close-btn { width: 34px; height: 34px; border-radius: 9px; background: var(--sw-subtle); border: 1px solid rgba(255,255,255,0.07); color: rgba(255,255,255,0.45); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; flex-shrink: 0; }
.sw-close-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.sw-close-btn svg { width: 13px; height: 13px; }


.sw-ctx-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 7px; background: rgba(200,151,30,0.07); border: 1px solid rgba(200,151,30,0.14); }
.sw-ctx-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--sw-gold); opacity: 0.65; }
.sw-ctx-txt { font-size: 10px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: rgba(200,151,30,0.65); }

.sw-convo { flex: 1; overflow-y: auto; padding: 22px 20px 10px; display: flex; flex-direction: column; gap: 12px; position: relative; z-index: 1; scrollbar-width: thin; scrollbar-color: rgba(200,151,30,0.12) transparent; }
.sw-convo::-webkit-scrollbar { width: 4px; }
.sw-convo::-webkit-scrollbar-thumb { background: rgba(200,151,30,0.18); border-radius: 2px; }

.sw-msg { display: flex; flex-direction: column; gap: 5px; animation: sw-msg-in 0.32s ease both; }
@keyframes sw-msg-in { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
.sw-msg.sw-s { align-items: flex-start; }
.sw-msg.sw-u { align-items: flex-end; }
.sw-bubble { max-width: 82%; padding: 12px 16px; font-size: 16px; font-weight: 400; line-height: 1.58; font-family: var(--sw-font-u); }
.sw-msg.sw-s .sw-bubble { background: var(--sw-navy-lift); color: rgba(255,255,255,0.86); border-radius: 4px 16px 16px 16px; border: 1px solid rgba(255,255,255,0.055); }
.sw-msg.sw-u .sw-bubble { background: linear-gradient(135deg, var(--sw-gold), #a87818); color: var(--sw-navy); font-weight: 600; border-radius: 16px 4px 16px 16px; }
.sw-greeting-bubble { font-family: var(--sw-font-d); font-style: italic; font-size: 21px; line-height: 1.65; background: transparent !important; border: none !important; padding: 4px 0 !important; color: rgba(255,255,255,0.90) !important; max-width: 100% !important; white-space: pre-line; }

.sw-typing { display: flex; align-items: center; gap: 5px; padding: 13px 16px; background: var(--sw-navy-lift); border-radius: 4px 16px 16px 16px; width: fit-content; border: 1px solid rgba(255,255,255,0.055); }
.sw-td { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,0.3); animation: sw-td 1.4s ease-in-out infinite; }
.sw-td:nth-child(2){animation-delay:.2s} .sw-td:nth-child(3){animation-delay:.4s}
@keyframes sw-td { 0%,60%,100%{transform:translateY(0);opacity:.3} 30%{transform:translateY(-6px);opacity:1} }

.sw-qrs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.sw-qr { font-family: var(--sw-font-u); font-size: 14px; font-weight: 500; padding: 8px 14px; border-radius: 20px; border: 1px solid rgba(200,151,30,0.28); background: rgba(200,151,30,0.05); color: rgba(255,255,255,0.65); cursor: pointer; transition: all 0.2s ease; }
.sw-qr:hover { background: rgba(200,151,30,0.14); border-color: rgba(200,151,30,0.6); color: var(--sw-gold-light); }

.sw-input-area { flex-shrink: 0; padding: 12px 16px 22px; border-top: 1px solid var(--sw-subtle); position: relative; z-index: 1; }
.sw-input-row { display: flex; align-items: center; gap: 9px; background: var(--sw-navy-lift); border-radius: 14px; border: 1px solid rgba(255,255,255,0.07); padding: 10px 12px; transition: border-color 0.2s ease; }
.sw-input-row:focus-within { border-color: rgba(200,151,30,0.38); }
.sw-msg-input { flex: 1; background: transparent; border: none; outline: none; font-family: var(--sw-font-u); font-size: 15px; color: #fff; }
.sw-msg-input::placeholder { color: rgba(255,255,255,0.26); }
.sw-ibtn { width: 32px; height: 32px; border-radius: 8px; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.2s ease; }
.sw-ibtn svg { width: 14px; height: 14px; }
.sw-mic { background: transparent; color: rgba(255,255,255,0.32); }
.sw-mic:hover { color: var(--sw-gold-light); background: rgba(200,151,30,0.1); }
.sw-mic.sw-listening { color: var(--sw-gold-light) !important; background: rgba(200,151,30,0.18) !important; animation: sw-mic-pulse 1s ease-in-out infinite; }
@keyframes sw-mic-pulse { 0%,100%{transform:scale(1);box-shadow:none} 50%{transform:scale(1.12);box-shadow:0 0 12px rgba(200,151,30,0.4)} }
.sw-send { background: var(--sw-gold); color: var(--sw-navy); }
.sw-send:hover { background: var(--sw-gold-light); transform: scale(1.06); }
.sw-input-hint { font-size: 10px; font-weight: 600; letter-spacing: 0.04em; color: rgba(255,255,255,0.18); text-align: center; margin-top: 9px; font-family: var(--sw-font-u); }

@media (max-width: 480px) {
  .sw-panel { width: 100vw; border-radius: 22px 22px 0 0; top: auto; bottom: 0; height: 92vh; }
  .sw-card  { bottom: 20px; right: 16px; }
}
