/**
 * BroDrop — Stealth Sovereign Minimalist Design System
 * 
 * Engineered for zero-knowledge data transport:
 * - Pure black canvas with deep #090909 card surfaces
 * - Signal Red (#FF3038) semantic accents & subtle red gradient highlights
 * - High-precision typography & tabular telemetry (WCAG AA compliant)
 * - Soft physical depth and thin luminous hairlines
 * - Fully responsive with zero horizontal overflow
 */

:root {
  /* Surfaces & Canvas — Pure Black & Minimalist Dark Surfaces */
  --bg-canvas: #000000;
  --bg-card: #090909;
  --bg-surface: #090909;
  --bg-surface-elevated: #101010;
  --bg-surface-glass: #090909;
  --bg-input: #050505;
  --bg-hover: #141414;
  --bg-active: #1c1c1c;

  /* Borders & Dividers — Subtle luminous hairlines */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-base: rgba(255, 255, 255, 0.10);
  --border-hover: rgba(255, 255, 255, 0.20);
  --border-focus: #FF3038;
  --border-glow: rgba(255, 48, 56, 0.25);

  /* Primary Accent & Red Gradient — Signal Red */
  --primary-accent: #FF3038;
  --accent-hover: #E51E2A;
  --red-gradient: linear-gradient(135deg, #FF4148 0%, #C8102E 100%);
  --red-glow: 0 4px 16px rgba(255, 48, 56, 0.25);
  --red-subtle: rgba(255, 48, 56, 0.12);
  --red-border: rgba(255, 48, 56, 0.25);

  /* Semantic Color Palette */
  --emerald-success: #10B981;
  --emerald-subtle: rgba(16, 185, 129, 0.12);
  --emerald-glow: rgba(16, 185, 129, 0.35);
  
  --amber-warning: #F59E0B;
  --amber-subtle: rgba(245, 158, 11, 0.12);

  --rose-danger: #EF4444;
  --rose-subtle: rgba(239, 68, 68, 0.12);

  /* Backward-compatibility aliases mapping old cyan/violet to new Signal Red theme */
  --cyan-primary: #FF3038;
  --cyan-hover: #E51E2A;
  --cyan-subtle: rgba(255, 48, 56, 0.12);
  --cyan-glow: rgba(255, 48, 56, 0.25);
  --cyan-focus: rgba(255, 48, 56, 0.35);

  --violet-accent: #FF3038;
  --violet-hover: #E51E2A;
  --violet-subtle: rgba(255, 48, 56, 0.12);
  --violet-glow: rgba(255, 48, 56, 0.25);

  /* Typography Colors (High Contrast WCAG AA compliant >= 4.5:1) */
  --text-primary: #F5F5F5;
  --text-secondary: #A1A1AA;
  --text-tertiary: #71717A;
  --text-muted: #71717A;
  --text-accent: #FF3038;
  --text-success: #10B981;
  --text-warning: #F59E0B;
  --text-danger: #EF4444;

  /* Typographic Hierarchy (Unified 7-step scale, strict >=12px floor) */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --text-xs: 12px;       /* Floor: badges, micro-labels, meta text */
  --text-sm: 13px;       /* Secondary: hints, counters, subtitles */
  --text-base: 14px;     /* Default: body copy, buttons, inputs */
  --text-md: 16px;       /* Prominent: large inputs, card titles */
  --text-lg: 18px;       /* Section headings */
  --text-xl: 22px;       /* Main titles, hero header */
  --text-2xl: 26px;      /* Display, percentages, large codes */

  /* Backward-compatibility aliases */
  --text-2xs: var(--text-xs);
  --text-display: var(--text-2xl);

  /* Radius Scale */
  --radius-xs: 4px;      /* micro tags, inner focus rings */
  --radius-sm: 8px;      /* buttons, text inputs */
  --radius-md: 12px;     /* containers, editor box */
  --radius-lg: 18px;     /* cards, modals */
  --radius-full: 9999px; /* pills, circles, round avatars */
  --radius-xl: var(--radius-lg);

  /* Shadows — Soft, subtle physical depth instead of neon washes */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.65);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.75);
  --shadow-elevated: 0 24px 50px rgba(0, 0, 0, 0.85);

  /* Transitions */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 140ms ease-out;
  --transition-base: 200ms ease-out;
}

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

