@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;600&display=swap');

/* ── Reset & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent:      #3b82f6;
  --accent-dark: #2563eb;
  --accent-light:#eff6ff;
  --bg:          #f5f4f0;
  --sidebar-bg:  #1e1e2e;
  --sidebar-txt: #cdd6f4;
  --sidebar-sub: #6c7086;
  --sidebar-hover: rgba(255,255,255,.07);
  --sidebar-active: rgba(59,130,246,.22);
  --card:        #ffffff;
  --border:      #e5e7eb;
  --text:        #1f2937;
  --text-muted:  #6b7280;
  --label:       #475569;   /* подписи полей: контраст 7.5:1 к белому */
  --bot-bubble:  #ffffff;
  --user-bubble: #3b82f6;
  --shadow:      0 1px 4px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --radius:      12px;
  --radius-sm:   8px;
  --font: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 15px;
}

/* ── Layout ────────────────────────────────────────────────────────────────── */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--sidebar-bg);
  color: var(--sidebar-txt);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform .25s ease;
}

.sidebar-header {
  padding: 20px 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  letter-spacing: .3px;
  line-height: 1.3;
}

.sidebar-emblem {
  width: 30px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  display: none;
}
.sidebar-emblem.visible { display: block; }

.sidebar-logo span {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--sidebar-sub);
  margin-top: 2px;
}

nav { flex: 1; padding: 10px 8px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  color: var(--sidebar-txt);
  transition: background .15s;
  user-select: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover   { background: var(--sidebar-hover); }
.nav-item.active  { background: var(--sidebar-active); color: #fff; font-weight: 500; }
.nav-item .icon   { opacity: .7; flex-shrink: 0; }
.nav-item.active .icon { opacity: 1; }

.sidebar-footer {
  padding: 12px 16px;
  font-size: 11px;
  color: var(--sidebar-sub);
  border-top: 1px solid rgba(255,255,255,.06);
}

/* ── Main ──────────────────────────────────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* ── Topbar ────────────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text);
  border-radius: 6px;
}
.menu-toggle:hover { background: var(--bg); }

.topbar-title {
  font-size: 20px;
  font-weight: 400;
  color: var(--text);
  font-family: 'Caveat', cursive;
  line-height: 1.2;
  flex: 1;
  text-align: center;
}

.topbar-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
  text-align: right;
  flex: 0 0 auto;
}

/* ── Content area ──────────────────────────────────────────────────────────── */
.content-area {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;          /* нужен flex-контекст для дочерних секций */
  flex-direction: column;
  min-height: 0;          /* разрешает flex-детям сжиматься ниже auto */
}

.content-section {
  flex: 1;                /* занимает всю высоту content-area */
  display: flex;
  flex-direction: column;
  min-height: 0;          /* критично: без этого inner-scroll не работает */
  overflow: hidden;
}
.content-section.hidden { display: none; }

/* ── Background decorations ────────────────────────────────────────────────── */
.bg-decor {
  position: absolute;
  top: 0; bottom: 0;
  width: 138px;          /* иконка 118 + поля; было 200 — 82px на сторону впустую */
  pointer-events: none;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* верх верхней иконки на одной линии с первым пунктом меню:
     45px = отступ первого .nav-item от верха .content-area (топбар 49px) */
  justify-content: space-between;
  padding: 45px 10px 20px;
  gap: 18px;
}

.bg-decor.left  { left: 0; }
.bg-decor.right { right: 0; }

.bg-decor svg {
  opacity: .13;
  filter: grayscale(60%);
  max-width: 130px;
  max-height: 100px;
  transition: opacity .3s;
}
.bg-decor img {
  width: 118px;
  max-height: 150px;
  height: auto;
  object-fit: contain;
  opacity: .25;
  filter: brightness(.90) drop-shadow(0 8px 18px rgba(15, 23, 42, .12));
}

/* ── Chat layout ───────────────────────────────────────────────────────────── */
#section-apply {
  position: relative;
}

.chat-outer {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin: 0 138px;   /* leave room for bg decors */
  min-width: 0;
  min-height: 0;     /* позволяет flex-детям сжиматься */
  z-index: 1;
  position: relative;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
  min-height: 0;     /* критично: flex-элемент должен уметь сжиматься */
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }

/* ── Message bubbles ───────────────────────────────────────────────────────── */
.msg-row {
  display: flex;
  max-width: 75%;
  animation: fadeUp .2s ease;
}
.msg-row.bot  { align-self: flex-start; }
.msg-row.user { align-self: flex-end; flex-direction: row-reverse; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.bubble {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.55;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  word-break: break-word;
}

.msg-row.bot  .bubble {
  background: var(--bot-bubble);
  color: var(--text);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
}

.msg-row.user .bubble {
  background: var(--user-bubble);
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* typing indicator */
.bubble.typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 16px;
}
.bubble.typing span {
  width: 7px; height: 7px;
  background: #9ca3af;
  border-radius: 50%;
  display: inline-block;
  animation: blink 1.2s infinite;
}
.bubble.typing span:nth-child(2) { animation-delay: .2s; }
.bubble.typing span:nth-child(3) { animation-delay: .4s; }

@keyframes blink {
  0%, 80%, 100% { opacity: .25; transform: scale(.9); }
  40%           { opacity: 1;   transform: scale(1); }
}

/* ── Chat choice buttons (fork) ────────────────────────────────────────────── */
.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 4px 0 2px;
}

.choice-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border: 1.5px solid var(--accent);
  border-radius: 20px;
  background: var(--card);
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
  font-family: var(--font);
}
.choice-btn:hover {
  background: var(--accent);
  color: #fff;
}

