/* ============================================
   VOXIK · Exhaustive Catalog Styles (v2)
   ============================================ */

/* PC + телефон бок о бок */
.pc-phone-pair {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: stretch;
}
.pc-phone-pair > .pc-side {
  min-width: 0;
}
.pc-phone-pair > .phone-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.pc-phone-pair .platform-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}
@media (max-width: 1100px) {
  .pc-phone-pair { grid-template-columns: 1fr; }
  .pc-phone-pair > .phone-side { align-self: center; }
}

/* Универсальный grid для матриц состояний */
.matrix {
  display: grid;
  gap: 16px;
  width: 100%;
}
.matrix.cols-3 { grid-template-columns: repeat(3, 1fr); }
.matrix.cols-4 { grid-template-columns: repeat(4, 1fr); }
.matrix.cols-5 { grid-template-columns: repeat(5, 1fr); }
.matrix.cols-6 { grid-template-columns: repeat(6, 1fr); }
.matrix.cols-8 { grid-template-columns: repeat(8, 1fr); }
@media (max-width: 1100px) {
  .matrix.cols-4, .matrix.cols-5, .matrix.cols-6, .matrix.cols-8 { grid-template-columns: repeat(2, 1fr); }
}

.matrix-cell {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 20px 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-height: 130px;
  position: relative;
}
.matrix-cell .mc-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.matrix-cell .mc-label {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  text-align: center;
  font-family: var(--font-mono);
}
.matrix-cell .mc-sub {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: -6px;
}

