/* Chatten med Räven Randi – fristående modul */
.randi-fab {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 1500;
  width: 66px; height: 66px; border-radius: 50%; border: 4px solid #fff; padding: 0; cursor: pointer;
  background: #fff1e2 center / cover no-repeat;
  box-shadow: 0 5px 0 #c24d17, 0 12px 26px rgba(0,0,0,.35);
  animation: randi-bob 3.2s ease-in-out infinite;
}
.randi-fab:active { transform: translateY(3px); box-shadow: 0 2px 0 #c24d17; }
.randi-fab .dot { position: absolute; top: -2px; right: -2px; width: 18px; height: 18px; border-radius: 50%;
  background: #e8174a; border: 3px solid #fff; animation: randi-ping 1.6s infinite; }
.randi-fab.seen .dot { display: none; }
.randi-teaser {
  position: fixed; right: 92px; bottom: calc(30px + env(safe-area-inset-bottom, 0px)); z-index: 1500;
  background: #fff; color: #2a1838; font: 800 14px/1.3 "Nunito", system-ui, sans-serif; padding: 9px 13px; border-radius: 16px 16px 4px 16px;
  box-shadow: 0 6px 18px rgba(0,0,0,.25); max-width: 200px; animation: randi-pop .4s cubic-bezier(.2,1.6,.4,1) both; cursor: pointer;
}
@keyframes randi-bob { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-5px) rotate(3deg); } }
@keyframes randi-ping { 50% { box-shadow: 0 0 0 6px rgba(232,23,74,0); } 0% { box-shadow: 0 0 0 0 rgba(232,23,74,.6); } }
@keyframes randi-pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.randi-panel {
  position: fixed; z-index: 1600; display: flex; flex-direction: column; overflow: hidden;
  left: 0; right: 0; bottom: 0; height: min(82vh, 640px); border-radius: 26px 26px 0 0;
  background: #fff7ee; box-shadow: 0 -10px 40px rgba(0,0,0,.35);
  font-family: "Nunito", system-ui, sans-serif; color: #2a1838;
  animation: randi-up .3s cubic-bezier(.2,.9,.3,1.1);
}
@media (min-width: 640px) {
  .randi-panel { left: auto; right: 20px; bottom: 96px; width: 380px; height: min(600px, calc(100vh - 120px)); border-radius: 26px; }
}
@keyframes randi-up { from { transform: translateY(40px); opacity: 0; } }
.randi-panel[hidden], .randi-teaser[hidden] { display: none !important; }

.randi-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; color: #fff;
  background: linear-gradient(135deg, #16a39a, #0e7c86); }
.randi-head img { width: 44px; height: 44px; border-radius: 50%; border: 3px solid #fff; background: #fff1e2; }
.randi-head b { display: block; font-family: "Fredoka", "Nunito", sans-serif; font-size: 19px; line-height: 1.1; }
.randi-head small { opacity: .85; font-weight: 700; }
.randi-head .x { margin-left: auto; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,255,255,.2); color: #fff; font-size: 17px; cursor: pointer; }

.randi-log { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 12px; display: flex; flex-direction: column; gap: 10px;
  background: repeating-linear-gradient(135deg, rgba(255,61,127,.04) 0 16px, transparent 16px 32px); }
.randi-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 88%; }
.randi-msg img { width: 28px; height: 28px; border-radius: 50%; flex: none; background: #fff1e2; }
.randi-msg p { margin: 0; padding: 10px 13px; border-radius: 18px; font-size: 16px; line-height: 1.35; white-space: pre-wrap; word-wrap: break-word; }
.randi-msg.r p { background: #fff; border-bottom-left-radius: 5px; box-shadow: 0 2px 0 #efdfe8; }
.randi-msg.u { align-self: flex-end; }
.randi-msg.u p { background: linear-gradient(180deg, #ff3d7f, #e8174a); color: #fff; border-bottom-right-radius: 5px; box-shadow: 0 2px 0 #a30d34; }
.randi-msg.err p { background: #ffe8ef; color: #b3123e; font-weight: 700; }
.randi-typing { display: inline-flex; gap: 4px; padding: 14px 14px !important; }
.randi-typing i { width: 7px; height: 7px; border-radius: 50%; background: #16a39a; animation: randi-dots 1s infinite; }
.randi-typing i:nth-child(2) { animation-delay: .15s; } .randi-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes randi-dots { 50% { transform: translateY(-5px); opacity: .5; } }

.randi-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 12px 8px; }
.randi-chips button { border: 0; border-radius: 999px; padding: 7px 12px; font: 800 13px "Nunito", sans-serif; cursor: pointer;
  background: #e3f7f5; color: #0e7c86; box-shadow: inset 0 0 0 2px #bfeae6; }

.randi-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); background: #fff; border-top: 1px solid #f1e4ec; }
.randi-form textarea { flex: 1; resize: none; max-height: 110px; min-height: 44px; font: inherit; font-size: 16px; color: inherit;
  border: 2px solid #eadff0; border-radius: 22px; padding: 10px 14px; outline: none; }
.randi-form textarea:focus { border-color: #16a39a; }
.randi-form button { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer; font-size: 20px; color: #fff;
  background: linear-gradient(180deg, #ff3d7f, #e8174a); box-shadow: 0 3px 0 #a30d34; }
.randi-form button:disabled { opacity: .5; }