html {
  background-color: var(--bg-canvas);
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

/* Browser Surface Details */
::selection {
  background: rgba(255, 48, 56, 0.35);
  color: #ffffff;
}

:focus-visible {
  outline: 2px solid var(--primary-accent);
  outline-offset: 2px;
}

/* Screen reader only utility (WCAG AA accessible) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Custom Minimal Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.24);
}

/* Ambient Red Celestial Orbit Arc Background */
.ambient-orbit-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orbit-svg {
  position: absolute;
  pointer-events: none;
  will-change: transform;
}

.orbit-svg-tl {
  top: -180px;
  left: -220px;
  width: 700px;
  height: 700px;
}

.orbit-svg-bl {
  bottom: -220px;
  left: -240px;
  width: 700px;
  height: 700px;
}

/* Particle Canvas Background — Hidden for clean, calm interface */
#particle-canvas {
  display: none;
}

/* App Wrapper Container */
.app-wrapper {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 20px 80px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==========================================================================
   APP HEADER
   ========================================================================== */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 8px 0 16px;
  border-bottom: 1px solid var(--border-base);
  position: relative;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255, 48, 56, 0.12);
  border: 1px solid rgba(255, 48, 56, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-accent);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.brand-icon:hover {
  background: rgba(255, 48, 56, 0.20);
  border-color: rgba(255, 48, 56, 0.45);
}

