/* Voice assistant "حمّودي" — street-graffiti styling, RTL-safe */
.voice-fab {
  position: absolute;
  inset-inline-end: 14px;
  bottom: calc(var(--tab-h) + var(--safe-b) + var(--vf-b, 14px));
  z-index: 25;
  display: inline-flex; align-items: center; gap: 8px;
  height: 52px; padding: 0 16px 0 14px;
  border-radius: 999px;
  background: var(--accent, #FF8A14); color: #1B1714;
  font: 800 14px/1 var(--font, system-ui);
  border: 2px solid #1B1714;
  box-shadow: 3px 4px 0 #1B1714, 0 10px 26px rgba(255,138,20,.35);
  transition: transform .2s ease, bottom .25s ease, opacity .2s;
}
.voice-fab:active { transform: translateY(2px) scale(.98); box-shadow: 1px 2px 0 #1B1714; }
.voice-fab b { white-space: nowrap; font-weight: 800; }
.voice-fab.is-compact { width: 52px; padding: 0; justify-content: center; }
.voice-fab.is-compact b { display: none; }
.voice-fab.hidden { opacity: 0; pointer-events: none; transform: scale(.8); }
.voice-fab .vf-ring { position: absolute; inset: -6px; border-radius: inherit; border: 2px solid var(--accent, #FF8A14); opacity: .0; animation: vfPulse 2.4s ease-out infinite; }
@keyframes vfPulse { 0% { opacity: .55; transform: scale(.92); } 100% { opacity: 0; transform: scale(1.18); } }

.voice-sheet { position: absolute; inset: 0; z-index: 60; pointer-events: none; }
.voice-sheet .vs-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); opacity: 0; transition: opacity .25s; }
.voice-sheet .vs-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: min(78%, 640px);
  display: flex; flex-direction: column;
  background: var(--bg-2, #1E1A16);
  border-top: 3px solid var(--accent, #FF8A14);
  border-radius: 22px 22px 0 0;
  padding: 6px 14px calc(10px + var(--safe-b, 0px));
  transform: translateY(105%);
  transition: transform .32s cubic-bezier(.2,.8,.2,1), height .3s ease;
  box-shadow: 0 -18px 50px rgba(0,0,0,.5);
  background-image: radial-gradient(circle at 85% 0%, rgba(255,138,20,.16), transparent 45%), radial-gradient(circle at 0% 30%, rgba(255,45,85,.10), transparent 40%);
}
.voice-sheet.is-open { pointer-events: auto; }
.voice-sheet.is-open .vs-backdrop { opacity: 1; }
.voice-sheet.is-open .vs-panel { transform: translateY(0); }
.voice-sheet.is-peek .vs-backdrop { opacity: 0; pointer-events: none; }
.voice-sheet.is-peek .vs-panel { height: 34%; }
.voice-sheet.is-peek .vs-chips, .voice-sheet.is-peek .vs-foot, .voice-sheet.is-peek .vs-orb { display: none; }
.vs-grip { width: 44px; height: 5px; border-radius: 9px; background: rgba(255,255,255,.18); margin: 4px auto 8px; }
.vs-head { display: flex; align-items: center; gap: 10px; }
.vs-avatar { width: 44px; height: 44px; border-radius: 50%; background: #111; border: 2px solid var(--accent, #FF8A14); display: grid; place-items: center; overflow: hidden; flex-shrink: 0; }
.vs-avatar img { width: 80%; }
.vs-title { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.vs-title b { font: 400 22px/1.1 var(--display, var(--font)); color: var(--text, #fff); display: flex; align-items: center; gap: 8px; }
.vs-title span#vsState { font-size: 12px; color: var(--muted, #B9A894); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vs-x { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.08); color: var(--text, #fff); font-size: 15px; }

.vs-orb { height: 46px; display: flex; align-items: center; justify-content: center; gap: 5px; margin: 6px 0 2px; }
.vs-orb i { width: 6px; height: 10px; border-radius: 6px; background: var(--accent, #FF8A14); opacity: .55; transition: height .2s; }
.vs-orb[data-mode="listening"] i { animation: vsBar 1s ease-in-out infinite; background: var(--green, #3DDB5D); opacity: 1; }
.vs-orb[data-mode="speaking"] i { animation: vsBar .7s ease-in-out infinite; opacity: 1; }
.vs-orb[data-mode="think"] i { animation: vsDot 1.1s ease-in-out infinite; background: var(--accent-2, #F7C43A); opacity: 1; }
.vs-orb i:nth-child(2) { animation-delay: .12s !important; } .vs-orb i:nth-child(3) { animation-delay: .24s !important; }
.vs-orb i:nth-child(4) { animation-delay: .36s !important; } .vs-orb i:nth-child(5) { animation-delay: .48s !important; }
@keyframes vsBar { 0%,100% { height: 10px; } 50% { height: 36px; } }
@keyframes vsDot { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.vs-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 6px 2px 10px; scroll-behavior: smooth; }
.vs-msg { max-width: 84%; padding: 10px 13px; border-radius: 16px; font-size: 15px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.vs-msg.is-bot { align-self: flex-start; background: #2A241E; color: var(--text, #fff); border: 1px solid var(--line, rgba(255,196,120,.14)); border-start-start-radius: 4px; }
.vs-msg.is-user { align-self: flex-end; background: var(--accent, #FF8A14); color: #1B1714; font-weight: 700; border-start-end-radius: 4px; }
.vs-msg.is-interim { opacity: .65; }
.vs-card { align-self: stretch; display: grid; gap: 3px; padding: 10px 12px; border-radius: 14px; background: rgba(61,219,93,.08); border: 1px dashed rgba(61,219,93,.5); font-size: 13px; color: var(--text, #fff); }
.vs-card b { font-size: 14px; } .vs-card span { color: var(--muted, #B9A894); } .vs-card em { font-style: normal; color: var(--accent-2, #F7C43A); font-weight: 700; }
.vs-card-order { text-align: center; justify-items: center; padding: 14px; background: linear-gradient(160deg, rgba(255,138,20,.18), rgba(255,45,85,.10)); border: 2px solid var(--accent, #FF8A14); border-style: solid; }
.vs-card-order .vs-ok { width: 38px; height: 38px; border-radius: 50%; background: var(--green, #3DDB5D); color: #0d1f12; display: grid; place-items: center; font-weight: 900; font-size: 20px; }
.vs-card-order .vs-no { font: 400 34px/1.1 var(--en, var(--display)); letter-spacing: 1px; color: var(--text, #fff); direction: ltr; }
.vs-card-order .vs-track { margin-top: 6px; min-height: 46px; justify-content: center; width: 100%; color: #1B1714; background: var(--accent, #FF8A14); font-weight: 800; }
.vs-card-order .vs-track span { color: #1B1714; }

.vs-chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.vs-chips.is-hidden { display: none; }
.vs-chips button { flex-shrink: 0; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line, rgba(255,196,120,.2)); background: rgba(255,255,255,.04); color: var(--text, #fff); font-size: 13px; }
.vs-input { display: flex; align-items: center; gap: 8px; }
.vs-input input { flex: 1; min-width: 0; height: 48px; border-radius: 999px; padding: 0 16px; background: #120F0C; border: 1px solid var(--line, rgba(255,196,120,.2)); color: var(--text, #fff); font: 500 15px var(--font, system-ui); }
.vs-input input:focus { outline: none; border-color: var(--accent, #FF8A14); }
.vs-mic { width: 58px; height: 58px; border-radius: 50%; flex-shrink: 0; background: var(--accent, #FF8A14); color: #1B1714; display: grid; place-items: center; border: 2px solid #1B1714; box-shadow: 2px 3px 0 #000; position: relative; }
.vs-mic.is-on { background: var(--green, #3DDB5D); animation: vsMicGlow 1.2s ease-in-out infinite; }
@keyframes vsMicGlow { 0%,100% { box-shadow: 0 0 0 0 rgba(61,219,93,.55); } 50% { box-shadow: 0 0 0 10px rgba(61,219,93,0); } }
.vs-send { width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.08); color: var(--accent, #FF8A14); font-size: 18px; transform: scaleX(-1); }
html[dir="ltr"] .vs-send { transform: none; }
.vs-foot { margin: 8px 0 0; font-size: 11px; text-align: center; color: var(--muted, #B9A894); }
#screen-menu .scroll { padding-bottom: 84px; }
