/* ==========================================================================
   ZERODROP — HIGH-PRECISION WEBRTC P2P SUITE
   The Developer's Canvas: Dark Mode Obsidian, High-Contrast Typography, Frosted Depth
   Crafted to mirror Dev Zero (zero.skillissue.gg) & DeV-ZEr0 Design System
   ========================================================================== */

:root {
  --bg: #0A0A0A;
  --bg-card: #121212;
  --surface: #121212;
  --surface-raised: #181818;
  --surface-hover: #222222;
  
  --border: #262626;
  --border-light: #333333;
  --border-hover: #404040;
  --border-focus: #FFFFFF;
  
  --text: #F3F4F6;
  --text-muted: #9CA3AF;
  --text-dim: #6B7280;
  
  --accent: #FFFFFF;
  --accent-blue: #3B82F6;
  --cyan: #00F0FF;
  --emerald: #10B981;
  --amber: #F59E0B;
  --red: #EF4444;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', "SFMono-Regular", Consolas, monospace;
  
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-card: 0 16px 36px rgba(0, 0, 0, 0.5);
  --shadow-modal: 0 24px 60px rgba(0, 0, 0, 0.85);
}

/* ── GLOBAL RESET & IMMERSIVE SCROLLBAR ── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: none;
}

::-webkit-scrollbar {
  display: none !important;
}

::selection {
  background: #FFFFFF;
  color: #0A0A0A;
}

html {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── LAYOUT CONTAINER ── */
.app-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 20px 60px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── TOP HEADER & NAVIGATION ── */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
  flex-wrap: wrap;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-title {
  font-family: var(--font-mono);
  font-size: 14.5px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 5px;
}
.brand-name {
  color: var(--text);
  font-weight: 700;
}
.brand-slash {
  color: var(--text-dim);
}
.brand-sub {
  color: #FFFFFF;
  font-weight: 500;
  opacity: 0.85;
}

/* Segmented Mode Switcher (Send Files vs Receive Files) */
.role-segmented-switcher {
  display: flex;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 3px;
}
.role-switch-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 18px;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.role-switch-btn:hover {
  color: var(--text);
}
.role-switch-btn.active {
  background: #FFFFFF;
  color: #0A0A0A;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Utility Header Group */
.header-links-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}
.pill-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: all 0.3s;
}
.pill-indicator.connecting {
  background: var(--amber);
}
.pill-indicator.connected {
  background: var(--emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.latency-readout {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.latency-readout span {
  color: var(--text);
  font-weight: 500;
}

.hdr-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-sans);
  font-size: 12px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.hdr-btn:hover {
  color: var(--text);
  border-color: var(--border-light);
  background: var(--surface-raised);
}
.hdr-btn.wiki-link {
  color: var(--text);
}
.hdr-btn.wiki-link:hover {
  border-color: var(--text-muted);
}

/* ── VIEW PANELS & TRANSITIONS ── */
.view-panel {
  display: none;
  width: 100%;
  animation: panelIn 0.2s var(--ease);
}
.view-panel.active {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
@keyframes panelIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── CORE CARDS & PANELS ── */
.pro-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s;
}
.pro-card:hover {
  border-color: var(--border-light);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}
.card-headline {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-headline svg {
  color: var(--text-muted);
}
.card-subtext {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

/* ── SUB-TAB SWITCHER (FILES VS CLIPBOARD) ── */
.sub-tab-bar {
  display: flex;
  gap: 6px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
}
.sub-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.sub-tab-btn:hover {
  color: var(--text);
}
.sub-tab-btn.active {
  background: var(--surface);
  border: 1px solid var(--border-light);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.sub-tab-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
}

/* ── ROOM PAIRING STATION (UPLOADER & RECEIVER) ── */
.pair-station-box {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pair-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pair-caption {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.pair-note {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}
.pair-station-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.room-code-display {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
  outline: none;
  text-align: center;
}
.room-code-display:focus {
  border-color: var(--border-hover);
}

/* Passkey Drawer */
.passkey-drawer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}
.passkey-toggle-btn {
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  transition: color 0.15s;
}
.passkey-toggle-btn:hover {
  color: var(--text-muted);
}
.passkey-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.subtle-passkey {
  padding: 8px 12px;
  font-size: 11.5px;
  color: var(--text);
  background: var(--bg);
}
.passkey-btn {
  padding: 8px 14px;
  font-size: 11px;
}

/* ── INPUTS & BUTTONS ── */
.mono-input {
  flex: 1;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.15s;
}
.mono-input:focus {
  border-color: var(--border-hover);
}
.mono-input::placeholder {
  color: var(--text-dim);
}

.pro-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s var(--ease);
  white-space: nowrap;
}
.pro-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  color: #FFFFFF;
}
.pro-btn:active {
  transform: translateY(1px);
}
.pro-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary-main {
  width: 100%;
  padding: 11px 18px;
  font-size: 13px;
  font-weight: 600;
  background: #FFFFFF;
  border: 1px solid #FFFFFF;
  color: #0A0A0A;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s var(--ease);
}
.btn-primary-main:hover {
  background: #E5E5E5;
  border-color: #E5E5E5;
}
.btn-primary-main:disabled {
  background: var(--surface-raised);
  border-color: var(--border);
  color: var(--text-dim);
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── DROPZONE & FILE ACTIONS ── */
.pro-dropzone {
  border: 1.5px dashed var(--border-light);
  border-radius: var(--radius-md);
  padding: 38px 24px;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.015);
  transition: all 0.2s var(--ease);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.pro-dropzone:hover, .pro-dropzone.drag-over {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.035);
}
.drop-icon {
  width: 36px;
  height: 36px;
  color: var(--text-muted);
  transition: all 0.2s var(--ease);
}
.pro-dropzone:hover .drop-icon {
  color: #FFFFFF;
  transform: translateY(-2px);
}
.drop-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
}
.drop-meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
}
.drop-actions-row {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}
.file-input-hidden {
  display: none;
}

/* Staging File Queue */
.queue-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}
.queue-title {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.03em;
}
.text-link-btn {
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.15s;
}
.text-link-btn:hover {
  color: var(--text);
}
.empty-state-muted {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-align: center;
  padding: 24px 16px;
  background: var(--surface-raised);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.staging-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}