.choice-btn:disabled {
  border-color: #d1d5db;
  background: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}

.choice-btn:disabled:hover {
  background: #f3f4f6;
  color: #9ca3af;
}

/* ── Chat input zone ───────────────────────────────────────────────────────── */
.chat-input-wrap {
  padding: 12px 20px 20px;
  background: var(--bg);
  position: relative;
  flex-shrink: 0;    /* никогда не сжимается — всегда видим */
}

.input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-text-input {
  flex: 1;
  padding: 11px 16px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  font-size: 14px;
  font-family: var(--font);
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.chat-text-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

.send-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s, transform .1s;
}
.send-btn:hover  { background: var(--accent-dark); }
.send-btn:active { transform: scale(.93); }

.file-row { flex-direction: column; align-items: flex-start; }

.file-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 24px;
  border: 1.5px dashed var(--accent);
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.file-label:hover { background: #dbeafe; border-color: var(--accent-dark); }

.submit-row { justify-content: center; }

.submit-final-btn {
  padding: 12px 40px;
  border-radius: 24px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: .3px;
  transition: background .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 2px 10px rgba(59,130,246,.35);
}
.submit-final-btn:hover  { background: var(--accent-dark); box-shadow: 0 4px 16px rgba(59,130,246,.45); }
.submit-final-btn:active { transform: scale(.97); }

/* ── Static sections ───────────────────────────────────────────────────────── */
.static-section {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

/* News cards */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.news-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: box-shadow .15s, transform .15s;
}
.news-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.1); transform: translateY(-2px); }

.news-date { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.news-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; line-height: 1.35; }
.news-card p  { font-size: 13px; color: var(--text-muted); line-height: 1.55; }

