:root {
  --bg-0: #f2f6fc;
  --bg-1: #e8f0fb;
  --surface: #ffffff;
  --surface-strong: #eaf1fb;
  --text: #1c2a3d;
  --muted: #5d718c;
  --line: #9eb3cc;
  --line-soft: #7f96b640;
  --accent: #2f87ea;
  --accent-strong: #0f4f9f;
  --header-bg: #1f2f46;
  --header-line: #6e8fbd;
  --table-head: #d8e5f8;
  --sticky: #edf3fc;
  --solved-bg: #92d8aa;
  --solved-text: #123622;
  --attempt-bg: #f8d7d7;
  --attempt-text: #7b2323;
  --shadow: 0 14px 32px rgba(20, 46, 82, 0.12);
}

html[data-theme="dark"] {
  --bg-0: #0f141b;
  --bg-1: #0f141b;
  --surface: #1a222d;
  --surface-strong: #243040;
  --text: #edf3fb;
  --muted: #b8c4d6;
  --line: #3f5168;
  --line-soft: transparent;
  --accent: #4ba9ff;
  --accent-strong: #a7d2ff;
  --header-bg: #131c29;
  --header-line: #45648c;
  --table-head: #263446;
  --sticky: #202b39;
  --solved-bg: #2f7b57;
  --solved-text: #e3ffd8;
  --attempt-bg: #6a3434;
  --attempt-text: #ffe0e0;
  --shadow: 0 18px 36px rgba(0, 0, 0, 0.38);
}

html[data-theme="dark"] body {
  background: #0f141b;
}

html[data-theme="dark"] body::before {
  display: none;
}

html[data-theme="dark"] .site-header {
  color: #e7eefc;
  box-shadow: 0 4px 14px rgba(5, 8, 14, 0.55);
}

html[data-theme="dark"] .theme-toggle {
  color: #dce8fb;
  border-color: #4b6080;
  background: #243144;
}

html[data-theme="dark"] .theme-toggle:hover {
  border-color: #799fd4;
}

html[data-theme="dark"] .theme-toggle:focus-visible {
  outline-color: #8ab6f5;
}

html[data-theme="dark"] .theme-toggle[aria-pressed="false"] .theme-icon--sun,
html[data-theme="dark"] .theme-toggle[aria-pressed="true"] .theme-icon--moon {
  background: #aac8ff2e;
}

html[data-theme="light"] .site-header {
  color: #edf4ff;
  box-shadow: 0 4px 14px rgba(18, 36, 65, 0.24);
}

html[data-theme="light"] .theme-toggle {
  color: #e5efff;
  border-color: #7f9fc8;
  background: #314767;
}

html[data-theme="light"] .theme-toggle:hover {
  border-color: #aac3e9;
}

html[data-theme="light"] .theme-toggle:focus-visible {
  outline-color: #9fc5fb;
}

html[data-theme="light"] .theme-toggle[aria-pressed="false"] .theme-icon--sun,
html[data-theme="light"] .theme-toggle[aria-pressed="true"] .theme-icon--moon {
  background: #bfd5f83d;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Verdana", "DejaVu Sans", sans-serif;
  line-height: 1.35;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 100%);
}

.container {
  width: min(1280px, 100% - 2rem);
  margin: 0 auto;
}

.site-header {
  background: linear-gradient(90deg, var(--header-bg) 0%, color-mix(in srgb, var(--header-bg) 72%, var(--accent) 28%) 100%);
  color: #def9cf;
  border-bottom: 2px solid var(--header-line);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 58px;
}

