:root {
  --ok: #1e8e3e;
  --err: #d93025;
  --warn: #e8710a;
  --bg: #f5f6f8;
  --card: #ffffff;
  --border: #d7dbe0;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  margin: 0;
  color: #1a1a1a;
}

/* Общее левое меню (index.html/labels.html) - 2026-08-23, добавлено по
   просьбе владельца, чтобы между разделами можно было переключаться прямо
   в открытой странице, а не только заново запускать нужную кнопку в
   Telegram. Внутри одного Telegram WebView cookie-сессия (см. app.py
   require_auth) уже есть после первого захода по ?key=..., так что обычные
   <a href> между страницами работают без токена в каждой ссылке. */
.app-layout { display: flex; min-height: 100vh; }
.app-sidebar {
  flex: 0 0 180px;
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 16px 0;
}
.app-sidebar .brand { padding: 0 16px 12px; font-weight: bold; font-size: 1.05rem; }
.app-sidebar nav { display: flex; flex-direction: column; }
.app-sidebar a {
  padding: 10px 16px;
  text-decoration: none;
  color: #1a1a1a;
  border-left: 3px solid transparent;
}
.app-sidebar a:hover { background: #eef; }
.app-sidebar a.active { border-left-color: var(--ok); background: #eef7ee; font-weight: bold; }
.app-main { flex: 1; min-width: 0; padding: 0 16px 40px; }

@media (max-width: 640px) {
  .app-layout { flex-direction: column; }
  .app-sidebar { flex: 0 0 auto; border-right: none; border-bottom: 1px solid var(--border); padding: 8px 0; }
  .app-sidebar .brand { display: none; }
  .app-sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .app-sidebar a { border-left: none; border-bottom: 3px solid transparent; }
  .app-sidebar a.active { border-left-color: transparent; border-bottom-color: var(--ok); }
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
}

h1 { font-size: 1.4rem; margin: 0; }

.screen { max-width: 900px; margin: 0 auto; }
.hidden { display: none !important; }

button {
  font-size: 1rem;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
}
button.danger { border-color: var(--err); color: var(--err); }
button:hover { background: #eee; }

ul { list-style: none; padding: 0; margin: 8px 0; }
li {
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 6px;
  cursor: pointer;
}
li:hover { background: #eef; }

.hint { color: #666; }
.error { color: var(--err); font-weight: bold; }

#progress-bar-wrap {
  height: 20px;
  background: #e2e5e9;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 12px;
}
#progress-bar {
  height: 100%;
  width: 0%;
  background: var(--ok);
  transition: width 0.3s ease;
}

#progress-counts {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin: 10px 0 20px;
  font-size: 1rem;
}
#progress-counts span { padding: 4px 10px; border-radius: 6px; background: var(--card); border: 1px solid var(--border); }

#scan-input {
  width: 100%;
  font-size: 1.6rem;
  padding: 16px;
  border-radius: 10px;
  border: 2px solid var(--border);
  margin-bottom: 12px;
}
#scan-input:focus { outline: none; border-color: #4285f4; }

#feedback {
  font-size: 1.3rem;
  font-weight: bold;
  padding: 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  text-align: center;
  transition: background 0.15s ease;
}
.feedback-idle { background: var(--card); color: #555; }
.feedback-ok { background: #d8f5df; color: var(--ok); }
.feedback-warn { background: #fde5cc; color: var(--warn); }
.feedback-err { background: #fbdad7; color: var(--err); }

.columns { display: flex; gap: 24px; flex-wrap: wrap; }
.col { flex: 1; min-width: 280px; }

.col li { font-size: 0.9rem; }

#finish-files li { cursor: default; }
#finish-files a { text-decoration: none; font-weight: bold; }