.news-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 8px;
}
.badge-event    { background: #fef3c7; color: #92400e; }
.badge-result   { background: #dcfce7; color: #166534; }
.badge-announce { background: #eff6ff; color: #1d4ed8; }

/* Contacts table */
.contacts-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: 14px;
}
.contacts-table th {
  background: #f9fafb;
  padding: 11px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.contacts-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #f3f4f6;
  color: var(--text);
}
.contacts-table tr:last-child td { border-bottom: none; }
.contacts-table tr:hover td { background: #f9fafb; }

/* Admin card */
.admin-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: var(--shadow);
  max-width: 480px;
}
.admin-card h3 { font-size: 17px; font-weight: 600; margin-bottom: 16px; }
.admin-field   { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.admin-field .label { font-size: 12px; color: var(--text-muted); min-width: 80px; padding-top: 1px; }
.admin-field .value { font-size: 14px; font-weight: 500; }
.admin-field a { color: var(--accent); text-decoration: none; }
.admin-field a:hover { text-decoration: underline; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .bg-decor { width: 130px; }
  .bg-decor svg { max-width: 90px; max-height: 70px; }
  .bg-decor img { width: 76px; }
  .chat-outer { margin: 0 130px; }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }

  .menu-toggle { display: flex; width: 44px; height: 44px; align-items: center; justify-content: center; padding: 0; }
  .bg-decor { display: none; }
  .chat-outer { margin: 0; }
  .static-section { padding: 20px 16px; }
  .topbar-sub { display: none; }

}

/* ── Focus visible ──────────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Подсказка под заголовком секции ───────────────────────── */
.section-hint {
  color: var(--text-muted);
  font-size: .9rem;
  margin-bottom: 24px;
  line-height: 1.5;
}

.section-hint {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Утилита hidden (глобальная) ────────────────────────────────────────── */
.hidden { display: none !important; }

.result-link {
  color: var(--accent);
  text-decoration: underline;
  font-weight: 500;
  cursor: pointer;
}
.result-link:hover { color: var(--accent-dark); }

/* ── Wizard / Table-form prototype ──────────────────────────────────────── */
.wizard-section {
  /* Сужаем форму и резервируем по краям полосы под .bg-decor (как .chat-outer) */
  max-width: none;
  width: auto;
  margin: 0 138px;   /* место для боковых иконок */
}
@media (max-width: 1024px) {
  .wizard-section { margin: 0 130px; }
}
@media (max-width: 768px) {
  .wizard-section { margin: 0; }   /* .bg-decor уже скрыт на узких экранах */
}

.wz-proto-note {
  font-size: .82rem;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.wz-back {
  border: none;
  background: none;
  color: var(--accent-dark);
  font-size: .9rem;
  cursor: pointer;
  padding: 4px 0;
  margin-bottom: 8px;
}
.wz-back:hover { text-decoration: underline; }

/* Choice cards */
.wz-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.wz-choice-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  padding: 22px 20px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s, box-shadow .15s;
  font-family: var(--font);
}
.wz-choice-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,.1);
}
.wz-choice-icon  { font-size: 28px; }
.wz-choice-title { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.35; }
.wz-choice-sub   { font-size: 12px; color: var(--text-muted); }

/* Fieldsets */
.wz-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px 20px;
  background: var(--card);
  margin-bottom: 18px;
}
.wz-fieldset legend {
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 0 6px;
}

.wz-grid {
  display: grid;
  /* min() обязателен: иначе auto-fit в узком контейнере создаёт колонки 0px */
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 14px 16px;
  margin-top: 12px;
}

.wz-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--label);
}

.wz-opt { font-size: .72rem; font-weight: 400; color: var(--text-muted); }

/* Inline validation */
.wz-invalid,
.wz-table .wz-invalid {
  border-color: #dc2626 !important;
  background: #fef2f2 !important;
}
.wz-invalid:focus { box-shadow: 0 0 0 3px rgba(220,38,38,.15); }

.wz-err {
  display: block;
  color: #dc2626;
  font-size: .72rem;
  font-weight: 500;
  margin-top: 3px;
}
.wz-table .wz-err { font-size: .68rem; margin-top: 2px; }

.wz-error-summary {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  color: #991b1b;
  font-size: .85rem;
  line-height: 1.5;
  padding: 10px 14px;
  margin-bottom: 16px;
}

/* Preliminary check (demo) panel */
.wz-precheck-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 16px;
}

.wz-submit-panel {
  margin: 12px 0 14px;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  background: #eff6ff;
  color: #1e3a8a;
  font-size: .88rem;
  line-height: 1.45;
}

.wz-submit-panel a {
  color: #1d4ed8;
  font-weight: 600;
}

