/* Extracted from index.html <style id="rabbit-chat-module-v22"> */

/* =========================================================
   Rabbit Chat Module V22
   SOSTITUZIONE PULITA: un solo bottone, un solo pannello,
   una sola logica. Nessun RMCC, nessun layer precedente.
   ========================================================= */

#rmccButton,
#rmccPanel,
#rmccIncoming,
#rmccCallModal,
.rfc-launcher,
.rfc-panel,
.rfc-call{
  display:none!important;
  visibility:hidden!important;
  pointer-events:none!important;
}

.rc22-button{
  position:fixed;
  right:22px;
  bottom:22px;
  z-index:2147483000;
  height:60px;
  min-width:152px;
  border:0;
  border-radius:999px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:0 16px 0 10px;
  color:#fff;
  background:linear-gradient(135deg,var(--button-chat,#1d4ed8),#0f766e);
  box-shadow:0 18px 50px rgba(29,78,216,.28),0 8px 22px rgba(15,23,42,.14);
  font:900 14px/1 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  user-select:none;
}

.rc22-button-icon{
  width:42px;
  height:42px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,.18);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.18);
  font-size:19px;
}

.rc22-button-text{
  display:grid;
  gap:3px;
  text-align:left;
}

.rc22-button-text b{
  font-size:14px;
}

.rc22-button-text small{
  font-size:11px;
  opacity:.82;
}

