/* Палитра сайта comandante-event.ru: белый, чёрный, фирменный красный, светлые блоки */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f8f4f4;
  --text: #111111;
  --text-2: #555555;
  --border: #e6dede;
  --accent: #aa0c0c;
  --accent-hover: #9a0b0b;
  --accent-soft: rgba(170, 12, 12, 0.06);
  --good: #1a7f37;
  --bad: #aa0c0c;
  --radius: 10px;
  --font: "Google Sans", "Noto Sans", "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--surface-2); color: var(--text); font: 16px/1.5 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
h1 { font-size: 1.9rem; line-height: 1.2; margin: 0 0 6px; }
h2 { font-size: 1.15rem; margin: 0 0 14px; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
main.wrap { flex: 1; padding-top: 28px; padding-bottom: 40px; }
main.wrap > * + * { margin-top: 16px; }
main.wrap > .page-head + * { margin-top: 0; }
.muted { color: var(--text-2); }
.small { font-size: 0.88rem; }
small { color: var(--text-2); font-weight: 400; font-size: 0.85rem; display: block; margin-top: 2px; }

.top { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--text); }
.brand b { font-size: 1.35rem; letter-spacing: 0.06em; }
.brand span { color: var(--accent); font-weight: 600; }
.brand b::after { content: ""; display: inline-block; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; margin-left: 8px; vertical-align: middle; }
.nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.nav a, .nav .link { padding: 8px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 500; }
.nav a:hover, .nav .link:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.link { background: none; border: 0; font: inherit; cursor: pointer; }

.foot { border-top: 1px solid var(--border); background: #fff; color: var(--text-2); font-size: 0.85rem; padding: 16px 0; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.narrow { max-width: 420px; margin: 40px auto; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.row > label { flex: 1 1 200px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { max-width: 760px; margin: 0; }

label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 0.95rem; }
label + label, label + .row, .row + label, .row + .row { margin-top: 14px; }
.w-sm { max-width: 280px; }
.w-md { max-width: 360px; }
input, textarea, select { font: inherit; font-weight: 400; color: var(--text); background: #fff; border: 1px solid #d6cccc; border-radius: 8px; padding: 10px 12px; width: 100%; }
textarea { resize: vertical; min-height: 80px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend { font-weight: 600; margin-bottom: 8px; }
details { margin-top: 16px; }
summary { cursor: pointer; font-weight: 600; color: var(--accent); }
details .row { margin-top: 12px; }

.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.choice { position: relative; border: 1px solid var(--border); border-radius: 8px; padding: 12px 12px 12px 40px; cursor: pointer; font-weight: 400; gap: 2px; margin: 0 !important; }
.choice input { position: absolute; left: 12px; top: 15px; width: auto; accent-color: var(--accent); }
.choice b { font-weight: 600; }
.choice span { color: var(--text-2); font-size: 0.88rem; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; margin: 6px 0 0 !important; }
.check input { width: auto; accent-color: var(--accent); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: 8px; padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--accent-hover); color: #fff; }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn.ghost { background: #fff; color: var(--text); border-color: #cfc4c4; }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.small { padding: 7px 12px; font-size: 0.9rem; }
.btn.big { padding: 14px 28px; font-size: 1.05rem; }
.actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.error { color: var(--bad); font-weight: 600; margin: 0; }
.choices + .error { margin-top: 8px; }

#a-progress { display: flex; gap: 16px; align-items: center; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

.article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
@media (max-width: 960px) { .article-grid { grid-template-columns: minmax(0, 1fr); } }
.text { max-width: 760px; }
.text h1 { font-size: 1.7rem; margin: 8px 0 14px; }
.text h2 { font-size: 1.25rem; margin: 26px 0 10px; }
.text p { margin: 0 0 12px; }
.text ul { margin: 0 0 12px; padding-left: 22px; }
.text .photo { color: var(--text-2); font-style: italic; background: var(--surface-2); border-left: 3px solid var(--accent); padding: 6px 10px; border-radius: 4px; }
#a-source { font: 14px/1.5 ui-monospace, Consolas, monospace; }

.score { font-size: 1.05rem; font-weight: 600; margin: 0 0 10px; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 6px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--text-2); font-weight: 600; }
.metrics td:nth-child(2), .metrics td:nth-child(3) { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.metrics tr.bad td:nth-child(3) { color: var(--bad); font-weight: 700; }
.metrics tr.ok td:nth-child(3) { color: var(--good); }
.metrics tr.ok td:nth-child(3)::before { content: "✓ "; }
.metrics tr.bad td:nth-child(3)::before { content: "✕ "; }
.list td a { font-weight: 600; text-decoration: none; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 0.8rem; font-weight: 600; background: var(--surface-2); }
.badge.done { color: var(--good); }
.badge.error { color: var(--bad); }
.badge.running, .badge.queued { color: var(--accent); }
.checks { list-style: none; padding: 0; margin: 8px 0 0; font-size: 0.9rem; }
.checks li { padding: 6px 0; border-top: 1px solid var(--border); }
.users { list-style: none; padding: 0; margin: 0 0 14px; }
.users li { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); }

@media (max-width: 600px) {
  h1 { font-size: 1.5rem; }
  .card { padding: 16px; }
  .brand b { font-size: 1.1rem; }
  .list th:nth-child(2), .list td:nth-child(2) { display: none; }
}

/* инструкция */
.help-link { font-weight: 600; color: var(--accent) !important; }
.doc { max-width: 860px; }
.doc .lead { font-size: 1.1rem; color: var(--text-2); margin: 0 0 20px; }
.doc section { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; margin-top: 16px; scroll-margin-top: 80px; }
.doc h2 { font-size: 1.3rem; margin: 0 0 12px; }
.doc p, .doc li, .doc dd { line-height: 1.65; }
.doc p { margin: 0 0 12px; }
.doc ul, .doc ol { margin: 0 0 12px; padding-left: 24px; }
.doc li + li { margin-top: 6px; }
.doc dl { margin: 0; }
.doc dt { font-weight: 700; margin-top: 14px; }
.doc dt:first-child { margin-top: 0; }
.doc dd { margin: 4px 0 0; }
.doc .toc { margin-bottom: 4px; }
.doc .toc ol { margin: 8px 0 0; columns: 2 280px; }
.doc .toc a { text-decoration: none; }
.doc .steps li { margin-top: 10px; }
.doc .note { background: var(--surface-2); border-left: 3px solid var(--accent); padding: 12px 14px; border-radius: 6px; }
.doc .fields td:first-child { font-weight: 600; width: 32%; }
.doc .fields td { padding: 10px 8px; line-height: 1.55; }
.photo-inline { color: var(--text-2); font-style: italic; background: var(--surface-2); padding: 1px 6px; border-radius: 4px; }
@media (max-width: 600px) { .doc section { padding: 16px; } .doc .fields td:first-child { width: auto; } .doc .fields, .doc .fields tbody, .doc .fields tr, .doc .fields td { display: block; } .doc .fields thead { display: none; } .doc .fields tr { border-bottom: 1px solid var(--border); padding: 6px 0; } .doc .fields td { border: 0; padding: 4px 0; } }
.nav a.btn, .nav a.btn:hover { color: #fff; background: var(--accent); }
.nav a.btn:hover { background: var(--accent-hover); }
