:root {
  --bg: #1a1a2e;
  --card-bg: #16213e;
  --accent: #e94560;
  --accent2: #0f3460;
  --text: #eaeaea;
  --muted: #9a9ab0;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: 16px;
}
.card {
  width: 100%;
  max-width: 480px;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 32px 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
h1 { margin: 0 0 8px; font-size: 22px; text-align: center; }
h2 { font-size: 16px; margin: 16px 0 8px; }
.subtitle { color: var(--muted); text-align: center; margin: 0 0 24px; font-size: 14px; }
form { display: flex; flex-direction: column; gap: 12px; }
input[type=text] {
  background: var(--accent2);
  border: 1px solid #23345c;
  color: var(--text);
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 18px;
  text-align: center;
  letter-spacing: 2px;
  width: 100%;
}
input[type=text]:focus {
  outline: none;
  border-color: var(--accent);
}
/* Поле кода активации: моноширинный шрифт, чтобы 0/o и 1/l не путались,
   и увеличенный трекинг для читаемости 12 символов. */
.code-input {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 4px;
  text-transform: lowercase;
}
/* Без сброса letter-spacing подсказка растягивалась в нечитаемую «лесенку» —
   трекинг применяется и к placeholder. */
.code-input::placeholder {
  letter-spacing: normal;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--muted);
  opacity: 1;
  font-size: 15px;
}
button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
button:disabled { opacity: 0.6; cursor: default; }
button.secondary { background: transparent; border: 1px solid var(--muted); color: var(--muted); }
.btn-row { display: flex; gap: 12px; margin-top: 16px; }
.btn-row button { flex: 1; }
/* Ссылка, выглядящая как кнопка (возврат к вводу кода с терминального экрана). */
.btn {
  flex: 1;
  display: block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}
.error {
  margin-top: 16px;
  background: rgba(233,69,96,0.15);
  border: 1px solid var(--accent);
  color: #ffb3c0;
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
}
.error a { color: #fff; }
.hidden { display: none !important; }
/* Наличие на главной: число — серой строкой, пустой сток — красной плашкой над формой. */
.stock { color: var(--muted); text-align: center; margin: -8px 0 20px; font-size: 15px; }
.stock b { color: var(--text); }
.error.stock-out { margin: -8px 0 20px; text-align: center; }
.dropzone {
  border: 2px dashed #34345c;
  border-radius: 12px;
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.dropzone.drag { border-color: var(--accent); color: var(--text); }
.progress-bar {
  background: var(--accent2);
  border-radius: 8px;
  height: 10px;
  overflow: hidden;
  margin-top: 16px;
}
.progress-fill { background: var(--accent); height: 100%; width: 0%; transition: width 0.2s; }
#progressText { text-align: center; margin-top: 8px; font-size: 13px; color: var(--muted); }
#accountBox p { margin: 4px 0; font-size: 14px; }
.spinner {
  width: 40px; height: 40px;
  border: 4px solid var(--accent2);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 16px auto;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#statusText { text-align: center; color: var(--muted); }
#resultBox { margin-top: 16px; padding: 16px; border-radius: 10px; text-align: center; font-size: 15px; }
#resultBox.success { background: rgba(46,204,113,0.15); border: 1px solid #2ecc71; color: #a4f0c4; }
#resultBox.error { background: rgba(233,69,96,0.15); border: 1px solid var(--accent); color: #ffb3c0; }

/* Batch controls use the original site's card, colors, type and buttons. */
[hidden] { display: none !important; }
textarea, input[type=tel], input[type=password] {
  background: var(--accent2); border: 1px solid #23345c; color: var(--text);
  padding: 14px 16px; border-radius: 10px; font-size: 18px; text-align: center; width: 100%;
}
textarea:focus, input:focus { outline: none; border-color: var(--accent); }
textarea.code-input { resize: vertical; min-height: 82px; line-height: 1.5; letter-spacing: 4px; }
textarea.code-input::placeholder { font-size: 15px; letter-spacing: normal; }
.notice { margin-top: 16px; background: rgba(233,69,96,.15); border: 1px solid var(--accent); color: #ffb3c0; padding: 12px; border-radius: 10px; font-size: 14px; }
.reservation { color: var(--muted); font-size: 13px; text-align: center; margin: 0 0 20px; }
.reservation p { margin: 6px 0; }
.reservation strong { color: var(--text); }
.timer.urgent { color: #ffb3c0; }
.dropzone { display: block; }
.dropzone.disabled { opacity: .6; cursor: default; }
.dropzone p { margin: 0; }
.divider { text-align: center; color: var(--muted); margin: 16px 0; font-size: 14px; }
details summary { list-style: none; cursor: pointer; display: block; text-align: center; background: transparent; border: 1px solid var(--muted); color: var(--muted); padding: 14px 16px; border-radius: 10px; font-size: 16px; font-weight: 600; }
details summary::-webkit-details-marker { display: none; }
#phone-form { margin-top: 12px; }
#phone-label { font-size: 14px; }
.phone-input { display: flex; flex-direction: column; gap: 12px; }
.upload-state, #phone-hint, #empty, #accounts-note, #confirmation-note, #connection, .dialog-note { font-size: 13px; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
#upload-summary { color: var(--text); }
.count-badge { font-weight: normal; color: var(--muted); }
.table-wrap { margin: 12px 0; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
th { text-align: left; color: var(--muted); font-size: 12px; font-weight: normal; }
td, th { padding: 10px 4px; border-bottom: 1px solid #23345c; vertical-align: top; overflow-wrap: anywhere; }
th:first-child { width: 39%; } th:nth-child(2) { width: 19%; } th:last-child { width: 28px; }
.avatar { display: none; }
.account-name { font-weight: 600; }
.account-meta, .status-message { margin-top: 5px; font-size: 11px; line-height: 1.5; color: var(--muted); }
.status-pill { font-size: 12px; }
.status-pill.ready, .status-pill.succeeded { color: #a4f0c4; }
.status-pill.error, .status-pill.failed, .status-pill.manual_check { color: #ffb3c0; }
.remove { padding: 0; width: 24px; height: 26px; background: transparent; color: var(--muted); font-size: 22px; }
.account-actions button { width: 100%; }
.batch-bottom { margin-top: 12px; }
.batch-bottom button { width: 100%; }
#connection { text-align: center; margin: 14px 0 0; }
.progress-top { text-align: center; }
.progress-top h2 { margin-top: 0; }
.progress-top strong { font-size: 16px; }
progress { width: 100%; height: 10px; border: 0; border-radius: 8px; overflow: hidden; margin-top: 16px; background: var(--accent2); accent-color: var(--accent); }
progress::-webkit-progress-bar { background: var(--accent2); }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }
#progress-detail { text-align: center; color: var(--muted); font-size: 13px; }
dialog { background: var(--card-bg); color: var(--text); border: 1px solid #23345c; border-radius: 16px; padding: 24px; width: calc(100% - 32px); max-width: 440px; }
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog h2 { margin: 0; font-size: 18px; } dialog p { margin: 0; line-height: 1.5; }
.dialog-buttons { display: flex; gap: 12px; margin-top: 12px; } .dialog-buttons button { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
@media(max-width: 420px) {
  th:nth-child(2), td.region { display: none; }
  th:first-child { width: 46%; }
  .dialog-buttons { flex-direction: column; }
}