/* Pre-join card */
.prejoin-stage {
  position: relative;
  background:
    radial-gradient(ellipse 400px 320px at 50% 30%, rgba(245,158,11,0.08), transparent 60%),
    var(--bg-deep);
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 460px;
  border-radius: var(--r-md);
}
.prejoin-card {
  width: 480px;
  max-width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-lg);
}
.prejoin-preview {
  position: relative;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #422006 0%, #78350f 50%, #92400e 100%);
  overflow: hidden;
}
.prejoin-preview::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 50% 65%, rgba(0,0,0,0.5), transparent 60%),
    radial-gradient(ellipse 30% 35% at 50% 38%, rgba(255, 235, 200, 0.18), transparent 60%);
}
.prejoin-preview.cam-off {
  background: var(--bg-elevated);
}
.prejoin-preview.cam-off::before { display: none; }
.prejoin-preview.cam-off .av-big {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.prejoin-preview.cam-off .av-big div {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 600;
}
.prejoin-controls {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2;
}
.prejoin-controls .icon-btn {
  width: 40px;
  height: 40px;
  background: rgba(0,0,0,0.6);
  border-color: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
}
.prejoin-controls .icon-btn.danger { background: var(--danger); border-color: transparent; }
.prejoin-controls .icon-btn .ic svg { width: 16px; height: 16px; }
.prejoin-mic-meter {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.prejoin-mic-meter .ic { color: var(--accent); }
.prejoin-mic-meter .ic svg { width: 12px; height: 12px; }
.prejoin-mic-meter .bars {
  display: flex;
  gap: 2px;
  align-items: flex-end;
  height: 12px;
}
.prejoin-mic-meter .bars span {
  width: 2px;
  background: var(--success);
  border-radius: 1px;
  height: 4px;
}
.prejoin-mic-meter .bars span.h2 { height: 7px; }
.prejoin-mic-meter .bars span.h3 { height: 10px; }
.prejoin-mic-meter .bars span.h4 { height: 12px; background: var(--accent); }

.prejoin-body {
  padding: 24px 28px 28px;
}
.prejoin-body h4 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.prejoin-body .room-tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.prejoin-body .vk-input { margin-bottom: 12px; }
.prejoin-body .row-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.prejoin-body .row-actions .vk-btn { flex: 1; }
.prejoin-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-dim);
}
.prejoin-meta .left { display: flex; align-items: center; gap: 8px; }
.prejoin-meta .left .av {
  width: 18px; height: 18px; border-radius: 50%;
  background: linear-gradient(135deg, #818cf8, #6366f1);
  color: white; font-size: 9px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}

/* Approval / waiting state */
.prejoin-waiting {
  text-align: center;
  padding: 48px 28px;
}
.prejoin-waiting .pulse-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 20px;
  background: var(--accent-glow);
  border: 2px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: var(--accent);
}
.prejoin-waiting .pulse-ring svg { width: 28px; height: 28px; }
.prejoin-waiting .pulse-ring::before, .prejoin-waiting .pulse-ring::after {
  content: '';
  position: absolute;
  inset: -2px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
  animation: ring-pulse 2.4s ease-out infinite;
}
.prejoin-waiting .pulse-ring::after { animation-delay: 1.2s; }
@keyframes ring-pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.6); opacity: 0; }
}
.prejoin-waiting h4 { font-size: 18px; font-weight: 600; margin-bottom: 6px; letter-spacing: -0.02em; }
.prejoin-waiting p { color: var(--text-muted); font-size: 13px; line-height: 1.5; margin-bottom: 18px; }
.prejoin-waiting .timer {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.prejoin-denied {
  text-align: center;
  padding: 48px 28px;
}
.prejoin-denied .icon-bad {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 18px;
  background: var(--danger-glow);
  border: 1px solid rgba(244,63,94,0.3);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
}
.prejoin-denied .icon-bad svg { width: 24px; height: 24px; }

/* Toolbar all-states matrix */
.tb-cell {
  background: rgba(8,7,6,0.7);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 22px 14px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.tb-cell .stage {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.tb-cell .name { font-size: 12px; font-weight: 500; }
.tb-cell .state {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* Toolbar btn variants */
.tbar-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.15s ease;
}
.tbar-btn .ic svg { width: 20px; height: 20px; }
.tbar-btn .badge {
  position: absolute;
  top: -2px; right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-deep);
}
.tbar-btn.is-hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.tbar-btn.is-focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.tbar-btn.is-pressed {
  transform: scale(0.94);
  background: rgba(255,255,255,0.04);
}
.tbar-btn.is-active {
  background: var(--accent-grad);
  color: var(--bg-deep);
  border-color: transparent;
  box-shadow: 0 0 16px rgba(245,158,11,0.35);
}
.tbar-btn.is-off {
  background: var(--danger);
  color: white;
  border-color: transparent;
}
.tbar-btn.is-warn {
  background: var(--warn);
  color: white;
  border-color: transparent;
  animation: handBounce 1.2s ease-in-out infinite;
}
@keyframes handBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
.tbar-btn.is-rec {
  background: var(--danger);
  color: white;
  border-color: transparent;
}
.tbar-btn.is-rec::before {
  content: '';
  position: absolute;
  inset: -3px;
  border: 2px solid var(--danger);
  border-radius: 50%;
  animation: rec-pulse 1.6s ease-out infinite;
}
@keyframes rec-pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  100% { transform: scale(1.25); opacity: 0; }
}
.tbar-btn.is-hangup {
  background: var(--danger);
  color: white;
  border-color: transparent;
  width: 64px;
  border-radius: 999px;
}
.tbar-btn.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* More menu (full opened) */
.more-menu {
  width: 280px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--sh-lg);
  overflow: hidden;
}
.more-menu .mm-section {
  padding: 6px;
}
.more-menu .mm-label {
  padding: 10px 12px 4px;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}
.more-menu .mm-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
}
.more-menu .mm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.1s ease;
  position: relative;
}
.more-menu .mm-item:hover { background: rgba(255,255,255,0.05); }
.more-menu .mm-item .ic { color: var(--text-muted); flex-shrink: 0; }
.more-menu .mm-item .ic svg { width: 15px; height: 15px; }
.more-menu .mm-item.is-active { color: var(--accent); }
.more-menu .mm-item.is-active .ic { color: var(--accent); }
.more-menu .mm-item .pip {
  margin-left: auto;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}
.more-menu .mm-sep { height: 1px; background: var(--border); margin: 4px 8px; }

