/* ═══════════════════════════════════════════════════
   SECTEL — Tactical Operations Terminal Aesthetic
   Quantum-Resistant E2E Encrypted Communication
   ═══════════════════════════════════════════════════ */

:root {
  /* Base palette */
  --bg-deepest: #050810;
  --bg-base: #0a0e17;
  --bg-card: #111827;
  --bg-card-hover: #1a2236;
  --bg-elevated: #1e2a3a;
  --bg-input: #0d1320;

  /* Accent: phosphor teal */
  --accent: #00d4aa;
  --accent-dim: #00a88a;
  --accent-glow: rgba(0, 212, 170, 0.15);
  --accent-glow-strong: rgba(0, 212, 170, 0.3);

  /* Danger: warning red */
  --danger: #ff4757;
  --danger-glow: rgba(255, 71, 87, 0.2);

  /* Success: call accept green */
  --success: #2ed573;
  --success-glow: rgba(46, 213, 115, 0.2);

  /* Text hierarchy */
  --text-primary: #e8edf5;
  --text-secondary: #8892a4;
  --text-muted: #4a5568;
  --text-accent: var(--accent);

  /* Borders */
  --border: #1e2a3a;
  --border-accent: rgba(0, 212, 170, 0.25);

  /* Typography */
  --font-display: 'Chakra Petch', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --font-body: 'Chakra Petch', sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

/* ─── Reset & Base ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  background: var(--bg-deepest);
  color: var(--text-primary);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Ambient Background Layers ─── */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(0, 212, 170, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 170, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.bg-scanlines {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
  pointer-events: none;
}

.bg-vignette {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse at center, transparent 40%, var(--bg-deepest) 100%);
  pointer-events: none;
}

/* ─── App Container ─── */
#app {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
}

/* ─── Screens ─── */
.screen {
  display: none;
  min-height: 100dvh;
}

.screen.active {
  display: flex;
}

.screen-inner {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: var(--space-lg);
}

/* ─── Desktop Split Layout ─── */
.desktop-split {
  display: flex;
  width: 100%;
  height: 100dvh;
}

/* Mobile: only contacts panel visible, chat overlays via JS */
.panel-contacts {
  width: 100%;
  flex-shrink: 0;
  overflow-y: auto;
}

.panel-chat {
  display: none;
}

.panel-chat.chat-open {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg-deepest);
}

.panel-chat-empty {
  display: none;
}

.panel-chat-empty-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-xl);
}

/* Desktop: side-by-side */
@media (min-width: 768px) {
  .panel-contacts {
    width: 380px;
    min-width: 320px;
    max-width: 420px;
    border-right: 1px solid var(--border);
    height: 100dvh;
  }

  .panel-contacts .screen-inner {
    max-width: 100%;
  }

  .panel-contacts .connect-layout {
    min-height: 100dvh;
  }

  .panel-chat {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
  }

  .panel-chat.chat-open {
    position: static;
    z-index: auto;
  }

  .panel-chat-empty {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
  }

  .panel-chat .chat-layout {
    flex: 1;
    height: 100dvh;
  }

  /* Hide back button on desktop */
  #btn-chat-back {
    display: none;
  }

  /* Identity screen wider on desktop */
  #screen-identity .screen-inner,
  #screen-gate .screen-inner {
    max-width: 520px;
  }
}

/* ═══════════════════════════════════════════════════
   SCREEN 1: IDENTITY
   ═══════════════════════════════════════════════════ */
.identity-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  gap: var(--space-xl);
  text-align: center;
}

/* Classification banner */
.classification-banner {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent-dim);
  padding: var(--space-xs) var(--space-md);
  border: 1px solid var(--border-accent);
  border-radius: 2px;
  animation: fadeSlideDown 0.6s ease both;
}

.classification-dot {
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
}

/* Logo */
.identity-logo {
  animation: fadeSlideDown 0.6s ease 0.1s both;
}

.identity-logo img {
  width: 120px;
  height: auto;
  filter: drop-shadow(0 0 30px rgba(0, 212, 170, 0.15));
  transition: filter var(--transition-base);
}

