/* Оформление страниц сайта. Токены и общие элементы — в base.css. */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  background: var(--bg);
}
input,
textarea,
select {
  font-family: var(--font);
}
::selection {
  background: var(--brand-soft);
}
@keyframes cr-fd {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.cr-brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--brand);
  flex-shrink: 0;
}
.cr-brand-name {
  font-weight: 800;
  font-size: 16.5px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.cr-navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 64px;
  padding: 0 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.cr-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
  margin-right: 16px;
}
.cr-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.cr-nav-link {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  border-radius: 9px;
  transition:
    background 0.12s,
    color 0.12s;
}
.cr-nav-link:hover {
  background: var(--surface-2);
  color: var(--text);
}
.cr-nav-link.active {
  color: var(--text);
  font-weight: 600;
  background: var(--surface-2);
}
.cr-navbar-spacer {
  flex: 1;
}
.cr-theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition:
    border-color 0.15s,
    color 0.15s;
}
.cr-theme-btn:hover {
  border-color: var(--line-2);
  color: var(--text);
}
[data-theme='dark'] .icon-moon {
  display: none;
}
[data-theme='light'] .icon-sun {
  display: none;
}
/* Контейнер чипа: кнопки «Войти» и «Регистрация» не должны складываться в столбик */
[data-user-chip] {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.cr-user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  padding: 0 12px 0 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s;
  cursor: pointer;
}
.cr-user-chip:hover {
  border-color: var(--line-2);
}
.cr-user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand-text);
  font-weight: 700;
  font-size: 11px;
  overflow: hidden;
  flex-shrink: 0;
}
.cr-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cr-user-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.3;
}
.cr-user-role {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.2;
}
.cr-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 18px;
  border: none;
  border-radius: 10px;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}
.cr-btn-primary:hover {
  background: var(--brand-strong);
}
.cr-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}
.cr-btn-secondary:hover {
  background: var(--surface-2);
}
.cr-auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  animation: cr-fd 0.3s ease;
}
.cr-auth-card {
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  padding: 38px;
  box-shadow: var(--shadow-lg);
}
.cr-auth-card-wide {
  max-width: 440px;
}
.cr-auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 40px;
  text-decoration: none;
  color: var(--text);
}
.cr-auth-brand-name {
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.01em;
}
.cr-auth-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.cr-auth-sub {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 24px;
}
.cr-auth-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}
.cr-auth-alt {
  margin-top: 22px;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
}
.cr-auth-alt-divided {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.cr-auth-alt a {
  color: var(--brand-text);
  font-weight: 600;
  text-decoration: none;
}
.cr-auth-field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}
.cr-auth-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
}
.cr-auth-input:focus {
  border-color: var(--brand);
}
/* Поле с кнопкой внутри — показ пароля. Отступ справа держим на самом поле,
   иначе длинный пароль уезжает под кнопку. */
