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

:root {
  --bg: #070b14;
  --bg2: #0a0f1e;
  --surface: rgba(10, 20, 42, 0.55);
  --surface-hover: rgba(15, 28, 55, 0.7);
  --border: rgba(90, 150, 255, 0.1);
  --border-hover: rgba(90, 150, 255, 0.25);
  --accent: #00d4ff;
  --accent-glow: rgba(0, 212, 255, 0.15);
  --text: #f0f4f8;
  --text-sec: #8899b4;
  --text-muted: #556580;
  --green: #22c55e;
  --red: #ef4444;
  --radius: 14px;
  --r-sm: 8px;
  --panel-bg: #0d1321;
}
body.light {
  --bg: #f0f4f8;
  --bg2: #e2e8f0;
  --surface: rgba(255,255,255,0.7);
  --surface-hover: rgba(255,255,255,0.85);
  --border: rgba(0,0,0,0.08);
  --border-hover: rgba(0,0,0,0.15);
  --accent: #0284c7;
  --accent-glow: rgba(2,132,199,0.12);
  --text: #0f172a;
  --text-sec: #475569;
  --text-muted: #94a3b8;
  --green: #16a34a;
  --red: #dc2626;
  --panel-bg: #ffffff;
}
body.light .scan-bar { background: rgba(0,0,0,0.03); }
body.light .chip { background: rgba(0,0,0,0.04); }
body.light #device-name { background: rgba(0,0,0,0.04); color: var(--text); }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 0 16px 24px;
  transition: background 0.3s, color 0.3s;
}
.container { max-width: 640px; margin: 0 auto; position: relative; z-index: 10; }

#wifi-bg {
  position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0;
}
body.light #wifi-bg { opacity: 0.5; }
.wifi-ring {
  position: absolute; top: 50%; left: 50%;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 212, 255, 0.2);
  transform: translate(-50%, -50%);
  animation: wifi-pulse 4.5s ease-out infinite;
}
.wifi-ring:nth-child(1) { animation-delay: 0s; border-width: 2px; border-color: rgba(0,212,255,0.25); }
.wifi-ring:nth-child(2) { animation-delay: 0.9s; border-width: 1.5px; border-color: rgba(59,130,246,0.2); }
.wifi-ring:nth-child(3) { animation-delay: 1.8s; border-width: 1px; border-color: rgba(139,92,246,0.15); }
.wifi-ring:nth-child(4) { animation-delay: 2.7s; border-width: 1px; border-color: rgba(0,212,255,0.12); }
.wifi-ring:nth-child(5) { animation-delay: 3.6s; border-width: 0.8px; border-color: rgba(59,130,246,0.1); }

@keyframes wifi-pulse {
  0% { width: 5vmin; height: 5vmin; opacity: 0.5; }
  100% { width: 220vmin; height: 220vmin; opacity: 0; }
}
@keyframes slide-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes peer-in {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes scan {
  0% { left: -100%; }
  100% { left: 100%; }
}
@keyframes slide-right {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

/* Header */
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; margin-bottom: 18px; flex-wrap: wrap; gap: 8px;
}
.header-left { display: flex; align-items: center; gap: 14px; }
.logo { display: flex; align-items: center; gap: 8px; }
.logo i { font-size: 22px; color: var(--accent); filter: drop-shadow(0 0 10px var(--accent-glow)); }
.logo h1 {
  font-size: 22px; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #3b82f6, #8b5cf6);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.connection-status {
  display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-muted); white-space: nowrap;
}
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--green); box-shadow: 0 0 6px rgba(34,197,94,0.5); }
.dot-red { background: var(--red); }

.header-actions { display: flex; align-items: center; gap: 2px; }
.hdr-btn {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  background: none; border: 1px solid transparent; border-radius: 8px;
  color: var(--text-muted); cursor: pointer; font-size: 15px;
  transition: all 0.2s;
}
.hdr-btn:hover { color: var(--accent); border-color: var(--border-hover); background: var(--surface); }
.hdr-btn:active { transform: scale(0.92); }

