: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;
}

[data-theme="light"] .subtitle.online,
[data-theme="light"] .w-step.done,
[data-theme="light"] .transfer-stage.done,
[data-theme="light"] .activity-entry.success .activity-msg {
  color: #15803d;
}

[data-theme="light"] .w-step.done span,
[data-theme="light"] .w-step.active span {
  color: #ffffff;
}

[data-theme="light"] .transfer-stage {
  color: #6d28d9;
}

[data-theme="light"] .transfer-stage.error,
[data-theme="light"] .activity-entry.error .activity-msg,
[data-theme="light"] .btn.danger,
[data-theme="light"] .remove-file-btn {
  color: #b91c1c;
}

[data-theme="light"] .activity-entry.warn .activity-msg {
  color: #a16207;
}

[data-theme="light"] .selected-file-item {
  background: #ffffff;
  color: #160e2e;
}

[data-theme="light"] .btn.primary {
  color: #ffffff;
  background: linear-gradient(135deg, #16a34a, #7e22ce);
}

[data-theme="light"] .drop-overlay {
  background: rgba(244, 241, 255, 0.88);
}

[data-theme="light"] .drop-overlay-box {
  background: #ffffff;
  color: #160e2e;
}

* {
  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;
  cursor: pointer;
  user-select: none;
}

.brand:hover .brand-icon {
  transform: scale(1.04);
}

.brand-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.22), rgba(168, 85, 247, 0.32));
  border: 1.5px solid rgba(74, 222, 128, 0.55);
  display: grid;
  place-items: center;
  box-shadow: 0 0 22px rgba(74, 222, 128, 0.3), 0 0 18px rgba(168, 85, 247, 0.3);
  transition: transform 0.15s;
  flex-shrink: 0;
}

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

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 11px;
  display: block;
}

.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;
}

.workspace-grid:not(:has(.side-column > .panel:not([hidden]))) {
  grid-template-columns: 1fr;
  max-width: 780px;
  margin: 0 auto;
}

.workspace-grid:not(:has(.side-column > .panel:not([hidden]))) .side-column {
  display: none;
}

.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;
}

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

.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: #facc15;
}

.transfer-dir-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.16);
  border: 1px solid rgba(250, 204, 21, 0.45);
  color: #fde047;
}

.transfer-item.completed .transfer-dir-pill {
  background: rgba(74, 222, 128, 0.16);
  border-color: rgba(74, 222, 128, 0.5);
  color: #4ade80;
}

[data-theme="light"] .transfer-dir-pill {
  color: #a16207;
  background: rgba(234, 179, 8, 0.14);
}

[data-theme="light"] .transfer-item.completed .transfer-dir-pill {
  color: #15803d;
  background: rgba(22, 163, 74, 0.12);
}

/* Paused State (Orange) */
.transfer-item.paused .transfer-dir-pill {
  background: rgba(251, 146, 60, 0.16);
  border-color: rgba(251, 146, 60, 0.5);
  color: #fdba74;
}
.transfer-item.paused .transfer-pct,
.transfer-item.paused .transfer-stage {
  color: #fdba74;
}
.transfer-item.paused .progress-fill {
  background: linear-gradient(90deg, #ea580c, #fb923c);
  box-shadow: 0 0 10px rgba(251, 146, 60, 0.45);
}

/* Cancelled / Declined / Error State (Red) */
.transfer-item.failed .transfer-dir-pill {
  background: rgba(251, 113, 133, 0.16);
  border-color: rgba(251, 113, 133, 0.55);
  color: #fda4af;
}
.transfer-item.failed .transfer-pct,
.transfer-item.failed .transfer-stage {
  color: #fda4af;
}
.transfer-item.failed .progress-fill {
  background: #ef4444;
  box-shadow: none;
}

[data-theme="light"] .transfer-item.paused .transfer-dir-pill,
[data-theme="light"] .transfer-item.paused .transfer-pct,
[data-theme="light"] .transfer-item.paused .transfer-stage {
  color: #c2410c;
}

[data-theme="light"] .transfer-item.failed .transfer-dir-pill,
[data-theme="light"] .transfer-item.failed .transfer-pct,
[data-theme="light"] .transfer-item.failed .transfer-stage {
  color: #b91c1c;
}

.transfer-item.completed .transfer-pct {
  color: #4ade80;
}

[data-theme="light"] .transfer-pct {
  color: #ca8a04;
}

[data-theme="light"] .transfer-item.completed .transfer-pct {
  color: #15803d;
}

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

.transfer-stage.done { color: #4ade80; }
.transfer-stage.error { color: #fca5a5; }

[data-theme="light"] .transfer-stage {
  color: #a16207;
}

.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, #eab308, #facc15);
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.55);
  transition: width 0.09s linear;
}

.transfer-item.completed .progress-fill {
  background: linear-gradient(90deg, #22c55e, #4ade80);
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.6);
}

.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;
  padding-right: 4px;
}