/* Video tile anatomy */
.tile-big {
  position: relative;
  aspect-ratio: 16/9;
  width: 100%;
  background: linear-gradient(135deg, #422006 0%, #78350f 50%, #92400e 100%);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.tile-big::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 50% 65%, rgba(0,0,0,0.5), transparent 60%),
    radial-gradient(ellipse 30% 35% at 50% 38%, rgba(255, 235, 200, 0.18), transparent 60%);
}

.tile-overlay-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  z-index: 3;
}
.tile-overlay-actions button {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tile-overlay-actions button svg { width: 13px; height: 13px; }
.tile-overlay-actions button:hover { background: rgba(0,0,0,0.8); }

.tile-volume-overlay {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 36px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  border-radius: 18px;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 4;
}
.tile-volume-overlay .vert-slider {
  width: 4px;
  height: 80px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  position: relative;
}
.tile-volume-overlay .vert-slider .fill {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--accent);
  border-radius: 2px;
  height: 60%;
}
.tile-volume-overlay .vert-slider .knob {
  position: absolute;
  bottom: 60%;
  left: 50%;
  transform: translate(-50%, 50%);
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--bg-deep);
}
.tile-volume-overlay .pct {
  font-family: var(--font-mono);
  font-size: 9px;
  color: white;
}
.tile-volume-overlay .ic { color: white; }
.tile-volume-overlay .ic svg { width: 12px; height: 12px; }

.tile-subtitle {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  max-width: 80%;
  text-align: center;
  line-height: 1.35;
  z-index: 3;
}
.tile-subtitle.partial {
  font-style: italic;
  color: rgba(255,255,255,0.75);
}
.tile-subtitle .who {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2px;
  font-weight: 600;
  font-style: normal;
}

.tile-screen-icon {
  position: absolute;
  top: 8px; left: 8px;
  width: 24px; height: 24px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  z-index: 2;
}
.tile-screen-icon svg { width: 13px; height: 13px; }

/* Anatomy callouts */
.anatomy-wrap {
  position: relative;
  width: 100%;
}
.anatomy-callout {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--accent);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid var(--border-accent);
  padding: 3px 8px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 5;
}
.anatomy-callout::before {
  content: '';
  position: absolute;
  width: 32px;
  border-top: 1px dashed var(--accent);
}
.anatomy-callout.right::before {
  right: 100%;
  top: 50%;
  width: 32px;
}
.anatomy-callout.left::before {
  left: 100%;
  top: 50%;
}

/* Reactions popover full */
.reactions-pop {
  display: inline-flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 8px;
  gap: 4px;
  box-shadow: var(--sh-lg);
  position: relative;
}
.reactions-pop::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px; height: 10px;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
}
.reactions-pop button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  cursor: pointer;
}
.reactions-pop button:hover {
  background: rgba(255,255,255,0.06);
  transform: scale(1.2);
}

/* Floating reaction stage */
.reaction-flow {
  position: relative;
  background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%);
  border-radius: var(--r-sm);
  aspect-ratio: 16/9;
  width: 100%;
  overflow: hidden;
}
.reaction-flow .float {
  position: absolute;
  font-size: 32px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
  animation: float-up 4s ease-out infinite;
}
@keyframes float-up {
  0% { transform: translateY(100%) scale(0.4); opacity: 0; }
  15% { transform: translateY(80%) scale(1); opacity: 1; }
  100% { transform: translateY(-30%) scale(1.1); opacity: 0; }
}

/* Settings preview helpers */
.set-preview-mic {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 16px;
  margin-bottom: 14px;
}
.set-preview-mic .lbl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.set-preview-mic .lbl .name { font-size: 12.5px; font-weight: 500; }
.set-preview-mic .lbl .val { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.set-preview-mic .meter {
  height: 8px;
  background: var(--bg-deep);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.set-preview-mic .meter .fill {
  position: absolute;
  inset: 0 30% 0 0;
  background: linear-gradient(90deg, var(--success) 0%, var(--success) 60%, var(--warn) 60%, var(--warn) 85%, var(--danger) 85%, var(--danger) 100%);
}
.set-preview-mic .meter .ticks {
  position: absolute;
  inset: 0;
  display: flex;
}
.set-preview-mic .meter .ticks span {
  flex: 1;
  border-right: 1px solid rgba(0,0,0,0.4);
}

.test-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.test-row .vk-btn { flex: 1; }

/* Watch Party */
.wp-frame {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 12px 40px rgba(0,0,0,0.7);
  z-index: 5;
}
.wp-frame .wp-poster {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #4a044e 0%, #701a75 50%, #1e1b4b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.wp-frame .wp-poster::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 80% at 30% 70%, rgba(245,158,11,0.3), transparent 60%),
    radial-gradient(ellipse 50% 70% at 70% 40%, rgba(99,102,241,0.4), transparent 60%);
}
.wp-frame .wp-label {
  position: absolute;
  top: 10px;
  left: 12px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: white;
  z-index: 2;
}
.wp-frame .wp-label .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.wp-frame .wp-controls {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 10px 14px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.85));
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 2;
}
.wp-frame .wp-controls .pp {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-deep);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.wp-frame .wp-controls .pp svg { width: 14px; height: 14px; fill: currentColor; }
.wp-frame .wp-controls .scrub {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  position: relative;
}
.wp-frame .wp-controls .scrub::before {
  content: '';
  position: absolute;
  inset: 0 60% 0 0;
  background: var(--accent);
  border-radius: 2px;
}
.wp-frame .wp-controls .scrub::after {
  content: '';
  position: absolute;
  left: 40%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--bg-deep);
}
.wp-frame .wp-controls .time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255,255,255,0.8);
}