.identity-logo img:hover {
  filter: drop-shadow(0 0 40px rgba(0, 212, 170, 0.25));
}

/* Tagline */
.identity-tagline {
  animation: fadeSlideDown 0.6s ease 0.2s both;
}

.tagline-main {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.tagline-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* Create Identity */
.identity-create {
  animation: fadeSlideDown 0.6s ease 0.3s both;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.identity-hint {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  max-width: 280px;
  line-height: 1.5;
}

/* Identity Display */
.identity-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
  width: 100%;
  animation: fadeIn 0.4s ease both;
}

/* ID Card */
.id-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
}

.id-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.id-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.id-card-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

.id-card-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.badge-dot--active {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
}

.badge-dot--connecting {
  background: #f9ca24;
  box-shadow: 0 0 8px #f9ca24;
  animation: pulse-dot 1s ease-in-out infinite;
}

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

/* Derived ID display */
.id-card-value {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  word-break: break-all;
  line-height: 1.6;
}

.id-prefix {
  color: var(--accent);
}

.id-separator {
  color: var(--text-muted);
  margin: 0 1px;
}

.id-group {
  color: var(--text-primary);
}

/* Restore banner */
.restore-banner {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: rgba(0, 212, 170, 0.08);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}

.restore-icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
  flex-shrink: 0;
}

.restore-text {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.id-card-nickname {
  margin-bottom: var(--space-lg);
}

.id-card-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
}

/* QR Container */
.qr-container {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 16, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease;
}

.qr-card {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

.qr-card-header {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

.qr-code {
  background: #fff;
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  min-width: 200px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Crypto specs footer */
.identity-footer {
  animation: fadeSlideDown 0.6s ease 0.4s both;
}

.crypto-specs {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.spec-divider {
  color: var(--border);
}

/* ═══════════════════════════════════════════════════
   SCREEN 2: CONNECT
   ═══════════════════════════════════════════════════ */
.connect-layout {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding: 0;
  max-width: 100%;
}

/* Header */
.connect-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  background: rgba(10, 14, 23, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.connect-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-width: 0;
}

.connect-logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.connect-own-id {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.own-id-label {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  line-height: 1;
  margin-bottom: 3px;
}

.own-id-value {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent);
  letter-spacing: 0.05em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connect-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.connection-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.connection-text {
  display: none;
}

@media (min-width: 480px) {
  .connection-text {
    display: inline;
  }
}

/* Dial section */
.dial-section {
  padding: var(--space-xl) var(--space-lg) var(--space-lg);
}

.dial-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.dial-input-row {
  display: flex;
  gap: var(--space-sm);
}

.dial-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 var(--space-md);
  transition: border-color var(--transition-fast);
  min-width: 0;
}

.dial-input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.dial-input-prefix {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.08em;
  flex-shrink: 0;
  user-select: none;
}

.dial-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.1em;
  padding: 14px 0 14px var(--space-xs);
  min-width: 0;
  text-transform: uppercase;
}

.dial-input::placeholder {
  color: var(--text-muted);
  letter-spacing: 0.15em;
}

.dial-input-wrapper--small {
  padding: 0 var(--space-sm);
}

.dial-input-wrapper--small .dial-input {
  padding: 10px 0 10px var(--space-xs);
  font-size: 0.75rem;
}

.dial-input-wrapper--small .dial-input-prefix {
  font-size: 0.75rem;
}

/* Call button */
.btn-call {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--accent);
  color: var(--bg-deepest);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 var(--space-xl);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-call:hover:not(:disabled) {
  background: #00eabb;
  box-shadow: 0 0 20px var(--accent-glow-strong);
}

.btn-call:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-call .btn-icon {
  width: 18px;
  height: 18px;
}

/* Contacts section */
.contacts-section {
  flex: 1;
  padding: 0 var(--space-lg) var(--space-lg);
}

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

.contacts-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* Add contact form */
.add-contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.form-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px var(--space-md);
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.add-contact-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
}

/* Contact list */
.contact-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.contact-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.contact-item:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
}

.contact-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.contact-info {
  flex: 1;
  min-width: 0;
}

.contact-name {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.contact-id {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-status {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.contact-status-text {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-status--online .contact-status-text {
  color: var(--accent);
}

.contact-status--offline .contact-status-text {
  color: var(--text-muted);
}

.contact-actions {
  display: flex;
  gap: var(--space-xs);
  flex-shrink: 0;
}

/* Empty state */
.contacts-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-3xl) var(--space-lg);
  text-align: center;
  color: var(--text-muted);
}

.contacts-empty-icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-md);
  opacity: 0.3;
}

.contacts-empty p {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: var(--space-xs);
}

.contacts-empty-hint {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  opacity: 0.6;
}

/* ═══════════════════════════════════════════════════
   SCREEN 3: CALL
   ═══════════════════════════════════════════════════ */
.call-layout {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #000;
}

/* Remote video */
.call-remote-video-container {
  position: absolute;
  inset: 0;
}

.call-remote-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.call-connecting-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-deepest);
  gap: var(--space-lg);
}

