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

body {
  font-family: system-ui, sans-serif;
  background: #0f1117;
  color: #e0e0e0;
  min-height: 100vh;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Header ────────────────────────────────────────────────── */
header h1 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 10px;
}

.conn-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

#status-text {
  flex: 1;
  font-size: 0.85rem;
  color: #8b9ab0;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: #1a1d27;
  border: 1px solid #2a2e40;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card.disabled { opacity: 0.4; pointer-events: none; }

/* ── Drop zone ──────────────────────────────────────────────── */
#drop-zone {
  border: 2px dashed #2e3450;
  border-radius: 6px;
  padding: 28px;
  text-align: center;
  color: #5a6480;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

#drop-zone.drag-over {
  border-color: #4f8ef7;
  background: rgba(79,142,247,0.06);
}

#drop-zone input[type="file"] { display: none; }

.browse-link {
  color: #4f8ef7;
  cursor: pointer;
  text-decoration: underline;
}

/* ── Options ────────────────────────────────────────────────── */
.options-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.options-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #8b9ab0;
}

#tile-coords {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── File list ──────────────────────────────────────────────── */
#file-list {
  font-size: 0.82rem;
  color: #7a8aaa;
  max-height: 120px;
  overflow-y: auto;
  line-height: 1.6;
}

#file-list .file-item { padding: 1px 0; }
#file-list .file-item.done { color: #4caf7d; }
#file-list .file-item.err  { color: #e05252; }

/* ── Actions ─────────────────────────────────────────────────── */
.actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: #2a2e40;
  border-radius: 3px;
  overflow: hidden;
}

#progress-fill {
  height: 100%;
  width: 0%;
  background: #4f8ef7;
  border-radius: 3px;
  transition: width 0.1s;
}

#progress-text {
  font-size: 0.78rem;
  color: #5a6480;
  white-space: nowrap;
  min-width: 60px;
}

/* ── Log ────────────────────────────────────────────────────── */
.log-card h2 {
  font-size: 0.85rem;
  font-weight: 600;
  color: #5a6480;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

#log-output {
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.78rem;
  color: #a0b0c8;
  background: #12141e;
  border-radius: 4px;
  padding: 12px;
  max-height: 280px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ── Buttons ─────────────────────────────────────────────────── */
button {
  padding: 7px 16px;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: opacity 0.15s;
}

button:disabled { opacity: 0.35; cursor: default; }

#connect-btn { background: #4f8ef7; color: #fff; }
#done-btn    { background: #2e3450; color: #c0c8e0; }
#upload-btn  { background: #4caf7d; color: #fff; white-space: nowrap; }

select, input[type="number"] {
  background: #12141e;
  border: 1px solid #2a2e40;
  border-radius: 4px;
  color: #e0e0e0;
  padding: 4px 6px;
  font-size: 0.85rem;
}