.staged-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  gap: 12px;
}
.staged-info {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}
.staged-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 380px;
}
.staged-size {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
  flex-shrink: 0;
}
.staged-del-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.staged-del-btn:hover {
  color: var(--red);
}

/* ── PROGRESS & TRANSFERS STREAM ── */
.transfers-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
}
.transfer-tile {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.transfer-tile.active {
  border-color: rgba(255, 255, 255, 0.25);
}
.transfer-tile.done {
  border-color: rgba(16, 185, 129, 0.35);
}
.tile-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.tile-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tile-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-transform: uppercase;
}
.meter-rail {
  width: 100%;
  height: 5px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  background: #FFFFFF;
  width: 0%;
  transition: width 0.15s linear;
}
.meter-fill.done {
  background: var(--emerald);
}
.tile-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}
.tile-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.checksum-badge {
  color: var(--emerald);
  font-family: var(--font-mono);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: auto;
}
.save-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  background: #FFFFFF;
  border: 1px solid #FFFFFF;
  color: #0A0A0A;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s var(--ease);
}
.save-btn:hover {
  background: #E5E5E5;
}

/* ── LIVE CLIPBOARD SUITE ── */
.clipboard-textarea-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.clip-textarea {
  width: 100%;
  min-height: 130px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
  outline: none;
  resize: vertical;
}
.clip-textarea:focus {
  border-color: var(--border-hover);
}
.clip-textarea::placeholder {
  color: var(--text-dim);
}
.clip-ctrl-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.char-info {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}
.auto-sync-toggle {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.btn-send-clip {
  background: #FFFFFF;
  border: 1px solid #FFFFFF;
  color: #0A0A0A;
  font-weight: 600;
}
.btn-send-clip:hover {
  background: #E5E5E5;
}

.clip-feed-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
}
.clip-card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.clip-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
}
.clip-lang {
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
}
.clip-time {
  color: var(--text-dim);
}
.clip-body {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 120px;
  overflow-y: auto;
}
.copy-pill-btn {
  align-self: flex-end;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.copy-pill-btn:hover {
  color: var(--text);
  border-color: var(--border-light);
}
.copy-pill-btn.done {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--emerald);
  color: var(--emerald);
}

