:root {
  --bg-dark: #090d16;
  --card-bg: rgba(18, 25, 41, 0.75);
  --card-border: rgba(255, 255, 255, 0.08);
  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-pink: #ec4899;
  --accent-green: #10b981;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --glass-glow: rgba(139, 92, 246, 0.25);
  --font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Background Animations */
.app-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  animation: floatOrb 18s ease-in-out infinite alternate;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: var(--accent-purple);
  top: -100px;
  left: -100px;
}

.orb-2 {
  width: 600px;
  height: 600px;
  background: var(--accent-cyan);
  bottom: -150px;
  right: -100px;
  animation-delay: -5s;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: var(--accent-pink);
  top: 40%;
  left: 50%;
  animation-delay: -10s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 80px) scale(1.15); }
  100% { transform: translate(-40px, -60px) scale(0.95); }
}

/* Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 1.25rem 1.75rem;
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #fff;
  box-shadow: 0 8px 24px var(--glass-glow);
}

.brand-text h1 {
  font-size: 1.6rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.badge-tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 20px;
  font-weight: 600;
  text-transform: uppercase;
}

.brand-text p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.room-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 30px;
  font-size: 0.9rem;
}

.room-pill i {
  color: var(--accent-green);
}

.room-pill strong {
  color: var(--accent-cyan);
  letter-spacing: 0.5px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  border-radius: 14px;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  border: none;
  transition: all 0.25s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-purple), #6366f1);
  color: #fff;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--card-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.btn-glow {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #fff;
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

.btn-glow:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 30px rgba(6, 182, 212, 0.6);
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 50%;
  transition: color 0.2s;
}

.btn-icon:hover {
  color: var(--text-main);
}

.btn-ghost {
  background: none;
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: #ef4444;
}

.btn-success {
  background: var(--accent-green);
  color: #fff;
}

/* Cards & Layout */
.main-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.75rem;
}

@media (max-width: 992px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 1.75rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.card-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-main);
}

.status-indicator {
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;

}

.status-indicator.online { color: var(--accent-green); }
.status-indicator.offline { color: #ef4444; }

/* Drop Zone */
.drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 3rem 2rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.3s ease;
  cursor: pointer;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.05);
  transform: scale(1.01);
}

.drop-icon-wrapper {
  width: 76px;
  height: 76px;
  margin: 0 auto 1.25rem;
  background: rgba(139, 92, 246, 0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-purple);
  font-size: 2.2rem;
}

.drop-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.drop-content p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.supported-files {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.supported-files span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Upload Queue */
.upload-queue {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 16px;
  border: 1px solid var(--card-border);
}

.queue-list {
  max-height: 200px;
  overflow-y: auto;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.queue-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.8rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  font-size: 0.88rem;
}

.queue-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
}

/* Devices Radar */
.devices-radar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.device-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  transition: all 0.2s;
}

.device-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.device-avatar {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(6, 182, 212, 0.2));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  font-size: 1.2rem;
}

.device-info {
  flex: 1;
}

.device-name {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
}

.device-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.badge-you {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-green);
  border-radius: 10px;
  font-weight: 700;
}

/* Chat Box */
.chat-box {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 18px;
  border: 1px solid var(--card-border);
  padding: 1.25rem;
}

.chat-messages {
  height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-right: 0.4rem;
  margin-bottom: 1rem;
}

.chat-placeholder {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 3rem;
}

.chat-msg {
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.88rem;
}

.chat-msg .author {
  font-weight: 700;
  color: var(--accent-cyan);
  font-size: 0.78rem;
  margin-bottom: 0.2rem;
  display: block;
}

.chat-input-wrapper {
  display: flex;
  gap: 0.6rem;
}

.chat-input-wrapper input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 0.65rem 1rem;
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: var(--font-family);
  outline: none;
}

.chat-input-wrapper input:focus {
  border-color: var(--accent-purple);
}

/* Files Feed */
.files-feed-card {
  margin-top: 2rem;
}

.feed-filters {
  display: flex;
  gap: 0.5rem;
}