/* Card */
.card {
  background: var(--surface); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px;
  transition: border-color 0.3s, background 0.3s;
}
.card:hover { border-color: var(--border-hover); }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.card-head-left { display: flex; align-items: center; gap: 8px; }
.card-head-left i { font-size: 14px; color: var(--accent); }
.card-head h2 { font-size: 13px; font-weight: 600; }
.card-head-right { display: flex; align-items: center; gap: 6px; }
.card-body { padding: 14px; }

.card-compact .card-body { padding: 10px 14px; }

.status-text { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-muted); }

.badge {
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 20px; padding: 1px 10px; font-size: 11px; font-weight: 600; color: var(--accent);
}

.broadcast-btn {
  display: none; align-items: center; gap: 4px;
  background: linear-gradient(135deg, rgba(0,212,255,0.15), rgba(139,92,246,0.15));
  border: 1px solid rgba(0,212,255,0.3); border-radius: 20px;
  color: var(--accent); cursor: pointer; padding: 2px 10px;
  font-size: 10px; font-weight: 600; transition: all 0.2s;
}
.broadcast-btn:hover { background: linear-gradient(135deg, var(--accent), #8b5cf6); color: #000; border-color: var(--accent); }
.broadcast-btn.show { display: inline-flex; }

.field { margin-bottom: 10px; }
.field:last-child { margin-bottom: 0; }
.field label {
  display: block; font-size: 10px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 4px;
}
.field-row { display: flex; gap: 14px; align-items: center; }
.field-row .field { flex: 1; margin-bottom: 0; }
.field.right { text-align: right; }

.input-row { display: flex; gap: 5px; }
#device-name {
  flex: 1; padding: 8px 11px; background: rgba(255,255,255,0.04);
  border: 1px solid var(--border); border-radius: 6px; color: var(--text);
  font-size: 13px; outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
#device-name:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

.icon-btn {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  background: var(--accent); border: none; border-radius: 6px; color: #000;
  font-size: 12px; cursor: pointer; transition: opacity 0.2s, transform 0.15s; flex-shrink: 0;
}
.icon-btn:hover { opacity: 0.85; transform: scale(1.05); }
.icon-btn:active { transform: scale(0.95); }

.toggle-row { display: flex; align-items: center; gap: 8px; }
#visibility-label { font-size: 12px; color: var(--text-sec); }

.toggle-btn {
  position: relative; width: 36px; height: 20px; border-radius: 20px;
  border: none; cursor: pointer; transition: background 0.25s; flex-shrink: 0;
  background: #1e293b;
}
body.light .toggle-btn { background: #cbd5e1; }
.toggle-btn.active { background: var(--accent) !important; }
.toggle-knob {
  position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  background: #64748b; border-radius: 50%; transition: transform 0.25s, background 0.25s;
}
body.light .toggle-knob { background: #94a3b8; }
.toggle-btn.active .toggle-knob {
  transform: translateX(16px); background: #000;
}
body.light .toggle-btn.active .toggle-knob { background: #fff; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--text-sec); background: rgba(255,255,255,0.04);
  padding: 4px 10px; border-radius: 20px; border: 1px solid var(--border);
}

/* Scan bar */
.scan-bar {
  display: flex; align-items: center; gap: 7px; padding: 7px 12px; margin-bottom: 10px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: var(--r-sm); font-size: 12px; color: var(--text-muted);
  position: relative; overflow: hidden;
}
.scan-bar::after {
  content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
  animation: scan 2.5s ease-in-out infinite;
}
.scan-bar i { font-size: 11px; color: var(--accent); position: relative; z-index: 1; }
.scan-bar span { position: relative; z-index: 1; }
#scan-bar.hidden-bar { display: none; }

/* Peer cards */
#peers-list { display: flex; flex-direction: column; gap: 6px; }

.peer-card {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px; cursor: pointer;
  background: rgba(255,255,255,0.02); border: 1px solid transparent;
  transition: all 0.2s;
  animation: peer-in 0.3s ease-out both;
}
.peer-card:hover { border-color: var(--border-hover); background: var(--surface-hover); }
.peer-card.selected { border-color: rgba(0,212,255,0.4); background: rgba(0,212,255,0.06); }
.peer-card.drag-over { border-color: var(--accent); background: var(--accent-glow); }

.peer-avatar {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(0,212,255,0.12), rgba(139,92,246,0.12));
  border-radius: 8px; font-size: 16px; color: var(--accent); flex-shrink: 0;
}

.peer-info { flex: 1; min-width: 0; }
.peer-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.peer-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.peer-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: var(--green); box-shadow: 0 0 6px rgba(34,197,94,0.4);
}

.peer-trust {
  background: none; border: none; cursor: pointer; font-size: 12px;
  color: var(--text-muted); padding: 4px; transition: all 0.2s; flex-shrink: 0;
  border-radius: 4px;
}
.peer-trust:hover { color: #f43f5e; background: rgba(244,63,94,0.08); }
.peer-trust.trusted { color: #f43f5e; }

.peer-send {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-muted); cursor: pointer; font-size: 12px; flex-shrink: 0;
  transition: all 0.2s;
}
.peer-send:hover { background: var(--accent); border-color: var(--accent); color: #000; }

/* Empty state */
#empty-state {
  display: flex; flex-direction: column; align-items: center; padding: 30px 20px; text-align: center;
}
#empty-state.hidden { display: none; }
.empty-icon {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: 50%; font-size: 18px; color: var(--text-muted); margin-bottom: 10px;
}
#empty-state p { font-size: 13px; color: var(--text-sec); margin-bottom: 2px; }
#empty-state .hint { font-size: 11px; color: var(--text-muted); }

/* Selected bar */
#selected-bar {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
  padding: 7px 10px; border-radius: var(--r-sm); font-size: 12px;
  background: rgba(0,212,255,0.06); border: 1px solid rgba(0,212,255,0.2);
  animation: slide-up 0.25s ease-out; flex-wrap: wrap;
}
#selected-bar i { color: var(--accent); font-size: 12px; }
#selected-bar span { flex: 1; color: var(--text-sec); min-width: 0; }
#selected-bar strong { color: var(--accent); }
#selected-bar.hidden { display: none; }

.send-file-btn {
  background: var(--accent); border: none; border-radius: 5px;
  color: #000; cursor: pointer; font-size: 11px; font-weight: 600;
  padding: 5px 10px; display: flex; align-items: center; gap: 4px;
  transition: opacity 0.2s; white-space: nowrap;
}
.send-file-btn:hover { opacity: 0.85; }
.send-file-btn i { font-size: 10px !important; }

#deselect-btn {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 13px; padding: 3px 5px; border-radius: 5px; transition: all 0.2s;
}
#deselect-btn:hover { color: var(--text); background: rgba(255,255,255,0.05); }

/* Dialog */
#dialog-overlay {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(0,0,0,0.7); backdrop-filter: blur(6px);
  animation: fade-in 0.2s;
}
#dialog-overlay.hidden { display: none; }
body.light #dialog-overlay { background: rgba(0,0,0,0.4); }

