
.ghost-brand{display:flex;align-items:center;gap:10px;}
.ghost-mark{width:34px;height:34px;display:block;filter:drop-shadow(0 0 10px rgba(245,168,75,.25));}
.ghost-byline{font-weight:600;letter-spacing:.08em;text-transform:uppercase;font-size:11px;color:var(--muted);}
.ghost-fabmark{width:22px;height:22px;display:block;filter:drop-shadow(0 0 12px rgba(0,179,255,.25));}
.ghost-link{color:var(--cyan);text-decoration:none;border-bottom:1px solid rgba(0,179,255,.35);}
.ghost-link:hover{border-bottom-color:rgba(0,179,255,.8);}

/* Ghost Bubble UI (RDS Ghost) */
:root{
  --ghost-bg:#0B0F1A;
  --ghost-panel:#0E1322;
  --ghost-panel2:#141A2E;
  --ghost-cyan:#00B3FF;
  --ghost-gold:#F5A84B;
  --ghost-text:#EAEFFF;
  --ghost-muted:#C9D1E6;
  --ghost-radius:18px;
  --ghost-shadow: 0 16px 44px rgba(0,0,0,.55);
}

#ghost-bubble{
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
#ghost-bubble .ghost-fab{
  width: 74px;
  height: 74px;
  border-radius: 999px;
  border: 1px solid rgba(0,179,255,.35);
  background: radial-gradient(120% 120% at 30% 25%, rgba(0,179,255,.22), rgba(11,15,26,.92) 55%, rgba(11,15,26,.98));
  box-shadow: 0 0 0 0 rgba(0,179,255,.22), var(--ghost-shadow);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  user-select:none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .18s ease, box-shadow .25s ease, border-color .25s ease;
  overflow:hidden;
}
#ghost-bubble .ghost-fab:hover{
  transform: translateY(-2px);
  border-color: rgba(0,179,255,.55);
}
#ghost-bubble .ghost-fab.pulse{
  animation: ghostPulse 2.8s ease-in-out;
}
@keyframes ghostPulse{
  0%{ box-shadow: 0 0 0 0 rgba(0,179,255,.0), var(--ghost-shadow); }
  40%{ box-shadow: 0 0 0 14px rgba(0,179,255,.12), var(--ghost-shadow); }
  70%{ box-shadow: 0 0 0 22px rgba(245,168,75,.10), var(--ghost-shadow); }
  100%{ box-shadow: 0 0 0 0 rgba(0,179,255,.0), var(--ghost-shadow); }
}
#ghost-bubble .ghost-fab img{
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 0 10px rgba(0,179,255,.35));
  opacity:.98;
}
#ghost-bubble .ghost-panel{
  position:fixed;
  right: 18px;
  bottom: 104px;
  width: min(380px, calc(100vw - 28px));
  max-height: min(560px, calc(100vh - 140px));
  display:none;
  flex-direction: column;
  border-radius: 20px;
  border: 1px solid rgba(0,179,255,.22);
  background: linear-gradient(180deg, rgba(14,19,34,.96), rgba(11,15,26,.96));
  backdrop-filter: blur(10px);
  box-shadow: var(--ghost-shadow);
  overflow:hidden;
}
#ghost-bubble.open .ghost-panel{ display:flex; }
#ghost-bubble .ghost-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 14px 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(20,26,46,.92), rgba(14,19,34,.80));
}
#ghost-bubble .ghost-brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
#ghost-bubble .ghost-brand img{
  width: 26px; height:26px;
  filter: drop-shadow(0 0 10px rgba(0,179,255,.35));
}
#ghost-bubble .ghost-title{
  display:flex;
  flex-direction:column;
  line-height:1.05;
  min-width:0;
}
#ghost-bubble .ghost-title strong{
  color: var(--ghost-text);
  font-size: 12.5px;
  letter-spacing: .14em;
}
#ghost-bubble .ghost-title span{
  color: rgba(245,168,75,.92);
  font-size: 10.5px;
  letter-spacing: .12em;
  margin-top: 2px;
}
#ghost-bubble .ghost-actions{
  display:flex;
  align-items:center;
  gap:8px;
}
.ghost-btn{
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: var(--ghost-text);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 12px;
  cursor:pointer;
  transition: transform .12s ease, background .2s ease, border-color .2s ease;
}
.ghost-btn:hover{
  background: rgba(255,255,255,.08);
  border-color: rgba(0,179,255,.22);
}
#ghost-bubble .ghost-body{
  padding: 12px 12px 10px 12px;
  overflow:auto;
  flex:1;
}
.ghost-note{
  color: rgba(201,209,230,.9);
  font-size: 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  padding: 10px 10px;
  border-radius: 14px;
  margin-bottom: 10px;
}
.ghost-msg{
  display:flex;
  margin: 10px 0;
}
.ghost-msg.user{ justify-content:flex-end; }
.ghost-bubble{
  max-width: 88%;
  padding: 10px 11px;
  border-radius: 14px;
  font-size: 12.5px;
  line-height: 1.35;
  white-space: pre-wrap;
}
.ghost-msg.user .ghost-bubble{
  background: rgba(0,179,255,.14);
  border: 1px solid rgba(0,179,255,.22);
  color: var(--ghost-text);
}
.ghost-msg.ghost .ghost-bubble{
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  color: var(--ghost-text);
}
.ghost-sys{
  color: rgba(245,168,75,.95);
  font-size: 11.5px;
  letter-spacing: .02em;
  margin: 6px 0 2px;
}
.ghost-row{
  display:flex;
  gap:10px;
  align-items:center;
  margin: 10px 0 8px;
}
.ghost-toggle{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
}
.ghost-toggle .label{
  color: var(--ghost-text);
  font-size: 12px;
}
.ghost-toggle .sub{
  color: rgba(201,209,230,.85);
  font-size: 11px;
  margin-top: 2px;
}
.switch{
  width: 44px; height: 24px;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.14);
  position: relative;
  cursor:pointer;
  flex: 0 0 auto;
}
.switch::after{
  content:"";
  width: 18px; height:18px;
  border-radius: 999px;
  position:absolute;
  top: 2px; left: 2px;
  background: rgba(234,239,255,.88);
  transition: transform .18s ease, background .18s ease;
}
.switch.on{
  background: rgba(0,179,255,.20);
  border-color: rgba(0,179,255,.30);
}
.switch.on::after{
  transform: translateX(20px);
  background: rgba(245,168,75,.95);
}
#ghost-bubble .ghost-footer{
  padding: 10px 10px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(11,15,26,.92);
}
.ghost-inputrow{
  display:flex;
  gap:8px;
}
.ghost-input{
  flex:1;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: var(--ghost-text);
  padding: 10px 12px;
  font-size: 13px;
  outline:none;
}
.ghost-input:focus{
  border-color: rgba(0,179,255,.35);
  box-shadow: 0 0 0 3px rgba(0,179,255,.14);
}
.ghost-send{
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(0,179,255,.28);
  background: rgba(0,179,255,.16);
  color: var(--ghost-text);
  cursor:pointer;
}
.ghost-meta{
  margin-top: 8px;
  font-size: 11px;
  color: rgba(201,209,230,.75);
  display:flex;
  justify-content:space-between;
  gap:8px;
}
.ghost-link{
  color: rgba(0,179,255,.95);
  text-decoration: none;
  border-bottom: 1px solid rgba(0,179,255,.25);
}
.ghost-link:hover{ border-bottom-color: rgba(0,179,255,.65); }