.activity-log::-webkit-scrollbar,
.selected-files-list::-webkit-scrollbar {
  width: 6px;
}

.activity-log::-webkit-scrollbar-thumb,
.selected-files-list::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.4);
  border-radius: 999px;
}

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

.activity-entry {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(7, 11, 20, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.08);
  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;
  }
  .side-column:has(#transfersPanel:not([hidden])) {
    order: -1;
  }
  .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-actions[hidden] {
  display: none;
}

.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;
}

.waiting-inline[hidden] {
  display: none;
}

.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-box.big-scanner {
  position: relative;
  min-height: 46vh;
  max-height: 55vh;
  display: grid;
  place-items: center;
  border-radius: 18px;
  box-shadow: 0 0 28px rgba(74, 222, 128, 0.25);
}

.qr-scanner-box.big-scanner video {
  width: 100%;
  height: 48vh;
  max-height: 55vh;
  object-fit: cover;
}

.scanner-reticle {
  position: absolute;
  width: 210px;
  height: 210px;
  border: 2.5px solid #4ade80;
  border-radius: 18px;
  box-shadow: 0 0 0 9999px rgba(7, 5, 16, 0.42), 0 0 24px rgba(74, 222, 128, 0.55);
  pointer-events: none;
}

.paste-page-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.send-link-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  margin-top: 4px;
}

/* Google AdSense Containers */
.ad-slot-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  text-align: center;
}

.ad-slot-card[hidden] {
  display: none;
}

.ad-banner-bottom {
  margin-top: 18px;
}

.ad-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}

.ad-inner {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Enhanced Mobile & Tablet Responsiveness */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100dvh;
}

.modal {
  max-height: 90dvh;
  overflow-y: auto;
}

@media (max-width: 640px) {
  .inline-qr-box {
    justify-content: center !important;
    text-align: center;
  }
  .inline-qr-details {
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 100% !important;
  }
  .site-footer {
    flex-direction: column;
    text-align: center;
  }
  .footer-links {
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .beam-node {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .peer-actions {
    display: flex;
    flex-wrap: wrap;
  }
  .peer-actions .btn {
    flex: 1 1 30%;
  }
  .cookie-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 420px) {
  .category-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .cat-btn {
    padding: 12px 4px;
  }
  .send-link-actions {
    gap: 8px;
  }
  .send-link-actions .btn {
    padding: 8px 6px;
    font-size: 0.75rem;
  }
  #sendQrImg {
    width: 165px;
    height: 165px;
  }
}

/* Mobile-First Touch & iOS/Android App Polish */
button, .btn, .chip-btn, .cat-btn, .hero-btn {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

@media (max-width: 640px) {
  input[type="text"],
  textarea,
  select {
    font-size: 16px; /* Prevents iOS Safari auto-zoom on focus */
  }
  .app-shell {
    padding: 14px 12px calc(48px + env(safe-area-inset-bottom));
  }
  .topbar {
    margin-bottom: 12px;
  }
  .self-card {
    padding: 12px 14px;
    margin-bottom: 14px;
  }
  .self-meta {
    display: none;
  }
  .panel {
    padding: 16px 14px;
  }
  .hero-btn {
    padding: 15px 16px;
    min-height: 68px;
  }
  .btn.small, .chip-btn {
    min-height: 38px;
  }
  .cookie-banner {
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 10px;
    right: 10px;
    padding: 12px 14px;
  }
}

.history-list {
  max-height: 46vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
}

.history-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.history-dir {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.history-dir.send {
  background: rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
}

.history-dir.receive {
  background: rgba(74, 222, 128, 0.2);
  color: #86efac;
}

[data-theme="light"] .history-dir.send {
  color: #6d28d9;
}

[data-theme="light"] .history-dir.receive {
  color: #15803d;
}

/* WhatsApp-Style Chat Room Modal */
.chat-modal {
  max-width: 520px;
  display: flex;
  flex-direction: column;
  height: 78dvh;
  max-height: 640px;
}

.chat-peer-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.small-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.small-avatar svg {
  width: 18px;
  height: 18px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-color: rgba(7, 5, 16, 0.62);
  background-image: radial-gradient(rgba(168, 85, 247, 0.1) 1px, transparent 1px);
  background-size: 18px 18px;
}

[data-theme="light"] .chat-messages {
  background-color: #efeae2;
  background-image: radial-gradient(rgba(15, 23, 42, 0.08) 1px, transparent 1px);
  background-size: 18px 18px;
}

.chat-bubble {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 0.86rem;
  display: flex;
  flex-direction: column;
  gap: 5px;
  word-break: break-word;
  animation: cardIn 0.16s ease-out;
}

.chat-bubble.me {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.24), rgba(168, 85, 247, 0.24));
  border: 1px solid rgba(74, 222, 128, 0.4);
  border-bottom-right-radius: 4px;
}

.chat-bubble.them {
  align-self: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

[data-theme="light"] .chat-bubble.me {
  background: #dcf8c6;
  border-color: #86efac;
  color: #111827;
}

[data-theme="light"] .chat-bubble.them {
  background: #ffffff;
  color: #111827;
}

.chat-bubble-meta {
  font-size: 0.68rem;
  color: var(--muted);
  align-self: flex-end;
}

.chat-file-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
}

[data-theme="light"] .chat-file-card {
  background: rgba(15, 23, 42, 0.06);
}

.chat-file-progress {
  height: 5px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.2);
  overflow: hidden;
  margin-top: 2px;
}