.brand-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-title {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-divider {
  color: rgba(255, 255, 255, 0.2);
  font-weight: 300;
  font-size: 15px;
}

.brand-tagline {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: 400;
}

/* ==========================================================================
   HERO HEADLINE & VALUE PROP
   ========================================================================== */
.hero-section {
  text-align: center;
  padding: 38px 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  background: #101010;
  border: 1px solid var(--border-base);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.hero-badge svg {
  color: var(--primary-accent);
}

.hero-title {
  font-size: clamp(2.3rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-title-accent {
  color: #FF3038;
  background: linear-gradient(135deg, #FF4148 0%, #C8102E 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: var(--text-base);
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.5;
  font-weight: 400;
}

/* Header Telemetry Pill */
.header-telemetry {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  background: #101010;
  border: 1px solid var(--border-base);
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background: var(--text-tertiary);
  transition: background-color var(--transition-fast);
}

.status-dot.connected {
  background: var(--emerald-success);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

.status-dot-pulse {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background: var(--primary-accent);
}

/* Ambient Backdrop Glow — Clean Black */
.hero-animation-backdrop,
.hero-cosmic-glow {
  display: none;
}

/* ==========================================================================
   NAVIGATION SEGMENTED CONTROL
   ========================================================================== */
.nav-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #090909;
  border: 1px solid var(--border-base);
  padding: 4px;
  border-radius: var(--radius-md);
  margin: 6px 0 10px;
  box-shadow: var(--shadow-sm);
}

.nav-tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.nav-tab-btn:hover {
  color: var(--text-primary);
  background: #141414;
}

.nav-tab-btn.active {
  color: #ffffff;
  background: #141414;
  border-color: var(--border-base);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.nav-tab-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
  color: inherit;
  transition: color var(--transition-fast);
}

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

/* Tab Content Visibility */
.tab-content {
  display: none;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 200ms ease-out;
}

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

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

/* ==========================================================================
   CARD SYSTEM & SURFACES
   ========================================================================== */
.card {
  background: #090909;
  border: 1px solid var(--border-base);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-md);
  position: relative;
  transition: border-color var(--transition-fast);
}

.card:hover {
  border-color: var(--border-hover);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
  gap: 12px;
}

.card-title {
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.card-desc {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-top: 3px;
  line-height: 1.45;
}

/* Connection Header Panel */
.connection-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

/* Sync & Status Badges */
.sync-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: #101010;
  border: 1px solid var(--border-base);
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.sync-status-badge.status-connected,
.sync-status-badge.status-synced {
  background: #101010;
  border-color: var(--border-base);
  color: var(--emerald-success);
}

.sync-status-badge.status-sending,
.sync-status-badge.status-syncing {
  background: #101010;
  border-color: var(--red-border);
  color: var(--primary-accent);
}

.sync-status-badge.status-receiving {
  background: #101010;
  border-color: var(--border-base);
  color: var(--text-primary);
}

.sync-status-badge.status-editing {
  background: #101010;
  border-color: rgba(245, 158, 11, 0.25);
  color: var(--amber-warning);
}

.sync-status-badge.status-error {
  background: #101010;
  border-color: rgba(239, 68, 68, 0.25);
  color: var(--rose-danger);
}

/* ==========================================================================
   BUTTONS & CONTROLS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  user-select: none;
  white-space: nowrap;
  box-sizing: border-box;
}

.btn:active {
  transform: translateY(1px);
}

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

.btn svg {
  width: 15px;
  height: 15px;
  stroke-width: 2;
  flex-shrink: 0;
}

/* Primary Button (Signal Red Gradient) */
.btn-primary {
  background: linear-gradient(135deg, #FF4148 0%, #C8102E 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 14px rgba(255, 48, 56, 0.25);
  font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #E51E2A 0%, #B00E26 100%);
  box-shadow: 0 6px 20px rgba(255, 48, 56, 0.35);
  color: #ffffff;
}

/* Secondary Button (Dark Surface) */
.btn-secondary {
  background: #101010;
  color: var(--text-primary);
  border: 1px solid var(--border-base);
  box-shadow: var(--shadow-sm);
  font-weight: 500;
}

.btn-secondary:hover:not(:disabled) {
  background: #161616;
  border-color: var(--border-hover);
  color: #ffffff;
}

/* Danger Button */
.btn-danger {
  background: #101010;
  color: var(--rose-danger);
  border: 1px solid rgba(239, 68, 68, 0.25);
  box-shadow: var(--shadow-sm);
  font-weight: 500;
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
}

/* White Pill Button for Join */
.btn-join-white {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #000000;
  font-weight: 600;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  border: none;
  border-radius: var(--radius-full);
  height: 34px;
  padding: 0 18px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-join-white:hover {
  background: #e4e4e7;
  transform: translateY(-1px);
}

/* Small Button Modifier */
.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: var(--text-xs);
  border-radius: 6px;
}

.btn-sm svg {
  width: 14px;
  height: 14px;
}

/* Ghost / Icon Button */
.btn-ghost,
.btn-remove-file,
.modal-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-tertiary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-sizing: border-box;
  padding: 4px;
}

.btn-ghost:hover,
.btn-remove-file:hover,
.modal-close-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-remove-file:hover {
  color: var(--rose-danger);
  border-color: rgba(239, 68, 68, 0.3);
}

/* Micro Tool Button */
.btn-tool {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 500;
  height: 28px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-tool:hover {
  color: var(--text-primary);
}

.btn-tool:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-tool.is-refreshing {
  color: var(--primary-accent);
  pointer-events: none;
}

.btn-tool.is-refreshing .refresh-icon {
  animation: spin-refresh 0.75s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes spin-refresh {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn-tool.is-refreshing .refresh-icon {
    animation: none;
    opacity: 0.6;
  }
}

/* Copied Feedback Class */
.btn-copied-success {
  background: var(--emerald-subtle) !important;
  color: var(--emerald-success) !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
}

/* ==========================================================================
   CLIPBOARD TOP GRID (SHARED CLIPBOARD & SCAN TO CONNECT)
   ========================================================================== */
.clipboard-top-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 16px;
  align-items: stretch;
}

@media (max-width: 768px) {
  .clipboard-top-grid {
    grid-template-columns: 1fr;
  }
}

.clipboard-card {
  background: #090909;
  border: 1px solid var(--border-base);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition-fast);
}

.clipboard-card:hover {
  border-color: var(--border-hover);
}

.clipboard-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.card-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.red-icon-badge {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(255, 48, 56, 0.12);
  border: 1px solid rgba(255, 48, 56, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-accent);
  flex-shrink: 0;
}

.code-section {
  display: flex;
  flex-direction: column;
}

.code-section-label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 6px;
}

.clipboard-code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #050505;
  border: 1px solid var(--border-base);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  width: 100%;
  transition: border-color var(--transition-fast);
}

.clipboard-code-box:hover {
  border-color: var(--border-hover);
}

.clipboard-code-digits {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  user-select: all;
}

.clipboard-share-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

#share-pin-link-btn {
  flex: 1.2;
  height: 42px;
  border-radius: 10px;
}

#create-new-clipboard-btn {
  flex: 0.8;
  height: 42px;
  border-radius: 10px;
}

.partner-join-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.partner-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #050505;
  border: 1px solid var(--border-base);
  border-radius: 10px;
  padding: 4px 6px 4px 14px;
  transition: border-color var(--transition-fast);
}

