:root {
  --primary: #4f6ef7;
  --primary-light: #eef1ff;
  --success: #22c55e;
  --warn: #f59e0b;
  --error: #ef4444;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --radius: 12px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Header ── */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo span { font-size: 24px; }

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-badge {
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 500;
}
.status-badge.connected { background: #dcfce7; color: #166534; }
.status-badge.disconnected { background: #fef2f2; color: #991b1b; }

.peers-info {
  font-size: 13px;
  color: var(--text-muted);
}
.peers-info strong { color: var(--text); }

/* ── Container ── */
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 20px;
}

/* ── Join Section ── */
.join-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
  text-align: center;
}

.join-card h2 {
  font-size: 22px;
  margin-bottom: 6px;
}

.join-card p {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 14px;
}

.join-row {
  display: flex;
  gap: 10px;
}

.join-row input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.join-row input:focus { border-color: var(--primary); }

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--bg); color: var(--text); }

/* ── Channel info bar ── */
.channel-bar {
  background: var(--primary-light);
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
}

.channel-bar code {
  background: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  color: var(--primary);
  font-size: 14px;
}

/* ── Drop zone ── */
.drop-zone {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 20px;
}
.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.drop-zone .icon { font-size: 40px; margin-bottom: 12px; }
.drop-zone h3 { font-size: 16px; margin-bottom: 4px; }
.drop-zone p { color: var(--text-muted); font-size: 13px; }

/* ── Progress ── */
.progress-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.progress-track {
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), #818cf8);
  border-radius: 4px;
  transition: width 0.15s ease;
}

.progress-text {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* ── Receive section ── */
.receive-card {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
}

.receive-card h4 { color: #166534; margin-bottom: 8px; }

.receive-info {
  font-size: 14px;
  color: #15803d;
  margin-bottom: 12px;
}

.receive-download {
  display: inline-block;
  padding: 10px 24px;
  background: var(--success);
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
.receive-download:hover { opacity: 0.9; }

/* ── Log ── */
.log-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.log-header {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.log-body {
  max-height: 200px;
  overflow-y: auto;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  padding: 8px 0;
}

.log-entry {
  padding: 4px 16px;
  line-height: 1.6;
}
.log-info { color: var(--text-muted); }
.log-success { color: var(--success); }
.log-warn { color: var(--warn); }
.log-error { color: var(--error); }

/* ── Utilities ── */
.hidden { display: none !important; }

.share-link {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.share-link a { color: var(--primary); word-break: break-all; }
