:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1e222b;
  --line: #2a2f3a;
  --text: #e8eaf0;
  --muted: #949cad;
  --accent: #6ea8fe;
  --ok: #57c98b;
  --err: #f0776c;
  --radius: 14px;
}

* { box-sizing: border-box; }

/* .gate/.jobs задают display классом — без !important он перебивает hidden
   и оба экрана показываются разом. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100svh;
  padding: 20px 16px calc(28px + env(safe-area-inset-bottom));
}

h1 { font-size: 19px; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
.muted { color: var(--muted); font-size: 13px; }
.center { text-align: center; }
.error { color: var(--err); font-size: 13px; margin: 4px 0 0; }

main, .gate { max-width: 720px; margin: 0 auto; }

header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}

button {
  font: inherit; cursor: pointer; border-radius: 10px; border: 0;
  background: var(--accent); color: #0b1220; font-weight: 600;
  padding: 11px 18px;
}
button:disabled { opacity: .55; cursor: default; }
.link {
  background: none; color: var(--muted); padding: 6px 0; font-weight: 500; font-size: 14px;
}
.link:hover { color: var(--text); }

/* вход */
.gate { display: grid; place-items: center; min-height: 80svh; }
.gate-card {
  width: 100%; max-width: 340px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; display: grid; gap: 12px;
}
.gate-card h1 { margin-bottom: 2px; }
input[type=password] {
  font-size: 16px; /* меньше — и iOS зумит при фокусе */
  padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); width: 100%;
}
input[type=password]:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* дропзона */
#drop {
  display: grid; gap: 6px; justify-items: center; text-align: center;
  padding: 34px 20px; border: 1.5px dashed var(--line); border-radius: var(--radius);
  background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s;
}
#drop:hover, #drop:focus-visible { border-color: var(--accent); background: var(--surface-2); outline: none; }
#drop.over { border-color: var(--accent); background: #1b2433; }
.drop-icon { font-size: 26px; }
.drop-title { font-weight: 600; }

#hint { margin: 12px 0 20px; }

/* задания */
.jobs { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.job {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px;
}
.job-head { display: flex; align-items: baseline; gap: 10px; justify-content: space-between; }
.job-name {
  font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.job-status { font-size: 12px; color: var(--muted); white-space: nowrap; }
.job-status.done { color: var(--ok); }
.job-status.error { color: var(--err); }

.bar { height: 3px; border-radius: 3px; background: var(--surface-2); margin-top: 10px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 40%; background: var(--accent); animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }

.job-text {
  margin: 12px 0 0; white-space: pre-wrap; word-break: break-word;
  background: var(--surface-2); border-radius: 10px; padding: 12px 14px; font-size: 15px;
  max-height: 320px; overflow: auto; -webkit-overflow-scrolling: touch;
}
.job-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.job-actions button {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line);
  padding: 7px 13px; font-size: 13px; font-weight: 500;
}
.job-actions button:hover { border-color: var(--accent); }
.job-err { color: var(--err); font-size: 13px; margin: 10px 0 0; }
