:root {
  --bg: #0f1115;
  --card: #171a21;
  --card-2: #1e222b;
  --line: #272c37;
  --text: #e8eaf0;
  --muted: #8b93a7;
  --accent: #ffd400;
  --accent-ink: #1a1400;
  --blue: #4a7dff;
  --ok: #35c46b;
  --err: #ff5d5d;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }

.screen {
  max-width: 620px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}
.center { min-height: 88vh; display: flex; align-items: center; }

h1 { font-size: 20px; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 16px; margin: 0 0 10px; font-weight: 650; }
p { margin: 0 0 10px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 16px; min-height: 36px;
}
.topbar h1 { flex: 1; text-align: center; }
.topbar > span { min-width: 64px; }
.topbar .btn { min-width: 64px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: var(--err); font-size: 14px; margin: 10px 0 0; }
.disk { font-size: 12px; margin: 10px 2px; }

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}

/* ---------- buttons ---------- */
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  padding: 12px 16px;
  border-radius: 11px;
  cursor: pointer;
  min-height: 46px;
  transition: filter .15s, opacity .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:hover:not(:disabled) { filter: brightness(1.15); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.ok { background: var(--ok); color: #04210f; border-color: var(--ok); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--err); }
.btn.small { padding: 7px 11px; min-height: 34px; font-size: 13px; }
.btn.big { width: 100%; font-size: 17px; padding: 15px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row .btn { flex: 1 1 auto; }

/* ---------- login ---------- */
.login { width: 100%; text-align: center; }
.login h1 { font-size: 28px; margin-bottom: 4px; }
.pin {
  width: 100%;
  font-size: 26px;
  text-align: center;
  letter-spacing: .4em;
  padding: 14px;
  margin: 18px 0 12px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
}
.login .btn { width: 100%; }

/* ---------- inputs ---------- */
.field { display: block; margin: 16px 0; }
.field > span:first-child { display: block; font-weight: 600; margin-bottom: 7px; font-size: 14px; }
textarea, input[type="text"], input[type="number"] {
  width: 100%;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  font: inherit;
  padding: 12px;
  resize: vertical;
}
textarea:focus, input:focus, .pin:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
.field .small { margin-top: 6px; display: block; }

.filedrop {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 26px 16px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--card-2);
  cursor: pointer;
  text-align: center;
}
.filedrop:hover { border-color: var(--blue); }
.filedrop-icon { font-size: 30px; }

/* ---------- jobs list ---------- */
.jobs { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.job {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px 14px;
  cursor: pointer; text-align: left; width: 100%;
  font: inherit; color: inherit;
}
.job:hover { border-color: var(--blue); }
.job-main { flex: 1; min-width: 0; }
.job-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }

.pill {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; padding: 4px 9px; border-radius: 999px;
  background: var(--card-2); color: var(--muted); white-space: nowrap;
}
.pill.busy { background: #2a3350; color: #a9c0ff; }
.pill.review { background: #4a3a00; color: var(--accent); }
.pill.done { background: #103d22; color: #7ce6a4; }
.pill.failed { background: #4a1414; color: #ff9a9a; }

/* ---------- progress ---------- */
.progress {
  height: 10px; background: var(--card-2); border-radius: 999px;
  overflow: hidden; margin: 14px 0 8px; border: 1px solid var(--line);
}
.progress .bar {
  height: 100%; width: 0%; background: var(--accent);
  transition: width .35s ease;
}
.spinner {
  width: 34px; height: 34px; margin: 6px auto 14px;
  border: 3px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.working { text-align: center; padding: 18px 0; }

/* ---------- media ---------- */
video {
  width: 100%; border-radius: 11px; background: #000; display: block;
  max-height: 62vh;
}
audio { width: 100%; margin-top: 10px; }

.note {
  background: #2a2410; border: 1px solid #5a4b10; color: #ffd98a;
  border-radius: 11px; padding: 11px 13px; font-size: 14px; margin-bottom: 14px;
}
.note.bad { background: #2c1414; border-color: #6b2020; color: #ffb3b3; }

.hint-line { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.startrow { display: flex; gap: 10px; align-items: flex-end; }
.startrow .field { flex: 0 0 110px; margin: 0; }
.startrow .btn { flex: 1; }
.counts { font-size: 12px; color: var(--muted); margin-top: 8px; }
