:root {
  --bg: #070510;
  --surface: rgba(15, 11, 30, 0.86);
  --surface-2: rgba(24, 18, 46, 0.82);
  --surface-hover: rgba(40, 28, 74, 0.85);
  --border: rgba(168, 85, 247, 0.25);
  --border-strong: rgba(74, 222, 128, 0.6);
  --text: #f3f0ff;
  --muted: #a79ec9;
  --accent: #4ade80;       /* Neon Light Green */
  --accent-2: #a855f7;     /* Electric Purple */
  --success: #22ff88;      /* Bright Cyber Green */
  --warn: #fde047;
  --danger: #fb7185;
  --radius: 16px;
  --shadow: 0 18px 45px rgba(4, 2, 14, 0.72), 0 0 24px rgba(168, 85, 247, 0.12);
}

[data-theme="light"] {
  --bg: #f4f1ff;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-2: rgba(243, 238, 255, 0.95);
  --surface-hover: rgba(233, 224, 255, 0.95);
  --border: rgba(126, 34, 206, 0.18);
  --border-strong: rgba(22, 163, 74, 0.55);
  --text: #160e2e;
  --muted: #5b4d82;
  --accent: #16a34a;
  --accent-2: #7e22ce;
  --success: #16a34a;
  --warn: #ca8a04;
  --danger: #dc2626;
  --shadow: 0 14px 36px rgba(88, 28, 135, 0.1);
}

[data-theme="light"] .modal {
  background: #ffffff;
}

[data-theme="light"] code {
  background: #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .activity-entry {
  background: #f8fafc;
}

[data-theme="light"] .chip-btn.accent {
  background: rgba(2, 132, 199, 0.12);
  color: #0369a1;
}

[data-theme="light"] .toast {
  background: #0f172a;
  color: #f8fafc;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 65% 45% at 15% 0%, rgba(74, 222, 128, 0.18), transparent 65%),
    radial-gradient(ellipse 60% 45% at 85% 5%, rgba(168, 85, 247, 0.24), transparent 65%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(126, 34, 206, 0.14), transparent 70%);
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 20px 56px;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}

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

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  color: #06120c;
  box-shadow: 0 0 22px rgba(74, 222, 128, 0.35), 0 0 18px rgba(168, 85, 247, 0.3);
  flex-shrink: 0;
}

.brand-icon svg {
  width: 22px;
  height: 22px;
}

.brand-text h1 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

.status-pill:has(.online) .status-dot {
  background: var(--success);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
}

.subtitle {
  font-size: 0.78rem;
  color: var(--muted);
}

.subtitle.online {
  color: #86efac;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.12s;
}

.chip-btn:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.chip-btn:active {
  transform: scale(0.98);
}

.chip-btn.accent {
  background: rgba(74, 222, 128, 0.14);
  border-color: rgba(74, 222, 128, 0.45);
  color: #86efac;
  box-shadow: 0 0 14px rgba(74, 222, 128, 0.15);
}

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

/* Self Identity Card */
.self-card {
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.self-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.device-avatar {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: rgba(56, 189, 248, 0.14);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.device-avatar svg {
  width: 22px;
  height: 22px;
}

.self-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.self-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.self-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.self-meta {
  font-size: 0.8rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
}

.shortcut-hint {
  font-size: 0.78rem;
  color: var(--muted);
}

kbd {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.74rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text);
}

/* Main 2-Column Grid */
.workspace-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
  align-items: start;
}

.side-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel {
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

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

.panel-header h2 {
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.panel-sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}

.badge {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  color: var(--accent);
  white-space: nowrap;
}

/* Peer Cards */
.peers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.peer-card {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 15px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: cardIn 0.22s ease-out;
  transition: transform 0.15s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

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

.peer-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.35);
}

.peer-card.drag-over {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.14);
  transform: scale(1.01);
}

.peer-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.peer-name {
  font-weight: 600;
  font-size: 0.96rem;
}

.peer-os {
  font-size: 0.78rem;
  color: var(--muted);
}

.peer-actions {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.9fr;
  gap: 6px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 18px 8px 10px;
}

.radar-pulse {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
}

.radar-pulse .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.8);
}

.radar-pulse .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(56, 189, 248, 0.45);
  animation: pulse 2.4s infinite ease-out;
}

.radar-pulse .ring:nth-child(2) {
  animation-delay: 1.2s;
}

@keyframes pulse {
  0% { transform: scale(0.3); opacity: 0.9; }
  100% { transform: scale(1.15); opacity: 0; }
}

.empty-state h3 {
  font-size: 1.08rem;
  margin-bottom: 6px;
}

.empty-desc {
  color: var(--muted);
  font-size: 0.88rem;
  max-width: 440px;
  margin: 0 auto 20px;
}

.inline-qr-box {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}

.qr-frame {
  background: #ffffff;
  padding: 8px;
  border-radius: 12px;
  display: inline-flex;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.qr-frame img {
  width: 150px;
  height: 150px;
  display: block;
}

#sendQrImg {
  width: 190px;
  height: 190px;
}