.chat-file-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #eab308, #facc15);
  transition: width 0.09s linear;
}

.chat-file-card.completed .chat-file-progress {
  background: rgba(74, 222, 128, 0.25);
}

.chat-file-card.completed .chat-file-progress-fill {
  background: linear-gradient(90deg, #22c55e, #4ade80);
  width: 100% !important;
}

.chat-file-status {
  font-size: 0.72rem;
  font-weight: 600;
  color: #fde047;
}

.chat-file-card.completed .chat-file-status {
  color: #4ade80;
}

[data-theme="light"] .chat-file-status {
  color: #a16207;
}

[data-theme="light"] .chat-file-card.completed .chat-file-status {
  color: #15803d;
}

.chat-composer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.chat-attach-btn {
  font-size: 1.15rem;
  padding: 6px;
  flex-shrink: 0;
}

.chat-send-btn {
  flex-shrink: 0;
  padding: 9px 14px;
}

.chat-modal {
  position: relative;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.chat-search-bar input {
  flex: 1;
  padding: 6px 10px;
  font-size: 0.84rem;
}

.chat-drop-overlay {
  position: absolute;
  inset: 58px 0 58px 0;
  background: rgba(168, 85, 247, 0.22);
  backdrop-filter: blur(4px);
  border: 2px dashed var(--accent);
  border-radius: 12px;
  margin: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  z-index: 5;
  pointer-events: none;
}

.chat-reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
  background: rgba(168, 85, 247, 0.12);
  border-top: 1px solid var(--border);
  border-left: 3px solid var(--accent);
}

.chat-reply-preview {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-size: 0.78rem;
}

.chat-reply-preview span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-emoji-picker {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.emoji-opt {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 1.2rem;
  padding: 5px;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.12s ease;
}

.emoji-opt:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: scale(1.12);
}

.chat-bubble {
  position: relative;
}

.chat-quote-box {
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-left: 3px solid var(--accent);
  font-size: 0.75rem;
  margin-bottom: 3px;
}

[data-theme="light"] .chat-quote-box {
  background: rgba(15, 23, 42, 0.07);
}

.chat-quote-box strong {
  display: block;
  font-size: 0.72rem;
  color: var(--accent);
}

.chat-bubble-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.14s ease;
  margin-top: 2px;
}

.chat-bubble:hover .chat-bubble-actions,
.chat-bubble:focus-within .chat-bubble-actions {
  opacity: 1;
}

.chat-act-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.7rem;
  padding: 2px 5px;
  cursor: pointer;
}

.chat-act-btn:hover {
  background: rgba(168, 85, 247, 0.25);
}

.chat-reactions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.chat-reaction-pill {
  font-size: 0.74rem;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  cursor: pointer;
}

.chat-file-thumb {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 4px;
}

.chat-typing-bubble {
  align-self: flex-start;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

.chat-deleted-text {
  font-style: italic;
  color: var(--muted);
  font-size: 0.82rem;
}

.chat-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #22c55e;
  color: #052e16;
  font-size: 0.68rem;
  font-weight: 800;
  margin-left: 5px;
}

.chat-date-pill {
  align-self: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  margin: 4px 0;
}

[data-theme="light"] .chat-date-pill {
  background: rgba(255, 255, 255, 0.88);
  color: #475569;
}

.chat-load-more-btn {
  align-self: center;
  font-size: 0.75rem;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
}

.chat-scroll-bottom {
  position: absolute;
  right: 16px;
  bottom: 72px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  z-index: 4;
}

.chat-tick {
  margin-left: 3px;
  font-weight: 700;
}