.cr-input-with-button {
  position: relative;
}
.cr-input-with-button .cr-auth-input {
  padding-right: 46px;
}
.cr-eye {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  color: var(--faint);
  cursor: pointer;
  border-radius: 0 10px 10px 0;
  transition: color 0.12s;
}
.cr-eye:hover {
  color: var(--text-2);
}
/* Открытый глаз — когда пароль скрыт, перечёркнутый — когда показан */
.cr-eye .cr-eye-hide {
  display: none;
}
.cr-eye[aria-pressed='true'] .cr-eye-show {
  display: none;
}
.cr-eye[aria-pressed='true'] .cr-eye-hide {
  display: block;
}
.cr-eye[aria-pressed='true'] {
  color: var(--brand-text);
}
.cr-auth-submit {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 11px;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s;
}
.cr-auth-submit:hover {
  background: var(--brand-strong);
}
.cr-role-switcher {
  display: flex;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  padding: 3px;
  background: var(--bg);
  margin-bottom: 22px;
}
.cr-role-btn {
  flex: 1;
  height: 38px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
.cr-role-btn.active {
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 600;
}
.cr-hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: 80px 32px 56px;
  text-align: center;
}
.cr-hero h1 {
  font-size: clamp(36px, 4.5vw, 50px);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 20px;
  text-wrap: balance;
}
.cr-hero p {
  font-size: 18px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 34px;
  text-wrap: pretty;
}
.cr-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 560px;
  margin: 0 auto 16px;
  padding: 7px 7px 7px 16px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.cr-search-bar input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-family: var(--font);
  outline: none;
}
.cr-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 36px;
}
.cr-section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 8px 32px 16px;
}
.cr-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 16px;
}
.cr-section-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.cr-section-sub {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}
.cr-all-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-text);
  text-decoration: none;
}
.cr-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.cr-step-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.cr-step-n {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-text);
  margin-bottom: 14px;
}
.cr-step-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}
.cr-step-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}
.cr-company-list {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}
.cr-company-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.12s;
  text-decoration: none;
  color: var(--text);
}
.cr-company-row:last-child {
  border-bottom: none;
}
.cr-company-row:hover {
  background: var(--surface-2);
}
.cr-company-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-text);
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
  overflow: hidden;
}
.cr-company-initial img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cr-verified-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
}
.cr-tests-count {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  white-space: nowrap;
}
.cr-tests-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.cr-test-card {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  text-decoration: none;
  color: var(--text);
}
.cr-test-card:hover {
  border-color: var(--line-2);
  box-shadow: var(--shadow);
}
.cr-search-icon {
  display: flex;
  color: var(--muted);
}
.cr-search-btn {
  height: 42px;
  border: none;
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}
.cr-hero-tagline {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--faint);
}
.cr-section-spaced {
  padding-top: 48px;
}
.cr-section-last {
  padding-bottom: 80px;
}
.cr-section-intro {
  margin-bottom: 18px;
}
.cr-list-empty {
  grid-column: 1 / -1;
  padding: 32px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}
.cr-company-main {
  flex: 1;
  min-width: 0;
}
.cr-company-name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 600;
}
.cr-company-meta {
  font-size: 13px;
  color: var(--muted);
}
.cr-row-arrow {
  display: flex;
  color: var(--faint);
}
.cr-test-card-tag {
  align-self: flex-start;
  margin-bottom: 14px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--brand-soft);
  color: var(--brand-text);
}
.cr-test-card-title {
  margin-bottom: 6px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}
.cr-test-card-meta {
  margin-bottom: 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--faint);
}
.cr-test-card-action {
  margin-top: auto;
}
.cr-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  margin-top: 48px;
}
.cr-footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.cr-footer-copy {
  font-size: 13px;
  color: var(--muted);
}
.cr-footer-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
}
.cr-brand-mark-sm {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}
.cr-footer-links {
  display: flex;
  gap: 18px;
}
.cr-footer-links a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}
.cr-footer-links a:hover {
  color: var(--text);
}
.sidebar {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 60px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex-shrink: 0;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
/* Карточка со списком: таблица прижата к её краям, поэтому у самой карточки
   отступов нет, а отступают ячейки. Одна и та же для тестов и конкурсов. */
.list-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}
.list-card-header {
  padding: 20px 24px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.list-card-header h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}
.table-wrapper {
  overflow-x: auto;
}
.tests-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.tests-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--faint);
  /* Серая полоса шапки — как у таблицы конкурсов */
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tests-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
}
/* Крайние колонки выравниваются с заголовком карточки («Обзор тестов»),
   у которого отступ 24px: иначе первая колонка визуально уезжает влево */
.tests-table th:first-child,
.tests-table td:first-child {
  padding-left: 24px;
}
.tests-table th:last-child,
.tests-table td:last-child {
  padding-right: 24px;
}
.tests-table tr:last-child td {
  border-bottom: none;
}
.tests-table tbody tr:hover td {
  background: var(--surface-2);
}
/* Название — обычный текст, как заголовок строки в таблице конкурсов.
   Красным в строке остаётся только то, что действительно требует внимания,
   а состояние передаёт цветная плашка статуса. */
.tests-table a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.tests-table a:hover {
  color: var(--brand-text);
}
.action-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition:
    border-color 0.15s,
    color 0.15s;
  flex-shrink: 0;
}
/* Ячейка действий: флексом делаем внутреннюю обёртку — display:flex
   на самой ячейке выбил бы её из табличной раскладки. */