.partner-input-wrap:focus-within {
  border-color: var(--border-hover);
}

.partner-input-prefix {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
}

.partner-join-input {
  background: transparent !important;
  border: none !important;
  color: var(--text-primary) !important;
  font-family: var(--font-mono);
  font-size: var(--text-sm) !important;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 6px 0 !important;
  width: 100%;
  outline: none !important;
  box-shadow: none !important;
}

.partner-join-input::placeholder {
  color: var(--text-tertiary);
  letter-spacing: normal;
  font-family: var(--font-sans);
}

/* QR Code Card */
.qr-card {
  background: #090909;
  border: 1px solid var(--border-base);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  gap: 14px;
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition-fast);
}

.qr-card:hover {
  border-color: var(--border-hover);
}

.qr-header-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.qr-reticle-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.qr-reticle-ambient-glow {
  position: absolute;
  width: 175px;
  height: 175px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 48, 56, 0.35) 0%, rgba(255, 48, 56, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

.qr-reticle-frame {
  position: relative;
  z-index: 1;
  padding: 14px;
  display: inline-block;
}

.qr-bracket {
  position: absolute;
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.bracket-tl {
  top: 0;
  left: 0;
  border-top: 2.5px solid rgba(255, 255, 255, 0.95);
  border-left: 2.5px solid rgba(255, 255, 255, 0.95);
  border-top-left-radius: 6px;
}

.bracket-tr {
  top: 0;
  right: 0;
  border-top: 2.5px solid rgba(255, 255, 255, 0.95);
  border-right: 2.5px solid rgba(255, 255, 255, 0.95);
  border-top-right-radius: 6px;
}

.bracket-bl {
  bottom: 0;
  left: 0;
  border-bottom: 2.5px solid rgba(255, 255, 255, 0.95);
  border-left: 2.5px solid rgba(255, 255, 255, 0.95);
  border-bottom-left-radius: 6px;
}

.bracket-br {
  bottom: 0;
  right: 0;
  border-bottom: 2.5px solid rgba(255, 255, 255, 0.95);
  border-right: 2.5px solid rgba(255, 255, 255, 0.95);
  border-bottom-right-radius: 6px;
}

.qr-canvas-wrapper svg {
  display: block;
  width: 125px;
  height: 125px;
  border-radius: 10px;
}

.qr-subtext {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin: 0;
}

/* ==========================================================================
   LIVE TEXT EDITOR STUDIO (NOTES CARD)
   ========================================================================== */
.editor-card {
  background: #090909;
  border: 1px solid var(--border-base);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition-fast);
}

.editor-card:hover {
  border-color: var(--border-hover);
}

.editor-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}

.editor-container {
  display: flex;
  flex-direction: column;
  background: #050505;
  border: 1px solid var(--border-base);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.editor-container:focus-within {
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.text-sync-editor {
  width: 100%;
  min-height: 190px;
  padding: 16px 18px;
  background: transparent;
  border: none;
  outline: none;
  resize: vertical;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.65;
  tab-size: 2;
  caret-color: var(--primary-accent);
}

.text-sync-editor::placeholder {
  color: var(--text-tertiary);
}

.editor-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: #050505;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.text-counter {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.editor-quick-tools {
  display: flex;
  gap: 6px;
}

.editor-primary-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.klipit-actions-bar .btn {
  height: 40px;
  padding: 0 18px;
  border-radius: 10px;
}

#send-text-btn {
  min-width: 100px;
}

/* ==========================================================================
   FILE DROP ZONE & STAGING QUEUE
   ========================================================================== */
.file-share-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.file-share-card {
  display: flex;
  flex-direction: column;
}

.size-limit-badge {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  background: var(--cyan-subtle);
  border: 1px solid rgba(255, 48, 56, 0.25);
  color: var(--cyan-primary);
}

.file-drop-zone-large {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 38px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.file-drop-zone-large:hover,
.file-drop-zone-large.drag-over {
  border-color: var(--cyan-primary);
  background: rgba(255, 48, 56, 0.04);
  transform: translateY(-1px);
}

.drop-icon-large {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-base);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan-primary);
  margin-bottom: 4px;
  transition: all var(--transition-fast);
}