/* Ghost brand emphasis */
.ghost-fab{
  border: 1px solid rgba(245,168,75,.55);
  box-shadow: 0 0 0 1px rgba(245,168,75,.2), 0 10px 26px rgba(0,0,0,.45), 0 0 22px var(--ghost-gold-glow);
}
.ghost-fab img{
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 0 10px var(--ghost-gold-glow));
}
.ghost-header .ghost-brand img{
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 0 10px var(--ghost-gold-glow));
}
.ghost-header .ghost-title{
  letter-spacing: .14em;
}


.ghost-details{ margin-top:10px; opacity:.92; }
.ghost-details summary{ cursor:pointer; color: rgba(234,239,255,.78); font-size:12px; }
.ghost-breakdown{ margin-top:8px; font-size:12px; line-height:1.35; white-space:pre-wrap; color: rgba(234,239,255,.78); }

/* Panel sizing: never cut off on mobile */
.ghost-panel{
  width:min(420px, calc(100vw - 24px));
  height:min(72vh, 560px);
  max-height:calc(100vh - 120px);
  right:12px;
  bottom:12px;
}
@media (max-width:480px){
  .ghost-panel{
    width:calc(100vw - 16px);
    height:min(78vh, 620px);
    right:8px;
    bottom:8px;
  }
}