.brand {
  display: inline-block;
  color: inherit;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.theme-toggle {
  border: 1px solid color-mix(in srgb, var(--header-line) 68%, #ffffff 32%);
  background: color-mix(in srgb, var(--header-bg) 78%, var(--accent) 22%);
  color: #d8f7cb;
  border-radius: 999px;
  padding: 0.2rem 0.3rem;
  min-width: 74px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  font-size: 1rem;
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: #a8dc91;
}

.theme-toggle:focus-visible {
  outline: 2px solid #b8e9a3;
  outline-offset: 2px;
}

.theme-icon {
  width: 1.4rem;
  height: 1.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  line-height: 1;
  transition: background-color 0.15s ease, opacity 0.15s ease;
  opacity: 0.55;
}

.theme-toggle[aria-pressed="false"] .theme-icon--sun {
  background: #d8f7cb33;
  opacity: 1;
}

.theme-toggle[aria-pressed="true"] .theme-icon--moon {
  background: #d8f7cb33;
  opacity: 1;
}

main.container {
  position: relative;
  z-index: 1;
  padding-bottom: 1.3rem;
}

.site-footer {
  border-top: 2px solid color-mix(in srgb, var(--line) 78%, transparent 22%);
  background: color-mix(in srgb, var(--surface) 88%, transparent 12%);
  margin-top: 1.2rem;
}

.footer-inner {
  min-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.7rem 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.footer-line a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.footer-line a:hover {
  color: var(--accent);
}

.page-head {
  margin: 1.2rem 0 1rem;
}

.page-head h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.32rem, 2vw, 1.75rem);
}

.page-head p {
  margin: 0;
  color: var(--muted);
}

.summary-links {
  margin-top: 0.55rem !important;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.summary-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.34rem 0.72rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, var(--accent) 28%);
  background: color-mix(in srgb, var(--surface-strong) 82%, var(--accent) 18%);
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 700;
  line-height: 1.1;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

button.summary-link-btn {
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.summary-link-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 62%, var(--line) 38%);
  background: color-mix(in srgb, var(--surface-strong) 72%, var(--accent) 28%);
  color: var(--accent);
}

.summary-link-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, #ffffff 30%);
  outline-offset: 2px;
}

.summary-link-btn.is-active {
  border-color: color-mix(in srgb, var(--accent-strong) 70%, var(--line) 30%);
  background: color-mix(in srgb, var(--accent) 62%, var(--surface) 38%);
  color: #ffffff;
}

.page-head code {
  background: color-mix(in srgb, var(--surface-strong) 68%, transparent 32%);
  border-radius: 6px;
  padding: 0.1rem 0.32rem;
}

.index-hero {
  margin: 1.2rem 0 1rem;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--line) 64%, transparent 36%);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--surface-strong) 78%, var(--accent) 22%) 0%,
    color-mix(in srgb, var(--surface) 92%, var(--accent) 8%) 100%
  );
  box-shadow: var(--shadow);
}

.index-hero h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  color: var(--accent-strong);
}

.index-hero p {
  margin: 0;
  color: var(--muted);
}

.form-block {
  margin: 1.15rem 0 1.5rem;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--line) 65%, transparent 35%);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.form-block__head h2 {
  margin: 0 0 0.8rem;
  color: var(--accent-strong);
}

.form-embed-shell {
  border: 1px solid color-mix(in srgb, var(--line) 62%, transparent 38%);
  border-radius: 12px;
  padding: 0.35rem;
  background: color-mix(in srgb, var(--surface) 92%, var(--surface-strong) 8%);
  max-width: 690px;
  margin: 0 auto;
}

.form-embed-iframe {
  width: min(100%, 650px);
  min-height: 760px;
  border: 0;
  border-radius: 10px;
  display: block;
  margin: 0 auto;
}

.contest-block {
  margin: 1.2rem 0 1.5rem;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--line) 65%, transparent 35%);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: var(--shadow);
  /* Прокрутка к контесту по якорю (из сводной) не должна прятать заголовок под
     липкой шапкой. */
  scroll-margin-top: 72px;
}

/* Подсветка контеста, к которому пришли по якорю (клик по названию в сводной). */
.contest-block:target {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent 45%), var(--shadow);
  animation: contest-target-flash 1.6s ease-out 1;
}

@keyframes contest-target-flash {
  0% { background: color-mix(in srgb, var(--accent) 22%, var(--surface) 78%); }
  100% { background: var(--surface); }
}

/* Ссылка-название контеста в шапке сводной таблицы. */
.summary-contest-link {
  color: inherit;
  text-decoration: none;
}
.summary-contest-link:hover {
  text-decoration: underline;
}