/* ── RECEIVER HERO STATION ── */
.receiver-hero-card {
  text-align: center;
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.receiver-hero-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.receiver-hero-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 440px;
  line-height: 1.5;
}
.receiver-connect-form {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}
.receiver-input-large {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #FFFFFF;
  text-align: center;
  text-transform: uppercase;
  outline: none;
  transition: border-color 0.15s;
}
.receiver-input-large:focus {
  border-color: var(--border-hover);
}
.receiver-input-large::placeholder {
  color: var(--text-dim);
  font-weight: 400;
  font-size: 15px;
  letter-spacing: normal;
}

/* ── MINIMALIST TECHNICAL DIAGNOSTICS BAR ── */
.diagnostics-strip {
  background: transparent;
  border-top: 1px solid var(--border);
  padding: 16px 0 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
}
.diag-items-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.diag-quiet-label {
  color: var(--text-dim);
}
.diag-quiet-sep {
  color: var(--border);
}
.diag-log-toggle {
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.15s;
}
.diag-log-toggle:hover {
  color: var(--text);
}
.console-drawer {
  width: 100%;
  display: none;
  background: #060608;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  max-height: 120px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--text-muted);
}
.console-drawer.open {
  display: block;
}

/* ── MODALS (QR CODE & AIR-GAP) ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease);
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.modal-panel {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-modal);
}
.modal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.modal-close-x {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}
.modal-close-x:hover {
  color: var(--text);
}
.qr-mount {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #FFFFFF;
  border-radius: var(--radius-md);
  margin: 0 auto;
}
.qr-mount canvas {
  display: block;
}

/* ── TOAST NOTIFICATION ── */
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(70px);
  background: #FFFFFF;
  color: #0A0A0A;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
  z-index: 999999;
  opacity: 0;
  transition: all 0.25s var(--ease);
  pointer-events: none;
}
#toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── PRO DEVELOPER FOOTER & CREDENTIALS ── */
.pro-footer {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
}
.footer-row-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-author-box,
.footer-meta-line {
  display: none !important;
}
.footer-links-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-a:hover {
  color: var(--text);
}
.footer-bottom-copy {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10.5px;
  color: var(--text-dim);
  flex-wrap: wrap;
  gap: 8px;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE SYSTEM (DeV-ZEr0 Design System)
   ========================================================================== */

@media (max-width: 768px) {
  .app-container {
    padding: 16px 14px 60px 14px;
    gap: 16px;
  }

  /* Top Header Mobile Flex Layout */
  .top-header {
    padding-bottom: 14px;
    gap: 10px;
    align-items: center;
  }

  .brand-section {
    order: 1;
    gap: 6px;
  }

  .brand-name, .brand-sub {
    font-size: 15px;
  }

  .header-links-group {
    order: 2;
    margin-left: auto;
    gap: 6px;
    display: flex;
    align-items: center;
  }

  .header-links-group a.hdr-btn {
    display: none !important; /* Secondary links preserved in footer */
  }

  .connection-pill {
    padding: 4px 9px;
    font-size: 10.5px;
    white-space: nowrap;
  }

  .latency-readout {
    display: none !important; /* Hide RTT text to save space on mobile */
  }

  .hdr-btn {
    padding: 4px 8px;
    font-size: 11px;
    white-space: nowrap;
  }

  /* Segmented Mode Switcher (Full Width 50/50 Mobile Row) */
  .role-segmented-switcher {
    order: 3;
    width: 100%;
    display: flex;
    padding: 4px;
    background: var(--surface-raised);
    border-radius: var(--radius-sm);
  }

  .role-switch-btn {
    flex: 1 1 50%;
    justify-content: center;
    text-align: center;
    padding: 10px 0;
    font-size: 13px;
    min-height: 42px;
    border-radius: var(--radius-xs);
  }

  /* Room Code Pairing Station */
  .pair-station-box {
    padding: 14px 12px;
    gap: 10px;
  }

  .pair-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .pair-station-row {
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  .room-code-display {
    width: 100%;
    flex: 1 1 100%;
    font-size: 16px;
    padding: 12px;
    letter-spacing: 0.08em;
  }

  .pair-station-row .pro-btn {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
    padding: 11px 8px;
    font-size: 12px;
    min-height: 42px;
  }

  /* Passkey Drawer Mobile */
  .passkey-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .passkey-row input {
    width: 100%;
    flex: 1 1 100%;
    font-size: 12px;
    padding: 10px;
  }

  .passkey-row .passkey-btn {
    width: 100%;
    flex: 1 1 100%;
    justify-content: center;
    padding: 10px;
    min-height: 40px;
  }

  /* Sub-Navigation Tabs */
  .sub-tab-bar {
    width: 100%;
    padding: 4px;
    gap: 4px;
  }

  .sub-tab-btn {
    flex: 1 1 50%;
    justify-content: center;
    text-align: center;
    padding: 10px 6px;
    font-size: 12px;
    min-height: 42px;
  }

  /* Dropzone Mobile */
  .pro-dropzone {
    padding: 24px 14px;
    gap: 10px;
  }

  .drop-icon {
    width: 32px;
    height: 32px;
  }

  .drop-title {
    font-size: 13.5px;
  }

  .drop-meta {
    font-size: 11px;
    line-height: 1.4;
  }

  .drop-actions-row {
    width: 100%;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
  }

  .drop-actions-row .btn-primary-main,
  .drop-actions-row .pro-btn {
    width: 100%;
    justify-content: center;
    padding: 13px;
    font-size: 13.5px;
    min-height: 46px;
  }

  /* Staged Queue */
  .staged-item {
    padding: 10px 12px;
    gap: 8px;
  }

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

  .staged-name {
    max-width: 150px;
    font-size: 12px;
  }

  .btn-primary-main#sendStagedBtn {
    width: 100%;
    padding: 14px 16px;
    font-size: 14px;
    justify-content: center;
    min-height: 48px;
  }

  /* Receiver Hero Connect Card */
  .receiver-hero-card {
    padding: 24px 14px;
    gap: 12px;
  }

  .receiver-hero-title {
    font-size: 17px;
  }

  .receiver-hero-subtitle {
    font-size: 12px;
    line-height: 1.5;
  }

  .receiver-connect-form {
    width: 100%;
    gap: 10px;
    margin-top: 4px;
  }

  .receiver-input-large {
    font-size: 16px;
    padding: 12px;
    letter-spacing: 0.08em;
  }

  .receiver-connect-form .btn-primary-main {
    width: 100%;
    padding: 14px;
    font-size: 14px;
    justify-content: center;
    min-height: 48px;
  }

  /* Inbound Transfer Tiles */
  .transfer-tile {
    padding: 12px 10px;
    gap: 8px;
  }

  .tile-head {
    flex-wrap: wrap;
    gap: 6px;
  }

  .tile-name {
    flex: 1 1 100%;
    font-size: 12.5px;
  }

  .tile-meta {
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
  }

  .tile-footer {
    flex-wrap: wrap;
    gap: 8px;
  }

  .save-btn {
    width: 100%;
    justify-content: center;
    padding: 11px;
    min-height: 42px;
  }

  /* Live Clipboard Mobile */
  .clip-ctrl-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .btn-send-clip {
    width: 100%;
    justify-content: center;
    padding: 12px;
    min-height: 44px;
  }

  /* Telemetry Diagnostics Bar */
  .diagnostics-strip {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .diag-items-group {
    justify-content: space-between;
    font-size: 10px;
  }

  .diag-log-toggle {
    align-self: flex-end;
  }

  /* Modals Mobile Touch-Fit */
  .modal-overlay {
    padding: 12px;
  }

  .modal-panel {
    padding: 18px 14px;
    max-height: 88vh;
    overflow-y: auto;
  }

  .qr-mount {
    padding: 12px;
    max-width: 250px;
  }

  .qr-mount canvas {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Footer Mobile */
  .footer-row-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .footer-links-row {
    flex-wrap: wrap;
    gap: 12px;
    font-size: 11px;
  }

  .footer-bottom-copy {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    font-size: 10px;
  }
}

@media (max-width: 400px) {
  .app-container {
    padding: 12px 10px 50px 10px;
  }

  .role-switch-btn {
    font-size: 12px;
    padding: 8px 0;
  }

  .staged-name {
    max-width: 110px;
  }

  .room-code-display {
    font-size: 14.5px;
  }

  .pair-station-row .pro-btn {
    font-size: 11px;
    padding: 8px;
  }
}
