:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #1b1e24;
  --muted: #6b7280;
  --border: #dfe2e7;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --success: #16a34a;
  --danger: #dc2626;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --surface: #1d2026;
    --text: #e7e9ee;
    --muted: #9aa1ac;
    --border: #2c313a;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
  }
}

* { box-sizing: border-box; }

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

.app-header {
  padding: clamp(1rem, 4vw, 2.5rem) clamp(1rem, 5vw, 3rem) 0.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.app-header h1 {
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  margin: 0 0 0.4rem;
}

.subtitle {
  color: var(--muted);
  margin: 0;
  font-size: 0.95rem;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem clamp(1rem, 5vw, 3rem) 3rem;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.drag-over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  outline: none;
}

.dropzone-icon {
  font-size: 2.2rem;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.dropzone-text {
  margin: 0;
  font-size: 1rem;
  color: var(--muted);
}

.file-picker-label {
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 480px) {
  .desktop-only { display: none; }
  .dropzone { min-height: 140px; }
}

.queue {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.upload-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
}

.upload-item-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.upload-item-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.upload-item-size {
  color: var(--muted);
  white-space: nowrap;
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s ease;
}

.upload-item.done .progress-fill { background: var(--success); }
.upload-item.error .progress-fill { background: var(--danger); }

.upload-item-footer {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.upload-item-status { flex: 1 1 auto; min-width: 8rem; }

.upload-item-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
  min-height: 2.1rem;
  touch-action: manipulation;
}

.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-cancel:hover { border-color: var(--danger); color: var(--danger); }

.app-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 1rem;
}

/* Cibles tactiles plus grandes sur mobile/tablette */
@media (pointer: coarse) {
  .btn { padding: 0.55rem 1.1rem; font-size: 0.95rem; }
  .file-picker-label { font-size: 1.05rem; }
}