.contest-block h2 {
  margin: 0 0 0.8rem;
  color: var(--accent-strong);
}

.contest-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.contest-block-head h2 {
  margin: 0;
}

.contest-block--pinned {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--line) 48%);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--surface-strong) 82%, var(--accent) 18%) 0%,
    var(--surface) 100%
  );
}

/* Доска почёта: свёрнута по умолчанию, раскрывается кликом по заголовку. */
.honor-board > .honor-board-summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
  margin-bottom: 0;
}

.honor-board > .honor-board-summary::-webkit-details-marker {
  display: none;
}

.honor-board-badge::before {
  content: "Развернуть ▾";
}

.honor-board[open] .honor-board-badge::before {
  content: "Свернуть ▴";
}

.honor-board[open] > .honor-board-summary {
  margin-bottom: 0.8rem;
}

.pinned-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.6rem;
  padding: 0.16rem 0.56rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 62%, var(--line) 38%);
  background: color-mix(in srgb, var(--accent) 17%, var(--surface) 83%);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.contest-materials-block {
  margin: 0 0 0.8rem;
}

.contest-materials-title {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.contest-materials-list {
  margin: 0.3rem 0 0;
  padding-left: 1.1rem;
}

.contest-materials-list li + li {
  margin-top: 0.15rem;
}

.contest-materials-list a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.contest-materials-list a:hover {
  color: var(--accent);
}

.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
}

.standings-table {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
  background: var(--surface);
}

.standings-table th,
.standings-table td {
  border-right: 1px solid color-mix(in srgb, var(--line) 56%, transparent 44%);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 56%, transparent 44%);
  padding: 0.5rem 0.6rem;
  text-align: center;
  white-space: nowrap;
}

.standings-table th:first-child,
.standings-table td:first-child {
  border-left: 1px solid color-mix(in srgb, var(--line) 56%, transparent 44%);
}

.standings-table thead tr:first-child th {
  border-top: 1px solid color-mix(in srgb, var(--line) 56%, transparent 44%);
}

.standings-table thead th {
  background: var(--table-head);
  color: color-mix(in srgb, var(--text) 86%, #000000 14%);
  font-weight: 800;
}

.standings-table tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--surface) 88%, var(--surface-strong) 12%);
}

.standings-table tbody tr:hover td {
  background: color-mix(in srgb, var(--surface-strong) 74%, var(--accent) 26%);
}

.student-col,
.student-name {
  text-align: left !important;
  min-width: 260px;
  position: sticky;
  left: 0;
  background: var(--sticky);
  z-index: 1;
}

.standings-table thead .student-col {
  background: color-mix(in srgb, var(--sticky) 64%, var(--table-head) 36%);
  z-index: 3;
}

.count-col,
.solved-count {
  min-width: 76px;
  font-weight: 700;
}

/* data-table — списки/записи (админка, профиль участника): текст слева, числа
   по центру, ширина по контенту (не растягивается, нет липкой первой колонки).
   В отличие от матричных таблиц standings/сводной, где всё по центру. */
.standings-table.data-table {
  width: auto;
  min-width: 0;
}

.standings-table.data-table th,
.standings-table.data-table td {
  text-align: left;
}

.standings-table.data-table .count-col,
.standings-table.data-table .solved-count {
  text-align: center;
}

.standings-table.data-table .student-col,
.standings-table.data-table .student-name {
  position: static;
  min-width: 0;
}

.provider-status-cell {
  min-width: 140px;
  text-align: left !important;
}

.subcontest-head {
  font-size: 0.92rem;
}

.task-col {
  padding: 0 !important;
}

.task-col a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 1.8rem;
  min-height: 2.1rem;
  border-radius: 0;
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 20%, var(--surface-strong) 80%);
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.12em;
  font-weight: 800;
  font-size: 1.03rem;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.task-col a:hover {
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent) 32%, var(--surface-strong) 68%);
}

.task-col a:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 72%, #ffffff 28%);
  outline-offset: 2px;
}

.status-cell {
  font-weight: 800;
  min-width: 44px;
  font-size: 1rem;
}