/* Top-of-screen elements */
.top-bar-stage {
  position: relative;
  background:
    linear-gradient(180deg, #050402, #0c0a09);
  padding: 16px;
  border-radius: var(--r-md);
  min-height: 100px;
  border: 1px solid var(--border);
}
.top-timer-pill {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
}
.top-timer-pill .pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulse 1.4s ease-in-out infinite;
}
.top-count-pill {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.top-count-pill .ic svg { width: 12px; height: 12px; }
.top-update-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
  border-radius: 999px;
  font-size: 12px;
  color: var(--accent);
  width: max-content;
  margin: 0 auto;
}
.top-update-banner .ic svg { width: 13px; height: 13px; }
.top-update-banner a {
  color: var(--accent);
  text-decoration: underline;
  font-weight: 500;
}

/* End-call summary */
.end-stage {
  background:
    radial-gradient(ellipse 500px 350px at 50% 30%, rgba(245,158,11,0.06), transparent 60%),
    var(--bg-deep);
  padding: 48px 32px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 480px;
}
.end-card {
  width: 520px;
  max-width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 32px;
  text-align: center;
  box-shadow: var(--sh-lg);
}
.end-card .check-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 20px;
  background: var(--success-glow, rgba(52,211,153,0.15));
  border: 1px solid rgba(52,211,153,0.3);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
}
.end-card .check-ring svg { width: 26px; height: 26px; }
.end-card h4 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.end-card .duration {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.end-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.end-stats .stat {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px;
}
.end-stats .stat .v {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 2px;
  font-family: var(--font-mono);
}
.end-stats .stat .l {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}
.end-actions {
  display: flex;
  gap: 8px;
}
.end-actions .vk-btn { flex: 1; }
.end-rate {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}
.end-rate .stars {
  display: inline-flex;
  gap: 4px;
  margin-top: 8px;
}
.end-rate .stars .star {
  font-size: 22px;
  color: var(--text-dim);
  cursor: pointer;
}
.end-rate .stars .star.on { color: var(--accent); }

/* Push notification */
.push-notif {
  width: 380px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.7);
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 12px;
  align-items: center;
}
.push-notif .app-icon {
  width: 40px; height: 40px;
  border-radius: 9px;
  background: var(--accent-grad);
  color: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
}
.push-notif .app-icon svg { width: 18px; height: 18px; }
.push-notif .body .title {
  font-size: 13px; font-weight: 600;
  margin-bottom: 2px;
}
.push-notif .body .text {
  font-size: 12px;
  color: var(--text-muted);
}
.push-notif .actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.push-notif .actions button {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}
.push-notif .actions .accept {
  background: var(--success);
  color: white;
}
.push-notif .actions .decline {
  background: var(--danger);
  color: white;
}