.action-row {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.action-icon-btn:hover {
  border-color: var(--line-2);
  color: var(--text);
}
.action-icon-btn.danger:hover {
  border-color: var(--red-text);
  color: var(--red-text);
}
/* Телефон: строка таблицы становится карточкой — тем же приёмом,
   что и список конкурсов. Подписи берутся из data-label, который
   проставляет companies/app.js при отрисовке строки. */
@media (max-width: 680px) {
  .tests-table thead {
    display: none;
  }
  .tests-table,
  .tests-table tbody {
    display: block;
  }
  .tests-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
    padding: 16px;
    border-bottom: 1px solid var(--line);
  }
  .tests-table tr:last-child {
    border-bottom: none;
  }
  .tests-table td,
  .tests-table td:first-child,
  .tests-table td:last-child {
    display: block;
    padding: 0;
    border-bottom: none;
  }
  /* Название и кнопки действий — на всю ширину карточки */
  .tests-table td:first-child,
  .tests-table td:last-child {
    grid-column: 1 / -1;
  }
  .tests-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--faint);
    margin-bottom: 2px;
  }
  .tests-table tbody tr:hover td {
    background: transparent;
  }
}
#tests-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
  font-size: 14px;
}
#tests-empty > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
#tests-empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
#tests-empty-sub {
  font-size: 13.5px;
}
/* Плашка блокировки. Висит первой строкой страницы, а не поверх содержимого:
   её нельзя не заметить, но она и не мешает пользоваться тем, что осталось. */
.cr-ban-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 24px;
  background: var(--red-soft);
  color: var(--red-text);
  font-size: 13.5px;
  line-height: 1.55;
}
.cr-ban-notice svg {
  flex-shrink: 0;
  margin-top: 2px;
}
.cr-ban-notice b {
  font-weight: 700;
}
.cr-ban-notice span {
  color: var(--text-2);
}
@media (max-width: 560px) {
  .cr-ban-notice {
    padding: 12px 16px;
    font-size: 13px;
  }
}
/* Одни и те же блоки в обоих кабинетах. */
.form-hint {
  font-size: 12px;
  color: var(--faint);
  line-height: 1.5;
}
.label-note {
  font-weight: 400;
  color: var(--muted);
}
.pic-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.pic-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  border-radius: 20px;
  background: var(--brand-soft);
  color: var(--brand-text);
  font-size: 32px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.pic-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Подсказка и кнопки занимают остаток строки, но не распирают её:
   без min-width: 0 длинная строка подсказки не переносится */