.inline-qr-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  max-width: 240px;
}

.step-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.qr-caption {
  font-size: 0.92rem;
  font-weight: 600;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  background: rgba(7, 11, 20, 0.75);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  word-break: break-all;
  color: #cbd5e1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s, transform 0.1s;
}

.btn:hover { opacity: 0.92; }
.btn:active { transform: scale(0.98); }

.btn.primary {
  background: linear-gradient(135deg, #4ade80, #a855f7);
  color: #070510;
  font-weight: 700;
  box-shadow: 0 0 18px rgba(74, 222, 128, 0.25);
}

.btn.secondary {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text);
}

.btn.danger {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
}

.btn.small {
  padding: 7px 10px;
  font-size: 0.78rem;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  font-size: 1.35rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
}

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

.icon-btn:hover {
  color: var(--text);
  background: rgba(148, 163, 184, 0.12);
}

.text-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
}

.text-btn:hover {
  text-decoration: underline;
}

/* Transfers */
.transfers-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.transfer-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.transfer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
}

.transfer-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transfer-pct {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.transfer-stage {
  font-size: 0.78rem;
  color: #bae6fd;
}

.transfer-stage.done { color: #86efac; }
.transfer-stage.error { color: #fca5a5; }

.progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(7, 11, 20, 0.75);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4ade80, #a855f7);
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.6);
  transition: width 0.09s linear;
}

.transfer-meta {
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.preview-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.preview-thumb {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
}

/* Live Activity */
.activity-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: livePulse 2s infinite;
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
  70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.activity-controls {
  display: flex;
  gap: 12px;
}

.activity-log {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
}

.activity-log[hidden] {
  display: none;
}

.activity-entry {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(7, 11, 20, 0.55);
  border-left: 3px solid var(--accent);
}

.activity-entry.success { border-left-color: var(--success); }
.activity-entry.warn { border-left-color: var(--warn); }
.activity-entry.error { border-left-color: var(--danger); }

.activity-time {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  flex-shrink: 0;
}

.activity-msg {
  color: var(--text);
  word-break: break-word;
}

.activity-entry.success .activity-msg { color: #bbf7d0; }
.activity-entry.warn .activity-msg { color: #fef08a; }
.activity-entry.error .activity-msg { color: #fecaca; }

/* Modals & Overlay */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.76);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 50;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: 100%;
  max-width: 430px;
  background: #100b21;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.modal-header h3 {
  font-size: 1rem;
}

.modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.qr-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.muted {
  color: var(--muted);
  font-size: 0.84rem;
}

.room-form {
  display: flex;
  gap: 8px;
}

input[type="text"],
textarea {
  width: 100%;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-family: inherit;
}

input[type="text"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.incoming-list {
  list-style: none;
  max-height: 190px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.incoming-list li {
  background: var(--surface-2);
  padding: 8px 11px;
  border-radius: 9px;
  font-size: 0.84rem;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

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

.received-text {
  background: var(--surface-2);
  padding: 12px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.88rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 240px;
  overflow-y: auto;
}

.drop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 11, 20, 0.86);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  z-index: 90;
  pointer-events: none;
}

.drop-overlay[hidden] {
  display: none;
}

.drop-overlay-box {
  border: 2px dashed var(--accent);
  border-radius: 24px;
  padding: 40px 52px;
  text-align: center;
  background: rgba(15, 23, 42, 0.85);
}

.drop-overlay-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  color: var(--accent);
}

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid var(--border-strong);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.84rem;
  z-index: 100;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

/* Responsive Breakpoints */
@media (max-width: 860px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
  .shortcut-hint {
    display: none;
  }
}

@media (max-width: 520px) {
  .app-shell {
    padding: 16px 12px 44px;
  }
  .inline-qr-details {
    align-items: center;
    text-align: center;
  }
  .room-form {
    flex-wrap: wrap;
  }
}

.recent-rooms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.recent-room-chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--accent);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.recent-room-chip:hover {
  border-color: var(--border-strong);
}

.turn-details {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.turn-details summary {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.turn-details[open] {
  gap: 8px;
}

.preview-modal {
  max-width: 580px;
}

.preview-container {
  display: grid;
  place-items: center;
  background: rgba(2, 6, 23, 0.35);
  border-radius: 12px;
  padding: 10px;
  max-height: 60vh;
  overflow: auto;
}

.preview-container img,
.preview-container video {
  max-width: 100%;
  max-height: 54vh;
  border-radius: 8px;
}

.preview-container audio {
  width: 100%;
}

/* Hero Send / Receive Buttons */
.hero-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hero-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: transform 0.14s, border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.hero-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(2, 6, 23, 0.28);
}

.hero-btn:active {
  transform: scale(0.98);
}

.hero-btn.send {
  border-color: rgba(168, 85, 247, 0.55);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.22), rgba(74, 222, 128, 0.14));
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.18);
}