/* Incoming call sheet */
.incoming-call {
  width: 320px;
  background:
    radial-gradient(ellipse 200px 200px at 50% 30%, rgba(245,158,11,0.18), transparent 60%),
    var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--sh-lg);
}
.incoming-call .av {
  width: 84px; height: 84px;
  border-radius: 50%;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 600;
  position: relative;
}
.incoming-call .av::before, .incoming-call .av::after {
  content: '';
  position: absolute;
  inset: -4px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
  animation: ring-pulse 1.8s ease-out infinite;
}
.incoming-call .av::after { animation-delay: 0.9s; }
.incoming-call h5 { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.incoming-call .who-from { font-size: 12px; color: var(--text-muted); margin-bottom: 22px; }
.incoming-call .actions {
  display: flex;
  gap: 24px;
  justify-content: center;
}
.incoming-call .actions button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
}
.incoming-call .actions .accept {
  background: var(--success);
  box-shadow: 0 0 24px rgba(52,211,153,0.4);
}
.incoming-call .actions .decline {
  background: var(--danger);
}
.incoming-call .actions svg { width: 22px; height: 22px; }

/* Error full-screen states */
.err-stage {
  background: var(--bg-deep);
  border-radius: var(--r-md);
  padding: 48px 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  text-align: center;
}
.err-card {
  max-width: 380px;
}
.err-card .icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.err-card .icon.warn { background: var(--accent-glow); border: 1px solid var(--border-accent); color: var(--accent); }
.err-card .icon.bad { background: var(--danger-glow); border: 1px solid rgba(244,63,94,0.3); color: var(--danger); }
.err-card .icon svg { width: 26px; height: 26px; }
.err-card h4 { font-size: 19px; font-weight: 600; margin-bottom: 6px; letter-spacing: -0.02em; }
.err-card p { color: var(--text-muted); font-size: 13px; line-height: 1.5; margin-bottom: 18px; }
.err-card .code {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  background: var(--bg-elevated);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 18px;
}

/* Layout modes side-by-side */
.layout-modes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}
@media (max-width: 1100px) {
  .layout-modes-grid { grid-template-columns: 1fr; }
}

/* Phone screen content */
.phone-content {
  position: absolute;
  inset: 0;
  padding: 32px 14px 14px;
  display: flex;
  flex-direction: column;
  z-index: 2;
}
.phone-statusbar {
  position: absolute;
  top: 4px; left: 0; right: 0;
  height: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 28px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text);
  z-index: 6;
}
.phone-statusbar .right { display: flex; gap: 6px; align-items: center; }

/* Mobile in-call layout */
.m-call {
  position: absolute;
  inset: 28px 0 0;
  display: flex;
  flex-direction: column;
}
.m-call .m-top {
  position: absolute;
  top: 28px; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  z-index: 5;
}
.m-call .m-grid {
  flex: 1;
  display: grid;
  gap: 6px;
  padding: 36px 6px 80px;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  min-height: 0;
}
.m-call .m-grid .tile {
  border-radius: 10px;
  font-size: 9px;
}
.m-call .m-toolbar {
  position: absolute;
  bottom: 12px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 5px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
}
.m-call .m-toolbar .tbar-btn {
  width: 36px; height: 36px;
}
.m-call .m-toolbar .tbar-btn .ic svg { width: 14px; height: 14px; }
.m-call .m-toolbar .tbar-btn.is-hangup { width: 48px; }

/* Mobile action grid (bottom-sheet tiles) */
.m-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 6px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 10px;
  color: var(--text);
  text-align: center;
  cursor: pointer;
  transition: all 0.12s ease;
}
.m-action .ic { color: var(--text-muted); }
.m-action .ic svg { width: 16px; height: 16px; }
.m-action:hover { background: rgba(255,255,255,0.04); }
.m-action.is-active {
  background: var(--accent-glow);
  border-color: var(--border-accent);
  color: var(--accent);
}
.m-action.is-active .ic { color: var(--accent); }

/* Mobile chat bottom sheet */
.m-sheet {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  top: 38%;
  background: var(--bg-surface);
  border-radius: 18px 18px 0 0;
  border: 1px solid var(--border-strong);
  border-bottom: none;
  display: flex;
  flex-direction: column;
  z-index: 8;
  overflow: hidden;
}
.m-sheet .handle {
  width: 36px; height: 4px;
  background: var(--text-dim);
  border-radius: 2px;
  margin: 8px auto 0;
}
.m-sheet .head {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
}
.m-sheet .body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 11px;
}
.m-sheet .foot {
  padding: 8px;
  border-top: 1px solid var(--border);
}

