:root {
  --bg: #f1f5f9;
  --card: #ffffff;
  --fg: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #2563eb;
  --accent-fg: #ffffff;
  --ok: #16a34a;
  --err: #dc2626;
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --card: #1e293b;
    --fg: #f1f5f9;
    --muted: #94a3b8;
    --border: #334155;
    --accent: #3b82f6;
  }
}

* { box-sizing: border-box; }
/* input не display:none — иначе .click() не откроет picker в части браузеров */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); opacity: 0; pointer-events: none;
}
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
#app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
  max-width: 640px;
  margin: 0 auto;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ── Login ─────────────────────────────────────────── */
.view { flex: 1; }
.card {
  margin: auto;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
}
#login-view { display: flex; flex-direction: column; justify-content: center; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { font-size: 20px; margin: 0; }
.brand.small { font-weight: 600; font-size: 15px; }
.logo { font-size: 22px; }
form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
input {
  font-size: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--fg);
}
input:focus { outline: 2px solid var(--accent); border-color: transparent; }
button {
  font-size: 16px;
  padding: 13px 16px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}
button.primary { background: var(--accent); color: var(--accent-fg); }
button.primary:disabled { opacity: .6; cursor: default; }
button.ghost {
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  font-weight: 500;
  font-size: 14px;
}
.error { color: var(--err); font-size: 14px; margin: 4px 0 0; }

/* ── Установка приложения ──────────────────────────── */
.install { margin-top: 20px; }
.sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.sep::before, .sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.ghost-btn {
  width: 100%;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  font-weight: 600;
}
#ios-install { font-size: 13px; text-align: center; margin: 0; }

/* ── Upload ────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 4px; position: sticky; top: 0; background: var(--bg);
}
.who { display: flex; align-items: center; gap: 8px; }
#dropzone {
  display: block;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
#dropzone.drag { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
.dz-inner { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.dz-icon { font-size: 40px; }
.dz-inner strong { font-size: 17px; }

.queue { list-style: none; padding: 0; margin: 18px 0 40px; display: flex; flex-direction: column; gap: 10px; }
.item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}
.item .row { display: flex; align-items: center; gap: 10px; }
.item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.item .status { font-size: 13px; color: var(--muted); flex-shrink: 0; }
.item .status.ok { color: var(--ok); }
.item .status.err { color: var(--err); }
.bar { height: 6px; background: var(--border); border-radius: 999px; margin-top: 10px; overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.item.done .bar { display: none; }
