/* ═══════════════════════════════════════════════════════════════════
   VotePortal — Design System  |  Light & Professional
   Fonts: Sora (headings) + DM Sans (body)
   ═══════════════════════════════════════════════════════════════════ */

/* ── Variables ────────────────────────────────────────────────────── */
:root {
  /* Основной цвет — зелёный (emerald). Тёмный оттенок выбран так, чтобы ссылки и
     подписи проходили по контрасту на белом (≈4.9:1). */
  --brand:        #047857;
  --brand-dark:   #065F46;
  --brand-light:  #ECFDF5;
  /* Светлый акцент — для градиентов и текста на тёмном фоне */
  --brand-accent: #34D399;
  /* Синий остался как «информационный»: им помечается запланированное, чтобы оно
     не сливалось с зелёным «идёт сейчас» */
  --info:         #2563EB;
  --info-bg:      #EFF6FF;
  --success:      #059669;
  --success-bg:   #ECFDF5;
  --warning:      #D97706;
  --warning-bg:   #FFFBEB;
  --danger:       #DC2626;
  --danger-bg:    #FEF2F2;
  --white:  #FFFFFF;
  --g50:    #F9FAFB;
  --g100:   #F3F4F6;
  --g200:   #E5E7EB;
  --g300:   #D1D5DB;
  --g400:   #9CA3AF;
  --g500:   #6B7280;
  --g600:   #4B5563;
  --g700:   #374151;
  --g800:   #1F2937;
  --g900:   #111827;
  --font-h: 'Sora', sans-serif;
  --font-b: 'DM Sans', sans-serif;
  --r-sm:  6px;  --r-md: 10px;
  --r-lg: 16px;  --r-xl: 24px;  --r-full: 9999px;
  --sh-sm: 0 1px 3px rgba(0,0,0,.1),0 1px 2px rgba(0,0,0,.06);
  --sh-md: 0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -1px rgba(0,0,0,.06);
  --sh-lg: 0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -2px rgba(0,0,0,.05);
  --sh-xl: 0 20px 25px -5px rgba(0,0,0,.1),0 10px 10px -5px rgba(0,0,0,.04);
  --tf: 150ms ease; --tm: 250ms ease;
  --nav-h: 68px;  --max-w: 1200px;
}

/* ── Reset ────────────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-b); color: var(--g800); background: var(--white); line-height: 1.6; min-height: 100vh; }
img  { max-width: 100%; height: auto; display: block; }
a    { color: var(--brand); text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

h1:focus {
    outline: none;
}

/* ── Icons ────────────────────────────────────────────────────────── */
/* Плоские одноцветные: размер от font-size контейнера, цвет — от текста */
.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -.125em; flex-shrink: 0; }

/* ── Layout ───────────────────────────────────────────────────────── */
.app-shell    { display: flex; flex-direction: column; min-height: 100vh; }
.main-content { flex: 1; padding-top: var(--nav-h); }
.container { max-width: var(--max-w); margin: 0 auto; padding: 10px 24px 0 24px; }
.section      { padding: 64px 0; }
.section--tinted { background: var(--g50); }

/* ── Navbar ───────────────────────────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h); border-bottom: 1px solid transparent;
  transition: border-color var(--tm), box-shadow var(--tm);
}
/* Матовое стекло — на подложке, а не на самой шапке: backdrop-filter делает элемент контейнером
   для потомков с position: fixed, и мобильное меню (fixed, на весь экран) отсчитывалось бы от
   шапки — панель получалась высотой в одни отступы, пунктов не видно */
.navbar::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(255,255,255,.92);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.navbar.scrolled { border-color: var(--g200); box-shadow: var(--sh-sm); }
.nav-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 24px;
  height: 100%; display: flex; align-items: center; gap: 32px;
}
.nav-brand {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-h); font-size: 1.25rem; font-weight: 700;
  color: var(--g900); text-decoration: none; white-space: nowrap;
}
/* Знак портала — шестиугольник с галкой (Icon "hex"), как в favicon */
.brand-hex { color: var(--brand); font-size: 1.4rem; display: inline-flex; vertical-align: middle; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-link {
  padding: 8px 12px; border-radius: var(--r-sm); color: var(--g600);
  font-size: .875rem; font-weight: 500;
  transition: color var(--tf), background var(--tf); text-decoration: none;
}
.nav-link:hover, .nav-link.active { color: var(--brand); background: var(--brand-light); }
.nav-link.active { font-weight: 600; }
.nav-icon { font-size: 1rem; display: inline-flex; }
/* Меню пользователя — нативный <details>: открывается без JS и без интерактивного рендера */
.nav-user-menu { position: relative; margin-left: 16px; }
.nav-user-menu > summary { list-style: none; }
.nav-user-menu > summary::-webkit-details-marker { display: none; }
.nav-user-menu > summary::marker { content: ""; }
.nav-user-mobile { display: none; }
.logout-form { margin: 0; }
.nav-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: .8rem; font-weight: 700;
  border: none; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background var(--tf);
}
.nav-avatar:hover { background: var(--brand-dark); }
/* Аватар из IDPMR поверх инициалов: не загрузился — видно инициалы */
.nav-avatar { position: relative; overflow: hidden; }
.nav-avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: #fff; border: 1px solid var(--g200); border-radius: var(--r-lg);
  box-shadow: var(--sh-xl); padding: 8px; min-width: 200px;
  animation: dd-in var(--tf);
}
@keyframes dd-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.user-dropdown-name  { padding: 8px 12px; font-weight: 600; font-size: .875rem; }
.user-dropdown-email { padding: 0 12px 8px; font-size: .8rem; color: var(--g400); }
.dropdown-divider    { border: none; border-top: 1px solid var(--g100); margin: 4px 0; }
.dropdown-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 10px 12px; border: none;
  background: none; text-align: left; font-size: .875rem;
  color: var(--g700); text-decoration: none;
  border-radius: var(--r-sm); cursor: pointer; transition: background var(--tf);
}
.dropdown-item:hover { background: var(--g100); }
.dropdown-item--danger { color: var(--danger); }
.dropdown-item--danger:hover { background: var(--danger-bg); }

/* Мобильное меню: чекбокс + label вместо кнопки — открывается без JS */
.nav-toggle {
  position: absolute; width: 1px; height: 1px; opacity: 0;   /* не прячем в display:none — иначе не сфокусировать с клавиатуры */
  margin: 0; pointer-events: none;
}
.nav-burger {
  display: none; flex-direction: column; gap: 5px;
  width: 36px; height: 36px; padding: 8px;
  background: none; border: none; cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-burger span {
  display: block; width: 22px; height: 2px; background: var(--g700);
  border-radius: 2px; transition: transform var(--tm), opacity var(--tm);
}
.nav-toggle:focus-visible ~ .nav-burger { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--r-sm); }
.nav-toggle:checked ~ .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle:checked ~ .nav-burger span:nth-child(2) { opacity: 0; }
.nav-toggle:checked ~ .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Footer ───────────────────────────────────────────────────────── */
.footer { background: var(--g900); color: var(--g400); padding: 48px 0; margin-top: auto; }
.footer-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 32px; flex-wrap: wrap;
}
.footer-brand { font-family: var(--font-h); font-weight: 700; color: #fff; }
.footer-copy  { font-size: .875rem; }
.footer-nav   { margin-left: auto; display: flex; gap: 24px; }
.footer-nav a { color: var(--g400); font-size: .875rem; transition: color var(--tf); }
.footer-nav a:hover { color: #fff; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--r-md); border: none;
  font-family: var(--font-h); font-size: .875rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: all var(--tf); white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); transform: translateY(-1px); box-shadow: var(--sh-md); }
.btn-outline { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
.btn-outline:hover:not(:disabled) { background: var(--brand-light); }
.btn-ghost   { background: transparent; color: var(--g600); border: 1.5px solid var(--g200); }
.btn-ghost:hover:not(:disabled)   { background: var(--g100); color: var(--g800); }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled)  { background: #B91C1C; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #047857; }
.btn-lg   { padding: 13px 32px; font-size: 1rem; border-radius: var(--r-lg); }
.btn-sm   { padding: 6px 12px; font-size: .8125rem; border-radius: var(--r-sm); }
.btn-xs   { padding: 4px 8px; font-size: .75rem; border-radius: var(--r-sm); }
.btn-full { width: 100%; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }

/* ── Forms ────────────────────────────────────────────────────────── */
.form-group  { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.form-label  { font-size: .875rem; font-weight: 600; color: var(--g700); }
.form-label.required::after { content: ' *'; color: var(--danger); }
.form-hint   { font-size: .75rem; color: var(--g400); }
.form-link   { font-size: .8rem; font-weight: 500; }
.float-right { float: right; }
.form-control {
  padding: 10px 14px; border: 1.5px solid var(--g200); border-radius: var(--r-md);
  font-size: .9375rem; color: var(--g800); background: #fff;
  transition: border-color var(--tf), box-shadow var(--tf); width: 100%;
}
.form-control:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.form-control::placeholder { color: var(--g400); }
/* Незаполненное обязательное поле: красная рамка и подсказка под ним (FieldError) */
.form-control.is-invalid { border-color: var(--danger); background-color: #FEF2F2; }
.form-control.is-invalid:focus { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220,38,38,.15); }
.field-error { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: .8125rem; font-weight: 500;
               color: var(--danger); animation: fade-in .15s ease; }
.field-error .icon { flex-shrink: 0; }
.form-control--sm { font-size: .875rem; padding: 8px 12px; }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-select {
  padding: 10px 14px; border: 1.5px solid var(--g200); border-radius: var(--r-md);
  font-size: .9375rem; background: #fff; appearance: none;
  cursor: pointer; width: 100%; padding-right: 36px;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  transition: border-color var(--tf);
}
.form-select:focus { outline: none; border-color: var(--brand); }
.form-row     { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
/* Перенос — для узких экранов: без него кнопки уезжали за край телефона и страница ехала вбок */
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; padding-top: 24px; border-top: 1px solid var(--g100); margin-top: 24px; }
.input-wrapper { position: relative; }
.input-wrapper .form-control { padding-right: 44px; }
.input-toggle  { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 1rem; color: var(--g400); }
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: .875rem; color: var(--g600); margin-bottom: 20px; }
.checkbox-label input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
.radio-group { display: flex; flex-direction: column; gap: 12px; }
.radio-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px; border: 1.5px solid var(--g200); border-radius: var(--r-md);
  cursor: pointer; transition: all var(--tf);
}
.radio-item:hover, .radio-item.selected { border-color: var(--brand); background: var(--brand-light); }
.radio-item input  { margin-top: 2px; flex-shrink: 0; accent-color: var(--brand); }
.radio-item div    { display: flex; flex-direction: column; gap: 2px; }
.radio-item strong { font-size: .9375rem; }
.radio-item span   { font-size: .8125rem; color: var(--g500); }

