:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #1b1f2a;
  --muted: #6b7280;
  --line: #d5d9e2;
  --accent: #2f4bff;
  --accent-dark: #2236cc;
  --accent-soft: #eef1ff;
  --error: #c0262d;
  --ok: #1a7f4b;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12141a;
    --surface: #1a1d26;
    --ink: #eef0f5;
    --muted: #9aa1b2;
    --line: #333849;
    --accent: #6f86ff;
    --accent-dark: #8a9cff;
    --accent-soft: #1f2540;
    --error: #ff7b80;
    --ok: #52d08b;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 64px 20px;
}

h1 {
  margin: 0 0 8px;
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.lead {
  margin: 0 0 32px;
  color: var(--muted);
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px;
  background: var(--surface);
  border: 2px dashed var(--line);
  border-radius: 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

.dz-title { margin: 0; font-size: 1.15rem; font-weight: 600; }
.dz-sub { margin: 6px 0; color: var(--muted); }
.dz-hint { margin: 16px 0 0; font-size: 0.85rem; color: var(--muted); }

.btn {
  padding: 10px 20px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn:hover:not(:disabled) { background: var(--accent-dark); }
.btn:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-ghost {
  color: var(--ink);
  background: transparent;
  border-color: var(--line);
}
.btn-ghost:hover:not(:disabled) { background: var(--accent-soft); }

.file-info {
  margin-top: 24px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.file-info[hidden] { display: none; }

.file-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.file-name { font-weight: 600; overflow-wrap: anywhere; }
.file-size { color: var(--muted); white-space: nowrap; }

video {
  display: block;
  width: 100%;
  max-height: 320px;
  background: #000;
  border-radius: 8px;
}

.progress {
  height: 8px;
  margin-top: 16px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: var(--accent);
  transition: width 0.1s linear;
}

.actions { display: flex; gap: 10px; margin-top: 16px; }

.status { min-height: 1.5em; margin-top: 16px; font-weight: 500; }
.status.error { color: var(--error); }
.status.success { color: var(--ok); }

/* ---- Results (phase 2) ---- */
.results {
  margin-top: 24px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.results[hidden] { display: none; }

.results h2 { margin: 0 0 4px; font-size: 1.25rem; }
.summary { margin: 0 0 16px; color: var(--muted); }

.table-wrap { margin-top: 16px; overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-weight: 600; color: var(--muted); }
td.num { font-variant-numeric: tabular-nums; }

.share { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.share-track { flex: 1; height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.share-fill { height: 100%; background: var(--accent); }

a.btn { display: inline-block; text-decoration: none; }