/* ========================================================
   EchoCall Mobile-First Ultra-Responsive Stylesheet
   Pure Voice Calling, Zero Glitchy Line-Breaks, Native App UI
   ======================================================== */

:root {
  --bg-core: #090c13;
  --bg-surface: rgba(18, 24, 38, 0.78);
  --bg-surface-elevated: rgba(26, 34, 54, 0.9);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(0, 132, 255, 0.5);

  --accent-primary: #0084ff;
  --accent-gradient: linear-gradient(135deg, #0084ff 0%, #00c6ff 100%);
  --accent-hover: #0073e6;

  --color-success: #00d26a;
  --success-gradient: linear-gradient(135deg, #00b050 0%, #00e676 100%);
  --color-danger: #ff3b30;
  --danger-gradient: linear-gradient(135deg, #e50914 0%, #ff5252 100%);
  --color-warning: #ff9500;

  --text-primary: #f2f6fa;
  --text-secondary: #8e9bb0;
  --text-muted: #5d6a80;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --header-height: 60px;
  --bottom-nav-height: 68px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-core);
  background-image: 
    radial-gradient(at 0% 0%, rgba(0, 132, 255, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(0, 198, 255, 0.08) 0px, transparent 50%);
  color: var(--text-primary);
  font-family: var(--font-body);
}

/* ================= MOBILE APP SHELL ================= */
.mobile-app-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 540px; /* Centered native phone app look on large monitors */
  height: 100%;
  height: 100dvh;
  margin: 0 auto;
  position: relative;
  background: var(--bg-core);
  border-left: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

/* ================= HEADER ================= */
.mobile-header {
  height: var(--header-height);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  z-index: 20;
}

.header-brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.header-logo-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 15px rgba(0, 132, 255, 0.4);
}

.header-titles {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.header-app-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.3px;
}

.header-status-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.header-status-pill.online {
  background: rgba(0, 210, 106, 0.15);
  color: var(--color-success);
  border: 1px solid rgba(0, 210, 106, 0.3);
}

.header-status-pill.offline {
  background: rgba(255, 59, 48, 0.15);
  color: var(--color-danger);
  border: 1px solid rgba(255, 59, 48, 0.3);
}

.header-actions-block {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header-profile-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
  max-width: 140px;
}

.header-profile-badge:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-primary);
}

.header-user-img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #141b2b;
  flex-shrink: 0;
}

.header-user-display {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* ================= SCROLLABLE VIEWPORT ================= */
.mobile-viewport-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
  padding-bottom: 16px;
}

.mobile-viewport-body::-webkit-scrollbar {
  width: 4px;
}
.mobile-viewport-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* ================= TAB VIEWS ================= */
.tab-view {
  display: none;
  padding: 16px;
  flex-direction: column;
  gap: 16px;
  animation: fadeInTab 0.25s ease;
}

.tab-view.active {
  display: flex;
}

@keyframes fadeInTab {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.section-title-row h2 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.section-title-row h2 i {
  color: var(--accent-primary);
  font-size: 16px;
  flex-shrink: 0;
}

.btn-text-link {
  background: transparent;
  border: none;
  color: var(--accent-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

/* ================= SEARCH INPUT ================= */
.search-input-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  transition: border-color 0.2s ease;
}

.search-input-shell:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(0, 132, 255, 0.25);
}

.search-icon {
  color: var(--text-muted);
  font-size: 14px;
  flex-shrink: 0;
}

.search-input-shell input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 14px;
  outline: none;
  min-width: 0;
}

/* ================= CALLS & CONTACTS LIST ================= */
.calls-history-scrollable,
.contacts-list-scrollable {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Contact Item Card */
.contact-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  min-width: 0;
}

.contact-item-card:hover {
  background: var(--bg-surface-elevated);
  border-color: rgba(0, 132, 255, 0.3);
}

.contact-info-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.contact-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.contact-avatar-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #141b2b;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  display: block;
}

.status-indicator-dot {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg-core);
}

.status-indicator-dot.online {
  background: var(--color-success);
  box-shadow: 0 0 6px var(--color-success);
}

.status-indicator-dot.offline {
  background: var(--text-muted);
}

.contact-text-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.contact-name-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.contact-display-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.contact-handle {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.contact-bio-preview {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.contact-action-right {
  margin-left: 10px;
  flex-shrink: 0;
}

.btn-round-call {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--success-gradient);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 210, 106, 0.3);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-round-call:active {
  transform: scale(0.92);
}

/* Call Log Item */
.call-log-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  min-width: 0;
}

.log-avatar-wrap {
  flex-shrink: 0;
  margin-right: 12px;
}

.log-avatar-img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #141b2b;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.log-details-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.log-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  margin-bottom: 2px;
}