.call-connecting-spinner {
  width: 48px;
  height: 48px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.call-connecting-text {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.call-connecting-sub {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.08em;
}

/* Local PiP video */
.call-local-pip {
  position: absolute;
  bottom: 100px;
  right: var(--space-lg);
  width: 140px;
  aspect-ratio: 3/4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 5;
}

.call-local-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.call-local-label {
  position: absolute;
  bottom: 6px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* Top bar */
.call-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--space-lg);
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent);
  z-index: 5;
}

.call-timer {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.1em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.call-info-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

/* Encryption badge */
.encryption-badge {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: rgba(0, 212, 170, 0.1);
  border: 1px solid rgba(0, 212, 170, 0.2);
  border-radius: 20px;
  padding: 6px 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.encryption-badge-icon {
  width: 14px;
  height: 14px;
  color: var(--accent);
  flex-shrink: 0;
}

.encryption-badge-text {
  display: flex;
  flex-direction: column;
}

.encryption-label {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 2px;
}

.encryption-algo {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.03em;
  line-height: 1;
  display: none;
}

@media (min-width: 480px) {
  .encryption-algo {
    display: block;
  }
}

/* SAS verification overlay */
.sas-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 16, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease;
}

.sas-card {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  max-width: 340px;
  width: 90%;
}

.sas-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.sas-instruction {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-lg);
}

.sas-code {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent);
  padding: var(--space-lg);
  background: var(--bg-input);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  text-shadow: 0 0 20px var(--accent-glow-strong);
}

.sas-label {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.sas-fingerprint {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-lg);
}

.sas-details {
  width: 100%;
  margin-bottom: var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.sas-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px var(--space-md);
  border-bottom: 1px solid var(--border);
}

.sas-detail-row:last-child {
  border-bottom: none;
}

.sas-detail-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.sas-detail-value {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-secondary);
  text-align: right;
}

.sas-detail-mono {
  font-size: 0.55rem;
  letter-spacing: 0.03em;
  color: var(--accent-dim);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sas-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
}

/* Call controls bar */
.call-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
  padding: var(--space-lg) var(--space-xl) calc(var(--space-xl) + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  z-index: 5;
}

.call-control-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  width: 56px;
  height: 56px;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: all var(--transition-fast);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0;
}

.call-control-btn .control-label {
  position: absolute;
  bottom: -20px;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}

.call-control-btn {
  position: relative;
}

.call-control-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.call-control-btn--hangup {
  background: var(--danger);
  border-color: var(--danger);
}

.call-control-btn--hangup:hover {
  background: #ff6b7a;
  border-color: #ff6b7a;
  box-shadow: 0 0 20px var(--danger-glow);
}

.call-control-btn--accept {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.call-control-btn--accept:hover {
  background: #4cd689;
  box-shadow: 0 0 20px var(--success-glow);
}

.control-icon {
  width: 22px;
  height: 22px;
}

.control-icon--off {
  display: none;
}

/* Muted state */
.call-control-btn.muted .control-icon--on {
  display: none;
}

.call-control-btn.muted .control-icon--off {
  display: block;
}

.call-control-btn.muted {
  background: rgba(255, 71, 87, 0.2);
  border-color: rgba(255, 71, 87, 0.3);
}

/* ═══════════════════════════════════════════════════
   INCOMING CALL OVERLAY
   ═══════════════════════════════════════════════════ */
.incoming-call-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 16, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fadeIn 0.3s ease;
}