.hero-btn.send:hover {
  border-color: #c084fc;
  box-shadow: 0 0 28px rgba(168, 85, 247, 0.35);
}

.hero-btn.receive {
  border-color: rgba(74, 222, 128, 0.55);
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.2), rgba(168, 85, 247, 0.12));
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.18);
}

.hero-btn.receive:hover {
  border-color: #4ade80;
  box-shadow: 0 0 28px rgba(74, 222, 128, 0.38);
}

.hero-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.hero-btn.send .hero-icon {
  background: linear-gradient(135deg, #a855f7, #7e22ce);
  color: #fff;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.5);
}

.hero-btn.receive .hero-icon {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  color: #052e16;
  box-shadow: 0 0 16px rgba(74, 222, 128, 0.5);
}

.hero-icon svg {
  width: 22px;
  height: 22px;
}

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

.hero-text strong {
  font-size: 1rem;
}

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

/* Wizard Views */
.wizard-view[hidden],
#homeActionView[hidden] {
  display: none;
}

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

.wizard-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.w-step {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.76rem;
  color: var(--muted);
}

.w-step span {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.2);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.72rem;
  flex-shrink: 0;
}

.w-step.done {
  border-color: rgba(34, 197, 94, 0.4);
  color: #86efac;
}

.w-step.done span {
  background: var(--success);
  color: #052e16;
}

.w-step.active {
  border-color: var(--border-strong);
  color: var(--text);
}

.w-step.active span {
  background: var(--accent);
  color: #082f49;
}

.wizard-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.wizard-file-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}

.waiting-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--muted);
  margin-top: 10px;
}

.wizard-peers-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.auto-send-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
}

.auto-send-toggle input {
  accent-color: var(--accent);
}

/* Category Filter Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 10px;
}

.cat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.14s, border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.cat-btn span {
  font-size: 1.5rem;
  line-height: 1;
}

.cat-btn strong {
  font-size: 0.78rem;
  font-weight: 600;
}

.cat-btn:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: var(--surface-hover);
  box-shadow: 0 0 18px rgba(74, 222, 128, 0.18);
}

.cat-btn.accent {
  border-color: rgba(168, 85, 247, 0.5);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.18), rgba(74, 222, 128, 0.12));
}

.smart-receive-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.smart-receive-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.qr-scanner-box {
  margin-top: 8px;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid var(--border-strong);
  background: #000;
}

.qr-scanner-box[hidden] {
  display: none;
}

.qr-scanner-box video {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  display: block;
}

.qr-scanner-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface);
}

.settings-tab {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.settings-tab.active {
  background: rgba(74, 222, 128, 0.16);
  border-color: var(--border-strong);
  color: var(--accent);
}

.settings-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-pane[hidden] {
  display: none;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.setting-row strong {
  font-size: 0.88rem;
}

.setting-row .muted {
  font-size: 0.76rem;
}

/* Receive Waves Animation */
.receive-hero {
  text-align: center;
  padding: 14px 8px 4px;
}

.receive-waves {
  position: relative;
  width: 112px;
  height: 112px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
}

.receive-waves .wave {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(34, 197, 94, 0.5);
  animation: receivePulse 2.4s infinite ease-out;
}

.receive-waves .wave:nth-child(2) { animation-delay: 0.8s; }
.receive-waves .wave:nth-child(3) { animation-delay: 1.6s; }

@keyframes receivePulse {
  0% { transform: scale(0.45); opacity: 0.95; }
  100% { transform: scale(1.25); opacity: 0; }
}

.wave-core {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e, #10b981);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 0 24px rgba(34, 197, 94, 0.55);
  position: relative;
  z-index: 2;
}

.wave-core svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 560px) {
  .hero-actions {
    grid-template-columns: 1fr;
  }
  .wizard-steps {
    grid-template-columns: 1fr;
  }
}

.processing-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 500;
}

.processing-banner[hidden] {
  display: none;
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(56, 189, 248, 0.25);
  border-top-color: var(--accent);
  animation: spin 0.75s linear infinite;
  flex-shrink: 0;
}

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

.tools-modal {
  max-width: 500px;
}

.tool-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  flex-wrap: wrap;
}

.tool-tab {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.tool-tab.active {
  background: rgba(56, 189, 248, 0.16);
  border-color: var(--border-strong);
  color: var(--accent);
}

.tool-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tool-pane[hidden] {
  display: none;
}

.tool-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tool-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--muted);
}

select {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 0.85rem;
}

.tool-result {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.82rem;
  word-break: break-all;
}

.master-sharing-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.1), rgba(168, 85, 247, 0.12));
  border: 1px solid rgba(74, 222, 128, 0.45);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.master-sharing-bar[hidden] {
  display: none;
}

.master-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.master-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.master-stat strong {
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

@media (max-width: 520px) {
  .master-sharing-bar {
    grid-template-columns: repeat(2, 1fr);
  }
}