.chat-tick.read {
  color: #38bdf8;
}

.chat-star-mark {
  color: #facc15;
  margin-right: 4px;
}

.chat-audio-player {
  width: 100%;
  max-width: 240px;
  height: 34px;
  margin: 2px 0;
}

.chat-voice-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: rgba(239, 68, 68, 0.12);
}

.voice-rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  animation: pulseDot 1s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.icon-btn.active-filter {
  background: rgba(250, 204, 21, 0.2);
  border-color: rgba(250, 204, 21, 0.5);
}

/* Footer & Legal Compliance */
.site-footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.legal-body {
  max-height: 55vh;
  overflow-y: auto;
  font-size: 0.86rem;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 10px;
  line-height: 1.6;
}

.legal-body h4 {
  color: var(--accent);
  font-size: 0.92rem;
  margin-top: 4px;
}

.legal-body p {
  color: var(--muted);
}

.cookie-banner {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 760px;
  margin: 0 auto;
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1.5px solid var(--border-strong);
  border-radius: 16px;
  padding: 14px 18px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  z-index: 95;
}

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

.cookie-text {
  flex: 1;
  min-width: 240px;
}

.cookie-text strong {
  font-size: 0.9rem;
}

.cookie-text p {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

.cookie-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.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;
}

/* Selected Files List below QR */
.selected-files-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.selected-files-list {
  list-style: none;
  max-height: 185px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 4px;
}

.selected-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(7, 5, 16, 0.55);
  border: 1px solid var(--border);
  font-size: 0.82rem;
}

.selected-file-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.selected-file-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-file-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.remove-file-btn {
  background: rgba(251, 113, 133, 0.16);
  color: #fda4af;
  border: none;
  border-radius: 6px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}

.remove-file-btn:hover {
  background: rgba(251, 113, 133, 0.35);
}

/* QR Pulse Frame */
.qr-pulse-frame {
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.45);
  animation: qrGlow 2.6s infinite ease-in-out;
}

@keyframes qrGlow {
  0%, 100% { box-shadow: 0 0 18px rgba(74, 222, 128, 0.25), 0 0 12px rgba(168, 85, 247, 0.25); }
  50% { box-shadow: 0 0 28px rgba(74, 222, 128, 0.55), 0 0 20px rgba(168, 85, 247, 0.45); }
}

/* Live Transfer Beam Animation (Yellow while active, Green when completed) */
.transfer-beam-box {
  background: rgba(250, 204, 21, 0.1);
  border: 1.5px solid rgba(250, 204, 21, 0.55);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.transfer-beam-box.completed {
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.65);
}

.transfer-beam-box[hidden],
.receive-waves[hidden] {
  display: none;
}

.beam-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.beam-node {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.beam-stream {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.22);
  position: relative;
  overflow: hidden;
}

.transfer-beam-box.completed .beam-stream {
  background: rgba(74, 222, 128, 0.35);
}

.beam-stream .packet {
  position: absolute;
  top: 0;
  left: -25%;
  width: 24%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #facc15, #eab308, transparent);
  animation: beamFly 1.2s infinite linear;
}

.transfer-beam-box.completed .beam-stream .packet {
  display: none !important;
  animation: none !important;
}

.transfer-beam-box.completed .beam-stream {
  background: #22c55e;
}

.transfer-beam-box.completed .beam-track {
  display: none;
}

.completion-badge {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.96rem;
  color: #4ade80;
}

[data-theme="light"] .completion-badge {
  color: #15803d;
}

.transfer-beam-box.completed .completion-badge {
  display: flex;
}

.completion-check-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #22c55e;
  color: #052e16;
  display: grid;
  place-items: center;
  font-size: 1rem;
  font-weight: 900;
  flex-shrink: 0;
}

.receive-waves[hidden] .wave,
.receive-waves.stopped .wave {
  animation: none !important;
}

.qr-pulse-frame {
  animation: none;
  box-shadow: 0 0 18px rgba(74, 222, 128, 0.22), 0 0 12px rgba(168, 85, 247, 0.22);
}

.beam-stream .packet:nth-child(2) { animation-delay: 0.3s; }
.beam-stream .packet:nth-child(3) { animation-delay: 0.6s; }
.beam-stream .packet:nth-child(4) { animation-delay: 0.9s; }

@keyframes beamFly {
  0% { left: -25%; }
  100% { left: 105%; }
}

.beam-status {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fde047;
}

.transfer-beam-box.completed .beam-status {
  color: #4ade80;
}

[data-theme="light"] .beam-status {
  color: #a16207;
}

[data-theme="light"] .transfer-beam-box.completed .beam-status {
  color: #15803d;
}

/* 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);
  }
}