.incoming-call-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.incoming-call-pulse {
  position: absolute;
  width: 200px;
  height: 200px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
  animation: incoming-pulse 2s ease-out infinite;
}

.incoming-call-pulse::before {
  content: '';
  position: absolute;
  inset: -20px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
  animation: incoming-pulse 2s ease-out 0.5s infinite;
}

.incoming-call-content {
  position: relative;
  text-align: center;
  z-index: 1;
}

.incoming-call-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: var(--space-lg);
  animation: blink-soft 2s ease-in-out infinite;
}

.incoming-call-id {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.incoming-call-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2xl);
}

.incoming-call-actions {
  display: flex;
  gap: var(--space-2xl);
  justify-content: center;
}

/* ═══════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-deepest);
  font-size: 0.85rem;
  padding: 14px var(--space-xl);
}

.btn-primary:hover {
  background: #00eabb;
  box-shadow: 0 0 24px var(--accent-glow-strong);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-glow {
  box-shadow: 0 0 30px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  padding: 8px var(--space-md);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.btn-small {
  font-size: 0.7rem;
  padding: 8px var(--space-md);
}

.btn-tiny {
  font-size: 0.6rem;
  padding: 6px 10px;
}

.btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-icon-only {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon-only:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.btn-icon-only svg {
  width: 16px;
  height: 16px;
}

/* ═══════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  animation: toastIn 0.3s ease both;
  max-width: 90vw;
  text-align: center;
}

.toast--success {
  border-color: var(--accent);
}

.toast--error {
  border-color: var(--danger);
}

.toast--exit {
  animation: toastOut 0.3s ease both;
}

/* ═══════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes incoming-pulse {
  0% {
    transform: scale(0.8);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

@keyframes blink-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

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

/* ═══════════════════════════════════════════════════
   SCREEN: CHAT
   ═══════════════════════════════════════════════════ */
.chat-layout {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: var(--bg-deepest);
}

/* Chat header */
.chat-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  background: rgba(10, 14, 23, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.chat-header-info {
  flex: 1;
  min-width: 0;
}

.chat-header-name {
  display: block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.chat-header-id {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-header-actions {
  flex-shrink: 0;
}

.encryption-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(0, 212, 170, 0.1);
  border: 1px solid rgba(0, 212, 170, 0.2);
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.encryption-pill:hover {
  background: rgba(0, 212, 170, 0.2);
}

.encryption-pill-icon {
  width: 12px;
  height: 12px;
}

.sas-algo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
  letter-spacing: 0.03em;
}

/* Messages area */
.chat-messages-area {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.chat-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Date separator */
.chat-date-sep {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  padding: var(--space-md) 0 var(--space-sm);
}

/* Chat bubbles */
.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  animation: fadeIn 0.15s ease;
}

.chat-bubble--mine {
  align-self: flex-end;
  background: var(--accent);
  color: var(--bg-deepest);
  border-bottom-right-radius: 4px;
}

.chat-bubble--theirs {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.chat-bubble-body {
  font-family: var(--font-body);
  font-size: 0.85rem;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}

.chat-bubble-meta {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  margin-top: 4px;
  opacity: 0.6;
  text-align: right;
}

.chat-bubble--theirs .chat-bubble-meta {
  color: var(--text-muted);
}

/* Typing indicator */
.chat-typing {
  padding: var(--space-xs) var(--space-lg) var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
}

.typing-dots {
  display: flex;
  gap: 3px;
}

.typing-dots span {
  width: 5px;
  height: 5px;
  background: var(--accent-dim);
  border-radius: 50%;
  animation: typingBounce 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 typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Input bar */
.chat-input-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg) calc(var(--space-md) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: rgba(10, 14, 23, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 10px 16px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast);
}

.chat-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.chat-input::placeholder {
  color: var(--text-muted);
}

.btn-chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: var(--bg-deepest);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.btn-chat-send:hover {
  background: #00eabb;
  box-shadow: 0 0 16px var(--accent-glow-strong);
}

.btn-chat-send svg {
  width: 18px;
  height: 18px;
}

/* Unread badge */
.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--bg-deepest);
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 700;
  margin-left: var(--space-sm);
}

/* ═══════════════════════════════════════════════════
   SETTINGS PANEL
   ═══════════════════════════════════════════════════ */
.settings-panel {
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.settings-section {
  margin-bottom: var(--space-md);
}

.settings-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.settings-label-icon {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

.settings-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px var(--space-md);
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238892a4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.settings-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.settings-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.mic-level-bar {
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  margin-top: var(--space-sm);
  overflow: hidden;
}

.mic-level-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 100ms ease;
}

.settings-hint {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.settings-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
}

/* ═══════════════════════════════════════════════════
   VOICE CALL OVERLAY
   ═══════════════════════════════════════════════════ */
.voice-call-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-deepest);
  animation: fadeIn 0.3s ease;
}