.file-drop-zone-large:hover .drop-icon-large {
  transform: scale(1.08);
  border-color: var(--cyan-primary);
}

.drop-text-primary {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.drop-text-secondary {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  max-width: 280px;
}

/* File Queue Listing */
.queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.queue-total-badge {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--cyan-primary);
  font-weight: 600;
}

.file-queue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.file-queue-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast);
}

.file-queue-item:hover {
  border-color: var(--border-base);
}

/* File Type Badges */
.file-badge {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 3px 6px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.badge-img { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.badge-media { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.badge-zip { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-pdf { background: rgba(244, 63, 94, 0.15); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.3); }
.badge-code { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-doc { background: rgba(148, 163, 184, 0.15); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.3); }


.file-queue-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.file-queue-icon {
  font-size: var(--text-lg);
  flex-shrink: 0;
}

.file-queue-text {
  min-width: 0;
}

.file-queue-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.file-queue-size {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.queue-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* ==========================================================================
   ACTIVE KEY CARD & RECEIVER BOX
   ========================================================================== */
.key-display-card {
  background: var(--bg-input);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.key-card-label {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: normal;
  color: var(--text-secondary);
}

.key-digits-large {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--cyan-primary);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.key-digits-large:hover {
  color: #7dd3fc;
}

.key-status-text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.key-actions-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.receive-box-content {
  display: flex;
  flex-direction: column;
}

.key-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.key-input-label {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: normal;
  color: var(--text-secondary);
}

.receive-feature-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.receive-feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-xs);
  background: var(--bg-hover);
  color: var(--cyan-primary);
  font-size: var(--text-xs);
  flex-shrink: 0;
}

/* ==========================================================================
   TRANSFER TELEMETRY & PROGRESS CARD
   ========================================================================== */
.transfer-progress-card {
  background: var(--bg-surface);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

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

.transfer-file-icon {
  min-width: 44px;
  height: 44px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-base);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan-primary);
  flex-shrink: 0;
}

.transfer-file-icon .file-badge {
  font-size: var(--text-xs);
  padding: 4px 8px;
}

.transfer-filename {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 380px;
}

.transfer-percent {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--cyan-primary);
  font-variant-numeric: tabular-nums;
}

.progress-track {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0284c7 0%, #38bdf8 100%);
  border-radius: var(--radius-full);
  transition: width 150ms linear;
}

.transfer-metrics-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.p2p-badge {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--emerald-subtle);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--emerald-success);
}

/* Transfer Complete Card */
.transfer-complete-card {
  text-align: center;
  padding: 36px 24px;
}

.complete-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--emerald-subtle);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--emerald-success);
  font-size: var(--text-xl);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

/* ==========================================================================
   CRYPTOGRAPHIC RADAR SCOPE (FORMER WORMHOLE STAGE)
   ========================================================================== */
.wormhole-stage-card {
  background: var(--bg-surface);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
}

.wormhole-stage-header {
  text-align: center;
  margin-bottom: 24px;
}

.wormhole-badge-row {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 12px;
}

.wormhole-badge {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--cyan-primary);
  background: var(--cyan-subtle);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.wormhole-meta-pill {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.wormhole-stage-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.wormhole-stage-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: 4px;
}

.wormhole-portal-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 16px 0 24px;
}

.wormhole-canvas-wrap {
  position: relative;
  width: 340px;
  height: 340px;
  padding: 10px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-base);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.wormhole-canvas-wrap canvas {
  position: relative;
  z-index: 2;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   ENCRYPTED CIPHER STREAM (UIVERSE MATRIX DIGITAL RAIN ADAPTATION)
   Whoisyourdeadie Uiverse Pattern adapted for NullDrop Zero-Knowledge WebCrypto
   ========================================================================== */

.matrix-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
  opacity: 0.38;
  contain: strict;
  border-radius: inherit;
}

.matrix-pattern {
  position: relative;
  width: 100%;
  height: 100%;
}

.matrix-column {
  position: absolute;
  top: -100%;
  width: 20px;
  height: 100%;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 15px;
  font-weight: 700;
  animation: matrix-fall linear infinite;
  white-space: nowrap;
}