/* Keyboard shortcuts cheatsheet */
.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.short-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12.5px;
}
.short-row .label { color: var(--text); }
.short-row .keys { display: flex; gap: 4px; }
.short-row .kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--bg-deep);
  border: 1px solid var(--border-strong);
  padding: 2px 8px;
  border-radius: 5px;
  color: var(--text-muted);
}

/* Host context menu (full) */
.host-menu {
  width: 240px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 6px;
  box-shadow: var(--sh-lg);
}

/* Loading skeletons in chat */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-elevated) 0%,
    rgba(255,255,255,0.04) 50%,
    var(--bg-elevated) 100%
  );
  background-size: 200% 100%;
  animation: skel 1.4s ease-in-out infinite;
  border-radius: 8px;
}
@keyframes skel {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Power saver mode pill */
.power-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  background: var(--info-glow, rgba(99,102,241,0.15));
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 999px;
  font-size: 11px;
  color: #a5b4fc;
}
.power-pill .ic svg { width: 12px; height: 12px; }

/* Subtitle channel demo */
.subtitle-demo {
  width: 100%;
  position: relative;
  background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%);
  border-radius: var(--r-sm);
  aspect-ratio: 16/8;
  position: relative;
  overflow: hidden;
}

/* Image bubble in chat */
.chat-msg .img-bubble {
  width: 160px;
  height: 100px;
  border-radius: 10px;
  background: linear-gradient(135deg, #422006, #92400e);
  position: relative;
  overflow: hidden;
}
.chat-msg .img-bubble::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 50% 60% at 50% 50%, rgba(255,235,200,0.3), transparent 70%);
}
.chat-msg .img-bubble .img-cap {
  position: absolute;
  bottom: 6px;
  left: 8px;
  font-size: 10px;
  color: white;
  background: rgba(0,0,0,0.5);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

/* Poll bubble */
.poll-bubble {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  width: 240px;
}
.poll-bubble .q { font-size: 12.5px; font-weight: 600; margin-bottom: 10px; }
.poll-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  position: relative;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  background: var(--bg-deep);
  overflow: hidden;
}
.poll-opt .bar {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--accent-glow);
  border-radius: 6px;
  z-index: 0;
}
.poll-opt .label-w {
  position: relative;
  z-index: 1;
  flex: 1;
}
.poll-opt .pct {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
}
.poll-opt.winner { border: 1px solid var(--border-accent); }

/* File bubble */
.file-bubble {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  width: 240px;
}
.file-bubble .file-icon {
  width: 32px; height: 32px;
  border-radius: 6px;
  background: var(--accent-glow);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.file-bubble .file-icon svg { width: 16px; height: 16px; }
.file-bubble .meta { flex: 1; min-width: 0; }
.file-bubble .meta .name {
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-bubble .meta .size {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
}
.file-bubble .dl {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}
.file-bubble .dl:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.file-bubble .dl svg { width: 13px; height: 13px; }

/* Typing indicator */
.typing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
  padding: 0 4px;
}
.typing .dots { display: inline-flex; gap: 2px; }
.typing .dots span {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typing-dot 1.2s ease-in-out infinite;
}
.typing .dots span:nth-child(2) { animation-delay: 0.15s; }
.typing .dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-3px); opacity: 1; }
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
}
.empty-state .ic {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--text-muted);
}
.empty-state .ic svg { width: 20px; height: 20px; }
.empty-state .t { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.empty-state .s { font-size: 11.5px; color: var(--text-dim); max-width: 220px; line-height: 1.4; }

/* Whiteboard width slider */
.wb-width {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}
.wb-width input[type=range] {
  width: 64px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg-elevated);
  border-radius: 2px;
}
.wb-width input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
}

/* Section with all swatches palette demo */
.wb-palette-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.wb-palette-row span {
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  position: relative;
}
.wb-palette-row span.active {
  border-color: var(--accent);
  transform: scale(1.08);
}
.wb-palette-row span.active::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
}

@media (max-width: 768px) {
  *:not([class*="spin"]):not([class*="load"]),
  *:not([class*="spin"]):not([class*="load"])::before,
  *:not([class*="spin"]):not([class*="load"])::after {
    animation-iteration-count: 1 !important;
  }
  [class*="overlay"], [class*="modal"], [class*="popover"],
  [class*="toast"], [class*="menu"], [class*="sheet"], [class*="panel"] {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
