/* Lurevana 4.20.0 — galleria profilo, vocali e chat professionale */
:root {
  --elorami-chat-bg: #f5f6fb;
  --elorami-chat-panel: rgba(255,255,255,.94);
  --elorami-chat-text: #15182a;
  --elorami-chat-muted: #73788e;
  --elorami-chat-border: rgba(25,29,52,.10);
  --elorami-chat-accent: #ff315f;
  --elorami-chat-accent-2: #7a4cff;
  --elorami-chat-own: linear-gradient(135deg,#ff315f 0%,#f22475 48%,#8a48ff 100%);
  --elorami-chat-other: #fff;
  --elorami-shadow-soft: 0 12px 34px rgba(28,32,58,.10);
}
@media (prefers-color-scheme: dark) {
  :root {
    --elorami-chat-bg: #0e1018;
    --elorami-chat-panel: rgba(22,24,35,.94);
    --elorami-chat-text: #f7f7fb;
    --elorami-chat-muted: #a8adbf;
    --elorami-chat-border: rgba(255,255,255,.10);
    --elorami-chat-other: #222532;
    --elorami-shadow-soft: 0 12px 34px rgba(0,0,0,.32);
  }
}

/* Chat: scope activated only when a real composer is detected. */
body.elorami-chat-upgraded {
  background: var(--elorami-chat-bg);
}
body.elorami-chat-upgraded :is(.chat-container,.chat-page,.conversation-page,.messages-page,[data-chat-container],[data-conversation]) {
  background:
    radial-gradient(circle at 14% 4%,rgba(255,49,95,.08),transparent 34%),
    radial-gradient(circle at 92% 14%,rgba(122,76,255,.08),transparent 36%),
    var(--elorami-chat-bg);
}
body.elorami-chat-upgraded :is(.chat-header,.conversation-header,.messages-header,[data-chat-header]) {
  position: sticky;
  top: 0;
  z-index: 18;
  min-height: 64px;
  border-bottom: 1px solid var(--elorami-chat-border);
  background: var(--elorami-chat-panel);
  box-shadow: 0 5px 18px rgba(30,34,62,.06);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  backdrop-filter: blur(18px) saturate(1.25);
}
body.elorami-chat-upgraded :is(.chat-messages,.messages-list,.message-list,.conversation-messages,[data-message-list]) {
  scrollbar-width: thin;
  scrollbar-color: rgba(122,76,255,.32) transparent;
  padding: 18px clamp(10px,3vw,30px) 24px;
  scroll-padding-bottom: 110px;
}
body.elorami-chat-upgraded :is(.message,.chat-message,.message-row,[data-message]) {
  max-width: min(78%,620px);
  margin-block: 5px;
  line-height: 1.42;
  overflow-wrap: anywhere;
}
body.elorami-chat-upgraded :is(.message-bubble,.bubble,.message-content,[data-message-bubble]) {
  border: 1px solid var(--elorami-chat-border);
  border-radius: 20px 20px 20px 7px;
  background: var(--elorami-chat-other);
  color: var(--elorami-chat-text);
  box-shadow: 0 4px 13px rgba(26,30,54,.055);
  padding: 10px 13px;
}
body.elorami-chat-upgraded :is(.sent,.outgoing,.mine,.own,.is-me,[data-own="true"],[data-sender="me"]) :is(.message-bubble,.bubble,.message-content,[data-message-bubble]),
body.elorami-chat-upgraded :is(.message.sent,.message.outgoing,.message.mine,.message.own,.message.is-me,[data-message][data-own="true"],[data-message][data-sender="me"]) {
  border-color: transparent;
  border-radius: 20px 20px 7px 20px;
  background: var(--elorami-chat-own);
  color: #fff;
  box-shadow: 0 6px 17px rgba(241,36,117,.20);
}
body.elorami-chat-upgraded :is(.message-time,.timestamp,.chat-time,[data-message-time]) {
  color: var(--elorami-chat-muted);
  font-size: .72rem;
  letter-spacing: .01em;
  opacity: .9;
}
body.elorami-chat-upgraded :is(.sent,.outgoing,.mine,.own,.is-me,[data-own="true"]) :is(.message-time,.timestamp,.chat-time,[data-message-time]) {
  color: rgba(255,255,255,.78);
}
body.elorami-chat-upgraded .elorami-composer-upgraded {
  position: relative;
  display: flex !important;
  align-items: flex-end;
  gap: 8px;
  padding: 9px max(10px,env(safe-area-inset-right)) calc(9px + env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));
  border-top: 1px solid var(--elorami-chat-border);
  background: var(--elorami-chat-panel);
  box-shadow: 0 -8px 26px rgba(25,29,52,.075);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  backdrop-filter: blur(18px) saturate(1.25);
}
body.elorami-chat-upgraded .elorami-message-input-upgraded {
  min-height: 44px !important;
  max-height: 138px;
  border: 1px solid var(--elorami-chat-border) !important;
  border-radius: 23px !important;
  background: color-mix(in srgb,var(--elorami-chat-other) 90%,transparent) !important;
  color: var(--elorami-chat-text) !important;
  padding: 11px 14px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
  outline: none;
  resize: none;
}
body.elorami-chat-upgraded .elorami-message-input-upgraded:focus {
  border-color: color-mix(in srgb,var(--elorami-chat-accent-2) 50%,transparent) !important;
  box-shadow: 0 0 0 4px rgba(122,76,255,.10);
}
.elorami-mic-button,
.elorami-recorder-action {
  appearance: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.elorami-mic-button {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg,var(--elorami-chat-accent),var(--elorami-chat-accent-2));
  box-shadow: 0 7px 18px rgba(239,45,116,.25);
  transition: transform .18s ease,box-shadow .18s ease,opacity .18s ease;
}
.elorami-mic-button:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(239,45,116,.30); }
.elorami-mic-button:active { transform: scale(.94); }
.elorami-mic-button:focus-visible { outline: 3px solid rgba(122,76,255,.28); outline-offset: 2px; }
.elorami-mic-button[disabled] { opacity: .48; cursor: not-allowed; }
.elorami-mic-button svg { width: 21px; height: 21px; fill: currentColor; }