.dialog {
  width: 100%; max-width: 400px;
  background: var(--panel-bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5); animation: slide-up 0.25s ease-out;
}
.dialog-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.dialog-head h3 { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.dialog-head h3 i { color: var(--accent); font-size: 12px; }
.dialog-head h3 span { color: var(--accent); }
.icon-btn-small {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 14px; padding: 4px; transition: color 0.2s;
}
.icon-btn-small:hover { color: var(--text); }

.dialog-body { padding: 16px; }
.dialog-target { font-size: 13px; color: var(--text-sec); margin-bottom: 12px; }
.dialog-target b { color: var(--text); }

.drop-zone {
  border: 2px dashed var(--border); border-radius: var(--r-sm);
  padding: 22px 16px; text-align: center; cursor: pointer; transition: all 0.25s;
}
.drop-zone:hover, .drop-zone.dragover { border-color: var(--accent); background: var(--accent-glow); }
.drop-zone i { font-size: 28px; color: var(--text-muted); margin-bottom: 6px; transition: color 0.25s; }
.drop-zone:hover i, .drop-zone.dragover i { color: var(--accent); }
.drop-zone p { font-size: 13px; color: var(--text-sec); }
.drop-hint { display: block; font-size: 10px; color: var(--text-muted); margin-top: 3px; }

.dialog-upload-methods { margin-bottom: 10px; }
.upload-buttons { display: flex; gap: 6px; margin-top: 8px; }
.upload-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 7px 10px; background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-sec); cursor: pointer;
  font-size: 11px; font-weight: 500; transition: all 0.2s;
}
.upload-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.upload-btn i { font-size: 12px; }

