:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #dc2626;
  --border: #e2e8f0;
  --radius: 12px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding: 24px 16px;
}

.container {
  max-width: 660px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 20px;
}

header h1 {
  font-size: 1.75rem;
  font-weight: 700;
}

.subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.tab {
  padding: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  transition: 0.15s;
}

.tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 16px;
  background: var(--card);
  border: 1px solid var(--border);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #94a3b8;
  flex-shrink: 0;
}

.status-wait .dot { background: #f59e0b; }
.status-connected .dot { background: #10b981; }
.status-error .dot { background: #ef4444; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.card h2 {
  font-size: 1rem;
  margin-bottom: 12px;
}

.share-grid {
  display: flex;
  gap: 16px;
  align-items: center;
}

@media (max-width: 540px) {
  .share-grid {
    flex-direction: column;
    align-items: stretch;
  }
}

.qr-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  flex-shrink: 0;
}

.qr-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}

.share-details {
  flex: 1;
  min-width: 0;
}

.field-label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.code-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
}

#share-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.url-display, .join-form {
  display: flex;
  gap: 8px;
}

input[type="text"], input[type="password"] {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: #f8fafc;
  color: var(--text);
}

.hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 10px;
}

button {
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s;
  white-space: nowrap;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #e2e8f0;
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-large {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  margin-top: 12px;
}

.drop-zone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius);
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: 0.15s;
}

.drop-zone.dragover {
  border-color: var(--primary);
  background: #eff6ff;
  color: var(--primary);
}

.file-list {
  list-style: none;
  margin-top: 12px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  gap: 10px;
}

.file-info {
  overflow: hidden;
}

.file-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.empty-msg {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 16px 0;
}

.progress-area {
  margin-top: 16px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.progress-header, .progress-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.progress-footer {
  margin-top: 6px;
  margin-bottom: 0;
}

.progress-track {
  width: 100%;
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.1s linear;
}

.hidden {
  display: none !important;
}