.score-cell {
  min-width: 44px;
  font-weight: 700;
  --score-alpha: 0;
  background: rgba(80, 180, 110, var(--score-alpha)) !important;
  color: color-mix(in srgb, var(--text) 86%, #0f2f16 14%);
}

.standings-table tbody tr:hover td.score-cell {
  box-shadow: inset 0 0 0 9999px color-mix(in srgb, var(--accent) 16%, transparent);
}

/* Ячейка «только сумма» в сводной: подсветка от красного (0) к зелёному
   (максимум) через hue; появляется только при наличии хотя бы одной посылки
   (--total-alpha > 0). */
.total-cell {
  min-width: 56px;
  font-weight: 700;
  --total-hue: 0;
  --total-alpha: 0;
  background: hsla(var(--total-hue), 65%, 45%, var(--total-alpha)) !important;
}

.standings-table tbody tr:hover td.total-cell {
  box-shadow: inset 0 0 0 9999px color-mix(in srgb, var(--accent) 16%, transparent);
}

.status-cell.solved {
  background: var(--solved-bg) !important;
  color: var(--solved-text);
}

.status-cell.attempted {
  background: var(--attempt-bg) !important;
  color: var(--attempt-text);
}

.status-cell.none {
  background: transparent;
}

/* Дорешка: те же цвета, но визуально приглушённо (значение в скобках). */
.status-cell.practice,
.score-cell.practice {
  opacity: 0.6;
  font-style: italic;
  font-weight: 600;
}

/* «Зачтено» (ejudge/informatics RUN_ACCEPTED, не полный OK): остаётся зелёной
   ячейкой решённой задачи, но внутри выделяется жёлтой рамочкой. outline с
   отрицательным offset рисуется ВНУТРИ клетки и не влияет на разметку/фон. */
.status-cell.solved.accepted,
.score-cell.accepted {
  outline: 2px solid #e6b400;
  outline-offset: -4px;
  border-radius: 5px;
}

.grade-input {
  width: 4.2rem;
  padding: 0.3rem 0.4rem;
  font: inherit;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}

.grade-weight {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.85em;
}

.account-list {
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.6rem;
  padding: 0.6rem 0.7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.4;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  resize: vertical;
}

.contest-generated-at {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0.5rem 0 0;
}

/* «Живой» суффикс у меток последнего обновления: «N назад · следующее через …».
   Моноширинные цифры — чтобы обратный отсчёт не «дёргал» ширину. */
.update-extra {
  color: color-mix(in srgb, var(--accent-strong) 75%, var(--muted) 25%);
  font-variant-numeric: tabular-nums;
}
.server-clock {
  font-variant-numeric: tabular-nums;
}

.empty-hint {
  color: var(--muted);
  margin: 0.8rem 0 0;
}

.admin-block {
  margin: 1.1rem 0 1.4rem;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--line) 65%, transparent 35%);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-block h2 {
  margin: 0 0 0.8rem;
  color: var(--accent-strong);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.45rem 0.8rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 58%, var(--accent) 42%);
  background: color-mix(in srgb, var(--accent) 18%, var(--surface-strong) 82%);
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.admin-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 62%, var(--line) 38%);
  background: color-mix(in srgb, var(--accent) 28%, var(--surface-strong) 72%);
}

.admin-btn--secondary {
  background: color-mix(in srgb, var(--surface) 88%, var(--surface-strong) 12%);
}

/* Список групп на главной админки: одна сетка на все строки, чтобы колонки
   кнопок были выровнены между собой независимо от длины названий. */
.admin-groups-grid {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) repeat(3, max-content);
  gap: 0.5rem 0.9rem;
  align-items: center;
}

.admin-groups-grid li {
  display: contents;
}

.admin-groups-grid li span {
  color: var(--muted);
}

.admin-groups-grid li .admin-btn {
  min-height: 1.9rem;
  padding: 0.3rem 0.7rem;
  justify-self: stretch;
}

@media (max-width: 700px) {
  .admin-groups-grid {
    display: block;
  }

  .admin-groups-grid li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.6rem;
    margin: 0.6rem 0;
  }
}