.matrix-column::before {
  content: "アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲンABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
  position: absolute;
  top: 0;
  left: 0;
  background: linear-gradient(
    to bottom,
    #ffffff 0%,
    #ffffff 4%,
    #00d2ff 14%,
    #10b981 38%,
    rgba(16, 185, 129, 0.55) 68%,
    transparent 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  writing-mode: vertical-lr;
  letter-spacing: 1.5px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.matrix-column:nth-child(1)  { left: 10px;  animation-delay: -2.5s; animation-duration: 3s; }
.matrix-column:nth-child(2)  { left: 32px;  animation-delay: -3.2s; animation-duration: 4s; }
.matrix-column:nth-child(3)  { left: 54px;  animation-delay: -1.8s; animation-duration: 2.5s; }
.matrix-column:nth-child(4)  { left: 76px;  animation-delay: -2.9s; animation-duration: 3.5s; }
.matrix-column:nth-child(5)  { left: 98px;  animation-delay: -1.5s; animation-duration: 3s; }
.matrix-column:nth-child(6)  { left: 120px; animation-delay: -3.8s; animation-duration: 4.5s; }
.matrix-column:nth-child(7)  { left: 142px; animation-delay: -2.1s; animation-duration: 2.8s; }
.matrix-column:nth-child(8)  { left: 164px; animation-delay: -2.7s; animation-duration: 3.2s; }
.matrix-column:nth-child(9)  { left: 186px; animation-delay: -3.4s; animation-duration: 3.8s; }
.matrix-column:nth-child(10) { left: 208px; animation-delay: -1.9s; animation-duration: 2.7s; }
.matrix-column:nth-child(11) { left: 230px; animation-delay: -3.6s; animation-duration: 4.2s; }
.matrix-column:nth-child(12) { left: 252px; animation-delay: -2.3s; animation-duration: 3.1s; }
.matrix-column:nth-child(13) { left: 274px; animation-delay: -3.1s; animation-duration: 3.6s; }
.matrix-column:nth-child(14) { left: 296px; animation-delay: -2.6s; animation-duration: 2.9s; }
.matrix-column:nth-child(15) { left: 318px; animation-delay: -3.7s; animation-duration: 4.1s; }

.matrix-column:nth-child(odd)::before {
  content: "アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲン123456789";
}

.matrix-column:nth-child(even)::before {
  content: "ガギグゲゴザジズゼゾダヂヅデドバビブベボパピプペポヴァィゥェォャュョッABCDEFGHIJKLMNOPQRSTUVWXYZ";
}

.matrix-column:nth-child(3n)::before {
  content: "アカサタナハマヤラワイキシチニヒミリウクスツヌフムユルエケセテネヘメレオコソトノホモヨロヲン0987654321";
}

.matrix-column:nth-child(4n)::before {
  content: "ンヲロヨモホノトソコオレメヘネテセケエルユムフヌツスクウリミヒニチシキイワラヤマハナタサカア";
}

.matrix-column:nth-child(5n)::before {
  content: "ガザダバパギジヂビピグズヅブプゲゼデベペゴゾドボポヴァィゥェォャュョッ!@#$%^&*()_+-=[]{}|;:,.<>?";
}

@keyframes matrix-fall {
  0% {
    transform: translateY(-10%);
    opacity: 1;
  }
  100% {
    transform: translateY(200%);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .matrix-column {
    animation: none;
    transform: translateY(0);
    opacity: 0.12;
  }
}

.wormhole-core-glow {
  display: none;
}

.wormhole-sucking-file {
  position: absolute;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 5;
}

.wormhole-sucking-file.active-enter,
.wormhole-sucking-file.emitting {
  display: flex;
}

.wormhole-file-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.wormhole-file-icon .file-badge {
  font-size: var(--text-sm);
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.wormhole-file-name {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--cyan-primary);
  background: rgba(0, 0, 0, 0.8);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.wormhole-hud-card {
  background: var(--bg-input);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}

.wormhole-hud-label {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: normal;
  color: var(--text-secondary);
}

.wormhole-key-digits {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--cyan-primary);
  margin: 6px 0;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.wormhole-key-digits:hover {
  color: #7dd3fc;
}

.wormhole-status-line {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.wormhole-actions-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==========================================================================
   ALERTS, TOASTS & MODALS
   ========================================================================== */
.alert-box {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  border: 1px solid transparent;
}

.alert-box.info {
  background: var(--cyan-subtle);
  border-color: rgba(56, 189, 248, 0.25);
  color: var(--text-accent);
}

.alert-box.success {
  background: var(--emerald-subtle);
  border-color: rgba(16, 185, 129, 0.25);
  color: var(--text-success);
}

.alert-box.error {
  background: var(--rose-subtle);
  border-color: rgba(244, 63, 94, 0.25);
  color: var(--text-danger);
}

/* Toast System */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transition: all var(--transition-base);
  max-width: 360px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-info { border-color: rgba(56, 189, 248, 0.35); }
.toast-success { border-color: rgba(16, 185, 129, 0.35); }
.toast-warning { border-color: rgba(245, 158, 11, 0.35); }
.toast-error { border-color: rgba(244, 63, 94, 0.35); }

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

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-elevated);
  animation: modalEnter 180ms ease-out;
}

@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

.modal-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.modal-body {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.qr-dropdown {
  background: var(--bg-input);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  margin-top: 14px;
}

.qr-canvas-wrapper {
  display: flex;
  justify-content: center;
  margin: 10px 0;
}

.qr-canvas-wrapper svg {
  border-radius: var(--radius-sm);
  padding: 8px;
  background: #ffffff;
}

.qr-subtext {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE & TABLET VIEWPORT)
   ========================================================================== */
@media (max-width: 768px) {
  .app-wrapper {
    padding: 24px 16px 64px;
  }

  .pin-pairing-grid,
  .file-share-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .header-telemetry {
    align-self: flex-start;
  }

  .wormhole-canvas-wrap {
    width: 280px;
    height: 280px;
  }

  .key-digits-large,
  .pin-display-number {
    font-size: var(--text-2xl);
  }
}

/* ==========================================================================
   ROOM PRESENCE & MULTI-DEVICE MANAGEMENT
   ========================================================================== */
.room-presence-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  margin-top: 2px;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.room-presence-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.room-presence-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--emerald-success);
}

.room-code-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.room-code-badge:hover {
  border-color: var(--cyan-primary);
  background: var(--cyan-subtle);
}

.room-code-badge .code-digits {
  color: var(--cyan-primary);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.room-devices-list {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.device-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px 10px;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.device-chip.is-self {
  border-color: rgba(56, 189, 248, 0.3);
  color: var(--text-primary);
  background: rgba(56, 189, 248, 0.04);
}

.device-chip .device-dot {
  width: 5px;
  height: 5px;
  border-radius: var(--radius-full);
  background: var(--emerald-success);
}

.device-chip svg {
  color: var(--text-tertiary);
}

.device-chip.is-self svg {
  color: var(--cyan-primary);
}

/* ==========================================================================
   ROOM FILES FEED (1-TO-MANY SHARED FILES)
   ========================================================================== */
.room-files-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.room-files-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
  text-align: center;
  background: var(--bg-input);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-tertiary);
  gap: 8px;
}

.room-files-empty svg {
  color: var(--text-muted);
}

.room-files-empty-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
}

.room-files-empty-desc {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  max-width: 280px;
  line-height: 1.4;
}

.room-files-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.room-file-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  gap: 12px;
  transition: all var(--transition-fast);
}