.btn-filter {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  border-radius: 10px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-filter.active, .btn-filter:hover {
  background: var(--accent-purple);
  color: #fff;
}

.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.file-card-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.25s ease;
}

.file-card-item:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.file-preview-area {
  height: 120px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.file-preview-area img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-preview-area i {
  font-size: 3rem;
  color: var(--accent-cyan);
}

.file-meta-info h4 {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.2rem;
}

.file-sub-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.empty-feed {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.15);
}

/* Footer */
.app-footer {
  text-align: center;
  margin-top: 3rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal-card {
  background: #0f172a;
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 1.75rem;
  width: 90%;
  max-width: 440px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
}

.qr-container {
  margin: 1.25rem 0;
  background: #fff;
  padding: 1rem;
  border-radius: 16px;
  display: inline-block;
}

.qr-container img {
  width: 220px;
  height: 220px;
}

.url-box {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.6rem 1rem;
  border-radius: 12px;
  font-size: 0.85rem;
  word-break: break-all;
  color: var(--accent-cyan);
  font-family: monospace;
}

.input-group {
  display: flex;
  gap: 0.6rem;
}

.input-group input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 1rem;
  outline: none;
}

.tag-cloud {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.room-tag {
  background: rgba(255, 255, 255, 0.06);
  padding: 0.3rem 0.7rem;
  border-radius: 10px;
  font-size: 0.82rem;
  cursor: pointer;
  font-weight: 600;
}

.room-tag:hover {
  background: var(--accent-purple);
}

.hidden { display: none !important; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.75rem; }
.pt-4 { padding-top: 1rem; }
.border-top { border-top: 1px solid var(--card-border); }
.text-center { text-align: center; }

/* Realtime conversation */
.device-call-hint,
.device-empty {
  margin-top: 0.75rem;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  color: var(--text-muted);
  background: rgba(6, 182, 212, 0.06);
  border: 1px solid rgba(6, 182, 212, 0.12);
  font-size: 0.84rem;
  text-align: center;
}

.btn-call-device {
  min-width: 92px;
  justify-content: center;
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.62rem 0.85rem;
}

.btn-call-device:hover:not(:disabled) {
  background: var(--accent-green);
  color: #fff;
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none !important;
}

.chat-messages {
  height: 280px;
}

.chat-msg {
  max-width: 90%;
  align-self: flex-start;
  line-height: 1.4;
}

.chat-msg.own-message {
  align-self: flex-end;
  background: rgba(139, 92, 246, 0.18);
  border: 1px solid rgba(139, 92, 246, 0.22);
}

.chat-msg p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-msg a {
  color: #67e8f9;
}

.message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.message-meta time {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.voice-composer {
  border-top: 1px solid var(--card-border);
  padding-top: 0.9rem;
  margin-top: 0.9rem;
}

.btn-voice {
  width: 100%;
  justify-content: center;
  background: rgba(236, 72, 153, 0.12);
  border: 1px solid rgba(236, 72, 153, 0.28);
  color: #f9a8d4;
}

.btn-voice:hover:not(:disabled),
.btn-voice.recording {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.recording-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  color: #fca5a5;
  margin-top: 0.65rem;
  font-size: 0.86rem;
}

.recording-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ef4444;
  animation: recordingPulse 1s ease-in-out infinite;
}

@keyframes recordingPulse {
  50% { opacity: 0.3; transform: scale(0.8); }
}

.audio-preview {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.audio-preview audio,
.voice-message-body audio {
  width: 100%;
  min-width: 180px;
  height: 38px;
}

.audio-preview-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.secure-context-warning {
  display: block;
  color: #fbbf24;
  line-height: 1.4;
  margin-top: 0.65rem;
}

.audio-message {
  width: min(100%, 360px);
}

.voice-message-body {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.6rem;
}

.voice-message-body > i {
  color: #f9a8d4;
}

.voice-message-body > span {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.file-actions {
  display: flex;
  gap: 0.5rem;
}

.file-actions .btn-primary {
  flex: 1;
  justify-content: center;
  padding: 0.55rem;
}

/* Voice call */
.btn-danger {
  background: #dc2626;
  color: #fff;
}

.call-incoming-card {
  text-align: center;
  max-width: 520px;
}

.incoming-call-icon {
  width: 92px;
  height: 92px;
  margin: 0 auto 1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 2rem;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
  box-shadow: 0 0 0 14px rgba(16, 185, 129, 0.09);
  animation: callPulse 1.7s ease-in-out infinite;
}

@keyframes callPulse {
  50% { box-shadow: 0 0 0 25px rgba(16, 185, 129, 0); }
}

.call-eyebrow {
  color: #6ee7b7;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
  font-weight: 800;
}

.call-incoming-card h3 {
  margin: 0.45rem 0 0.35rem;
  font-size: 1.45rem;
}

.call-incoming-card > p:not(.call-eyebrow) {
  color: var(--text-muted);
}

.incoming-call-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

.btn-call-large {
  min-height: 58px;
  justify-content: center;
  font-size: 1rem;
}

.call-panel {
  position: fixed;
  z-index: 800;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  width: min(720px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border: 1px solid rgba(139, 92, 246, 0.45);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65), 0 0 35px rgba(139, 92, 246, 0.16);
}

.call-panel.connected {
  border-color: rgba(16, 185, 129, 0.5);
}

.call-panel-avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #a5f3fc;
  font-size: 1.25rem;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.35), rgba(6, 182, 212, 0.28));
}