.admin-groups-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.35rem 0;
}

.admin-groups-list li .admin-btn {
  margin-left: auto;
  min-height: 1.9rem;
  padding: 0.3rem 0.7rem;
}

/* Несколько кнопок в строке: вправо уходит только первая, остальные — вплотную. */
.admin-groups-list li .admin-btn + .admin-btn {
  margin-left: 0;
}

/* Объединённые группы: карточка — заголовок с кнопками, ниже состав. */
.combined-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

.combined-item {
  margin: 0.5rem 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface-strong);
}

.combined-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
}

.combined-item-title {
  font-weight: 600;
}

.combined-item-actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.combined-item-actions .admin-btn {
  min-height: 1.9rem;
  padding: 0.3rem 0.7rem;
}

.combined-item-members {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.admin-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: var(--muted);
}

.admin-form-grid input,
.admin-form-grid select {
  min-height: 2.2rem;
  border-radius: 9px;
  border: 1px solid color-mix(in srgb, var(--line) 74%, transparent 26%);
  background: var(--surface);
  color: var(--text);
  padding: 0.4rem 0.6rem;
}

.admin-form-grid__wide {
  grid-column: 1 / -1;
}

.admin-editor-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: flex-end;
  margin-bottom: 0.7rem;
}

.admin-select-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: var(--muted);
  min-width: min(560px, 100%);
  flex: 1 1 420px;
}

.admin-select-wrap select {
  min-height: 2.2rem;
  border-radius: 9px;
  border: 1px solid color-mix(in srgb, var(--line) 74%, transparent 26%);
  background: var(--surface);
  color: var(--text);
  padding: 0.4rem 0.6rem;
}

.admin-editor {
  height: min(62vh, 560px);
  min-height: 280px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent 40%);
  overflow: hidden;
}

.admin-editor-status {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-weight: 700;
}

.admin-editor-status--ok {
  color: color-mix(in srgb, var(--text) 72%, #1f8f4b 28%);
}

.admin-editor-status--error {
  color: #b03535;
}

/* Предупреждение о коллизии аккаунтов в пробном merge (dry-run). */
.merge-conflict-note {
  margin: 0.4rem 0 0.6rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e0a800;
  border-radius: 10px;
  background: color-mix(in srgb, #ffd54a 22%, var(--surface) 78%);
  color: var(--text);
  font-size: 0.9rem;
}
.merge-conflict-row {
  background: color-mix(in srgb, #ffd54a 14%, transparent 86%);
}
.merge-conflict-row td:last-child {
  color: #a06b00;
}
.acct-conflict {
  background: color-mix(in srgb, #ffd54a 40%, transparent 60%);
  outline: 1px solid #e0a800;
  border-radius: 4px;
  padding: 0 0.15rem;
}

.admin-result-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.45rem 0.8rem;
  margin-bottom: 0.65rem;
  color: var(--muted);
}

.admin-errors {
  margin: 0.3rem 0 0.8rem;
  padding-left: 1.2rem;
}

.admin-errors li + li {
  margin-top: 0.2rem;
}

.admin-log {
  margin: 0;
  padding: 0.7rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 64%, transparent 36%);
  background: color-mix(in srgb, var(--surface-strong) 62%, transparent 38%);
  color: var(--text);
  overflow: auto;
  max-height: 48vh;
}

@media (max-width: 768px) {
  .container {
    width: calc(100% - 1rem);
  }

  .header-inner {
    min-height: 54px;
  }

  .theme-toggle {
    min-width: 68px;
    font-size: 0.95rem;
  }

  .contest-block {
    padding: 0.68rem;
  }

  .contest-block-head {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 0.6rem;
  }

  .index-hero {
    padding: 0.8rem 0.85rem;
  }

  .form-block {
    padding: 0.7rem;
  }

  .form-embed-iframe {
    min-height: 700px;
  }

  .student-col,
  .student-name {
    min-width: 208px;
  }

  .footer-inner {
    font-size: 0.8rem;
    gap: 0.15rem;
  }

  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .admin-editor {
    height: min(58vh, 460px);
  }
}