.log-peer-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  margin-right: 8px;
}

.log-time-tag {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.log-status-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.log-status-row.incoming {
  color: var(--color-success);
}
.log-status-row.outgoing {
  color: var(--accent-primary);
}
.log-status-row.missed {
  color: var(--color-danger);
}

.btn-log-recall {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 10px;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-log-recall:active {
  background: var(--accent-primary);
  color: #fff;
  transform: scale(0.92);
}

/* Empty States */
.empty-state-box,
.loading-state-box {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.empty-state-icon {
  font-size: 34px;
  color: var(--text-muted);
}

.empty-state-box h4 {
  color: #fff;
  font-size: 15px;
}

.empty-state-box p {
  font-size: 12px;
  line-height: 1.5;
  max-width: 280px;
}

/* ================= TAB 3: PROFILE ================= */
.profile-card-shell {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.avatar-hero-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.avatar-glow-wrap {
  position: relative;
  width: 90px;
  height: 90px;
}

.profile-hero-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid var(--accent-primary);
  background: #141b2b;
  box-shadow: 0 0 20px rgba(0, 132, 255, 0.4);
  object-fit: cover;
}

.avatar-camera-btn {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 32px;
  height: 32px;
  background: var(--accent-gradient);
  border-radius: 50%;
  border: 2px solid var(--bg-core);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.avatar-change-hint {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

.avatar-picker-strip {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.avatar-choice-item {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  background: #141b2b;
  transition: transform 0.15s ease;
}

.avatar-choice-item:hover {
  transform: scale(1.15);
}

.avatar-choice-item.selected {
  border-color: var(--accent-primary);
  box-shadow: 0 0 8px var(--accent-primary);
}

.profile-form-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.input-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-cell label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-cell input {
  background: rgba(10, 14, 23, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

.input-cell input:focus {
  border-color: var(--accent-primary);
}

.input-cell input.input-readonly {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* ================= TAB 4: SETTINGS ================= */
.settings-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-headline h3 {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.mic-meter-shell {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.mic-meter-progress {
  width: 0%;
  height: 100%;
  background: var(--success-gradient);
  transition: width 0.08s ease;
  border-radius: var(--radius-full);
}

.mic-controls-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mic-status-label {
  font-size: 12px;
  color: var(--text-muted);
}

.security-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sec-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.sec-icon {
  font-size: 16px;
  color: var(--accent-primary);
  margin-top: 2px;
}

.sec-item strong {
  font-size: 13px;
  color: #fff;
  display: block;
}

.sec-item p {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.4;
}

/* ================= BOTTOM NAVIGATION ================= */
.mobile-bottom-nav {
  height: var(--bottom-nav-height);
  background: var(--bg-surface);
  backdrop-filter: blur(24px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-shrink: 0;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 20;
}

.nav-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  min-width: 60px;
}

.nav-tab-btn i {
  font-size: 18px;
  transition: transform 0.2s ease;
}

.nav-tab-btn span {
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.nav-tab-btn.active {
  color: var(--accent-primary);
}

.nav-tab-btn.active i {
  transform: translateY(-2px);
}

/* ================= BUTTONS ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 132, 255, 0.35);
}

.btn-primary:active {
  filter: brightness(0.9);
  transform: scale(0.98);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid var(--border-subtle);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(0, 132, 255, 0.5);
  color: var(--accent-primary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-lg {
  padding: 13px 20px;
  font-size: 14px;
}

.btn-block {
  width: 100%;
}

.badge-success {
  background: rgba(0, 210, 106, 0.15);
  color: var(--color-success);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

/* ================= INCOMING / OUTGOING CALL OVERLAYS ================= */
.voice-call-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(8, 11, 18, 0.92);
  backdrop-filter: blur(28px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.voice-call-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.call-stage-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 320px;
  width: 100%;
}

.pulsing-rings-wrap {
  position: relative;
  width: 130px;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.caller-stage-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  position: relative;
  z-index: 2;
  border: 3px solid rgba(255, 255, 255, 0.2);
  background: #111827;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.pulse-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(0, 132, 255, 0.3);
  animation: ripplePulse 2s infinite ease-out;
}

.ring-green .pulse-ring {
  background: rgba(0, 210, 106, 0.35);
}

.ring-2 { animation-delay: 0.6s; }
.ring-3 { animation-delay: 1.2s; }

@keyframes ripplePulse {
  0% { transform: scale(0.8); opacity: 0.9; }
  100% { transform: scale(2.2); opacity: 0; }
}

.caller-stage-name {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.caller-stage-handle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
}

.caller-stage-state {
  font-size: 13px;
  color: var(--accent-primary);
  margin: 14px 0 30px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ring-green + .caller-stage-name + .caller-stage-handle + .caller-stage-state {
  color: var(--color-success);
}

.call-action-btns-row {
  display: flex;
  align-items: center;
  gap: 40px;
}

.btn-circle-action {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: white;
  transition: transform 0.15s ease;
}

.btn-circle-action:active {
  transform: scale(0.9);
}

.btn-circle-action.btn-danger {
  background: var(--danger-gradient);
  box-shadow: 0 8px 24px rgba(255, 59, 48, 0.45);
}

.btn-circle-action.btn-success {
  background: var(--success-gradient);
  box-shadow: 0 8px 24px rgba(0, 210, 106, 0.45);
}

/* ================= ACTIVE VOICE CALL ROOM ================= */
.active-call-viewport {
  position: fixed;
  inset: 0;
  background: #080c14;
  background-image: radial-gradient(circle at center, rgba(0, 132, 255, 0.14) 0%, #060910 80%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.active-call-viewport.active {
  opacity: 1;
  pointer-events: auto;
}

.active-call-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 210, 106, 0.12);
  color: var(--color-success);
  border: 1px solid rgba(0, 210, 106, 0.25);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.call-timer-badge {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  letter-spacing: 1px;
}

.btn-chat-toggle {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
}

.active-call-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto 0;
}

.active-peer-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.active-glow-aura {
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: 30px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 132, 255, 0.35) 0%, transparent 70%);
  animation: glowPulse 3s infinite ease-in-out;
}

@keyframes glowPulse {
  0% { transform: scale(0.95); opacity: 0.5; }
  50% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.5; }
}

.active-peer-big-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.2);
  background: #141b2b;
  position: relative;
  z-index: 2;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
}

.active-peer-big-name {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-top: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.active-peer-sub-handle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
}

.remote-mute-pill {
  background: rgba(255, 59, 48, 0.2);
  color: #ff5252;
  border: 1px solid rgba(255, 59, 48, 0.4);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  margin-top: 6px;
  white-space: nowrap;
}

.active-waveform-box {
  width: 100%;
  max-width: 360px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Call Controls Dock */
.active-call-dock-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: rgba(18, 23, 36, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  margin: 0 auto;
}

.dock-circle-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  min-width: 68px;
  transition: all 0.15s ease;
}

.dock-circle-btn i {
  font-size: 17px;
}

.dock-circle-btn span {
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.dock-circle-btn:active {
  transform: scale(0.92);
}

.dock-circle-btn.active-danger {
  background: var(--danger-gradient);
  border-color: transparent;
}

.dock-circle-btn.active-warning {
  background: var(--color-warning);
  border-color: transparent;
}

.dock-circle-btn.btn-hangup {
  background: var(--danger-gradient);
  border-color: transparent;
  padding: 10px 22px;
  box-shadow: 0 4px 16px rgba(255, 59, 48, 0.4);
}

/* In-Call Chat Sheet */
.in-call-chat-sheet {
  position: absolute;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100%;
  background: rgba(10, 14, 22, 0.98);
  backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10;
  padding: 16px;
}

.in-call-chat-sheet.open {
  right: 0;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.sheet-header h4 {
  font-family: var(--font-heading);
  font-size: 16px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-close-sheet {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 26px;
  cursor: pointer;
}

.sheet-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
}

.msg-bubble {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
}

.bubble-left {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.bubble-right {
  align-self: flex-end;
  background: var(--accent-gradient);
  color: #fff;
}

.msg-sender {
  font-size: 10px;
  opacity: 0.7;
}

.msg-time {
  font-size: 9px;
  opacity: 0.6;
  text-align: right;
  margin-top: 2px;
}

.sheet-input-row {
  display: flex;
  gap: 8px;
}

.sheet-input-row input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: #fff;
  outline: none;
  font-size: 13px;
}

/* ================= AUTH MODAL ================= */
.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 11, 18, 0.88);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.auth-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.auth-modal-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  margin-bottom: 10px;
}

.auth-header h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.auth-header p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.auth-avatar-preview-box {
  display: flex;
  justify-content: center;
}

.auth-avatar-preview-box img {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px solid var(--accent-primary);
  background: #141b2b;
}

.auth-input-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-item label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.field-item input {
  background: rgba(10, 14, 23, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: #fff;
  font-size: 13px;
  outline: none;
}

.input-with-random {
  display: flex;
  gap: 6px;
}

.input-with-random input {
  flex: 1;
}

/* ================= TOASTS ================= */
.toast-stack {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 3000;
  width: 90%;
  max-width: 360px;
  pointer-events: none;
}

.toast-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(22, 28, 45, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent-primary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: slideDownToast 0.25s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast-pill.out {
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.25s ease;
}

@keyframes slideDownToast {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