.pic-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 220px;
  min-width: 0;
}
.pic-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chips:empty {
  display: none;
}
.chip-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 7px 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 13px;
}
.chip-x {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--faint);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  transition:
    background 0.12s,
    color 0.12s;
}
.chip-x:hover {
  background: var(--red-soft);
  color: var(--red-text);
}
.chip-add {
  display: flex;
  gap: 8px;
}
.chip-add input {
  flex: 1;
  min-width: 0;
}
.chip-add button {
  height: 42px;
  flex-shrink: 0;
}
.chip-add input:disabled {
  background: var(--surface-2);
  color: var(--muted);
  cursor: not-allowed;
}
@media (max-width: 560px) {
  .pic-preview {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    font-size: 26px;
  }
  /* Поле и «Добавить» рядом оставляют полю меньше половины строки */
  .chip-add {
    flex-direction: column;
    align-items: stretch;
  }
}
.modal-card {
  width: 100%;
  max-width: 640px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  animation: cr-fd 0.2s ease;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.field {
  margin-bottom: 16px;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.field textarea {
  height: auto;
  min-height: 120px;
  padding: 12px 13px;
  line-height: 1.5;
  resize: vertical;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--brand);
}
.errorlist {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--red-text);
}
.app-alert {
  margin: 0 28px 16px;
  padding: 12px 16px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--red-text);
  background: var(--red-soft);
  border-color: var(--red-text);
}
.app-alert-inline {
  margin: 0 0 16px;
}
.cst-save-status {
  font-size: 0.75rem;
  color: var(--muted);
  flex-shrink: 0;
  white-space: nowrap;
}
.mini-link-button {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s;
}
.mini-link-button:hover {
  color: var(--text);
}
.mini-link-button-primary {
  background: var(--brand);
  color: var(--on-brand);
  border-color: transparent;
}
.mini-link-button-primary:hover {
  color: var(--on-brand);
  background: var(--brand-strong);
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: color 0.15s;
}
.theme-toggle:hover {
  color: var(--text);
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 3px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
/* Защита от случайного горизонтального скролла (clip не ломает sticky-навбар) */
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition:
    background 0.25s,
    color 0.25s;
  overflow-x: clip;
}
/* Заголовки и названия переносят длинные слова и не вылезают за края карточек */
h1,
h2,
h3,
h4,
[class*='title'],
[class*='Title'],
[class*='name'],
[class*='heading'] {
  overflow-wrap: break-word;
  word-break: break-word;
}
.cr-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.cr-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.cr-filter-label {
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--faint);
  margin-bottom: 10px;
  margin-right: 4px;
  white-space: nowrap;
}
.cr-filter-divider {
  height: 20px;
  width: 1px;
  background: var(--line);
  flex-shrink: 0;
}
.cr-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 15px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.12s,
    border-color 0.12s,
    color 0.12s;
  white-space: nowrap;
  font-family: inherit;
  text-decoration: none;
}
.cr-chip:hover {
  border-color: var(--brand);
  color: var(--brand-text);
}
.cr-chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
}
.cr-filter-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--faint);
  margin-left: auto;
  white-space: nowrap;
}
@media (max-width: 560px) {
  .cr-filters {
    gap: 6px;
    margin-bottom: 20px;
  }
  .cr-filter-divider {
    display: none;
  }
  .cr-filter-count {
    width: 100%;
    margin: 4px 0 0;
    text-align: left;
  }
}
.cr-burger {
  display: none;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
}
.cr-burger:hover {
  color: var(--text);
}
/* Меню сворачивается в бургер, пока шесть разделов и кнопки аккаунта
   не помещаются в одну строку */
@media (max-width: 1000px) {
  .cr-navbar {
    padding: 0 16px;
    gap: 6px;
  }
  .cr-brand {
    margin-right: 6px;
  }
  .cr-brand-name {
    display: none;
  }
  /* оставляем только иконку */
  .cr-burger {
    display: inline-flex;
  }
  .cr-nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.12);
    z-index: 60;
  }
  .cr-navbar.nav-open .cr-nav {
    display: flex;
  }
  .cr-nav-link {
    height: 44px;
  }
  /* на узком экране у чипа аккаунта оставляем только аватар, размером как кнопки навбара */
  .cr-user-chip > :not(.cr-user-avatar) {
    display: none;
  }
  .cr-user-chip {
    padding: 0;
    border: none;
    background: transparent;
    height: auto;
  }
  .cr-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    font-size: 14px;
  }
}
@media (max-width: 400px) {
  .cr-navbar {
    padding: 0 12px;
    gap: 4px;
  }
  .cr-brand {
    margin-right: 2px;
  }
  .mini-link-button {
    padding: 0 10px;
  }
}
@media (max-width: 1000px) {
  .cr-steps-grid,
  .cr-tests-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 620px) {
  .cr-steps-grid,
  .cr-tests-grid {
    grid-template-columns: 1fr;
  }
}
/* ══════════════════════════════════════════════════════════════════════
   Элементы, добавленные при доработке функционала.
   Вынесены отдельным блоком, чтобы их легко было найти и переоформить.
   ══════════════════════════════════════════════════════════════════════ */