/* ===== Ghost v2 bubble UI additions ===== */
.ghost-fab{ position:fixed; right:18px; bottom:18px; z-index:9999; width:74px; height:74px; border-radius:999px;
  background:radial-gradient(120px 120px at 30% 20%, rgba(0,179,255,.28), rgba(0,0,0,.85));
  border:1px solid rgba(0,179,255,.28);
  box-shadow:0 18px 40px rgba(0,0,0,.55), 0 0 26px rgba(0,179,255,.12);
  display:flex; align-items:center; justify-content:center; cursor:pointer; }
.ghost-fab-ring{ position:absolute; inset:8px; border-radius:999px;
  border:1px solid rgba(0,179,255,.22);
  box-shadow: inset 0 0 24px rgba(0,179,255,.10);
  pointer-events:none; }
.ghost-fab img{ width:44px; height:44px; }

.ghost-panel{ z-index:99999; }

.ghost-header{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 12px 10px; }
.ghost-brand{ display:flex; align-items:center; gap:10px; }
.ghost-brand img{ width:40px; height:40px; filter: drop-shadow(0 0 16px rgba(0,179,255,.55)); }
.ghost-brand-text{ display:flex; flex-direction:column; line-height:1.05; }
.ghost-title{ font-weight:800; letter-spacing:.12em; font-size:12px; opacity:.95; }
.ghost-sub{ font-size:11px; opacity:.72; }

.ghost-actions{ display:flex; align-items:center; gap:8px; }
.ghost-btn{ border-radius:10px; padding:8px 10px; font-size:12px; background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10); color:rgba(234,239,255,.92); cursor:pointer; }
.ghost-btn:hover{ background:rgba(255,255,255,.09); }

.ghost-toggle{ display:flex; align-items:center; gap:8px; cursor:pointer; }
.ghost-toggle input{ display:none; }
.ghost-toggle-pill{ border-radius:999px; padding:8px 10px; font-size:12px; background:rgba(0,179,255,.10);
  border:1px solid rgba(0,179,255,.22); color:rgba(234,239,255,.92); }
.ghost-toggle input:checked + .ghost-toggle-pill{ background:rgba(0,179,255,.18); box-shadow:0 0 18px rgba(0,179,255,.18); }

.ghost-body{ padding:0 12px 12px; display:flex; flex-direction:column; height:100%; }
.ghost-prefbar{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 0 10px; }
.ghost-save{ display:flex; align-items:center; gap:8px; font-size:12px; opacity:.85; }
.ghost-save input{ width:14px; height:14px; }
.ghost-prefhint{ font-size:12px; opacity:.55; }

.ghost-messages{ flex:1; overflow:auto; padding:8px 0; }
.ghost-msg{ max-width:92%; border-radius:16px; padding:10px 12px; margin:10px 0;
  border:1px solid rgba(255,255,255,.08); background:rgba(255,255,255,.05); }
.ghost-msg.user{ margin-left:auto; border-color:rgba(0,179,255,.22); background:rgba(0,179,255,.08); }
.ghost-msg.assistant{ margin-right:auto; }
.ghost-msg.small{ opacity:.85; }
.ghost-msg-name{ font-size:10px; opacity:.60; letter-spacing:.12em; text-transform:uppercase; margin-bottom:6px; }
.ghost-msg-text{ font-size:14px; line-height:1.45; white-space:pre-wrap; }

.ghost-footer{ display:flex; gap:10px; padding:12px; border-top:1px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.25)); }
.ghost-input{ flex:1; padding:12px 12px; border-radius:14px; background:rgba(0,0,0,.35); color:rgba(234,239,255,.92);
  border:1px solid rgba(255,255,255,.10); outline:none; }
.ghost-input:focus{ border-color:rgba(0,179,255,.28); box-shadow:0 0 0 3px rgba(0,179,255,.10); }
.ghost-send{ padding:12px 14px; border-radius:14px; cursor:pointer; border:1px solid rgba(245,168,75,.35);
  background:rgba(245,168,75,.10); color:rgba(234,239,255,.92); font-weight:700; }

.ghost-toast{ position:absolute; left:12px; right:12px; bottom:92px; padding:10px 12px; border-radius:12px;
  background:rgba(0,0,0,.70); border:1px solid rgba(0,179,255,.18); opacity:0; transform:translateY(8px);
  transition:opacity .18s ease, transform .18s ease; font-size:12px; }
.ghost-toast.show{ opacity:1; transform:translateY(0); }

@media (max-width:480px){
  .ghost-fab{ right:12px; bottom:12px; width:70px; height:70px; }
  .ghost-fab img{ width:40px; height:40px; }
  .ghost-msg-text{ font-size:13.5px; }
}

.ghost-fab-mark svg{fill:currentColor;}
.ghost-fab-mark rect{fill:currentColor;}