.elorami-recorder-panel {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 10020;
  width: min(94vw,560px);
  transform: translateX(-50%);
  border: 1px solid var(--elorami-chat-border);
  border-radius: 24px;
  background: var(--elorami-chat-panel);
  color: var(--elorami-chat-text);
  box-shadow: 0 22px 70px rgba(20,22,42,.28);
  padding: 14px;
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  backdrop-filter: blur(22px) saturate(1.3);
  animation: elorami-recorder-in .22s ease-out;
}
@keyframes elorami-recorder-in { from { opacity: 0; transform: translate(-50%,14px) scale(.97); } }
.elorami-recorder-head { display:flex; align-items:center; gap:11px; min-height:42px; }
.elorami-record-dot { width:11px; height:11px; border-radius:50%; background:#ff315f; box-shadow:0 0 0 0 rgba(255,49,95,.35); animation:elorami-pulse 1.3s infinite; }
@keyframes elorami-pulse { 70% { box-shadow:0 0 0 9px rgba(255,49,95,0); } }
.elorami-recorder-title { font-weight:750; flex:1; }
.elorami-recorder-time { font-variant-numeric:tabular-nums; color:var(--elorami-chat-muted); font-weight:700; }
.elorami-recorder-wave { display:flex; align-items:center; justify-content:center; gap:3px; height:42px; margin:5px 0 8px; overflow:hidden; }
.elorami-recorder-wave span { width:3px; height:10px; border-radius:3px; background:linear-gradient(var(--elorami-chat-accent),var(--elorami-chat-accent-2)); animation:elorami-wave .85s ease-in-out infinite alternate; }
.elorami-recorder-wave span:nth-child(3n+1) { animation-delay:-.35s; }
.elorami-recorder-wave span:nth-child(3n+2) { animation-delay:-.6s; }
@keyframes elorami-wave { to { height:34px; } }
.elorami-recorder-actions { display:grid; grid-template-columns:1fr 1fr; gap:9px; }
.elorami-recorder-action { min-height:44px; border-radius:14px; font-weight:750; font-size:.96rem; }
.elorami-recorder-cancel { background:rgba(115,120,142,.12); color:var(--elorami-chat-text); }
.elorami-recorder-send { background:linear-gradient(135deg,var(--elorami-chat-accent),var(--elorami-chat-accent-2)); color:#fff; }
.elorami-recorder-send[disabled] { opacity:.5; cursor:wait; }
.elorami-recorder-status { min-height:20px; padding-top:7px; text-align:center; color:var(--elorami-chat-muted); font-size:.82rem; }

.elorami-audio-player {
  --progress: 0%;
  display:grid;
  grid-template-columns:38px minmax(120px,1fr) auto;
  align-items:center;
  gap:9px;
  width:min(330px,72vw);
  min-height:54px;
  padding:7px 9px;
  border-radius:17px;
  background:rgba(122,76,255,.08);
  color:inherit;
}
:is(.sent,.outgoing,.mine,.own,.is-me,[data-own="true"]) .elorami-audio-player { background:rgba(255,255,255,.16); }
.elorami-audio-toggle { width:38px; height:38px; border:0; border-radius:50%; display:grid; place-items:center; cursor:pointer; color:#fff; background:linear-gradient(135deg,var(--elorami-chat-accent),var(--elorami-chat-accent-2)); box-shadow:0 4px 11px rgba(40,27,94,.18); }
:is(.sent,.outgoing,.mine,.own,.is-me,[data-own="true"]) .elorami-audio-toggle { background:#fff; color:#e92f75; }
.elorami-audio-toggle svg { width:17px; height:17px; fill:currentColor; }
.elorami-audio-main { min-width:0; display:grid; gap:4px; }
.elorami-audio-range { width:100%; height:4px; accent-color:var(--elorami-chat-accent-2); cursor:pointer; }
.elorami-audio-meta { display:flex; justify-content:space-between; gap:8px; font-size:.70rem; opacity:.78; font-variant-numeric:tabular-nums; }
.elorami-audio-speed { border:0; background:transparent; color:inherit; font-weight:800; font-size:.73rem; cursor:pointer; padding:5px 3px; }

/* Profile photo gallery */
.elorami-gallery-shell {
  position:relative;
  width:100%;
  max-width:780px;
  margin:0 auto 18px;
  overflow:hidden;
  border-radius:clamp(18px,4vw,30px);
  background:#11131c;
  box-shadow:var(--elorami-shadow-soft);
  isolation:isolate;
  touch-action:pan-y pinch-zoom;
}
.elorami-gallery-track { display:flex; width:100%; transition:transform .34s cubic-bezier(.22,.8,.24,1); will-change:transform; }
.elorami-gallery-slide { flex:0 0 100%; min-width:0; aspect-ratio:4/5; margin:0; background:#11131c; overflow:hidden; }
.elorami-gallery-slide img { display:block; width:100%; height:100%; object-fit:cover; user-select:none; -webkit-user-drag:none; cursor:zoom-in; }
.elorami-gallery-source-hidden { position:absolute !important; width:1px !important; height:1px !important; overflow:hidden !important; clip:rect(0 0 0 0) !important; clip-path:inset(50%) !important; white-space:nowrap !important; }
.elorami-gallery-counter { position:absolute; top:12px; right:12px; z-index:4; min-width:47px; padding:6px 10px; border-radius:999px; background:rgba(12,13,21,.66); color:#fff; text-align:center; font-size:.78rem; font-weight:800; -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px); }
.elorami-gallery-nav { position:absolute; inset-block:50% auto; z-index:4; width:42px; height:42px; transform:translateY(-50%); border:0; border-radius:50%; display:grid; place-items:center; background:rgba(255,255,255,.88); color:#171827; box-shadow:0 6px 20px rgba(0,0,0,.17); cursor:pointer; }
.elorami-gallery-nav.prev { left:10px; }
.elorami-gallery-nav.next { right:10px; }
.elorami-gallery-nav svg { width:20px; height:20px; fill:currentColor; }
.elorami-gallery-dots { position:absolute; z-index:4; left:50%; bottom:12px; transform:translateX(-50%); display:flex; gap:6px; max-width:70%; padding:7px 9px; border-radius:999px; background:rgba(12,13,21,.45); -webkit-backdrop-filter:blur(9px); backdrop-filter:blur(9px); }
.elorami-gallery-dot { width:7px; height:7px; border:0; padding:0; border-radius:50%; background:rgba(255,255,255,.45); cursor:pointer; transition:width .2s ease,background .2s ease; }
.elorami-gallery-dot[aria-current="true"] { width:20px; border-radius:7px; background:#fff; }
.elorami-gallery-lightbox { position:fixed; inset:0; z-index:11000; display:grid; place-items:center; background:rgba(6,7,12,.94); opacity:0; visibility:hidden; transition:opacity .2s ease,visibility .2s ease; padding:max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left)); }
.elorami-gallery-lightbox.open { opacity:1; visibility:visible; }
.elorami-gallery-lightbox img { max-width:100%; max-height:92dvh; object-fit:contain; border-radius:12px; box-shadow:0 20px 70px rgba(0,0,0,.42); }
.elorami-gallery-lightbox-close { position:absolute; top:max(14px,env(safe-area-inset-top)); right:max(14px,env(safe-area-inset-right)); width:46px; height:46px; border:0; border-radius:50%; background:rgba(255,255,255,.14); color:#fff; font-size:29px; cursor:pointer; }
.elorami-gallery-lightbox-count { position:absolute; top:max(18px,env(safe-area-inset-top)); left:50%; transform:translateX(-50%); color:#fff; font-weight:800; font-size:.86rem; }
@media (max-width:640px) {
  body.elorami-chat-upgraded :is(.message,.chat-message,.message-row,[data-message]) { max-width:86%; }
  .elorami-gallery-shell { border-radius:0; max-width:none; }
  .elorami-gallery-nav { display:none; }
  .elorami-audio-player { width:min(300px,74vw); }
}
@media (prefers-reduced-motion:reduce) {
  .elorami-gallery-track,.elorami-recorder-panel,.elorami-mic-button { transition:none !important; animation:none !important; }
  .elorami-record-dot,.elorami-recorder-wave span { animation:none !important; }
}

/* Lurevana 4.22.0 · iPhone voice-send + chat contrast polish */
.elorami-recorder-send{min-width:0;white-space:normal;line-height:1.15}
.elorami-recorder-panel .elorami-recorder-status{overflow-wrap:anywhere;line-height:1.35}
body.elorami-chat-upgraded .crew413-messages article.mine,
body.elorami-chat-upgraded .crew413-messages article.mine p,
body.elorami-chat-upgraded .crew413-messages article.mine .message-body{color:#fff!important}
body.elorami-chat-upgraded .crew413-messages article.mine small,
body.elorami-chat-upgraded .crew413-messages article.mine time,
body.elorami-chat-upgraded .crew413-messages article.mine .x-meta{color:rgba(255,255,255,.82)!important;opacity:1!important}
body.elorami-chat-upgraded .crew413-messages article:not(.mine) small,
body.elorami-chat-upgraded .crew413-messages article:not(.mine) time{color:#74778a!important;opacity:1!important}
@media(max-width:640px){
  .elorami-recorder-panel{width:calc(100vw - 20px);bottom:calc(86px + env(safe-area-inset-bottom,0px));padding:13px;border-radius:22px}
  .elorami-recorder-actions{grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr)}
  .elorami-recorder-action{font-size:.88rem;padding:0 10px}
  body.elorami-chat-upgraded .elorami-composer-upgraded{gap:8px!important;padding:10px!important;border-radius:22px!important}
  body.elorami-chat-upgraded .elorami-message-input-upgraded{min-width:0!important}
}
