:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --border: #2a2d3a;
  --accent: #4f8ef7;
  --accent-hover: #6aa3ff;
  --text: #e0e4f0;
  --muted: #6b7280;
  --success: #34d399;
  --warn: #fbbf24;
  --error: #f87171;
  --radius: 8px;
  --font: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Consolas", monospace;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

.app {
  max-width: 780px;
  margin: 0 auto;
  padding: 32px 16px;
}

header {
  margin-bottom: 32px;
}

header h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

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

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.panel h2 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

.form-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.form-row label {
  width: 110px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 13px;
}

.form-row input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  padding: 7px 10px;
  outline: none;
  transition: border-color 0.15s;
}

.form-row input:focus {
  border-color: var(--accent);
}

.button-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

button {
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  transition: background 0.15s;
}

button:hover:not(:disabled) {
  background: var(--accent-hover);
}

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

.status {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
}

.status--idle    { background: rgba(107,114,128,0.2); color: var(--muted); }
.status--connecting { background: rgba(251,191,36,0.15); color: var(--warn); }
.status--connected  { background: rgba(52,211,153,0.15); color: var(--success); }
.status--error      { background: rgba(248,113,113,0.15); color: var(--error); }

.muted {
  color: var(--muted);
  font-size: 13px;
}

.file-list {
  list-style: none;
  margin-top: 12px;
  max-height: 200px;
  overflow-y: auto;
}

.file-list li {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 3px 0;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.file-list li:last-child {
  border-bottom: none;
}

.file-list li .file-size {
  float: right;
  color: #4b5563;
}

.progress-bar-wrap {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 14px;
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  width: 0%;
  transition: width 0.2s;
}

#progress-label {
  margin-top: 6px;
}

.log {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  max-height: 260px;
  margin-top: 14px;
  overflow-y: auto;
  padding: 10px 12px;
  white-space: pre-wrap;
  word-break: break-all;
}

.log:empty {
  display: none;
}

button.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

button.btn-secondary:hover:not(:disabled) {
  background: var(--border);
  color: var(--text);
}