/* Selected files area */
#selected-files-area {
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: 6px; padding: 8px; margin-top: 6px;
  max-height: 120px; overflow-y: auto;
}
.selected-files-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px; font-size: 11px; color: var(--text-sec); font-weight: 600;
}
.file-chip {
  display: flex; align-items: center; gap: 5px;
  padding: 3px 6px; margin-bottom: 2px; border-radius: 4px;
  font-size: 10px; color: var(--text-sec); background: rgba(255,255,255,0.04);
}
.file-chip i { color: var(--accent); font-size: 9px; }
.file-chip .fname { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-chip .fsize { color: var(--text-muted); white-space: nowrap; }

.send-btn {
  width: 100%; margin-top: 10px; padding: 9px; border: none; border-radius: 6px;
  font-size: 13px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px;
  background: linear-gradient(135deg, var(--accent), #3b82f6); color: #000; transition: opacity 0.2s;
}
.send-btn:hover:not(:disabled) { opacity: 0.9; }
.send-btn:disabled { opacity: 0.3; cursor: not-allowed; background: #1e293b; color: #64748b; }

/* Dialog activity */
#dialog-activity { margin-top: 12px; }
.activity-title {
  font-size: 10px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 6px;
}
.activity-item {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: 6px; font-size: 11px; color: var(--text-sec); margin-bottom: 4px;
}
.activity-item i.fa-inbox { color: var(--accent); }
.activity-item i.fa-check-circle { color: var(--green); }
.activity-item .act-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn-xs {
  padding: 3px 8px; border: none; border-radius: 4px; font-size: 10px; font-weight: 600;
  cursor: pointer; transition: opacity 0.2s;
}
.btn-xs:hover { opacity: 0.85; }
.btn-primary { background: var(--accent); color: #000; }
.btn-secondary { background: rgba(255,255,255,0.06); color: var(--text-sec); }
.btn-secondary:hover { color: var(--text); }

/* Scanner */
#scanner-overlay {
  position: fixed; inset: 0; z-index: 150; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(0,0,0,0.85); animation: fade-in 0.2s;
}
#scanner-overlay.hidden { display: none; }
.scanner-box {
  width: 100%; max-width: 380px;
  background: var(--panel-bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5); overflow: hidden;
}
.scanner-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.scanner-head h3 { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.scanner-head h3 i { color: var(--accent); }
.scanner-body { padding: 14px; }
.scanner-viewport {
  position: relative; width: 100%; aspect-ratio: 1; border-radius: 10px;
  overflow: hidden; background: #000;
}
#scanner-video { width: 100%; height: 100%; object-fit: cover; }
.scanner-frame {
  position: absolute; inset: 15%; border: 2px solid var(--accent);
  border-radius: 12px; box-shadow: 0 0 0 9999px rgba(0,0,0,0.4);
  animation: pulse-border 2s ease-in-out infinite;
}
@keyframes pulse-border {
  0%, 100% { border-color: var(--accent); }
  50% { border-color: rgba(0,212,255,0.3); }
}
#scanner-status { text-align: center; font-size: 12px; color: var(--text-sec); margin-top: 10px; }

/* Notifications */
#notifications {
  position: fixed; top: 12px; right: 12px; z-index: 200;
  display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 320px;
  pointer-events: none;
}
.notif {
  pointer-events: auto; animation: slide-up 0.25s ease-out;
  background: var(--surface); backdrop-filter: blur(16px);
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4); overflow: hidden;
}
.notif-body { padding: 10px 12px; }
.notif-msg { font-size: 12px; }
.notif-msg strong { color: var(--accent); }
.notif-meta { font-size: 11px; color: var(--text-muted); margin-top: 3px; display: flex; align-items: center; gap: 5px; }
.notif-actions { display: flex; border-top: 1px solid var(--border); }
.notif-actions button, .notif-actions a {
  flex: 1; padding: 7px; border: none; background: none; font-size: 11px; font-weight: 600; cursor: pointer;
  transition: background 0.2s; text-align: center; text-decoration: none; color: inherit; display: block;
}
.notif-actions .accept-btn { color: var(--accent); }
.notif-actions .accept-btn:hover { background: rgba(0,212,255,0.08); }
.notif-actions .decline-btn { color: var(--text-muted); border-left: 1px solid var(--border); }
.notif-actions .decline-btn:hover { background: rgba(255,255,255,0.04); }
.notif-actions .download-link { color: #000; background: var(--accent); }
.notif-actions .download-link:hover { opacity: 0.9; }
.notif-actions .dismiss-btn { color: var(--text-muted); border-left: 1px solid var(--border); }
.notif-actions .dismiss-btn:hover { background: rgba(255,255,255,0.04); }

/* Footer */
.footer {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  margin-top: 28px; padding-bottom: 6px;
  font-size: 11px; color: rgba(255,255,255,0.12);
}
.footer i { font-size: 9px; }
.footer a { color: rgba(255,255,255,0.2); text-decoration: none; font-weight: 500; }
.footer a:hover { color: var(--accent); }
body.light .footer { color: rgba(0,0,0,0.2); }
body.light .footer a { color: rgba(0,0,0,0.25); }
body.light .footer a:hover { color: var(--accent); }
.footer-contact { margin-top: 1px; }

/* Global drag overlay */
#global-drop {
  position: fixed; inset: 0; z-index: 50; display: none;
  align-items: center; justify-content: center; pointer-events: none;
}
#global-drop.show { display: flex; }
#global-drop-inner {
  background: rgba(0,212,255,0.08); backdrop-filter: blur(8px);
  border: 2px dashed rgba(0,212,255,0.5); border-radius: 24px; padding: 28px 36px; text-align: center;
}
#global-drop-inner i { font-size: 32px; color: var(--accent); margin-bottom: 8px; display: block; }
#global-drop-inner p { font-size: 14px; font-weight: 600; }
#global-drop-inner span { font-size: 11px; color: var(--text-sec); display: block; margin-top: 3px; }

/* QR Fullscreen */
#qr-overlay {
  position: fixed; inset: 0; z-index: 170; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(0,0,0,0.85); backdrop-filter: blur(10px);
  animation: fade-in 0.2s;
}
#qr-overlay.hidden { display: none; }
.qr-box {
  background: var(--panel-bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px; text-align: center; position: relative;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5); animation: slide-up 0.25s ease-out;
}
.qr-box-close { position: absolute; top: 10px; right: 12px; font-size: 16px !important; }
.qr-box h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; color: var(--accent); }
.qr-box canvas, .qr-box img { display: block; margin: 0 auto; border-radius: 8px; }
.qr-device-name { font-size: 14px; margin-top: 12px; color: var(--text); font-weight: 500; }
.qr-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* Panel overlay */
#panel-overlay {
  position: fixed; inset: 0; z-index: 140; display: flex; justify-content: flex-end;
  animation: fade-in 0.2s;
}
#panel-overlay.hidden { display: none; }
.panel {
  width: 100%; max-width: 360px; height: 100%;
  background: var(--panel-bg); border-left: 1px solid var(--border);
  box-shadow: -8px 0 40px rgba(0,0,0,0.4);
  animation: slide-right 0.3s ease-out;
  display: flex; flex-direction: column;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.panel-head h3 { font-size: 14px; font-weight: 600; }
.panel-body { flex: 1; padding: 18px; overflow-y: auto; }

.pfield { margin-bottom: 14px; }
.plabel {
  display: block; font-size: 10px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 6px;
}
.pdivider { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.plink {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none; color: var(--accent); cursor: pointer;
  font-size: 13px; padding: 8px 0; width: 100%; transition: opacity 0.2s;
}
.plink:hover { opacity: 0.8; }
.plink.danger { color: var(--red); }

/* Trusted list */
#trusted-list .text-muted { font-style: italic; }
.trusted-item {
  display: flex; align-items: center; gap: 6px; padding: 5px 8px;
  background: rgba(255,255,255,0.03); border-radius: 6px;
  margin-bottom: 3px; font-size: 12px;
}
.trusted-item i { color: #f43f5e; font-size: 11px; }
.trusted-item .trusted-name { flex: 1; }
.trusted-item .untrust-btn {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 11px; padding: 2px 5px; border-radius: 4px;
}
.trusted-item .untrust-btn:hover { color: var(--red); background: rgba(239,68,68,0.1); }

/* Guide list */
.guide-list { margin: 0; padding-left: 16px; }
.guide-list li { font-size: 12px; color: var(--text-sec); margin-bottom: 7px; line-height: 1.4; }
.guide-list li strong { color: var(--accent); }
.guide-tip { font-size: 11px; color: var(--text-muted); margin-top: 10px; }
.guide-tip i { color: #facc15; margin-right: 4px; }

/* History */
#history-list .history-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border: 1px solid var(--border); border-radius: 6px;
  margin-bottom: 4px; font-size: 11px;
}
.history-item i.sent { color: var(--accent); }
.history-item i.received { color: var(--green); }
.hist-info { flex: 1; min-width: 0; }
.hist-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.hist-meta { color: var(--text-muted); margin-top: 1px; font-size: 10px; }

.hidden { display: none !important; }

@media (max-width: 540px) {
  body { padding: 0 8px 16px; }
  header { padding: 10px 0; gap: 6px; }
  .logo h1 { font-size: 18px; }
  .logo i { font-size: 18px; }
  .connection-status { font-size: 10px; }
  .header-actions { gap: 0; }
  .hdr-btn { width: 30px; height: 30px; font-size: 13px; }
  .card-head { padding: 10px 12px; }
  .card-head h2 { font-size: 12px; }
  .card-body { padding: 10px; }
  .qr-box { padding: 24px; margin: 0 8px; }
  .qr-box h3 { font-size: 14px; }
  .qr-box canvas, .qr-box img { width: 200px !important; height: 200px !important; }
  .panel { max-width: 300px; }
  .dialog { margin: 0 4px; }
  .dialog-body { padding: 12px; }
  .drop-zone { padding: 16px 12px; }
  .drop-zone i { font-size: 22px; }
  #notifications { left: 8px; right: 8px; max-width: none; top: 8px; }
  .notif-body { padding: 8px 10px; }
  .notif-msg { font-size: 11px; }
  #selected-bar span { font-size: 11px; width: 100%; order: -1; }
  .send-file-btn { padding: 4px 8px; font-size: 10px; }
  .upload-buttons { flex-direction: column; }
  #global-drop-inner { padding: 20px 24px; margin: 0 12px; }
  #global-drop-inner i { font-size: 24px; }
  #global-drop-inner p { font-size: 13px; }
  .scanner-box { margin: 0 4px; }
  .guide-list li { font-size: 11px; }
}