.room-file-card:hover {
  border-color: var(--border-base);
  background: var(--bg-hover);
}

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

.room-file-details {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.room-file-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-file-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.room-file-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ==========================================================================
   MINIMALIST HORIZONTAL FEATURE ROW (3-ITEM STRIP)
   ========================================================================== */
.features-horizontal-section,
.how-it-works-section {
  width: 100%;
  margin-top: 48px;
  margin-bottom: 24px;
}

.features-horizontal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 18px 0;
  gap: 20px;
}

.feature-col {
  display: flex;
  align-items: center;
  gap: 14px;
}

.feature-icon {
  width: 36px;
  height: 36px;
  color: var(--primary-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feature-icon svg {
  width: 28px;
  height: 28px;
  color: var(--primary-accent);
}

.feature-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feature-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.feature-desc {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  line-height: 1.4;
  margin: 0;
}

@media (max-width: 768px) {
  .features-horizontal-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
}

/* ==========================================================================
   APP FOOTER (MINIMALIST 2-TIER REDESIGN)
   ========================================================================== */
.app-footer {
  margin-top: 56px;
  padding: 32px 0 48px;
  border-top: 1px solid var(--border-subtle);
  width: 100%;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
}

.footer-brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--primary-accent);
}

.footer-brand-row svg {
  width: 20px;
  height: 20px;
  color: var(--primary-accent);
  fill: var(--primary-accent);
}