.voice-call-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-md);
  padding: var(--space-2xl);
}

.voice-call-status {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  animation: blink-soft 2s ease-in-out infinite;
}

.voice-call-status.connected {
  animation: none;
  color: var(--accent);
}

.voice-call-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  margin: var(--space-md) 0;
}

.voice-call-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.voice-call-id-display {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.voice-call-timer {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.15em;
  margin: var(--space-md) 0;
}

.voice-call-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--space-lg);
}

.voice-call-detail-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--accent-dim);
  letter-spacing: 0.03em;
  padding: 5px 14px;
  background: rgba(0, 212, 170, 0.08);
  border: 1px solid rgba(0, 212, 170, 0.15);
  border-radius: 20px;
  justify-content: center;
}

.voice-call-detail-row .encryption-pill-icon {
  color: var(--accent-dim);
  flex-shrink: 0;
}

.voice-call-controls {
  display: flex;
  gap: var(--space-2xl);
  margin-top: var(--space-xl);
}

/* Call button in chat header */
.btn-icon-call {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

.btn-icon-call:hover {
  background: var(--accent) !important;
  color: var(--bg-deepest) !important;
}

/* ═══════════════════════════════════════════════════
   VIDEO CALL OVERLAY
   ═══════════════════════════════════════════════════ */
.video-call-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #000;
  animation: fadeIn 0.3s ease;
}

.vc-remote-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vc-local-pip {
  position: absolute;
  bottom: 100px;
  right: var(--space-lg);
  width: 120px;
  aspect-ratio: 3/4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 5;
}

.vc-local-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.vc-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent);
  z-index: 5;
}

.vc-timer {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.1em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.vc-peer-name {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.vc-info-bar {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 12px;
  border-radius: 12px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.vc-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
  padding: var(--space-lg) var(--space-xl) calc(var(--space-xl) + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  z-index: 5;
}

@media (min-width: 768px) {
  .vc-local-pip {
    width: 180px;
    bottom: 120px;
  }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */
@media (min-width: 768px) {
  .screen-inner {
    max-width: 520px;
  }

  .panel-contacts .screen-inner {
    max-width: 100%;
    padding: 0;
  }

  .id-card-value {
    font-size: 1.35rem;
  }

  .call-local-pip {
    width: 180px;
    bottom: 120px;
  }

  .call-controls {
    gap: var(--space-2xl);
  }

  .call-control-btn {
    width: 64px;
    height: 64px;
  }

  .control-icon {
    width: 26px;
    height: 26px;
  }
}

/* ═══════════════════════════════════════════════════
   UNKNOWN CONTACT ALERT
   ═══════════════════════════════════════════════════ */
.unknown-alert-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 16, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease;
}

.unknown-alert-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 200, 50, 0.3);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  max-width: 380px;
  width: 90%;
}

.unknown-alert-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-md);
  color: #f9ca24;
}

.unknown-alert-icon svg {
  width: 100%;
  height: 100%;
}

.unknown-alert-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.unknown-alert-id {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: var(--space-md);
}

.unknown-alert-text {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-lg);
}

.unknown-alert-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}

/* ─── Utility: hidden attribute override ─── */
[hidden] {
  display: none !important;
}