.cr-report-btn {
  display: none; /* показывается скриптом только вошедшим */
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  margin-left: auto;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition:
    border-color 0.12s,
    color 0.12s;
}
.cr-report-btn.is-available {
  display: inline-flex;
}
.cr-report-btn:hover {
  border-color: var(--red-text);
  color: var(--red-text);
}
.cr-report-btn svg {
  flex-shrink: 0;
}
/* Закреплён в правом верхнем углу, чтобы не занимать место под формой. */
.cr-float-actions {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10;
  display: flex;
  gap: 8px;
}
.cr-float-actions > .theme-toggle {
  box-shadow: var(--shadow);
  text-decoration: none;
}
.cr-float-actions svg {
  flex-shrink: 0;
}
/* На узком экране оставляем только иконки — подписи съедали бы полширины */
@media (max-width: 560px) {
  .cr-float-actions {
    top: 12px;
    right: 12px;
  }
  .cr-float-actions > .theme-toggle {
    width: 34px;
    padding: 0;
    justify-content: center;
  }
  .cr-float-actions [data-theme-label],
  .cr-float-actions [data-float-label] {
    display: none;
  }
}
/* Поле с ошибкой: рамка и лёгкая заливка, чтобы проблему было видно
   сразу, а не только по тексту под полем. */
.cr-auth-input.is-invalid,
.ud-form-input.is-invalid {
  border-color: var(--red-text);
  background: var(--red-soft);
}
.cr-auth-input.is-invalid:focus,
.ud-form-input.is-invalid:focus {
  border-color: var(--red-text);
}
/* Успешное действие — тот же баннер, но зелёный */
.app-alert-success {
  color: var(--green-text);
  background: var(--green-soft);
  border-color: var(--green-text);
}
/* Несколько ошибок у одного поля — читаемым списком */
.errorlist li + li {
  margin-top: 3px;
}
.cr-pager {
  display: none; /* показывается, когда страниц больше одной */
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}
.cr-pager.visible {
  display: flex;
}
.cr-pager-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition:
    background 0.12s,
    border-color 0.12s,
    color 0.12s;
}
.cr-pager-btn:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand-text);
}
.cr-pager-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.cr-pager-info {
  padding: 0 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}
@media (max-width: 620px) {
  .cr-pager-info {
    padding: 0 4px;
  }
}
/* Плашка модератора на публичных страницах (js/moderation-bar.js) */
.mb-bar {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px 9px 14px;
  max-width: calc(100vw - 24px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 34px rgba(16, 24, 40, 0.2);
}
.mb-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand-text);
  white-space: nowrap;
}
.mb-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(214, 40, 57, 0.18);
  flex-shrink: 0;
}
/* Кого модерируем: длинный логин обрезаем, а не растягиваем панель */
.mb-target {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}
.mb-sep {
  width: 1px;
  align-self: stretch;
  background: var(--line);
  margin: 0 2px;
}
.mb-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
}
.mb-close:hover {
  background: var(--surface-2);
  color: var(--text);
}
.mb-btn {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
}
.mb-btn:hover {
  border-color: var(--brand);
  color: var(--brand-text);
}
.mb-btn.mb-danger,
.mb-btn.mb-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.mb-btn.mb-danger:hover {
  opacity: 0.9;
  color: #fff;
}
.mb-btn.mb-mini {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}
.mb-overlay {
  position: fixed;
  inset: 0;
  z-index: 9100;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.mb-modal {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 16px 44px rgba(16, 24, 40, 0.28);
  max-height: 90vh;
  overflow-y: auto;
}
.mb-modal-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: var(--text);
}
.mb-modal-text {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 14px;
}
.mb-group-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--faint);
  margin: 16px 0 8px;
}
.mb-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-2);
  padding: 6px 0;
  cursor: pointer;
}
.mb-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 1px 8px;
}
.mb-textarea {
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 10px;
  box-sizing: border-box;
}
.mb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.mb-num {
  width: 70px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
}
.mb-grow {
  flex: 1;
}
.mb-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 18px;
}
.mb-flash:not(:empty) {
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13px;
  background: var(--red-soft);
  color: var(--red-text);
}
.mb-flash.is-ok {
  background: var(--green-soft);
  color: var(--green-text);
}
/* На телефоне панель занимает всю ширину и переносит кнопки */
@media (max-width: 560px) {
  .mb-bar {
    left: 12px;
    right: 12px;
    bottom: 12px;
    transform: none;
    max-width: none;
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .mb-sep {
    display: none;
  }
  .mb-target {
    max-width: none;
    flex: 1;
  }
  .mb-btn {
    flex: 1;
  }
}