.footer-brand-name {
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.footer-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-link {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-link:hover, .footer-link:focus-visible {
  color: var(--text-primary);
  text-decoration: underline;
}

.footer-sep {
  color: var(--text-tertiary);
  font-size: 10px;
}

.footer-legal {
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  margin: 0;
}

@media (max-width: 768px) {
  .footer-bottom-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }
}

/* ==========================================================================
   MODALS (ACCESSIBLE INFORMATION & FEEDBACK)
   ========================================================================== */
.info-modal-content {
  text-align: left;
  max-height: 70vh;
  overflow-y: auto;
  padding: 8px 12px;
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--text-secondary);
}

.info-modal-content h4 {
  color: var(--text-primary);
  font-size: var(--text-md);
  margin-bottom: 6px;
}

.info-modal-content p {
  margin-bottom: 12px;
}

button.footer-btn-link {
  background: transparent;
  border: none;
  padding: 0;
  font: inherit;
  font-size: var(--text-xs);
  cursor: pointer;
}

.feedback-form-group {
  margin-bottom: 14px;
  text-align: left;
}

.feedback-form-label {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.feedback-select {
  width: 100%;
  padding: 8px 12px;
  background: #101010;
  border: 1px solid var(--border-base);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--text-sm);
  outline: none;
  transition: border-color var(--transition-fast);
}

.feedback-select:focus {
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 2px rgba(255, 48, 56, 0.25);
}

.feedback-textarea {
  width: 100%;
  padding: 10px 12px;
  background: #101010;
  border: 1px solid var(--border-base);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition-fast);
}

.feedback-textarea:focus {
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 2px rgba(255, 48, 56, 0.25);
}

/* Specific Refinement for Editor Clear Button */
#editor-clear-btn {
  background: transparent;
  color: var(--rose-danger);
  border: 1px solid transparent;
  box-shadow: none;
}

#editor-clear-btn:hover {
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.25);
  color: #ff5c5c;
}

/* ==========================================================================
   PWA INSTALL BUTTON
   ========================================================================== */
.pwa-install-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 48, 56, 0.12);
  border: 1px solid rgba(255, 48, 56, 0.35);
  color: var(--primary-accent);
  font-weight: 600;
  transition: all 0.25s var(--ease-spring);
  padding: 4px 11px;
}

.pwa-install-btn:hover {
  background: rgba(255, 48, 56, 0.22);
  border-color: rgba(255, 48, 56, 0.55);
  box-shadow: 0 0 16px rgba(255, 48, 56, 0.25);
  transform: translateY(-2px);
}

/* ==========================================================================
   SCREEN-WIDE DRAG & DROP HOLOGRAM OVERLAY
   ========================================================================== */
.global-drag-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s ease;
  padding: 24px;
}

body.global-drag-active .global-drag-overlay {
  opacity: 1;
  visibility: visible;
}

.drag-hologram-card {
  position: relative;
  width: min(480px, 90vw);
  padding: 40px 28px;
  background: #090909;
  border: 2px dashed rgba(255, 48, 56, 0.65);
  border-radius: var(--radius-xl, 22px);
  text-align: center;
  box-shadow: 0 0 60px rgba(255, 48, 56, 0.2), 0 20px 50px rgba(0, 0, 0, 0.85);
  animation: hologram-border-pulse 2.2s ease-in-out infinite;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

@keyframes hologram-border-pulse {
  0%, 100% {
    border-color: rgba(255, 48, 56, 0.65);
    box-shadow: 0 0 40px rgba(255, 48, 56, 0.15), 0 20px 50px rgba(0, 0, 0, 0.85);
  }
  50% {
    border-color: rgba(255, 65, 72, 0.95);
    box-shadow: 0 0 70px rgba(255, 48, 56, 0.30), 0 20px 50px rgba(0, 0, 0, 0.85);
  }
}

.drag-hologram-pulse {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-full);
  background: rgba(255, 48, 56, 0.1);
  border: 1px solid rgba(255, 48, 56, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-accent);
  margin-bottom: 4px;
  box-shadow: 0 0 30px rgba(255, 48, 56, 0.25);
}

.drag-hologram-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.drag-hologram-sub {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  max-width: 340px;
  line-height: 1.5;
}