.call-panel-copy {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 1rem;
}

.call-panel-copy span {
  grid-column: 1 / -1;
  color: #6ee7b7;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.call-panel-copy strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 1.08rem;
}

.call-panel-copy time {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.call-panel-actions {
  display: flex;
  gap: 0.65rem;
}

.call-control {
  min-width: 82px;
  min-height: 58px;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  cursor: pointer;
}

.call-control span {
  font-size: 0.7rem;
}

.call-control.muted {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.4);
}

.call-control.hangup {
  background: #dc2626;
  border-color: #ef4444;
  color: #fff;
}

.app-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1200;
  max-width: min(420px, calc(100vw - 48px));
  padding: 0.85rem 1.25rem;
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 14px;
  background: #6d28d9;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.2s ease-out;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
.room-tag:focus-visible {
  outline: 3px solid #67e8f9;
  outline-offset: 3px;
}

@media (max-width: 680px) {
  .container { padding: 0.8rem; }
  .app-header, .card { padding: 1.1rem; border-radius: 18px; }
  .brand-text p { display: none; }
  .header-actions { width: 100%; }
  .header-actions .btn { flex: 1; justify-content: center; }
  .room-pill { width: 100%; justify-content: center; }
  .device-item { align-items: center; }
  .btn-call-device { min-width: 76px; }
  .chat-input-wrapper input { min-width: 0; }
  .feed-filters { width: 100%; overflow-x: auto; padding-bottom: 0.25rem; }
  .files-feed-card .card-header { align-items: flex-start; flex-direction: column; gap: 0.8rem; }
  .call-panel { grid-template-columns: auto 1fr; bottom: 10px; }
  .call-panel-actions { grid-column: 1 / -1; width: 100%; }
  .call-control { flex: 1; }
  .incoming-call-actions { grid-template-columns: 1fr; }
  .app-toast { right: 12px; bottom: 12px; }
}

/* Android TV / TV Box browsers: large D-pad targets and readable distance UI. */
.tv-mode .container {
  max-width: 1500px;
  font-size: 18px;
}

.tv-mode .btn,
.tv-mode .call-control,
.tv-mode input {
  min-height: 56px;
  font-size: 1rem;
}

.tv-mode .device-item {
  min-height: 78px;
}

.tv-mode .btn-call-device {
  min-width: 130px;
}

.tv-mode .chat-messages {
  height: 360px;
}

.tv-mode .call-panel {
  width: min(980px, calc(100vw - 64px));
  bottom: 40px;
  padding: 1.4rem;
}

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