/* Upload */
.upload-zone {
  position: relative; border: 2px dashed var(--g200); border-radius: var(--r-lg);
  min-height: 120px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden; transition: border-color var(--tf);
}
.upload-zone:hover { border-color: var(--brand); }
.upload-zone--has-img { border-style: solid; }
.upload-placeholder { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--g400); }
.upload-icon    { font-size: 1.75rem; color: var(--g400); line-height: 1; }
.upload-hint    { font-size: .75rem; }
.upload-preview { width: 100%; height: 160px; object-fit: cover; border-radius: var(--r-md); }
.upload-remove  {
  position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.5);
  color: #fff; border: none; border-radius: 50%;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: .8rem;
}
.upload-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-label { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* Option rows */
.option-row     { display: flex; align-items: flex-start; gap: 12px; padding: 16px; background: var(--g50); border-radius: var(--r-lg); margin-bottom: 12px; }
.option-order   { display: flex; flex-direction: column; align-items: center; gap: 2px; flex-shrink: 0; margin-top: 2px; }
.option-order > span { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; }

/* Порядок вариантов: ручка перетаскивания (SortableList) и сортировка по алфавиту */
.option-sort { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -8px 0 14px; font-size: .8125rem; color: var(--g500); }
.option-sort-hint { margin-right: 4px; }
.drag-handle { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: none; border-radius: var(--r-sm); background: none; color: var(--g400); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.drag-handle:hover { color: var(--g700); background: var(--g100); }
.drag-handle:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.sortable > [data-sort-item] { transition: transform .18s ease; }
.sortable.is-sorting { user-select: none; -webkit-user-select: none; }
.sortable.is-sorting .drag-handle { cursor: grabbing; }
.sortable > [data-sort-item].is-dragging { transition: none; position: relative; z-index: 2; box-shadow: 0 10px 28px rgba(15, 23, 42, .18); opacity: .97; }
.option-content { flex: 1; }
.option-remove  { background: none; border: none; color: var(--g400); font-size: 1rem; cursor: pointer; padding: 8px; margin-top: 2px; transition: color var(--tf); }
.option-remove:hover { color: var(--danger); }
.option-img-row { display: flex; align-items: center; gap: 8px; }
.option-img-thumb { width: 48px; height: 48px; border-radius: var(--r-sm); object-fit: cover; }

/* Form sections */
.form-section  { background: #fff; border: 1px solid var(--g200); border-radius: var(--r-xl); padding: 28px; margin-bottom: 20px; }
.form-section-title { font-family: var(--font-h); font-size: 1rem; font-weight: 700; color: var(--g800); margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.form-layout   { display: grid; grid-template-columns: 1fr 280px; gap: 32px; align-items: start; }
.form-sidebar  { position: sticky; top: calc(var(--nav-h) + 24px); }
.preview-card  { background: #fff; border: 1px solid var(--g200); border-radius: var(--r-xl); padding: 20px; }
.preview-card h4 { font-family: var(--font-h); font-size: .875rem; font-weight: 700; color: var(--g500); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }
.preview-title   { font-family: var(--font-h); font-weight: 700; font-size: 1.0625rem; color: var(--g900); margin-bottom: 8px; }
.preview-desc    { font-size: .8125rem; color: var(--g500); margin-bottom: 12px; }
.preview-meta    { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.preview-options { display: flex; flex-direction: column; gap: 6px; }
.preview-option  { font-size: .8125rem; color: var(--g600); }

/* ── Alerts ───────────────────────────────────────────────────────── */
.alert { padding: 14px 16px; border-radius: var(--r-md); font-size: .875rem; line-height: 1.5; margin-bottom: 16px; }
.alert-success { background: var(--success-bg); color: #065F46; border: 1px solid #A7F3D0; }
.alert-error   { background: var(--danger-bg);  color: #991B1B; border: 1px solid #FECACA; }
.alert-warning { background: var(--warning-bg); color: #92400E; border: 1px solid #FDE68A; }

/* Интерактивная часть упала — блок показывает сам Blazor */
#blazor-error-ui {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
  padding: 14px 48px 14px 24px; background: var(--warning-bg); color: #92400E;
  border-top: 1px solid #FDE68A; box-shadow: var(--sh-md); font-size: .9375rem;
}
#blazor-error-ui .reload { margin-left: 8px; font-weight: 600; color: inherit; }
#blazor-error-ui .dismiss { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); cursor: pointer; }

/* ── Badges ───────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--r-full); font-size: .75rem; font-weight: 600; white-space: nowrap; }
.badge-green  { background: var(--success-bg);  color: #065F46; }
.badge-blue   { background: var(--info-bg);     color: var(--info); }
.badge-purple { background: #F5F3FF; color: #7C3AED; }
.badge-orange { background: #FFF7ED; color: #C2410C; }
.badge-red    { background: var(--danger-bg);   color: #991B1B; }
.badge-gray   { background: var(--g100);        color: var(--g600); }
.badge-pending { background: var(--warning-bg); color: #92400E; }
.badge-group  { display: flex; gap: 4px; flex-wrap: wrap; }

/* Status badge */
.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: var(--r-full); font-size: .8125rem; font-weight: 600; }
.status-badge--sm  { padding: 2px 8px; font-size: .75rem; }
.status-active     { background: var(--success-bg);  color: var(--success); }
.status-scheduled  { background: var(--warning-bg);  color: var(--warning); }
.status-completed  { background: var(--info-bg);     color: var(--info); }
.status-terminated { background: var(--danger-bg);   color: var(--danger); }
.status-draft      { background: var(--g100);        color: var(--g500); }

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero {
  display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 80px;
  max-width: var(--max-w); margin: 0 auto; padding: 80px 24px; min-height: 88vh;
}
.hero-badge    { display: inline-block; padding: 6px 14px; border-radius: var(--r-full); background: var(--brand-light); color: var(--brand); font-size: .8125rem; font-weight: 600; letter-spacing: .02em; margin-bottom: 20px; }
.hero-title    { font-family: var(--font-h); font-size: clamp(2.5rem,5vw,3.75rem); font-weight: 800; line-height: 1.1; color: var(--g900); margin-bottom: 20px; }
.hero-accent   { font-style: normal; color: var(--brand); }
.hero-subtitle { font-size: 1.125rem; color: var(--g500); max-width: 480px; line-height: 1.7; margin-bottom: 32px; }
.hero-cta      { display: flex; gap: 12px; flex-wrap: wrap; }

/* Visual */
.hero-visual { display: flex; align-items: center; justify-content: center; position: relative; height: 420px; }
.vis-rings   { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.vis-ring    { position: absolute; border-radius: 50%; border: 1.5px solid; animation: ring-pulse 4s ease-in-out infinite; }
.r1 { width: 240px; height: 240px; border-color: rgba(37,99,235,.15); animation-delay: 0s; }
.r2 { width: 330px; height: 330px; border-color: rgba(37,99,235,.08); animation-delay: .8s; }
.r3 { width: 420px; height: 420px; border-color: rgba(37,99,235,.04); animation-delay: 1.6s; }
@keyframes ring-pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.04); opacity: .6; } }
.vis-center { font-size: 5rem; display: flex; color: var(--brand); z-index: 1; animation: float 6s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.vis-dots { position: absolute; inset: 0; }
.vd { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); opacity: .25; animation: dot-float 5s ease-in-out infinite; }
.vd0 { top:15%; left:20%; } .vd1 { top:25%; right:15%; animation-delay:.5s; }
.vd2 { top:60%; left:10%; animation-delay:1s; } .vd3 { top:70%; right:20%; animation-delay:1.5s; }
.vd4 { bottom:15%; left:30%; animation-delay:2s; opacity:.15; }
.vd5 { top:40%; left:5%; animation-delay:2.5s; opacity:.12; }
.vd6 { top:10%; right:30%; animation-delay:3s; opacity:.2; }
.vd7 { bottom:25%; right:5%; animation-delay:3.5s; opacity:.15; }
@keyframes dot-float { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-10px) scale(1.2); } }

/* Stats */
.stats-strip { background: var(--g900); }
.stats-grid  { display: flex; align-items: center; gap: 48px; padding: 40px 0; }
.stat     { text-align: center; }
.stat-num { display: block; font-family: var(--font-h); font-size: 2.25rem; font-weight: 800; color: #fff; }
.stat-lbl { font-size: .8125rem; color: var(--g400); }
.stat-sep { width: 1px; height: 40px; background: rgba(255,255,255,.12); flex-shrink: 0; }

/* Steps */
.steps-grid { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 16px; }
.step-card  { background: #fff; border: 1px solid var(--g200); border-radius: var(--r-xl); padding: 32px 24px; text-align: center; }
.step-num   { font-family: var(--font-h); font-size: 2.5rem; font-weight: 800; color: var(--g100); margin-bottom: 8px; }
.step-icon  { font-size: 2rem; margin-bottom: 12px; color: var(--brand); line-height: 1; }
.step-card h3 { font-family: var(--font-h); font-size: 1.0625rem; font-weight: 700; margin-bottom: 8px; }
.step-card p  { font-size: .875rem; color: var(--g500); line-height: 1.6; }
.step-arrow   { font-size: 1.5rem; color: var(--g300); }

/* Section heads */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 40px; }
.section-head h2 { font-family: var(--font-h); font-size: 1.75rem; font-weight: 700; color: var(--g900); }
.section-head.centered { flex-direction: column; text-align: center; gap: 8px; }
.section-head.centered p { color: var(--g500); font-size: 1.0625rem; }
.link-more { font-size: .875rem; font-weight: 600; color: var(--brand); }
.link-more:hover { text-decoration: underline; }

/* ── Poll Grid & Cards ────────────────────────────────────────────── */
.polls-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(300px,1fr)); gap: 24px; }

/* «Показать ещё» под длинным списком */
.list-more { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 28px; }
.list-more .text-muted { font-size: .875rem; }
.poll-card {
  display: flex; flex-direction: column; background: #fff;
  border: 1px solid var(--g200); border-radius: var(--r-xl);
  overflow: hidden; text-decoration: none; color: inherit;
  transition: transform var(--tm), box-shadow var(--tm), border-color var(--tm);
}
.poll-card:hover { transform: translateY(-4px); box-shadow: var(--sh-xl); border-color: transparent; }
.poll-card-img { height: 180px; background-size: cover; background-position: center; }
.poll-card-img--placeholder { display: flex; align-items: center; justify-content: center; font-size: 3rem; color: var(--g200); background: linear-gradient(135deg,var(--g50),var(--g100)); }
.poll-card-body { padding: 20px; display: flex; flex-direction: column; flex: 1; gap: 10px; }
.poll-card-top  { display: flex; align-items: center; justify-content: space-between; }
.poll-type-chip { font-size: .75rem; font-weight: 600; color: var(--g500); background: var(--g100); padding: 3px 8px; border-radius: var(--r-full); }
.poll-card-title { font-family: var(--font-h); font-size: 1.0625rem; font-weight: 700; color: var(--g900); line-height: 1.35; }
.poll-card-desc  { font-size: .875rem; color: var(--g500); line-height: 1.5; flex: 1; }
.poll-card-winner { font-size: .8125rem; font-weight: 600; padding: 8px 12px; border-radius: var(--r-sm); background: #FFFBEB; color: #92400E; }
.poll-card-winner--none { background: var(--g100); color: var(--g500); }
.poll-card-terminated { font-size: .8125rem; background: var(--danger-bg); color: var(--danger); padding: 8px 12px; border-radius: var(--r-sm); }
.poll-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--g100); margin-top: auto; }
.poll-card-meta  { font-size: .8125rem; color: var(--g400); }
.poll-card-arrow { color: var(--brand); font-weight: 600; }

/* ── Page Hero ────────────────────────────────────────────────────── */
.page-hero     { background: var(--g900); color: #fff; padding: 48px 0; }
.page-hero--sm { padding: 36px 0; }
.page-hero h1  { font-family: var(--font-h); font-size: 2rem; font-weight: 700; color: #fff; }
.page-hero p   { color: var(--g400); margin-top: 8px; }
.page-hero-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.back-link     { display: inline-block; color: var(--g400); font-size: .875rem; margin-bottom: 12px; }
.back-link:hover { color: #fff; }

/* ── Toolbar ──────────────────────────────────────────────────────── */
.list-toolbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.search-box   { position: relative; flex: 1; min-width: 200px; }
.search-icon  { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; display: flex; font-size: 1.05rem; color: var(--g400); }
.search-input { width: 100%; padding: 9px 14px 9px 36px; border: 1.5px solid var(--g200); border-radius: var(--r-md); font-size: .9rem; transition: border-color var(--tf); }
.search-input:focus { outline: none; border-color: var(--brand); }
.filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.filter-tab  { padding: 7px 14px; border-radius: var(--r-md); border: 1.5px solid var(--g200); font-size: .8125rem; font-weight: 500; background: #fff; color: var(--g600); cursor: pointer; transition: all var(--tf); }
.filter-tab:hover  { border-color: var(--brand); color: var(--brand); }
.filter-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Tabs */
.tab-bar     { display: flex; gap: 4px; margin-bottom: 28px; border-bottom: 2px solid var(--g100); flex-wrap: wrap; }
.tab-bar--sm { border-bottom: none; margin-bottom: 0; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: none; background: none; cursor: pointer; font-size: .875rem; font-weight: 500; color: var(--g500); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all var(--tf); white-space: nowrap; }
.tab:hover  { color: var(--brand); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.archive-tabs { display: flex; gap: 12px; margin-bottom: 40px; flex-wrap: wrap; }
.archive-tab  { display: inline-flex; align-items: center; gap: 8px; padding: 10px 24px; border: 1.5px solid var(--g200); border-radius: var(--r-lg); background: #fff; cursor: pointer; font-size: .9375rem; font-weight: 500; color: var(--g600); transition: all var(--tf); }
.archive-tab:hover  { border-color: var(--brand); color: var(--brand); }
.archive-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ── Poll Detail ──────────────────────────────────────────────────── */
.poll-detail-hero  { background: var(--g900); color: #fff; padding: 48px 0; }
.poll-detail-img   { height: 280px; background-size: cover; background-position: center; }
.poll-detail-meta  { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.poll-type-label, .poll-revote-label { font-size: .8125rem; color: var(--g400); }
.poll-detail-title { font-family: var(--font-h); font-size: clamp(1.5rem,3vw,2.25rem); font-weight: 700; color: #fff; margin-bottom: 16px; line-height: 1.2; }
.poll-detail-desc  { color: var(--g300); font-size: 1.0625rem; line-height: 1.7; margin-bottom: 16px; }
.poll-detail-info  { display: flex; gap: 20px; flex-wrap: wrap; font-size: .8125rem; color: var(--g400); }
.poll-detail-layout { display: grid; grid-template-columns: 1fr 300px; gap: 40px; align-items: start; }
.poll-main   { display: flex; flex-direction: column; gap: 24px; }
.poll-sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--nav-h) + 16px); }

/* Results */
.results-block, .vote-block, .action-block { background: #fff; border: 1px solid var(--g200); border-radius: var(--r-xl); padding: 28px; }
.block-title { font-family: var(--font-h); font-size: 1.25rem; font-weight: 700; margin-bottom: 20px; }
/* Вариант в результатах — карточкой, как при голосовании (.vote-option), чтобы его было так же видно */
.result-row { margin-bottom: 12px; padding: 14px 16px; border: 1.5px solid var(--g200); border-radius: var(--r-lg); background: #fff; }
.results-note { font-size: .8125rem; color: var(--g500); margin: -8px 0 16px; }
/* Прошедшие порог варианты выделяются фоном — режим «Список победителей» */
.result-row--winner { background: var(--warning-bg); border-color: #FDE68A; }
.result-row--winner .result-opt-text { color: var(--brand); font-weight: 700; }
.result-row--mine { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.result-row--compact { margin-bottom: 12px; padding: 0; border: 0; background: none; box-shadow: none; }
.result-opt-head { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.result-opt-img  { width: 72px; height: 72px; border-radius: var(--r-md); object-fit: cover; flex-shrink: 0; }
/* Текст с описанием — чтобы по результатам было видно, за что голосовал */
.result-opt-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.result-opt-text { font-size: .9375rem; font-weight: 500; color: var(--g900); }
.result-opt-desc { font-size: .8125rem; color: var(--g500); line-height: 1.4; }
.result-cnt      { font-size: .875rem; font-weight: 700; color: var(--g600); margin-left: auto; }
.result-bar-track { height: 8px; background: var(--g100); border-radius: var(--r-full); overflow: hidden; }
.result-bar-fill  { height: 100%; background: linear-gradient(90deg,var(--brand),var(--brand-accent)); border-radius: var(--r-full); transition: width .6s cubic-bezier(.4,0,.2,1); }
.result-pct { font-size: .8125rem; color: var(--g400); margin-top: 4px; }
/* Тайное: варианты того же размера, что в бюллетене (.vote-options--ballot) */
.results-block--ballot .result-row { padding: 18px 20px; border-width: 2px; }
.results-block--ballot .result-opt-head { gap: 18px; }
.results-block--ballot .result-opt-text { font-size: 1.25rem; font-weight: 600; line-height: 1.35; }
.results-block--ballot .result-opt-desc { font-size: .9375rem; }
.results-block--ballot .result-opt-img { width: 96px; height: 96px; }
.results-block--ballot .result-cnt { font-size: 1.125rem; }
.result-total { margin-top: 16px; font-size: .875rem; color: var(--g400); border-top: 1px solid var(--g100); padding-top: 12px; }
.winner-crown { font-size: 1rem; color: var(--warning); display: inline-flex; }
.my-badge { background: var(--brand); color: #fff; font-size: .7rem; font-weight: 600; padding: 2px 6px; border-radius: var(--r-full); }
.winners-summary { margin-top: 16px; padding: 12px 16px; background: #FFFBEB; border-radius: var(--r-md); font-size: .875rem; display: flex; gap: 8px; flex-wrap: wrap; }
.winners-label { font-weight: 700; }
.no-winner-notice { margin-top: 12px; font-size: .875rem; color: var(--g400); font-style: italic; }

/* Action block */
.action-block { text-align: center; }
.action-block--pending  { background: var(--warning-bg); border-color: #FDE68A; }
.action-block--rejected { background: var(--danger-bg);  border-color: #FECACA; }
.action-icon { font-size: 2.25rem; margin-bottom: 12px; color: var(--g400); line-height: 1; }
.action-block--pending .action-icon  { color: var(--warning); }
.action-block--rejected .action-icon { color: var(--danger); }
.action-block h3 { font-family: var(--font-h); font-size: 1.125rem; font-weight: 700; margin-bottom: 8px; }
.action-block p  { color: var(--g500); font-size: .9375rem; margin-bottom: 20px; }
.action-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Vote options */
.vote-hint { font-size: .875rem; color: var(--g500); margin-bottom: 16px; }
.vote-options { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.vote-option {
  display: flex; align-items: center; gap: 16px; padding: 14px 16px;
  border: 1.5px solid var(--g200); border-radius: var(--r-lg);
  background: #fff; cursor: pointer; text-align: left; transition: all var(--tf);
}
.vote-option:hover   { border-color: var(--brand); background: var(--brand-light); }
.vote-option.selected { border-color: var(--brand); background: var(--brand-light); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.vote-opt-img { width: 72px; height: 72px; border-radius: var(--r-md); object-fit: cover; flex-shrink: 0; }
.vote-opt-content { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.vote-opt-text { font-size: .9375rem; font-weight: 500; color: var(--g900); }
.vote-opt-desc { font-size: .8125rem; color: var(--g500); }
.vote-opt-check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--g300); display: flex; align-items: center; justify-content: center; font-size: .875rem; font-weight: 700; color: var(--brand); transition: all var(--tf); flex-shrink: 0; }
.vote-option.selected .vote-opt-check { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Бюллетень тайного голосования: выбор — главное на странице, крупнее всего остального */
.ballot-obtain-hint { max-width: 640px; margin-bottom: 14px; color: var(--g600); line-height: 1.5; }
.ballot-obtain-hint p { margin: 0 0 6px; }
.ballot-obtain-hint strong { color: var(--g900); font-size: 1.0625rem; }
.ballot-procedure { margin-bottom: 18px; }
.ballot-procedure h2 { font-family: var(--font-h); font-size: 1.375rem; font-weight: 700; color: var(--g900); margin: 0 0 8px; }
.ballot-procedure p { margin: 0; max-width: 720px; color: var(--g600); line-height: 1.55; }
.ballot-hint { font-family: inherit; font-size: 1rem; font-weight: 400; color: var(--g500); margin-bottom: 12px; }
.vote-options--ballot .vote-option { padding: 18px 20px; gap: 18px; border-width: 2px; }
.vote-options--ballot .vote-opt-text { font-size: 1.25rem; font-weight: 600; line-height: 1.35; }
.vote-options--ballot .vote-opt-desc { font-size: .9375rem; }
.vote-options--ballot .vote-opt-img { width: 96px; height: 96px; }
.vote-options--ballot .vote-opt-check { width: 30px; height: 30px; font-size: 1rem; }
.ballot-submit-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; font-size: .875rem; color: var(--g500); }
.ballot-submit-note .icon { flex-shrink: 0; margin-top: 2px; color: var(--brand); }

/* Бюллетень принят: голосование для человека окончено */
.ballot-done { text-align: center; padding: 8px 0 20px; }
.ballot-done-mark { width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 50%; display: flex; align-items: center;
                    justify-content: center; background: var(--brand-light); color: var(--brand); font-size: 2.25rem; }
.ballot-done h2 { font-family: var(--font-h); font-size: 1.5rem; font-weight: 700; color: var(--g900); margin-bottom: 8px; }
.ballot-done p  { font-size: 1rem; line-height: 1.55; color: var(--g500); max-width: 480px; margin: 0 auto; }
.ballot-done-action { margin-top: 14px; }

/* Sidebar */
.sidebar-card { background: #fff; border: 1px solid var(--g200); border-radius: var(--r-lg); padding: 20px; }
.sidebar-card--countdown { background: var(--g900); border-color: transparent; }
.sidebar-card h4 { font-family: var(--font-h); font-size: .875rem; font-weight: 700; color: var(--g500); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }
.sidebar-card--countdown h4 { color: var(--g400); }
.sidebar-stat { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--g100); font-size: .875rem; }
.sidebar-stat:last-child { border-bottom: none; }
.sidebar-stat span   { color: var(--g500); }
.sidebar-stat strong { font-weight: 600; color: var(--g800); }
.sidebar-back { display: block; text-align: center; font-size: .875rem; color: var(--g500); padding: 12px; }
.sidebar-back:hover { color: var(--brand); }

/* Countdown */
.countdown { display: flex; align-items: center; gap: 8px; justify-content: center; }
.countdown-unit { text-align: center; }
.countdown-num  { display: block; font-family: var(--font-h); font-size: 1.75rem; font-weight: 800; color: #fff; }
.countdown-lbl  { font-size: .7rem; color: var(--g400); text-transform: uppercase; }
.countdown-sep  { font-size: 1.5rem; font-weight: 300; color: var(--g500); margin-bottom: 16px; }
.countdown-ended { font-size: .9rem; color: var(--g400); text-align: center; }

/* ── Auth ─────────────────────────────────────────────────────────── */
.auth-page { min-height: calc(100vh - var(--nav-h)); display: flex; align-items: center; justify-content: center; padding: 40px 16px; background: var(--g50); }
.auth-card { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--g200); border-radius: var(--r-xl); padding: 40px; box-shadow: var(--sh-lg); }
.auth-card--centered { text-align: center; }
.auth-brand    { display: flex; align-items: center; gap: 8px; font-family: var(--font-h); font-size: 1.25rem; font-weight: 700; color: var(--g900); margin-bottom: 28px; }
.auth-title    { font-family: var(--font-h); font-size: 1.5rem; font-weight: 700; color: var(--g900); margin-bottom: 8px; }
.auth-subtitle { color: var(--g500); font-size: .9375rem; margin-bottom: 28px; }
.auth-footer   { text-align: center; font-size: .875rem; color: var(--g500); margin-top: 24px; }
.auth-footer a { font-weight: 600; }
.auth-hint     { text-align: center; font-size: .8125rem; color: var(--g500); line-height: 1.5; margin-top: 16px; }
.auth-card code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .8125rem; background: var(--g100); border-radius: var(--r-sm); padding: 1px 5px; }
.result-icon   { font-size: 3.5rem; margin-bottom: 16px; }
.result-icon--success { color: var(--success); }
.result-icon--error   { color: var(--danger); }
.result-icon--brand   { color: var(--brand); }
.link-btn { background: none; border: none; color: var(--brand); cursor: pointer; font-size: inherit; padding: 0; font-weight: 500; }
.link-btn:hover { text-decoration: underline; }

/* Password strength */
.pwd-strength { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.pwd-bars     { display: flex; gap: 4px; }
.pwd-bar      { width: 32px; height: 4px; border-radius: 2px; background: var(--g200); transition: background var(--tf); }
.pwd-bar--weak   { background: var(--danger); }
.pwd-bar--fair   { background: var(--warning); }
.pwd-bar--good   { background: #FBBF24; }
.pwd-bar--strong { background: var(--success); }
.pwd-label         { font-size: .75rem; font-weight: 600; }
.pwd-label--weak   { color: var(--danger); }
.pwd-label--fair   { color: var(--warning); }
.pwd-label--good   { color: #D97706; }
.pwd-label--strong { color: var(--success); }

/* ── Operator / Admin ─────────────────────────────────────────────── */
.op-stats { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 16px; }
.op-stat-card { background: #fff; border: 1px solid var(--g200); border-radius: var(--r-lg); padding: 20px; text-align: center; }
.op-stat-card--yellow { border-top: 3px solid var(--warning); }
.op-stat-card--green  { border-top: 3px solid var(--success); }
.op-stat-card--red    { border-top: 3px solid var(--danger); }
.op-stat-card--blue   { border-top: 3px solid var(--brand); }
.op-stat-num { display: block; font-family: var(--font-h); font-size: 2rem; font-weight: 800; color: var(--g900); }
.op-stat-lbl { font-size: .8125rem; color: var(--g500); }

.op-table-wrap, .admin-table-wrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--g200); }
.op-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.op-table thead th { background: var(--g50); padding: 12px 16px; text-align: left; font-weight: 600; color: var(--g500); font-size: .8125rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--g200); white-space: nowrap; }
.op-table tbody td { padding: 14px 16px; border-bottom: 1px solid var(--g100); vertical-align: middle; }
.op-table tbody tr:last-child td { border-bottom: none; }
.op-table tbody tr:hover td { background: var(--g50); }
.op-table tbody tr.row--admin td { background: #FFFBEB; }
.table-link { font-weight: 600; color: var(--g900); }
.table-link:hover { color: var(--brand); }
.table-num { font-weight: 700; } .table-sub { color: var(--g400); }
.table-actions { display: flex; gap: 8px; align-items: center; }
.text-muted { color: var(--g400); }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-avatar-sm { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; font-size: .75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.op-detail-layout  { display: grid; grid-template-columns: 1fr 320px; gap: 32px; align-items: start; }
.op-detail-main    { display: flex; flex-direction: column; gap: 24px; }
.op-detail-sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--nav-h) + 16px); }

.card { background: #fff; border: 1px solid var(--g200); border-radius: var(--r-xl); overflow: hidden; }
.card-head { padding: 20px 24px; border-bottom: 1px solid var(--g100); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head h3 { font-family: var(--font-h); font-size: 1.0625rem; font-weight: 700; color: var(--g900); }
.card-body { padding: 20px 24px; }

.perm-list { display: flex; flex-direction: column; gap: 12px; }
.perm-row  { display: flex; align-items: center; gap: 14px; padding: 12px; background: var(--g50); border-radius: var(--r-lg); }
.perm-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg,var(--brand),var(--brand-accent)); color: #fff; font-size: .875rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.perm-info   { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.perm-name   { font-weight: 600; font-size: .9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.perm-email  { font-size: .8rem; color: var(--g400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.perm-date   { font-size: .75rem; color: var(--g400); }
.perm-actions { display: flex; gap: 6px; flex-shrink: 0; }

.info-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--g100); font-size: .875rem; }
.info-row:last-child { border-bottom: none; }
.info-row span   { color: var(--g500); }
.info-row strong { font-weight: 600; }

/* My votes */
.my-vote-card { background: #fff; border: 1px solid var(--g200); border-radius: var(--r-xl); padding: 20px 24px; margin-bottom: 16px; }
.my-vote-card--pending { border-left: 4px solid var(--warning); }
.my-vote-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.my-vote-title { font-family: var(--font-h); font-size: 1.0625rem; font-weight: 700; color: var(--g900); display: block; margin-bottom: 6px; }
.my-vote-title:hover { color: var(--brand); }
.my-vote-meta  { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: .8125rem; color: var(--g400); }
.my-vote-choices { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.my-vote-label   { font-size: .8125rem; font-weight: 600; color: var(--g500); }
.my-vote-note    { flex: 1 1 260px; font-size: .8125rem; color: var(--g600); }
.my-choice-badge { background: var(--brand-light); color: var(--brand); font-size: .8125rem; font-weight: 600; padding: 4px 10px; border-radius: var(--r-full); }

/* Modal */
.modal-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade-in .15s ease; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal { background: #fff; border-radius: var(--r-xl); width: 100%; max-width: 480px; box-shadow: var(--sh-xl); animation: slide-up .2s ease; overflow: hidden; }
@keyframes slide-up { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Окно потери связи (ReconnectModal.razor) ─────────────────────────
   Классы состояния ставит blazor.web.js на сам <dialog>; видно только то, что им соответствует */
/* margin: auto — центр экрана: общий сброс отступов снимает его и у <dialog> */
.reconnect { margin: auto; border: none; padding: 0; background: transparent; max-width: calc(100vw - 32px); overflow: visible; }
.reconnect:focus, .reconnect:focus-visible { outline: none; }
.reconnect .btn:focus-visible { outline: 3px solid var(--brand-accent); outline-offset: 2px; }
.reconnect::backdrop { background: rgba(17,24,39,.45); backdrop-filter: blur(3px); animation: fade-in .2s ease; }
.reconnect[open] { animation: slide-up .25s ease; }
.reconnect-card { width: 400px; max-width: 100%; box-sizing: border-box; padding: 36px 32px 32px; text-align: center;
                  background: #fff; border-radius: var(--r-xl); box-shadow: var(--sh-xl); }
.reconnect-card h2 { font-family: var(--font-h); font-size: 1.25rem; font-weight: 700; color: var(--g800); margin: 0 0 8px; }
.reconnect-card p  { color: var(--g500); font-size: .9375rem; line-height: 1.55; margin: 0; }
.reconnect-card p strong { color: var(--g800); font-variant-numeric: tabular-nums; }

/* Знак портала в кольце: кольцо крутится, пока идут попытки; при неудаче — значок тревоги */
.reconnect-visual { position: relative; width: 76px; height: 76px; margin: 0 auto 20px; }
.reconnect-ring { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--brand-light);
                  border-top-color: var(--brand); animation: spin 1s linear infinite; }
.reconnect-mark { position: absolute; inset: 9px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
                  background: var(--brand-light); color: var(--brand); font-size: 1.9rem; }
.reconnect-mark--off { display: none; background: #FEF2F2; color: var(--danger); }

.reconnect-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }

.reconnect-state { display: none; }
.reconnect.components-reconnect-show .reconnect-state--first,
.reconnect.components-reconnect-retrying .reconnect-state--retrying,
.reconnect.components-reconnect-failed .reconnect-state--failed,
.reconnect.components-reconnect-paused .reconnect-state--paused,
.reconnect.components-reconnect-resume-failed .reconnect-state--resume-failed { display: block; }
/* Повторные попытки идут вместе с классом show — тогда первое сообщение прячем */
.reconnect.components-reconnect-retrying .reconnect-state--first,
.reconnect.components-reconnect-failed .reconnect-state--first,
.reconnect.components-reconnect-paused .reconnect-state--first { display: none; }

/* Попыток больше нет — кольцо останавливается */
.reconnect.components-reconnect-failed .reconnect-ring,
.reconnect.components-reconnect-paused .reconnect-ring,
.reconnect.components-reconnect-resume-failed .reconnect-ring { animation: none; border-color: var(--g100); }
.reconnect.components-reconnect-failed .reconnect-mark,
.reconnect.components-reconnect-resume-failed .reconnect-mark { display: none; }
.reconnect.components-reconnect-failed .reconnect-mark--off,
.reconnect.components-reconnect-resume-failed .reconnect-mark--off { display: flex; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--g100); }
.modal-head h3 { font-family: var(--font-h); font-size: 1.125rem; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 1.1rem; color: var(--g400); cursor: pointer; padding: 4px; border-radius: var(--r-sm); transition: color var(--tf); }
.modal-close:hover { color: var(--g800); }
.modal-body { padding: 24px; }
.modal-body p { color: var(--g600); margin-bottom: 16px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--g100); display: flex; gap: 12px; justify-content: flex-end; }

/* ── Диалог подтверждения (ConfirmDialog — общий с приложением) ───────── */
.confirm-overlay { position: fixed; inset: 0; z-index: 300; background: rgba(17,24,39,.5); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade-in .15s ease; }
.confirm-card { background: #fff; border-radius: var(--r-xl); width: 100%; max-width: 440px; box-shadow: var(--sh-xl); padding: 28px 28px 22px; text-align: center; animation: slide-up .2s ease; }
.confirm-mark { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--brand-light); color: var(--brand); font-size: 1.6rem; }
.confirm-mark--danger { background: var(--danger-bg, #FEF2F2); color: var(--danger, #DC2626); }
.confirm-title { font-family: var(--font-h); font-size: 1.1875rem; font-weight: 700; color: var(--g800); margin: 0 0 10px; }
.confirm-body { color: var(--g600); font-size: .9375rem; line-height: 1.55; }
.confirm-body p { margin: 0 0 10px; }
.confirm-body p:last-child { margin-bottom: 0; }
.confirm-body strong { color: var(--g800); }
.confirm-actions { display: flex; gap: 12px; justify-content: center; margin-top: 22px; }
.confirm-actions .btn { min-width: 130px; justify-content: center; }
.confirm-choices { margin: 0 0 12px; padding: 10px 14px; list-style: none; background: var(--brand-light); border-radius: 10px; text-align: left; }
.confirm-choices li { padding: 3px 0; font-weight: 600; color: var(--g900); }
.confirm-choices li::before { content: '✓ '; color: var(--brand); }

/* ── «Открыть в приложении» на странице голосования (только с телефона) ── */
.open-in-app { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 16px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--brand-light); color: var(--g800); position: relative; }
.open-in-app > svg, .open-in-app > .icon { width: 22px; height: 22px; color: var(--brand); flex-shrink: 0; }
.open-in-app-text { flex: 1 1 200px; font-size: .9rem; line-height: 1.4; padding-right: 22px; }
.open-in-app-get { font-size: .875rem; color: var(--brand); }
.open-in-app-close { position: absolute; top: 4px; right: 6px; border: 0; background: none; font-size: 1.25rem; line-height: 1; color: var(--g500); cursor: pointer; padding: 4px; }

/* ── Доступ оператора ─────────────────────────────────────────────── */
.card-plain {
  background: #fff; border: 1px solid var(--g200); border-radius: var(--r-xl);
  padding: 28px; text-align: center;
}
.operator-offer { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.operator-offer .card-plain { text-align: left; }
.check-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.check-list li { position: relative; padding-left: 26px; color: var(--g600); font-size: .9375rem; line-height: 1.5; }
.check-list li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: var(--success); font-weight: 700;
}
.operator-price {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--g50); border-radius: var(--r-lg); padding: 16px; margin-bottom: 20px;
}
.operator-price-num { font-family: var(--font-h); font-size: 1.5rem; font-weight: 800; color: var(--g900); }
@media (max-width: 768px) {
  .operator-offer { grid-template-columns: 1fr; }
}

/* ── Empty / Error ────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 64px 24px; }
.empty-state--sm { padding: 32px 16px; }
.empty-icon  { font-size: 2.75rem; margin-bottom: 16px; color: var(--g300); line-height: 1; }
.empty-state h3 { font-family: var(--font-h); font-size: 1.25rem; font-weight: 700; color: var(--g700); margin-bottom: 8px; }
.empty-state p  { color: var(--g500); font-size: .9375rem; margin-bottom: 24px; }
.error-page  { text-align: center; padding: 80px 24px; }
.error-code  { font-family: var(--font-h); font-size: 6rem; font-weight: 900; color: var(--g100); line-height: 1; margin-bottom: 8px; }
.error-page h1 { font-family: var(--font-h); font-size: 1.5rem; font-weight: 700; color: var(--g800); margin-bottom: 12px; }
.error-page p  { color: var(--g500); margin-bottom: 28px; }
.error-icon    { font-size: 2.75rem; margin-bottom: 12px; color: var(--g300); line-height: 1; }
.access-denied { text-align: center; padding: 80px 24px; }

/* Страница ошибок (404, 403 и прочие): крупный код, на нём значок в круге бренда */
.status-page   { max-width: 560px; margin: 0 auto; text-align: center; padding: 72px 0 88px; }
.status-visual { position: relative; display: inline-block; margin-bottom: 28px; }
.status-code   { display: block; font-family: var(--font-h); font-size: clamp(5rem, 22vw, 8.5rem); font-weight: 900;
                 line-height: 1; letter-spacing: -.04em; color: var(--g100); user-select: none; }
.status-mark   { position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%);
                 width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
                 background: var(--brand); color: #fff; font-size: 1.9rem;
                 box-shadow: 0 0 0 6px var(--bg, #fff), 0 10px 24px rgba(0,0,0,.12); }
.status-page h1 { font-family: var(--font-h); font-size: 1.625rem; font-weight: 800; color: var(--g800); margin-bottom: 12px; }
.status-text   { color: var(--g500); font-size: 1rem; line-height: 1.6; margin: 0 auto 20px; max-width: 460px; }
.status-path   { margin: 0 auto 28px; max-width: 100%; }
.status-path code { display: inline-block; max-width: 100%; overflow-wrap: anywhere; padding: 4px 10px; border-radius: 8px;
                    background: var(--g50); color: var(--g600); font-size: .8125rem; }
.status-page .action-btns { margin-top: 8px; }
.page-loading  { display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.not-found     { text-align: center; padding: 80px 24px; }
.not-found h1  { font-family: var(--font-h); font-size: 4rem; font-weight: 900; color: var(--g200); }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--g200); border-top-color: var(--brand); animation: spin .7s linear infinite; }
.loader-center { display: flex; align-items: center; justify-content: center; padding: 80px 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .poll-detail-layout, .op-detail-layout { grid-template-columns: 1fr; }
  .poll-sidebar, .op-detail-sidebar { position: static; }
  .form-layout { grid-template-columns: 1fr; }
  .form-sidebar { position: static; }
}
@media (max-width: 768px) {
  .nav-links {
    position: fixed; top: var(--nav-h); left: 0; right: 0; bottom: 0;
    background: #fff; flex-direction: column; align-items: stretch;
    padding: 24px 16px; gap: 4px; z-index: 95;
    transform: translateX(100%); transition: transform var(--tm); overflow-y: auto;
  }
  .nav-toggle:checked ~ .nav-links { transform: translateX(0); }
  .nav-link { padding: 14px 16px; font-size: 1rem; border-radius: var(--r-md); }
  /* На телефоне меню и так на весь экран — выпадашка не нужна, выход показан строкой */
  .nav-user-menu { display: none; }
  .nav-user-mobile {
    display: block; margin-top: 16px; padding-top: 16px;
    border-top: 1px solid var(--g100);
  }
  .nav-user-mobile .dropdown-item { padding: 14px 16px; font-size: 1rem; }
  .nav-burger { display: flex; margin-left: auto; }
  .hero { grid-template-columns: 1fr; min-height: auto; padding: 48px 16px; gap: 40px; }
  .hero-visual { height: 240px; }
  .r1 { width: 160px; height: 160px; } .r2 { width: 220px; height: 220px; } .r3 { width: 280px; height: 280px; }
  .vis-center { font-size: 3.5rem; }
  .steps-grid { grid-template-columns: 1fr; gap: 24px; }
  .step-arrow { display: none; }
  .stats-grid { gap: 24px; }
  .stat-num   { font-size: 1.75rem; }
  .polls-grid { grid-template-columns: 1fr; }
  .form-row   { grid-template-columns: 1fr; }
  .auth-card  { padding: 28px 20px; }
  .op-stats   { grid-template-columns: 1fr 1fr; }
  .footer-inner { flex-direction: column; gap: 16px; text-align: center; }
  .footer-nav   { margin-left: 0; }
  .modal-foot { flex-wrap: wrap; }
  .poll-detail-info { flex-direction: column; gap: 6px; }
  .page-hero-row { flex-direction: column; align-items: flex-start; }
  .list-toolbar  { flex-direction: column; align-items: stretch; }
  .search-box    { min-width: unset; }
  .tab { padding: 8px 12px; font-size: .8125rem; }
  .my-vote-card-head { flex-direction: column; }
}
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .section   { padding: 40px 0; }
  .hero-title { font-size: 2rem; }
  .hero-cta   { flex-direction: column; }
  .btn-lg     { width: 100%; }
  .op-stats   { grid-template-columns: 1fr; }
  .perm-row   { flex-wrap: wrap; }
  .perm-actions { width: 100%; }
  .stats-grid { flex-direction: column; gap: 20px; }
  .stat-sep   { width: 40px; height: 1px; }
  .archive-tabs { flex-direction: column; }
}

/* ═══════════════════════════════════════════════════════════════════
   Anonymity / Blind Signature Section
   ═══════════════════════════════════════════════════════════════════ */

/* Intro callout */
.anon-callout {
  display: flex; align-items: flex-start; gap: 20px;
  background: linear-gradient(135deg, #ECFDF5 0%, #F0FDFA 100%);
  border: 1px solid #A7F3D0; border-radius: var(--r-xl);
  padding: 28px 32px; margin-bottom: 56px;
}
.anon-callout-icon { font-size: 2.25rem; flex-shrink: 0; line-height: 1; color: var(--brand); }
.anon-callout-text { font-size: 1.0625rem; color: var(--g700); line-height: 1.7; }
.anon-callout-text strong { color: var(--g900); }

/* Схема обмена: регистратор — голосующий — хранилище бюллетеней */
.flow-scheme { margin: 0 0 56px; }
.fs-row {
  display: grid; grid-template-columns: 1fr 120px 1fr 120px 1fr;
  align-items: stretch;
}
.fs-node {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
  background: #fff; border: 1px solid var(--g300); border-radius: var(--r-lg);
  padding: 20px 16px 16px;
}
.fs-node strong { font-family: var(--font-h); font-size: 1rem; font-weight: 700; color: var(--g900); }
.fs-node span   { font-size: .875rem; color: var(--g600); }
.fs-knows {
  margin-top: auto; padding: 5px 12px; border-radius: var(--r-full);
  font-style: normal; font-size: .8125rem; font-weight: 600;
  background: var(--g100); color: var(--g700);
}
.fs-node span:last-of-type { margin-bottom: 12px; }
/* Регистратор — фиолетовый, хранилище — бирюзовый: как два независимых сервера */
.fs-node--reg { background: #EEEDFE; border-color: #AFA9EC; }
.fs-node--reg strong, .fs-node--reg .fs-knows { color: #3C3489; }
.fs-node--reg span { color: #534AB7; }
.fs-node--reg .fs-knows { background: #CECBF6; }
.fs-node--box { background: #E1F5EE; border-color: #5DCAA5; }
.fs-node--box strong, .fs-node--box .fs-knows { color: #085041; }
.fs-node--box span { color: #0F6E56; }
.fs-node--box .fs-knows { background: #9FE1CB; }

.fs-link {
  display: flex; flex-direction: column; justify-content: center; gap: 10px;
  padding: 0 12px;
}
.fs-label { font-size: .8125rem; color: var(--g600); text-align: center; line-height: 1; }
.fs-arrow { position: relative; display: block; height: 2px; background: var(--g400); }
.fs-arrow::after {
  content: ''; position: absolute; top: -4px; right: -1px;
  border: 5px solid transparent; border-left: 8px solid var(--g400); border-right: 0;
}
.fs-arrow--back::after { right: auto; left: -1px; border-left: 0; border-right: 8px solid var(--g400); }

.flow-scheme figcaption {
  margin: 16px auto 0; max-width: 760px; text-align: center;
  font-size: .875rem; color: var(--g500); line-height: 1.65;
}

@media (max-width: 768px) {
  .fs-row { grid-template-columns: 1fr; }
  .fs-link { flex-direction: row; align-items: center; justify-content: center; gap: 14px; padding: 8px 0; }
  .fs-label { flex: 1; text-align: right; }
  .fs-label:last-child { text-align: left; }
  .fs-arrow { width: 2px; height: 44px; }
  .fs-arrow::after {
    top: auto; bottom: -1px; right: auto; left: -4px;
    border: 5px solid transparent; border-top: 8px solid var(--g400); border-bottom: 0;
  }
  .fs-arrow--back::after { bottom: auto; top: -1px; border-top: 0; border-bottom: 8px solid var(--g400); }
}

/* Protocol steps */
.protocol-grid {
  display: flex; flex-direction: column; align-items: stretch; gap: 0;
  margin-bottom: 56px;
}

.protocol-step {
  background: #fff; border: 1px solid var(--g200);
  border-radius: var(--r-xl); padding: 32px 36px;
  position: relative;
  transition: box-shadow var(--tm);
}
.protocol-step:hover { box-shadow: var(--sh-lg); }

.protocol-step--accent {
  background: linear-gradient(135deg, #ECFDF5 0%, #F0FDFA 100%);
  border-color: #6EE7B7;
}

.protocol-step-head {
  display: flex; align-items: center; gap: 16px; margin-bottom: 16px;
}
.protocol-step-head h3 {
  font-family: var(--font-h); font-size: 1.125rem;
  font-weight: 700; color: var(--g900); margin: 0;
}

.protocol-badge {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--g900); color: #fff;
  font-family: var(--font-h); font-size: .875rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.protocol-badge--accent {
  background: linear-gradient(135deg, var(--brand), #10B981);
}

.protocol-step p {
  font-size: .9375rem; color: var(--g600); line-height: 1.75; margin: 0 0 16px;
}
.protocol-step p:last-of-type { margin-bottom: 0; }
.protocol-step em { font-style: normal; color: var(--brand); font-weight: 600; }

.protocol-note {
  font-size: .875rem !important; color: var(--g500) !important;
  font-style: italic; background: rgba(255,255,255,.6);
  border-left: 3px solid var(--brand);
  padding: 10px 16px; border-radius: 0 var(--r-sm) var(--r-sm) 0;
  margin-top: 12px !important;
}

/* Formula block */
.protocol-formula {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--g900); border-radius: var(--r-md);
  padding: 14px 20px; margin: 16px 0; font-size: .8125rem;
}
.pf-label { color: var(--g400); white-space: nowrap; }
.pf-code  {
  font-family: 'Courier New', Consolas, monospace;
  color: #6EE7B7; font-size: .875rem;
  background: rgba(255,255,255,.05); padding: 3px 8px; border-radius: 4px;
}
.pf-sep   { color: var(--g500); font-size: 1.1rem; }

/* Tag */
.protocol-tag {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 16px; padding: 5px 12px;
  background: var(--g100); color: var(--g600);
  border-radius: var(--r-full); font-size: .8rem; font-weight: 600;
}
.protocol-tag--accent {
  background: var(--brand-light); color: var(--brand-dark);
}
.protocol-tag::before { content: '✓'; font-size: .75rem; }

/* Connector between steps */
.protocol-connector {
  display: flex; flex-direction: column; align-items: center;
  padding: 4px 0; gap: 0;
}
.protocol-line      { width: 2px; height: 24px; background: var(--g200); }
.protocol-arrow-down { color: var(--g400); font-size: 1.1rem; line-height: 1; }

/* Guarantee grid */
.guarantee-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px; margin-bottom: 40px;
}
.guarantee-card {
  background: #fff; border: 1px solid var(--g200);
  border-radius: var(--r-xl); padding: 24px;
  transition: transform var(--tm), box-shadow var(--tm);
}
.guarantee-card:hover {
  transform: translateY(-3px); box-shadow: var(--sh-md);
}
.guarantee-icon {
  font-size: 1.75rem; margin-bottom: 14px; display: block;
  color: var(--brand); line-height: 1;
}
.guarantee-card h4 {
  font-family: var(--font-h); font-size: 1rem; font-weight: 700;
  color: var(--g900); margin-bottom: 8px;
}
.guarantee-card p {
  font-size: .875rem; color: var(--g500); line-height: 1.65; margin: 0;
}

/* Algorithm note */
.algo-note {
  background: var(--g900); border-radius: var(--r-xl);
  overflow: hidden;
}
.algo-note-title {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 28px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-family: var(--font-h); font-size: 1rem; font-weight: 700; color: #fff;
}
.algo-note-icon { font-size: 1.25rem; }
.algo-note-body { padding: 24px 28px; }
.algo-note-body p {
  color: var(--g400); font-size: .9375rem; line-height: 1.75;
  margin: 0 0 24px;
}
.algo-note-body strong { color: var(--g200); }

.algo-params {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.algo-param {
  background: rgba(255,255,255,.05); border-radius: var(--r-md);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 4px;
}
.ap-key { font-size: .75rem; color: var(--g500); text-transform: uppercase; letter-spacing: .04em; }
.ap-val { font-family: 'Courier New', Consolas, monospace; font-size: .9rem; color: #6EE7B7; font-weight: 600; }

/* ── Responsive for anonymity section ──────────────────────────── */
@media (max-width: 900px) {
  .guarantee-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .anon-callout { flex-direction: column; gap: 12px; padding: 20px; }
  .anon-callout-icon { font-size: 2rem; }
  .anon-callout-text { font-size: .9375rem; }
  .protocol-step { padding: 20px; }
  .protocol-formula { flex-direction: column; align-items: flex-start; gap: 8px; }
  .guarantee-grid { grid-template-columns: 1fr; gap: 12px; }
  .algo-note-title { padding: 16px 20px; font-size: .9375rem; }
  .algo-note-body  { padding: 20px; }
  .algo-params { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .algo-params { grid-template-columns: 1fr; }
  .protocol-step-head { flex-direction: column; align-items: flex-start; gap: 10px; }
}


/* ═══ Тайное голосование ═══════════════════════════════════════════════ */

.alert-info { background: var(--info-bg); color: #1E40AF; border: 1px solid #BFDBFE; }
.alert:has(> svg) { display: flex; gap: 10px; align-items: flex-start; }
.alert > svg    { flex-shrink: 0; margin-top: 2px; font-size: 1.125rem; }
.alert p        { margin: 6px 0 0; }
.alert p.mb-0   { margin-bottom: 0; }
.radio-item--off { opacity: .55; }
.radio-item em  { display: block; font-style: normal; }

/* Доли ключа: показываются один раз, поэтому крупно и с запасом на перенос */
.keys-card  { text-align: left; max-width: 860px; margin: 0 auto; }
.keys-list  { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }
.key-row    { display: flex; gap: 12px; align-items: baseline; padding: 10px 14px;
              border: 1px solid var(--g200); border-radius: var(--r-md); background: var(--g50); }
.key-num    { font-weight: 600; font-size: .8125rem; color: var(--g500); white-space: nowrap; }
.key-value  { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
              font-size: .75rem; line-height: 1.5; word-break: break-all; color: var(--g700); }

.check-item       { display: flex; gap: 10px; align-items: center; font-size: .9375rem; cursor: pointer; }
.check-item input { accent-color: var(--brand); width: 18px; height: 18px; flex-shrink: 0; }

/* Доли по одной на носитель: шаги, карточка текущей доли */
.share-steps      { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 14px; }
.share-step       { width: 30px; height: 30px; border-radius: var(--r-full); display: grid; place-items: center;
                    font-size: .8125rem; font-weight: 700; background: var(--white);
                    border: 1px solid var(--g200); color: var(--g500); }
.share-step--now  { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
.share-step--done { background: var(--brand); border-color: var(--brand); color: var(--white); }
.share-card       { border: 1px solid var(--g200); border-radius: var(--r-lg); padding: 20px 22px; background: var(--g50); }
.share-title      { font-family: var(--font-h); font-size: 1.0625rem; font-weight: 700; margin: 0 0 6px; }
.share-hint       { color: var(--g600); font-size: .9375rem; margin: 0; }
.share-actions    { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 8px; }
.share-reveal     { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; }
.share-reveal .key-value { flex: 1; padding: 8px 10px; background: var(--white);
                           border: 1px dashed var(--g300); border-radius: var(--r-md); }
.share-confirm    { margin-top: 20px; }
.share-nav        { justify-content: space-between; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.share-nav > :only-child { margin-left: auto; }

/* Сбор долей при подсчёте: держатели приносят носители по одному */
.share-collector    { margin-top: 14px; }
.share-list         { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.share-item         { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px;
                      border: 1px solid var(--g200); border-radius: var(--r-md); background: var(--white); }
.share-item--sealed { background: var(--warning-bg); border-color: #FDE68A; }
.share-item-num     { font-weight: 700; font-size: .875rem; min-width: 76px; }
.share-item-state   { display: inline-flex; gap: 4px; align-items: center; flex: 1;
                      font-size: .8125rem; color: var(--g600); }
.share-pin          { max-width: 180px; }
.share-manual       { margin: 10px 0; font-size: .875rem; }
.share-manual summary { cursor: pointer; color: var(--g600); margin-bottom: 8px; }
.share-progress     { display: flex; gap: 8px; align-items: center; margin: 12px 0;
                      font-size: .875rem; color: var(--g600); }
@media (max-width: 480px) {
  .share-card { padding: 16px; }
  .share-pin  { max-width: none; flex-basis: 100%; }
}

/* Ход тайного голосования на странице участника */
.secret-steps      { display: flex; flex-direction: column; gap: 6px; margin: 24px 0 0; }
.secret-step       { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px;
                     border: 1.5px solid transparent; border-radius: var(--r-md); }
.secret-step--done { background: var(--brand-light); }
/* Текущий шаг — тот, ради которого кнопка выше: рамка цвета бренда и номер в кольце */
.secret-step--now  { background: var(--white); border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
.secret-step--now .secret-step-num { border: 2px solid var(--brand); color: var(--brand); }
.secret-step--now .secret-step-body strong { color: var(--brand-dark); }
.secret-step--next { opacity: .5; }
.secret-step-num   { width: 26px; height: 26px; flex-shrink: 0; border-radius: var(--r-full);
                     display: grid; place-items: center; font-size: .8125rem; font-weight: 700;
                     background: var(--white); border: 1px solid var(--g200); color: var(--g600); }
.secret-step--done .secret-step-num { background: var(--brand); border-color: var(--brand); color: var(--white); }
.secret-step-body strong { display: block; font-size: .9375rem; }
.secret-step-body span   { font-size: .8125rem; color: var(--g500); }

/* Квитанция и блокчейн */
.receipt-code   { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
                  font-size: .8125rem; word-break: break-all; background: var(--g50);
                  border: 1px dashed var(--g300); border-radius: var(--r-md); padding: 10px 12px;
                  display: block; margin: 8px 0; color: var(--g800); }

/* Лист квитанции для печати (BallotHost). На экране его нет: печатается копия, которую
   votePortal.printSheet кладёт прямо в <body>, а всё остальное на время печати прячется */
.receipt-sheet  { display: none; }
@media print {
  body.printing-sheet                 { background: #fff; min-height: 0; }
  body.printing-sheet > :not(.print-sheet) { display: none !important; }
  body.printing-sheet > .print-sheet  { display: block; padding: 20mm 22mm; color: #000;
                                        font-size: 11pt; line-height: 1.5; }
  .receipt-sheet-brand  { font-family: var(--font-h); font-weight: 700; margin-bottom: 12mm; }
  .receipt-sheet-title  { font-family: var(--font-h); font-size: 18pt; font-weight: 700; line-height: 1.25;
                          margin-bottom: 7mm; }
  .receipt-sheet-facts  { display: grid; grid-template-columns: max-content 1fr; gap: 1.5mm 6mm; margin-bottom: 9mm; }
  .receipt-sheet-facts dt,
  .receipt-sheet-muted  { color: #555; }
  .receipt-sheet-label  { font-size: 8.5pt; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
                          color: #555; margin-bottom: 2.5mm; }
  .receipt-sheet-code   { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 15pt;
                          line-height: 1.7; border: 1.5pt dashed #000; border-radius: 3mm; padding: 5mm 7mm;
                          margin-bottom: 10mm; break-inside: avoid; }
  .receipt-sheet-steps  { padding-left: 5mm; margin-bottom: 10mm; }
  .receipt-sheet-steps li + li { margin-top: 2mm; }
  .receipt-sheet-url    { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 10pt;
                          overflow-wrap: anywhere; }
  .receipt-sheet-note   { border-top: .75pt solid #999; padding-top: 4mm; font-size: 10pt; color: #333;
                          break-inside: avoid; }
}

.chain-list     { display: flex; flex-direction: column; gap: 8px; }
.chain-block    { border: 1px solid var(--g200); border-radius: var(--r-md); padding: 12px 14px; background: var(--white); }
.chain-head     { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.chain-index    { font-weight: 700; }
.chain-hash     { font-family: ui-monospace, Consolas, monospace; font-size: .6875rem; color: var(--g500); word-break: break-all; }
/* Адрес хранилища в тексте: без переносов он шире телефона, и страница уезжает вбок */
.chain-url      { overflow-wrap: anywhere; }
.chain-tx       { font-size: .8125rem; color: var(--g600); padding: 4px 0 0 14px; border-left: 2px solid var(--g200); margin-top: 8px; }
.chain-tx + .chain-tx { margin-top: 4px; }
/* Права оператора: какие голосования он может создавать (панель администратора) */
.kinds-choice   { border: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 8px; }
.kinds-choice legend { font-weight: 600; font-size: .875rem; color: var(--g700); margin-bottom: 8px; }
.operator-kinds { font-size: .75rem; margin-top: 4px; }

.chain-tx-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* Журнал бывает на сотни тысяч записей: порядок, переход к блоку по номеру, страницы */
.chain-toolbar  { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.seg-toggle     { display: inline-flex; border: 1px solid var(--g200); border-radius: var(--r-md); overflow: hidden; }
.seg-toggle button { border: none; background: var(--white); padding: 7px 14px; font-size: .8125rem; color: var(--g600); cursor: pointer; }
.seg-toggle button + button { border-left: 1px solid var(--g200); }
.seg-toggle button.active { background: var(--brand); color: #fff; font-weight: 600; }
.chain-jump     { display: flex; align-items: center; gap: 8px; font-size: .8125rem; color: var(--g600); }
.chain-jump .form-control { width: 130px; padding-top: 6px; padding-bottom: 6px; }
.chain-from     { font-size: .8125rem; color: var(--g500); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spinner--sm    { width: 20px; height: 20px; border-width: 2px; flex-shrink: 0; }

.key-input      { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: .75rem;
                  min-height: 92px; }

/* Число в вкладке фильтра («Идут 3») */
.filter-count { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 5px;
                border-radius: var(--r-full); background: var(--g100); color: var(--g600);
                font-size: .6875rem; line-height: 18px; text-align: center; }
.filter-tab.active .filter-count { background: rgba(255,255,255,.25); color: inherit; }

/* ── Картинка варианта крупно (ZoomImage) ─────────────────────────────── */
.zoom-thumb { cursor: zoom-in; }
.img-zoom {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: calc(var(--safe-top, 0px) + 16px) calc(var(--safe-right, 0px) + 16px)
           calc(var(--safe-bottom, 0px) + 16px) calc(var(--safe-left, 0px) + 16px);
  background: rgba(17, 24, 39, .86); cursor: zoom-out; outline: none;
  animation: img-zoom-in .15s ease-out;
}
.img-zoom-frame {
  position: relative; margin: 0; max-width: 100%; max-height: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 10px; cursor: default;
}
.img-zoom-frame img {
  display: block; max-width: min(1100px, 100%); max-height: calc(100vh - 120px);
  object-fit: contain; border-radius: 12px; background: #fff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
}
.img-zoom-frame figcaption {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 16px;
  color: #fff; font-size: .9375rem; font-weight: 600; text-align: center;
}
.img-zoom-frame figcaption a { color: #A7F3D0; font-weight: 500; font-size: .875rem; }
.img-zoom-close {
  position: absolute; top: -14px; right: -14px; width: 36px; height: 36px; border-radius: 50%;
  border: none; background: #fff; color: #111827; font-size: 1.5rem; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
}
@media (max-width: 600px) { .img-zoom-close { top: 6px; right: 6px; } }
@keyframes img-zoom-in { from { opacity: 0; } to { opacity: 1; } }
/* ── Главная: мобильное приложение ────────────────────────────────────── */
.app-promo {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center;
  background: #fff; border: 1px solid var(--g200); border-radius: var(--r-xl, 20px); padding: 40px;
}
.app-promo-text h2 { font-family: var(--font-h); font-size: 2rem; font-weight: 800; color: var(--g900); margin: 14px 0 12px; }
.app-promo-text > p { color: var(--g600); line-height: 1.65; margin: 0 0 16px; }
.app-promo-list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 8px; }
.app-promo-list li { display: flex; align-items: flex-start; gap: 10px; color: var(--g700); font-size: .9375rem; }
.app-promo-list li svg { color: var(--brand); flex-shrink: 0; margin-top: 3px; }
.app-promo-stores { display: flex; flex-wrap: wrap; gap: 10px; }
.app-promo-note { margin: 14px 0 0; font-size: .8125rem; color: var(--g500); max-width: 560px; }

.store-btn {
  display: inline-flex; align-items: center; gap: 10px; min-width: 170px;
  padding: 9px 16px; border-radius: var(--r-md); text-decoration: none;
  background: var(--g900); color: #fff; border: 1px solid var(--g900);
  font-family: var(--font-h); font-weight: 700; font-size: 1rem; line-height: 1.15;
  transition: transform .15s, box-shadow .15s;
}
.store-btn svg { width: 22px; height: 22px; flex-shrink: 0; }
.store-btn span { display: flex; flex-direction: column; }
.store-btn small { font-family: var(--font-b, inherit); font-weight: 500; font-size: .6875rem; opacity: .8; }
a.store-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(17, 24, 39, .18); color: #fff; }
.store-btn--primary { background: var(--brand); border-color: var(--brand); }
.store-btn--soon { background: transparent; color: var(--g400); border: 1px dashed var(--g300); cursor: default; }

.app-promo-visual { display: flex; justify-content: center; }
.app-phone {
  width: 210px; height: 400px; border-radius: 34px; padding: 10px;
  background: var(--g900); box-shadow: 0 24px 60px rgba(17, 24, 39, .25);
}
.app-phone-screen {
  height: 100%; border-radius: 26px; background: var(--g50); overflow: hidden;
  display: flex; flex-direction: column; gap: 12px;
}
.app-phone-bar {
  display: flex; align-items: center; gap: 8px; padding: 26px 16px 14px;
  background: #111827; color: #fff; font-family: var(--font-h); font-weight: 700; font-size: .8125rem;
}
.app-phone-bar svg { color: var(--brand); width: 16px; height: 16px; }
.app-phone-card { margin: 0 14px; height: 120px; border-radius: 14px; background: linear-gradient(135deg, var(--brand-light), var(--g200)); }
.app-phone-line { margin: 0 14px; height: 10px; border-radius: 5px; background: var(--g200); }
.app-phone-line--short { width: 55%; }
.app-phone-btn { margin: auto 14px 18px; height: 34px; border-radius: 10px; background: var(--brand); }

@media (max-width: 860px) {
  .app-promo { grid-template-columns: 1fr; padding: 28px 22px; gap: 28px; }
  .app-promo-visual { display: none; }
  .app-promo-text h2 { font-size: 1.6rem; }
}
/* «Наблюдатель»: картинка слева, текст справа; макет окна приложения */
.app-promo--reverse { grid-template-columns: 1fr 1.4fr; }
.obs-window {
  width: 100%; max-width: 360px; border-radius: 14px; overflow: hidden; background: #fff;
  border: 1px solid var(--g200); box-shadow: 0 24px 60px rgba(17, 24, 39, .16);
}
.obs-window-bar { display: flex; gap: 6px; padding: 10px 12px; background: #111827; }
.obs-window-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--g600); }
.obs-window-body { padding: 16px; display: grid; gap: 8px; }
.obs-verdict {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; margin-bottom: 4px;
  background: var(--brand-light); color: var(--brand-dark, var(--brand)); font-weight: 700; font-size: .875rem;
}
.obs-check {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--g100); font-size: .8125rem; color: var(--g700);
}
.obs-check svg, .obs-verdict svg { color: var(--brand); flex-shrink: 0; width: 16px; height: 16px; }
@media (max-width: 860px) { .app-promo--reverse { grid-template-columns: 1fr; } }
/* Кто голосовал: кнопка под вариантом и отдельное окно со списком */
.option-voters-toggle { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 4px 0; border: 0; background: none; color: var(--brand); font: inherit; font-size: .8125rem; font-weight: 600; cursor: pointer; }
.option-voters-toggle .icon, .option-voters-toggle svg { width: 16px; height: 16px; }
.voters-overlay { position: fixed; inset: 0; z-index: 400; background: rgba(17,24,39,.5); display: flex; align-items: center; justify-content: center; padding: 16px; padding-top: calc(var(--safe-top, 0px) + 16px); padding-bottom: calc(var(--safe-bottom, 0px) + 16px); }
.voters-card { display: flex; flex-direction: column; width: 100%; max-width: 480px; max-height: 100%; background: #fff; border-radius: 16px; box-shadow: 0 20px 40px rgba(0,0,0,.2); overflow: hidden; }
.voters-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 18px 10px; }
.voters-head-text { flex: 1; min-width: 0; }
.voters-title { margin: 0; font-size: 1.125rem; font-weight: 700; color: var(--g800); }
.voters-sub { margin-top: 2px; font-size: .8125rem; color: var(--g500); display: flex; gap: 6px; flex-wrap: wrap; }
.voters-option { color: var(--g700); font-weight: 600; overflow-wrap: anywhere; }
.voters-close { flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--g100); color: var(--g600); font-size: 1rem; cursor: pointer; }
.voters-search { display: flex; align-items: center; gap: 8px; margin: 0 18px 10px; padding: 0 12px; border: 1px solid var(--g200); border-radius: 10px; background: #fff; color: var(--g400); }
.voters-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,0,0,.06); }
.voters-search .icon, .voters-search svg { flex: none; width: 18px; height: 18px; }
.voters-search input { flex: 1; min-width: 0; padding: 10px 0; border: 0; outline: none; background: none; color: var(--g800); font: inherit; font-size: .9375rem; }
.voters-body { flex: 1; min-height: 120px; overflow-y: auto; padding: 0 18px 18px; }
.voters-list { margin: 0; padding: 0 0 0 2.6em; color: var(--g800); font-size: .9375rem; }
.voters-list li { padding: 7px 0; border-bottom: 1px solid var(--g100); }
.voters-list li::marker { color: var(--g400); font-size: .8125rem; }
.voters-note { padding: 8px 0; font-size: .8125rem; color: var(--g500); }
.voters-error { padding: 8px 0; font-size: .875rem; color: var(--danger, #DC2626); }
.voters-more { display: block; width: 100%; margin-top: 10px; justify-content: center; }