.rc22-panel{
  position:fixed;
  right:22px;
  bottom:94px;
  z-index:2147483001;
  width:min(920px,calc(100vw - 44px));
  height:min(690px,calc(100dvh - 126px));
  display:none;
  grid-template-columns:300px minmax(0,1fr);
  overflow:hidden;
  border-radius:28px;
  border:1px solid rgba(15,23,42,.10);
  background:#fff;
  box-shadow:0 34px 110px rgba(15,23,42,.25);
  color:#0f172a;
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

.rc22-panel.open{
  display:grid;
}

.rc22-sidebar{
  min-width:0;
  min-height:0;
  display:grid;
  grid-template-rows:auto auto minmax(0,1fr);
  background:linear-gradient(180deg,#f8fbff,#f3f7ff);
  border-right:1px solid rgba(15,23,42,.08);
}

.rc22-head{
  min-height:72px;
  padding:14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border-bottom:1px solid rgba(15,23,42,.08);
  background:#fff;
}

.rc22-head b{
  display:block;
  font-size:17px;
  letter-spacing:-.04em;
}

.rc22-head small{
  display:block;
  margin-top:3px;
  color:#64748b;
  font-size:12px;
  font-weight:750;
}

.rc22-close{
  width:40px;
  height:40px;
  border-radius:14px;
  border:1px solid rgba(15,23,42,.10);
  background:#fff;
  color:#0f172a;
  display:grid;
  place-items:center;
  cursor:pointer;
  font-weight:950;
  font-size:18px;
}

.rc22-search{
  padding:10px 12px;
  border-bottom:1px solid rgba(15,23,42,.08);
}

.rc22-search input{
  width:100%;
  min-height:42px;
  border-radius:15px;
  border:1px solid rgba(15,23,42,.12);
  background:#fff;
  padding:0 13px;
  font-size:14px;
  outline:none;
}

.rc22-list{
  min-height:0;
  overflow:auto;
  padding:10px;
  display:grid;
  gap:8px;
  align-content:start;
}

.rc22-contact{
  width:100%;
  border:1px solid transparent;
  background:transparent;
  border-radius:18px;
  padding:10px;
  display:grid;
  grid-template-columns:44px minmax(0,1fr);
  gap:10px;
  align-items:center;
  color:#0f172a;
  cursor:pointer;
  text-align:left;
}

.rc22-contact:hover,
.rc22-contact.active{
  background:#fff;
  border-color:rgba(29,78,216,.16);
  box-shadow:0 12px 26px rgba(15,23,42,.07);
}

.rc22-avatar{
  width:44px;
  height:44px;
  border-radius:16px;
  display:grid;
  place-items:center;
  color:#fff;
  font-weight:950;
  background:linear-gradient(135deg,#1d4ed8,#0f766e);
  position:relative;
}

.rc22-avatar::after{
  content:"";
  position:absolute;
  right:2px;
  bottom:2px;
  width:10px;
  height:10px;
  border-radius:50%;
  border:2px solid #fff;
  background:#10b981;
}

.rc22-contact.off .rc22-avatar::after{background:#94a3b8;}
.rc22-contact.away .rc22-avatar::after{background:#f59e0b;}

.rc22-contact-text{
  min-width:0;
}

.rc22-contact-text b,
.rc22-contact-text small{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.rc22-contact-text b{
  font-size:13.5px;
}

.rc22-contact-text small{
  margin-top:3px;
  color:#64748b;
  font-size:11.5px;
}

.rc22-main{
  min-width:0;
  min-height:0;
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  background:#fff;
}

.rc22-thread-head{
  min-height:76px;
  padding:13px 15px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border-bottom:1px solid rgba(15,23,42,.08);
  background:linear-gradient(180deg,#fff,#f8fbff);
}

.rc22-peer{
  min-width:0;
  display:flex;
  align-items:center;
  gap:10px;
}

.rc22-peer-text{
  min-width:0;
}

.rc22-peer-text b,
.rc22-peer-text small{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.rc22-peer-text b{
  font-size:15px;
}

.rc22-peer-text small{
  margin-top:3px;
  color:#64748b;
  font-size:12px;
  font-weight:750;
}

.rc22-tools{
  display:flex;
  align-items:center;
  gap:8px;
}

.rc22-tool{
  width:42px;
  height:42px;
  border-radius:15px;
  border:1px solid rgba(15,23,42,.10);
  background:#fff;
  color:#0f172a;
  display:grid;
  place-items:center;
  cursor:pointer;
  font-size:18px;
  font-weight:950;
  box-shadow:0 8px 18px rgba(15,23,42,.05);
}

.rc22-tool.audio{background:#0f766e;color:#fff;border-color:#0f766e;}
.rc22-tool.video{background:#7c3aed;color:#fff;border-color:#7c3aed;}

.rc22-messages{
  min-height:0;
  overflow:auto;
  padding:18px;
  display:flex;
  flex-direction:column;
  gap:10px;
  background:
    radial-gradient(circle at top right,rgba(191,219,254,.45),transparent 32%),
    linear-gradient(180deg,#f8fbff,#eef4ff 54%,#f8fbff);
}

.rc22-empty{
  margin:auto;
  max-width:420px;
  text-align:center;
  color:#64748b;
  line-height:1.45;
  font-weight:700;
}

.rc22-bubble{
  max-width:min(78%,560px);
  align-self:flex-start;
  padding:11px 13px;
  border-radius:20px 20px 20px 8px;
  border:1px solid rgba(15,23,42,.08);
  background:#fff;
  color:#0f172a;
  box-shadow:0 10px 24px rgba(15,23,42,.06);
  word-break:break-word;
  line-height:1.42;
}

.rc22-bubble.me{
  align-self:flex-end;
  border-radius:20px 20px 8px 20px;
  background:linear-gradient(180deg,#2563eb,#1d4ed8);
  color:#fff;
  border-color:#1d4ed8;
}

.rc22-bubble small{
  display:inline-block;
  margin-top:6px;
  font-size:10.5px;
  opacity:.78;
}

.rc22-bubble.me small{
  opacity:1;
  color:rgba(255,255,255,.95);
  padding:3px 7px;
  border-radius:999px;
  background:rgba(255,255,255,.16);
}

.rc22-compose{
  padding:12px;
  display:grid;
  grid-template-columns:1fr auto;
  gap:8px;
  border-top:1px solid rgba(15,23,42,.08);
  background:linear-gradient(180deg,#fff,#f8fbff);
}

.rc22-compose input{
  min-width:0;
  min-height:46px;
  border-radius:999px;
  border:1px solid rgba(15,23,42,.12);
  padding:0 15px;
  outline:none;
  font-size:14px;
}

.rc22-compose button{
  min-height:46px;
  border:0;
  border-radius:999px;
  padding:0 18px;
  background:#1d4ed8;
  color:#fff;
  font-weight:950;
  cursor:pointer;
}

.rc22-call{
  position:fixed;
  inset:0;
  z-index:2147483003;
  display:none;
  grid-template-rows:auto minmax(0,1fr) auto;
  background:#030712;
  color:#fff;
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

.rc22-call.open{
  display:grid;
}

.rc22-call-head{
  min-height:70px;
  padding:14px 16px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  border-bottom:1px solid rgba(255,255,255,.10);
  background:rgba(15,23,42,.72);
}

.rc22-call-title{
  min-width:0;
}

.rc22-call-title b,
.rc22-call-title small{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.rc22-call-title b{font-size:16px;}
.rc22-call-title small{margin-top:3px;color:#cbd5e1;font-size:12px;font-weight:700;}

.rc22-call-body{
  min-height:0;
  padding:14px;
  display:grid;
  grid-template-columns:minmax(0,1fr) 320px;
  gap:14px;
}

.rc22-stage{
  position:relative;
  min-height:0;
  border-radius:24px;
  overflow:hidden;
  background:radial-gradient(circle at center,rgba(29,78,216,.20),transparent 34%),#020617;
  border:1px solid rgba(255,255,255,.10);
}

.rc22-stage video{
  width:100%;
  height:100%;
  object-fit:cover;
  background:#020617;
}

.rc22-placeholder{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  text-align:center;
  padding:24px;
  color:#cbd5e1;
  background:linear-gradient(180deg,rgba(2,6,23,.20),rgba(2,6,23,.50));
}

.rc22-local{
  position:absolute;
  right:16px;
  bottom:16px;
  width:176px;
  height:126px;
  border-radius:20px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.16);
  background:#020617;
  box-shadow:0 20px 48px rgba(0,0,0,.36);
}

.rc22-local video{
  width:100%;
  height:100%;
  object-fit:cover;
}

.rc22-live{
  min-height:0;
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  border-radius:24px;
  overflow:hidden;
  background:#fff;
  color:#0f172a;
}

.rc22-live-head{
  padding:13px;
  border-bottom:1px solid rgba(15,23,42,.08);
  background:#f8fbff;
  font-weight:950;
}

.rc22-live-list{
  min-height:0;
  overflow:auto;
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:8px;
  background:#f8fbff;
}

.rc22-live-msg{
  padding:9px 10px;
  border-radius:14px;
  background:#fff;
  border:1px solid rgba(15,23,42,.08);
  font-size:12px;
  line-height:1.35;
}

.rc22-live-msg.me{
  background:#1d4ed8;
  color:#fff;
  border-color:#1d4ed8;
}

.rc22-live-msg small{
  display:block;
  margin-top:4px;
  opacity:.78;
  font-size:10px;
}

.rc22-live-compose{
  display:grid;
  grid-template-columns:1fr auto;
  gap:7px;
  padding:10px;
  border-top:1px solid rgba(15,23,42,.08);
  background:#fff;
}

.rc22-live-compose input{
  min-width:0;
  min-height:40px;
  border-radius:999px;
  border:1px solid rgba(15,23,42,.12);
  padding:0 12px;
  font-size:13px;
}

.rc22-live-compose button{
  border:0;
  border-radius:999px;
  padding:0 13px;
  background:#1d4ed8;
  color:#fff;
  font-weight:950;
}

.rc22-call-controls{
  padding:12px 14px calc(12px + env(safe-area-inset-bottom,0px));
  display:flex;
  justify-content:center;
  gap:10px;
  border-top:1px solid rgba(255,255,255,.10);
  background:rgba(15,23,42,.72);
}

.rc22-call-controls button{
  min-height:46px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.16);
  background:#fff;
  color:#0f172a;
  font-weight:950;
  padding:0 15px;
}

.rc22-call-controls button.off{background:#334155;color:#fff;}
.rc22-call-controls button.danger{background:#dc2626;color:#fff;border-color:#dc2626;}

@media(max-width:900px){
  .rc22-panel{
    grid-template-columns:1fr;
    grid-template-rows:250px minmax(0,1fr);
    right:12px;
    left:12px;
    width:auto;
    height:min(80dvh,760px);
  }
  .rc22-sidebar{
    border-right:0;
    border-bottom:1px solid rgba(15,23,42,.08);
  }
  .rc22-call-body{
    grid-template-columns:1fr;
    grid-template-rows:minmax(0,1fr) 260px;
  }
}

@media(max-width:640px){
  .rc22-button{
    right:14px;
    bottom:calc(14px + env(safe-area-inset-bottom,0px));
    width:60px;
    min-width:60px;
    height:60px;
    padding:0;
  }
  .rc22-button-text{display:none;}

  .rc22-panel{
    inset:0;
    width:100vw;
    height:100dvh;
    max-width:100vw;
    max-height:100dvh;
    border-radius:0;
    grid-template-columns:1fr;
    grid-template-rows:minmax(220px,32dvh) minmax(0,1fr);
    box-shadow:none;
  }

  .rc22-thread-head{
    align-items:flex-start;
    flex-direction:column;
    gap:10px;
    padding:11px 12px;
    min-height:112px;
  }

  .rc22-tools{
    width:100%;
    justify-content:flex-start;
  }

  .rc22-tool{
    width:44px;
    height:44px;
    min-width:44px;
    border-radius:14px;
  }

  .rc22-messages{
    padding:13px 12px;
  }

  .rc22-bubble{
    max-width:91%;
  }

  .rc22-compose{
    position:sticky;
    bottom:0;
    padding:10px 10px calc(10px + env(safe-area-inset-bottom,0px));
  }

  .rc22-compose input{
    font-size:16px;
  }

  .rc22-call-body{
    padding:10px;
    grid-template-rows:minmax(0,1fr) minmax(185px,28dvh);
    gap:10px;
  }

  .rc22-stage{
    border-radius:22px;
  }

  .rc22-local{
    width:116px;
    height:154px;
    right:12px;
    bottom:12px;
    border-radius:18px;
  }

  .rc22-live{
    border-radius:20px;
  }

  .rc22-live-compose input{
    font-size:16px;
  }

  .rc22-call-controls{
    justify-content:space-between;
    gap:8px;
    padding:10px 8px calc(10px + env(safe-area-inset-bottom,0px));
  }

  .rc22-call-controls button{
    flex:1;
    min-width:0;
    min-height:46px;
    padding:0 7px;
    font-size:11px;
  }
}