.wz-precheck-verdict {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.wz-precheck--ok     { color: #166534; }
.wz-precheck--no     { color: #991b1b; }
.wz-precheck--review { color: #92400e; }
.wz-precheck--warn   { color: #92400e; }
.wz-precheck--return { color: #1e40af; }

.wz-precheck-note {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
}

.wz-precheck-sub {
  font-size: .85rem;
  color: var(--text);
  margin-bottom: 8px;
}

.wz-precheck-reasons {
  margin: 0 0 8px;
  padding-left: 18px;
  font-size: .85rem;
  line-height: 1.55;
}
.wz-precheck-reasons li { margin-bottom: 3px; }

.wz-precheck-evidence {
  margin: 10px 0 12px;
  padding: 12px 14px;
  border: 1px solid #dbeafe;
  border-radius: var(--radius-sm);
  background: #eff6ff;
  color: #1e3a8a;
  font-size: .84rem;
  line-height: 1.55;
}

.wz-precheck-evidence-title {
  margin-bottom: 5px;
  font-weight: 700;
  color: #1e40af;
}

.wz-precheck-evidence span {
  font-weight: 700;
}

.wz-precheck-evidence details {
  margin-top: 8px;
}

.wz-precheck-evidence summary {
  cursor: pointer;
  font-weight: 600;
}

.wz-precheck-evidence pre {
  margin: 8px 0 0;
  max-height: 190px;
  overflow: auto;
  white-space: pre-wrap;
  font-size: .76rem;
  color: #172554;
}

.wz-precheck-report {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: .82rem;
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--text);
  max-height: 240px;
  overflow-y: auto;
}

.wz-precheck-error {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: var(--radius-sm);
  color: #78350f;
  font-size: .85rem;
  line-height: 1.5;
  padding: 10px 14px;
}

/* ── Единый статус решения (decision.decision / verdict) ───────────── */
.res-verdict--ok     { color: #166534; }
.res-verdict--no     { color: #991b1b; }
.res-verdict--review { color: #92400e; }
.res-verdict--warn   { color: #92400e; }

.res-decision-code,
.wz-precheck-code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .02em;
  padding: 2px 8px;
  border-radius: 6px;
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
  white-space: nowrap;
}
.wz-precheck-code { margin-left: 8px; vertical-align: middle; }

.wz-deadline-banner {
  margin: 8px 0 4px;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  line-height: 1.5;
  border: 1px solid #fcd34d;
  background: #fffbeb;
  color: #78350f;
}
.wz-deadline-banner[data-expired] {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #7f1d1d;
}
.wz-deadline-banner a { color: inherit; }

.wz-hint {
  margin-top: 12px;
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.wz-field-note {
  grid-column: 1 / -1;
  margin: -6px 0 0;
  font-size: .78rem;
  line-height: 1.45;
  color: var(--text-muted);
}

/* Подсказка о применяемых условиях дисциплины (над таблицей спортсменов) */
.wz-hints {
  margin: 16px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wz-hints.hidden { display: none; }
.wz-hints-title {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.wz-hint-card {
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  background: #fafafa;
  padding: 10px 14px;
}
.wz-hint-card--place        { border-left-color: #16a34a; background: #f0fdf4; }
.wz-hint-card--score        { border-left-color: #2563eb; background: #eff6ff; }
.wz-hint-card--time_percent { border-left-color: #d97706; background: #fffbeb; }
.wz-hint-card--victory_count { border-left-color: #ea580c; background: #fff7ed; }
.wz-hint-card--result_percent { border-left-color: #4f46e5; background: #eef2ff; }
.wz-hint-head {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.wz-hint-text {
  font-size: .82rem;
  color: var(--text);
  line-height: 1.5;
}
.wz-hint-thresholds {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.wz-hint-thresholds b { color: var(--text); font-weight: 600; }

.wz-grid input,
.wz-grid select {
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font);
  background: #fafafa;
  color: var(--text);
  transition: border-color .15s;
  width: 100%;
}
.wz-grid input:focus,
.wz-grid select:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}
.wz-grid select:disabled { opacity: .5; cursor: not-allowed; }
.wz-grid .wz-qualified-wrap {
  grid-column: 1 / -1;
}
.wz-qualified-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  font-size: .83rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.wz-qualified-title {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.wz-qualified-fields {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;   /* равная высота колонок → инпуты в один ряд */
  gap: 6px;
}
.wz-qualified-fields label {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;   /* подпись сверху, инпут прижат к низу и выровнен */
  gap: 4px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.15;
  text-transform: uppercase;
  min-width: 0;
  flex: 1 1 0;
  word-break: break-word;
  hyphens: auto;
}
/* hide number spinners on rank inputs — prevents "I" looking like "II" */
.wz-qualified-rank::-webkit-inner-spin-button,
.wz-qualified-rank::-webkit-outer-spin-button,
.cf-qualified-rank::-webkit-inner-spin-button,
.cf-qualified-rank::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.wz-qualified-rank,
.cf-qualified-rank {
  -moz-appearance: textfield;
}
/* compact, centred rank inputs */
.wz-qualified-fields input {
  height: 30px;
  padding: 0 4px;
  font-size: .82rem;
  text-align: center;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  color: var(--text);
}
/* на узких экранах — переносим разряды, чтобы не сплющивались в нечитаемые столбики */
@media (max-width: 600px) {
  .wz-qualified-fields { flex-wrap: wrap; }
  .wz-qualified-fields label { flex: 1 1 calc(33.333% - 6px); }
}
.wz-qualified-rank::placeholder,
.cf-qualified-rank::placeholder,
.wz-qualified-fields input::placeholder {
  color: var(--text-muted);
  font-style: italic;
  opacity: 1;
}
.wz-ekp-field { position: relative; }
.wz-grid .wz-ekp-search-field { grid-column: 1 / -1; }
.wz-grid .wz-comp-name-field { grid-column: 1 / -1; }

/* Label text + inline badge on the same row */
.wz-label-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  line-height: 1.3;
}

.wz-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  cursor: help;
}
.wz-info:hover::after,
.wz-info:focus::after {
  content: attr(aria-label);
  position: absolute;
  z-index: 25;
  top: 22px;
  left: 0;
  width: max-content;
  max-width: min(320px, calc(100vw - 32px));
  box-sizing: border-box;
  white-space: normal;
  padding: 8px 10px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  font-size: .76rem;
  font-weight: 400;
  line-height: 1.35;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .18);
}
.wz-ekp-dropdown {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 190px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .16);
}
.wz-ekp-option {
  width: 100%;
  display: block;
  padding: 9px 11px;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.wz-ekp-option:hover,
.wz-ekp-option:focus {
  outline: none;
  background: #eff6ff;
}
.wz-ekp-option b { display: block; font-size: .84rem; }
.wz-ekp-option span { display: block; margin-top: 2px; font-size: .73rem; color: var(--text-muted); line-height: 1.35; }
.wz-ekp-option .wz-ekp-sport {
  display: inline-block;
  width: auto;
  margin-top: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-weight: 700;
  text-transform: uppercase;
}

/* Athletes table */
.wz-table-scroll { overflow-x: auto; margin-top: 12px; }

.wz-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
  min-width: 960px;
}
.wz-table thead { display: none; }
.wz-table th {
  text-align: left;
  padding: 8px 8px;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.wz-table td {
  padding: 6px 0;
  border-bottom: 8px solid transparent;
  vertical-align: top;
}
.wz-athlete-grid {
  display: flex;
  gap: 10px;
  align-items: stretch;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
}
.wz-athlete-row-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wz-athlete-row1,
.wz-athlete-row2 {
  display: flex;
  gap: 10px 12px;
  align-items: end;
}
.wz-athlete-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--label);
}
/* Row 1 */
.wz-athlete-field--fio    { flex: 3; min-width: 160px; }
.wz-athlete-field--dob    { flex: 2; min-width: 110px; }
.wz-athlete-field--gender { flex: 0 0 56px; }
.wz-athlete-field--email  { flex: 2; min-width: 150px; }
.wz-athlete-field--phone  { flex: 1.6; min-width: 130px; }
.wz-athlete-field--org    { flex: 2; min-width: 120px; }
/* Row 2 */
.wz-athlete-field--rank   { flex: 1; min-width: 100px; }
.wz-athlete-field--result { flex: 1.5; min-width: 100px; }
.wz-athlete-field--unit   { flex: 1.5; min-width: 130px; }
.wz-athlete-field--winner { flex: 1.5; min-width: 100px; }
.wz-athlete-field--region { display: none; }
.wz-athlete-actions {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8px;
  flex-shrink: 0;
}
.wz-table .a-unit {
  min-width: 0;
  padding-right: 24px;
}
.wz-table input,
.wz-table select {
  width: 100%;
  height: 40px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: var(--font);
  background: #fafafa;
  color: var(--text);
}
.wz-table input:focus,
.wz-table select:focus { outline: none; border-color: var(--accent); background: #fff; }

.wz-table.wz-hide-place .wz-col-place,
.wz-table.wz-hide-result .wz-col-result,
.wz-table.wz-hide-result .wz-cell-result,
.wz-table.wz-hide-unit .wz-cell-unit,
.wz-table.wz-hide-winner .wz-cell-winner {
  display: none;
}
.wz-table.wz-hide-victory .wz-cell-victory { display: none; }

@media (max-width: 820px) {
  .wz-table { min-width: 0; }
  .wz-athlete-row1,
  .wz-athlete-row2 {
    flex-wrap: wrap;
  }
  .wz-athlete-field--fio  { flex: 1 1 100%; }
  .wz-athlete-field--rank { flex: 1 1 100%; }
}

@media (max-width: 600px) {
  .wz-athlete-grid {
    flex-direction: column;
  }
  .wz-athlete-actions {
    justify-content: flex-end;
    padding-top: 0;
  }
  .wz-athlete-row1 > .wz-athlete-field,
  .wz-athlete-row2 > .wz-athlete-field {
    flex: 1 1 100%;
    min-width: 0;
  }
  /* dob + gender рядом, остальное стопкой */
  .wz-athlete-field--dob    { flex: 1 1 calc(60% - 6px); }
  .wz-athlete-field--gender { flex: 0 0 auto; width: calc(40% - 6px); }
  .wz-athlete-field--result,
  .wz-athlete-field--winner { flex: 1 1 calc(50% - 6px); }
}

.wz-row-del {
  border: 1px solid #fca5a5;
  background: #fff1f2;
  color: #dc2626;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 5px 8px;
  border-radius: 6px;
  transition: background .15s, border-color .15s;
}
.wz-row-del:hover { background: #fee2e2; border-color: #f87171; color: #991b1b; }

.wz-add-row {
  margin-top: 12px;
  padding: 8px 16px;
  border: 1.5px dashed var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}
.wz-add-row:hover { background: #dbeafe; }

/* Document slots */
.wz-docs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 12px;
}
.wz-doc-slot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fafafa;
}
.wz-doc-label { font-size: .85rem; font-weight: 500; color: var(--text); }
.wz-doc-hint  { font-size: .74rem; color: var(--muted); line-height: 1.35; }
.wz-doc-row   { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wz-doc-file  { font-size: .82rem; flex: 1 1 auto; min-width: 0; }
.wz-judge-doc-cat { font-size: .82rem; padding: 3px 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; flex-shrink: 0; }
.wz-doc-name  { font-size: .78rem; color: var(--accent-dark); word-break: break-all; }

/* Actions */
.wz-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.wz-actions-left { justify-content: flex-start; margin-bottom: 16px; }

.wz-primary {
  padding: 11px 28px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.wz-primary:hover { background: var(--accent-dark); }
.wz-primary:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.wz-secondary {
  padding: 9px 20px;
  background: #fff;
  color: var(--accent-dark);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.wz-secondary:hover { background: var(--accent); color: #fff; }

.wz-json-details {
  margin-top: 14px;
}

.wz-json-details summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.wz-json {
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-size: .82rem;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

/* ── Chat inline report card ─────────────────────────────────────────────── */
.chat-report-card {
  margin-top: 2px;
  padding: 12px 14px;
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .85rem;
  line-height: 1.5;
}

.chat-report-verdict {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chat-report-reasons {
  margin: 0 0 8px;
  padding-left: 18px;
  color: var(--text);
  font-size: .83rem;
}
.chat-report-reasons li { margin-bottom: 2px; }

.chat-report-llm {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: .82rem;
  line-height: 1.6;
  white-space: pre-wrap;
  margin-bottom: 8px;
  max-height: 200px;
  overflow-y: auto;
  color: var(--text);
}

.chat-report-disclaimer {
  font-size: .75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.4;
}

/* ── Wizard: competition sub-groups ───────────────────────────────── */
.wz-subgroup {
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid #f0f4f8;
}
.wz-subgroup:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.wz-subgroup-title {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #94a3b8;
  margin-bottom: 10px;
}

/* ── Wizard: judging panel (CLAUDE-EVSK-002) ──────────────────────── */
.wz-judging-status-label {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #64748b;
}
.wz-judging-hint {
  font-size: .8rem;
  color: var(--text-muted);
  margin: 0 0 12px;
  line-height: 1.5;
}
.wz-judging-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.wz-judging-role {
  flex: 1 1 220px;
  min-width: 200px;
}
.wz-judging-role label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text);
}
.wz-judging-role select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .88rem;
  background: #fff;
}
.wz-judging-min {
  font-size: .72rem;
  color: var(--text-muted);
  font-weight: 400;
}
.wz-judging-cat-warn {
  margin-top: 4px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  font-size: .78rem;
  border: 1px solid #fca5a5;
  background: #fef2f2;
  color: #7f1d1d;
}
.wz-judging-source-note {
  margin-top: 10px;
  font-size: .75rem;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}

/* ── Wizard: судьи п.40–41 ────────────────────────────────────────── */
.wz-p40-vrds-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: .85rem;
  color: var(--text);
  cursor: pointer;
}
.wz-p40-vrds-label input[type="checkbox"] { width: 15px; height: 15px; flex-shrink: 0; }
.wz-p40-rule-hint--error { color: #b91c1c !important; font-weight: 600; }
.wz-p40-rule-hint--ok    { color: #15803d !important; }

/* ── Wizard: "available sports" link ──────────────────────────────── */
.wz-sports-link-row {
  text-align: right;
  margin-bottom: 12px;
}
.wz-sports-link {
  display: inline-block;
  font-size: .75rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  opacity: .8;
}
.wz-sports-link:hover { opacity: 1; text-decoration: underline; }

/* ── Wizard: inactive sport warning ──────────────────────────────── */
.wz-sport-inactive-note {
  font-size: .78rem;
  color: #dc2626;
  margin-top: 4px;
  display: none;
}
.wz-sport-inactive-note.visible { display: block; }

/* ── Wizard: documents as collapsible details ────────────────────── */
.wz-fieldset-details {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 18px;
  background: #fff;
}
.wz-fieldset-details summary {
  cursor: pointer;
  font-size: .92rem;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.wz-fieldset-details summary::-webkit-details-marker { display: none; }
.wz-fieldset-details summary::before {
  content: '›';
  font-size: 1.1rem;
  color: var(--accent);
  transition: transform .15s;
  display: inline-block;
  width: 14px;
}
.wz-fieldset-details[open] summary::before { transform: rotate(90deg); }
.wz-docs-skip {
  font-size: .72rem;
  font-weight: 400;
  color: #64748b;
  font-style: italic;
}
.wz-docs-body { margin-top: 14px; }
.wz-no-docs-note {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 440px;
  font-size: .8rem;
  color: #64748b;
  align-self: center;
  line-height: 1.35;
}
.wz-no-docs-note.hidden { display: none; }
.wz-no-docs-consent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  font-size: .8rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}
.wz-no-docs-consent input {
  width: 15px;
  height: 15px;
  margin: 0;
}

/* ── Wizard: personal-data consent (152-ФЗ) ─────────────────────────── */
.wz-pd-consent {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.wz-pd-consent-block summary {
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent-dark);
  cursor: pointer;
}
.wz-pd-consent-text {
  margin-top: 8px;
  padding: 10px 12px;
  max-height: 220px;
  overflow-y: auto;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .76rem;
  line-height: 1.4;
  color: #334155;
}
.wz-pd-consent-text p { margin: 0 0 8px; }
.wz-pd-consent-text p:last-child { margin-bottom: 0; }
.wz-pd-consent-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  font-size: .8rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}
.wz-pd-consent-checkbox input {
  width: 15px;
  height: 15px;
  margin: 0;
}
.wz-pd-consent-checkbox input:disabled + span {
  color: #94a3b8;
  cursor: not-allowed;
}
.wz-pd-consent-error {
  font-size: .8rem;
  font-weight: 600;
  color: var(--danger, #dc2626);
}
.wz-pd-consent-error.hidden { display: none; }

/* ── Wizard: emblem in section header ────────────────────────────── */
.wz-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.wz-section-emblem {
  width: 44px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
  display: none;
}
.wz-section-emblem.visible { display: block; }

/* ── Sports list section ─────────────────────────────────────────── */
.sports-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.sports-list-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sports-list-card::before { content: '🏅'; font-size: 1rem; }

/* ── Выравнивание полей в строке ─────────────────────────────────────────────
   Подписи бывают в одну и в две строки (длинное название, звёздочка, бейдж «i»).
   Без этого поле под двухстрочной подписью опускается ниже соседей и строка
   «разъезжается». margin-top:auto прижимает контрол к низу ячейки — верхние
   границы полей в строке совпадают независимо от высоты подписи.            */
.wz-grid label > input,
.wz-grid label > select,
.wz-athlete-field > input,
.wz-athlete-field > select {
  margin-top: auto;
}

/* Подсказка в заголовке блока документов */
.wz-summary-hint {
  font-weight: 400;
  color: var(--text-muted);
  font-size: .85em;
}

/* ── Страница «О системе» ────────────────────────────────────────────────── */
.about-section { max-width: 760px; }
.about-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
}
.about-emblem { width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0; }
.about-title { font-size: 24px; font-weight: 700; color: var(--text); line-height: 1.2; }
.about-lead { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
.about-p { font-size: 15px; line-height: 1.65; color: var(--text); margin-bottom: 18px; }
.about-h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 26px 0 12px;
}
.about-list { margin: 0 0 18px 20px; font-size: 15px; line-height: 1.65; color: var(--text); }
.about-list li { margin-bottom: 8px; }
.about-note {
  background: var(--accent-light);
  border: 1px solid #bfdbfe;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.6;
  color: #1e3a8a;
  margin: 22px 0;
}
.about-contact {
  margin-top: 28px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.about-contact-label { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.about-contact-email {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-dark);
  text-decoration: none;
}
.about-contact-email:hover { text-decoration: underline; }

/* ── Пометка обязательных полей ──────────────────────────────────────────── */
.wz-req { color: #dc2626; font-weight: 700; }
.wz-req-note {
  font-size: 13px;
  color: var(--text-muted);
  margin: -14px 0 20px;
  line-height: 1.5;
}

/* ── Подвал сайдбара: эмблема программы ──────────────────────────────────── */
.sidebar-prog {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--sidebar-txt);
}
.sidebar-prog:hover { background: var(--sidebar-hover); }
.sidebar-prog-em { width: 28px; height: 28px; flex-shrink: 0; border-radius: 8px; }
.sidebar-prog-text { min-width: 0; }
.sidebar-prog-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}
.sidebar-prog-sub {
  display: block;
  font-size: 10.5px;
  color: var(--sidebar-sub);
  margin-top: 2px;
}

/* ── Мобильные тач-цели ──────────────────────────────────────────────────────
   Блок намеренно в конце файла: правила .wz-grid input / .wz-table input
   объявлены ниже раннего @media(768px), поэтому там override проигрывал
   по порядку каскада при равной специфичности.
   16px — порог, ниже которого iOS Safari зумит страницу при фокусе.
   44px — минимальный тач-таргет.                                            */
@media (max-width: 768px) {
  .wz-grid input, .wz-grid select,
  .wz-table input, .wz-table select,
  .wz-qualified-fields input { font-size: 16px; height: 46px; }
  .wz-pd-consent-checkbox input[type=checkbox],
  .wz-no-docs-consent input[type=checkbox] { width: 22px; height: 22px; }
}
