/* /new/ — minimal Wordle-like shell */
:root {
  --bg: #f9f9f9;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --accent: #6aaa64;
  --accent-hover: #538d4e;
  --border: #d3d6da;
  --tile: #e8e8e8;
  --danger: #b61f1f;
  --danger-soft: rgba(182, 31, 31, 0.1);
  --success-soft-bg: rgba(106, 170, 100, 0.12);
  --success-soft-border: rgba(106, 170, 100, 0.35);
  /* Таблица результатов: фон + цвет текста в ячейках */
  --results-cell-full-bg: #d8ffd8;
  --results-cell-full-fg: var(--text);
  --results-cell-some-bg: #fff0b0;
  --results-cell-some-fg: var(--text);
  --results-cell-partial-bg: #e0e0ff;
  --results-cell-partial-fg: var(--text);
  --results-cell-zero-bg: #ffd0d0;
  --results-cell-zero-fg: var(--text);
  --results-cell-no-bg: #f0f8ff;
  --results-cell-no-fg: var(--text);
  --results-row-me-bg: #b0c0ff;
  --results-row-me-fg: #1637b3;
  /* Якоря / scrollIntoView: запас под sticky-шапку (.new-nav) */
  --new-ui-scroll-margin-top: 5.5rem;
  font-size: 16px;
}

/* Тёмная палитра: только при классе .new-ui-dark (ставится скриптом из меню / системы) */
html.new-ui-dark {
  --bg: #121213;
  --surface: #1a1a1b;
  --text: #d7dadc;
  --muted: #a0a3a8;
  --accent: #6aaa64;
  --accent-hover: #7bc96f;
  --border: #3a3a3c;
  --tile: #2d2d2f;
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --success-soft-bg: rgba(106, 170, 100, 0.18);
  --success-soft-border: rgba(106, 170, 100, 0.42);
  --results-cell-full-bg: #1a3022;
  --results-cell-full-fg: #c8f0d0;
  --results-cell-some-bg: #3d3518;
  --results-cell-some-fg: #f5e7a8;
  --results-cell-partial-bg: #242b45;
  --results-cell-partial-fg: #cbd6ff;
  --results-cell-zero-bg: #3d2226;
  --results-cell-zero-fg: #f8c4c8;
  --results-cell-no-bg: #1c2433;
  --results-cell-no-fg: #b8d7f2;
  --results-row-me-bg: #2a3558;
  --results-row-me-fg: #e4e9ff;
}

*, *::before, *::after { box-sizing: border-box; }

body.new-ui {
  margin: 0;
  min-height: 100vh;
  font-family: "Clear Sans", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  color-scheme: light;
}

html.new-ui-dark body.new-ui {
  color-scheme: dark;
}

.new-wrap {
  max-width: 36rem;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
}

@media (min-width: 920px) {
  .new-wrap {
    max-width: 60rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* Nav */
.new-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
}

.new-nav__inner {
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

@media (min-width: 920px) {
  .new-nav__inner {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

.new-nav__brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--text);
}

.new-nav__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  align-items: center;
}

.new-clock {
  color: var(--muted);
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

/* Переключатель темы (☀️ / 🌙 / 💻 = системная) */
.new-theme-switch {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}

.new-theme-switch__btn {
  appearance: none;
  margin: 0;
  border: none;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1;
  padding: 0.25rem 0.45rem;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.new-theme-switch__btn:last-child {
  border-right: none;
}

.new-theme-switch__btn:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.new-theme-switch__btn.is-active {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 22%, var(--surface));
}

.new-nav__links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.35rem 0;
}

.new-nav__loginbtn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.35rem 0;
  cursor: pointer;
}

.new-nav__loginbtn:hover {
  color: var(--accent);
}

.new-nav__links a:hover,
.new-nav__links a[aria-current="page"] {
  color: var(--accent);
}

.new-mode-toggle {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.6rem !important;
  line-height: 1.6;
}

.new-mode-toggle:hover {
  border-color: var(--accent);
}

/* Tiles / cards */
.new-tile {
  display: block;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 4px;
  padding: 1.25rem 1rem;
  margin-bottom: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.1s;
}

.new-tile:hover {
  border-color: var(--accent);
}

.new-tile h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.new-tile p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.new-heading {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 1.5rem 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.new-category {
  margin-bottom: 1.5rem;
}

.new-task {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  min-width: 0;
}

.new-task > span {
  min-width: 0;
  flex: 1 1 auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.new-task:hover {
  border-color: var(--accent);
}

.new-task small {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.8rem;
}

/* Forms */
.new-form label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 1rem 0 0.35rem;
}

.new-form input[type="text"],
.new-form input[type="email"],
.new-form input[type="url"],
.new-form select,
.new-form textarea {
  width: 100%;
  max-width: 100%;
  padding: 0.65rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
}

/* Profile: compact name fields */
.new-profile-names input[type="text"] {
  padding: 0.55rem 0.65rem;
  font-size: 0.95rem;
}

.new-form input:focus,
.new-form select:focus {
  outline: none;
  border-color: var(--accent);
}

.new-field-error {
  display: block;
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.new-two {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}

@media (min-width: 560px) {
  .new-two {
    grid-template-columns: 1fr 1fr;
  }
}

.new-profile-head {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.new-profile-names {
  flex: 1 1 16rem;
  min-width: 16rem;
}

.new-avatar {
  width: 5.25rem;
  height: 5.25rem;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--tile);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.new-avatar:hover {
  border-color: var(--accent);
}

.new-avatar span {
  font-size: 0.85rem;
}

.new-btn {
  display: inline-block;
  margin-top: 1.25rem;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
}

.new-btn:hover {
  background: var(--accent-hover);
}

.new-btn--ghost {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.new-btn--danger {
  background: transparent;
  color: var(--danger);
  border: 2px solid var(--danger);
  margin-top: 0.5rem;
}

.new-messages {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.new-messages li {
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.new-messages .success {
  background: var(--success-soft-bg);
  color: var(--text);
  border: 1px solid var(--success-soft-border);
}
.new-messages .error {
  background: var(--danger-soft);
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--danger) 42%, transparent);
}

.new-team-block {
  margin-bottom: 1.75rem;
}

/* Страница «Мои команды»: крупные блоки (не тонкие линии между секциями) */
.new-team-hub-section {
  margin-top: 1.35rem;
  padding: 1.2rem 1.15rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.055);
}
html.new-ui-dark .new-team-hub-section {
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.4);
}
.new-team-hub-section:first-of-type {
  margin-top: 0;
}
.new-team-hub-section__title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.85rem;
  color: var(--muted);
  line-height: 1.35;
}
/* Переключатель команд: активная — отдельный подблок сверху */
.new-team-switcher-active-box {
  margin-top: 0.25rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}
html.new-ui-dark .new-team-switcher-active-box {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
}
.new-team-switcher-subheading {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.new-team-switcher-active-row {
  font-size: 1.05rem;
  line-height: 1.35;
}
.new-team-switcher-others-box {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
}
.new-team-switcher-others-label {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
}
/* Список остальных команд — разделитель только между строками */
.new-team-switcher-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.new-team-switcher-list > li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0;
}
.new-team-switcher-list > li:first-child {
  padding-top: 0;
}
.new-team-switcher-list > li + li {
  border-top: 1px dashed color-mix(in srgb, var(--border) 75%, transparent);
}
/* Активная команда — акцент слева; неактивные — нейтральная полоса */
.new-team-hub-section--primary {
  border-left: 4px solid var(--accent);
}
.new-team-hub-section--secondary {
  border-left: 4px solid color-mix(in srgb, var(--muted) 50%, var(--border));
}
.new-team-hub-heading {
  margin: 0 0 0.65rem;
  font-size: 1.25rem;
  line-height: 1.3;
}
.new-team-hub-heading--solo {
  margin-bottom: 0.35rem;
}

.new-team-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 760px) {
  .new-team-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.new-team-switch {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.75rem 0 1rem;
}

.new-switchbtn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

.new-switchbtn.is-active {
  border-color: var(--accent);
  color: var(--accent);
}

.new-team-panels {
  margin-top: 0.25rem;
}

.new-inline-check {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.new-checkmark {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 800;
}

.new-checkmark.ok {
  border-color: var(--accent);
  color: var(--accent);
}

.new-checkmark.bad {
  border-color: color-mix(in srgb, var(--danger) 75%, var(--border));
  color: var(--danger);
}

.new-link-muted {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0;
  margin-top: 0.75rem;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  font-size: 0.95rem;
}

.new-link-muted:hover {
  color: var(--text);
}

.new-link-dotted{
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  font-size: 0.95rem;
}

.new-link-dotted:hover{
  color: var(--text);
}

.new-community-links{
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.5rem;
}

.new-community-link{
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
}

.new-community-link .fa {
  color: var(--accent);
  opacity: 0.92;
}

.new-create-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.new-join-actions {
  margin-top: 0.75rem;
}

.new-team-block h2 {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
}

.new-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.new-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.new-list a.new-mini {
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.new-list a.new-mini:hover {
  border-color: var(--accent);
}

.new-login-hint {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 1rem 0;
}

.new-text-danger {
  color: var(--danger);
  font-weight: 700;
}

/* New UI: карточки заданий/описаний */
.new-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.9rem 1rem;
  margin: 0.75rem 0 1.25rem;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.new-card__title {
  color: var(--text);
}

.new-card__text {
  color: var(--text);
}

.new-pay-title {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.2px;
  padding-left: 0.65rem;
  border-left: 4px solid var(--accent);
  margin: -0.1rem 0 0.5rem;
}

.new-pay-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.new-pay-link {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1.2;
}

.new-pay-link:hover {
  border-color: var(--accent);
}

.new-pay-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* «скидка?» рядом с ценой билета по умолчанию (2000 ₽) */
.new-pay-line--price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
}

/* Открывается по клику (details), чтобы успеть нажать ссылку внутри */
.new-pay-discount {
  position: relative;
  display: inline-block;
  vertical-align: baseline;
}

.new-pay-discount > summary.new-pay-discount__trigger {
  list-style: none;
}

.new-pay-discount > summary.new-pay-discount__trigger::-webkit-details-marker {
  display: none;
}

.new-pay-discount__trigger {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px dashed var(--border);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  line-height: 1.25;
}

.new-pay-discount[open] .new-pay-discount__trigger {
  border-color: var(--accent);
  border-style: solid;
}

.new-pay-discount__tip {
  position: absolute;
  left: 0;
  top: calc(100% + 0.35rem);
  z-index: 20;
  min-width: 14rem;
  max-width: min(22rem, calc(100vw - 2rem));
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text);
}

.new-pay-discount__tip a {
  color: var(--accent);
  font-weight: 700;
}

.new-pay-discount__trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.new-taskcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
  scroll-margin-top: var(--new-ui-scroll-margin-top);
  /* В grid/flex иначе min-content ширины ломают колонку и контент вылезает */
  min-width: 0;
}

.new-taskgrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

/* Table views for TaskGroup.view: show tasks as 3 or 4 per row on wide screens. */
@media (min-width: 500px) {
  .new-taskgrid--3,
  .new-taskgrid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 800px) {
  .new-taskgrid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .new-taskgrid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* In grid mode, cards shouldn't have their own vertical margin. */
.new-taskgrid .new-taskcard {
  margin-bottom: 0;
}

/* Мета-полоса карточки (как в пропорциях): номер, баллы, попытки, подсказки, ответ, лайки */
.new-taskcard__meta-bar.new-proportions-compact-bar {
  margin: 0 0 0.6rem;
  padding: 0.28rem 0.45rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--tile) 35%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
  min-width: 0;
}

.new-taskcard__body {
  min-width: 0;
}

.new-taskcard__text {
  margin: 0 0 0.75rem;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.new-taskcard__text img,
.new-card img {
  max-width: 100%;
  height: auto;
}

.new-taskcard__img {
  margin: 0.35rem 0 0.65rem;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Не задавать width/max-width в CSS так, чтобы перебить атрибут width и get_image_width() */
.new-taskcard__img img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--tile);
}

.new-taskcard__points {
  color: var(--muted);
  font-size: 0.9rem;
  margin: -0.1rem 0 0.65rem;
}

.new-taskcard__penalty {
  margin-left: 0.35rem;
  color: var(--muted);
}

.new-max-points {
  font-weight: 800;
}

.new-max-points--reduced {
  color: var(--danger);
}

.new-hint-safe {
  margin-left: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.new-taskcard__answer {
  margin-top: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: var(--success-soft-bg);
  border: 1px solid var(--success-soft-border);
  border-radius: 6px;
  color: var(--text);
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.new-pill {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  background: transparent;
}

.new-pill--danger{
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
}

.new-card--warn{
  border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
  background: var(--danger-soft);
  color: var(--text);
}

.new-pill--ok {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
}

.new-action-link {
  border: none;
  background: transparent;
  padding: 0;
  color: var(--muted);
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.new-action-link:hover {
  color: var(--text);
}

.new-action-muted {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Likes/dislikes — similar to old UI, aligned right */
.new-like-dislike {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  margin-left: auto;
}

.new-likebtn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.95rem;
  line-height: 1.4;
}

.new-likebtn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.new-likebtn.is-active {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--border));
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
}

.new-likebtn--dislike.is-active {
  border-color: color-mix(in srgb, var(--danger) 48%, var(--border));
  color: var(--danger);
  background: var(--danger-soft);
}

.new-likebtn__count {
  font-weight: 700;
  color: inherit;
}

.new-attempt-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.new-attempt-row input[type="text"] {
  padding: 0.65rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  flex: 1 1 14rem;
  min-width: 12rem;
}

.new-attempt-row input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}

.new-btn--mini {
  margin-top: 0;
  padding: 0.65rem 0.9rem;
  font-size: 0.9rem;
}

/* New: Десяточки list */
.new-games-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/*
 * --- Кастомный скроллбар списка игр (отключён; вернуть вместе с разметкой и JS в folder_games.html) ---
.new-games-list-wrap {
  display: grid;
  grid-template-columns: 1fr 18px;
  gap: 0.75rem;
  align-items: start;
}

.new-smart-scrollbar-container {
  position: sticky;
  top: 4.25rem;
}

.new-smart-scrollbar {
  width: 12px;
  height: 220px;
  background: var(--tile);
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
}

.new-smart-scrollbar-track {
  width: 100%;
  background: var(--accent);
  border-radius: 999px;
  position: absolute;
  left: 0;
  top: 0;
  height: 10%;
  z-index: 0;
  pointer-events: none;
}

.new-smart-scrollbar-thumb {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 22px;
  background: var(--accent-hover);
  border-radius: 999px;
  cursor: grab;
  z-index: 1;
}

.new-smart-scrollbar-thumb:active { cursor: grabbing; }

@media (max-width: 720px) {
  .new-games-list-wrap { grid-template-columns: 1fr; }
  .new-smart-scrollbar-container { display: none; }
}

html.new-ui-dark .new-smart-scrollbar-track {
  background: color-mix(in srgb, var(--accent) 42%, var(--tile));
}

html.new-ui-dark .new-smart-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent) 88%, #1a1a1a);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 12%, transparent);
}
--- конец закомментированного кастомного скролла ---
*/

.new-games-list {
  display: grid;
  gap: 0.75rem;
}

.new-game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 0.9rem;
  display: grid;
  grid-template-columns: 10.5rem 1fr;
  gap: 0.85rem;
}

.new-game-card__time {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: left;
  margin-bottom: 0.5rem;
}

.new-game-card__logo img {
  width: 144px;
  height: 144px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--tile);
}

.new-game-card__title {
  font-weight: 800;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.new-game-card__meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.new-game-card__actions {
  margin-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.new-game-card__rowactions{
  display: inline-flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
}

.new-game-card__actions .new-btn--mini {
  padding: 0.55rem 0.8rem;
  font-size: 0.85rem;
  width: fit-content;
  max-width: 100%;
}

.new-games-list-footer {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.new-scrollbar-info {
  color: var(--muted);
  font-size: 0.85rem;
  /* при кастомном скролле в колонке справа: margin-top: 0.5rem; white-space: nowrap; */
}

.new-loading {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 720px) {
  .new-game-card { grid-template-columns: 1fr; }
}

.new-attempt-msg {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  min-height: 1.2em;
}

.new-hints {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
  scroll-margin-top: var(--new-ui-scroll-margin-top);
}

.new-hints__title {
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.new-hints__title .new-action-link{
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 800;
}

.new-hints__body{
  margin-top: 0.25rem;
}

.new-hint {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.5rem;
  background: color-mix(in srgb, var(--text) 4%, var(--surface));
}

.new-hint__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.new-hint__penalty{
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--danger) 38%, transparent);
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 800;
  font-size: 0.85rem;
  white-space: nowrap;
}

.new-hint__text {
  margin-top: 0.5rem;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Wall (порт из старого интерфейса, чуть адаптирован) */
.wall{
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}
.wall-tiles{
  display: grid;
  grid-template-columns: repeat(var(--wall-cols, 4), 148px);
  gap: 0.5rem;
  width: max-content;
  margin: 0 auto;
}
.wall-explanations{
  margin-top: 0.75rem;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.wall-tile{
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid rgba(116,112,143,0.6);
  border-radius: 8px;
  padding: 0.4rem 0.35rem;
  background: var(--surface);
  min-height: 74px;
  display: grid;
  place-items: center;
}
.wall-tile-not-guessed{
  background: rgba(233,232,242,0.6);
  cursor: pointer;
}
.wall-tile-not-guessed:hover{
  background: var(--surface);
}
.wall-tile-stop-guessing{
  cursor: default;
  opacity: 0.75;
}
.wall-tile-selected{
  background: #ffd86c;
}
.wall-tile-selected:hover{
  background: #fff0b0;
}
.wall-tile-guessed-0{ background: #33f97f !important; }
.wall-tile-guessed-1{ background: #44d890 !important; }
.wall-tile-guessed-2{ background: #44a97b !important; }
.wall-tile-guessed-3{ background: #498269 !important; }
.wall-tile-guessed-4{ background: #3d6358 !important; color: #fff; }
img.wall-tile-image{ max-height: 90px; max-width: 140px; }
img.wall-attempt-image{ max-height: 45px; max-width: 70px; }

@media (max-width: 720px){
  .wall-tiles{ grid-template-columns: repeat(2, 148px); }
}

.new-attempts {
  margin: 0.5rem 0 0.75rem;
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
}

.new-attempts__summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
  list-style: none;
}

.new-attempts__summary::-webkit-details-marker { display: none; }

.new-attempts__list {
  margin-top: 0.5rem;
  display: grid;
  gap: 0.5rem;
}

.new-attempts__row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.6rem;
}

.new-attempts__meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.new-attempts__points {
  font-weight: 800;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  background: rgba(0, 0, 0, 0.03);
}

.new-attempts__text {
  font-weight: 600;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.new-attempts__comment {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.new-tg-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

@media (max-width: 480px) {
  :root {
    /* На узком экране навигация в несколько строк — больше запас */
    --new-ui-scroll-margin-top: 7rem;
  }
  .new-nav__inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Палиндромы: карточка правил (как в макете Inter + синий) */
.pal-fullbleed {
  width: 100vw;
  max-width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  padding: 2.25rem 1.25rem 2.5rem;
  background: #f5f7fb;
  margin-bottom: 1.75rem;
  box-sizing: border-box;
}

.pal-card {
  max-width: 900px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
  padding: 36px;
  border: 1px solid #e5e7eb;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  color: #1f2937;
}

.pal-kicker {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.pal-title {
  font-size: 34px;
  line-height: 1.15;
  margin: 0 0 18px;
  font-weight: 800;
  color: #111827;
}

.pal-lead {
  font-size: 19px;
  line-height: 1.6;
  margin: 0 0 28px;
  color: #374151;
}

.pal-rules {
  display: grid;
  gap: 16px;
  margin: 0 0 34px;
}

.pal-rule {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 16px 18px;
}

.pal-rule-number {
  min-width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #2563eb;
  color: white;
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.25);
}

.pal-rule-text {
  font-size: 18px;
  line-height: 1.55;
  color: #1f2937;
}

.pal-example-box {
  margin-top: 12px;
  background: linear-gradient(135deg, #eff6ff, #f8fafc);
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  padding: 24px;
}

.pal-example-title {
  font-size: 24px;
  font-weight: 800;
  margin: 0 0 18px;
  color: #1d4ed8;
}

.pal-example-grid {
  display: grid;
  gap: 14px;
}

.pal-example-item {
  background: rgba(255, 255, 255, 0.88);
  border-radius: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(191, 219, 254, 0.85);
}

.pal-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1d4ed8;
  margin-bottom: 8px;
}

.pal-text {
  font-size: 20px;
  line-height: 1.45;
  color: #111827;
  font-weight: 600;
}

.pal-note {
  margin: 18px 0 0;
  font-size: 17px;
  line-height: 1.6;
  color: #374151;
}

.pal-after-card {
  margin-top: 0.5rem;
}

@media (max-width: 640px) {
  .pal-fullbleed {
    padding: 1.25rem 1rem 1.5rem;
  }

  .pal-card {
    padding: 24px 18px;
    border-radius: 18px;
  }

  .pal-title {
    font-size: 28px;
  }

  .pal-lead,
  .pal-rule-text,
  .pal-note {
    font-size: 16px;
  }

  .pal-text {
    font-size: 18px;
  }

  .pal-example-title {
    font-size: 20px;
  }
}

.new-task .new-task__meta {
  display: block;
  margin-top: 0.25rem;
  font-weight: 400;
}

.new-task.new-task--partial{
  background: color-mix(in srgb, #e8b923 22%, var(--surface));
  border-color: color-mix(in srgb, #e8b923 48%, var(--border));
}

.new-task.new-task--solved{
  background: color-mix(in srgb, var(--accent) 20%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
}

/* Заголовок раздела с кнопкой «Правила» */
.new-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.new-section-header__logo img{
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--tile);
  display: block;
}

.new-section-header__title{
  font-weight: 850;
  font-size: 1.55rem;
  letter-spacing: 0.2px;
  line-height: 1.1;
}

.new-section-header__actions{
  display: flex;
  align-items: center;
}

.new-section-header__actions .new-pill{
  margin-top: 0;
}

.new-results-fullbleed{
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 0 1rem 2rem;
  display: flex;
  justify-content: center;
}

.new-results-wrap{
  margin-top: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  overflow: auto;
  max-height: min(72vh, 720px);
  display: inline-block;
}

.new-results-table{
  /* Ширины первых колонок — переменные, на узких экранах уменьшаются (ниже). */
  --results-col-rank: 3.1rem;
  --results-col-team: 12.5rem;
  --results-col-score: 5.7rem;
  --results-col-time: 4.8rem;
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  font-size: 0.86rem;
}

.new-results-table th,
.new-results-table td{
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 0.32rem 0.42rem;
  background: var(--surface);
  white-space: nowrap;
  text-align: center;
}

.new-results-table thead th{
  font-weight: 800;
  background: color-mix(in srgb, var(--surface) 92%, var(--tile));
}

.new-results-table tr.is-me th,
.new-results-table tr.is-me td{
  background: var(--results-row-me-bg);
  font-weight: 800;
  color: var(--results-row-me-fg);
}

.new-results-table td.cell-full{
  background: var(--results-cell-full-bg);
  color: var(--results-cell-full-fg);
}
.new-results-table td.cell-some{
  background: var(--results-cell-some-bg);
  color: var(--results-cell-some-fg);
}
.new-results-table td.cell-partial{
  background: var(--results-cell-partial-bg);
  color: var(--results-cell-partial-fg);
}
.new-results-table td.cell-zero{
  background: var(--results-cell-zero-bg);
  color: var(--results-cell-zero-fg);
}
.new-results-table td.cell-no{
  background: var(--results-cell-no-bg);
  color: var(--results-cell-no-fg);
}

.new-results-table .hint-numbers{
  margin-left: 0.15rem;
  font-size: 0.8em;
  color: inherit;
  opacity: 0.78;
}

.new-results-table th.col-score,
.new-results-table td.col-score{
  text-align: left;
}

.new-results-table th.col-team{
  text-align: left;
  max-width: var(--results-col-team);
  overflow: hidden;
  text-overflow: ellipsis;
}

.new-results-table .is-sticky-top{
  position: sticky;
  top: 0;
  z-index: 5;
}
/* Second frozen row: top must match real height of first thead row (set via --results-sticky-row1-height in results template). */
.new-results-table .is-sticky-top-2{
  position: sticky;
  top: var(--results-sticky-row1-height, 2.15rem);
  z-index: 5;
}

.new-results-table .is-sticky-left{
  position: sticky;
  left: 0;
  z-index: 6;
  width: var(--results-col-rank);
  min-width: var(--results-col-rank);
}
.new-results-table .is-sticky-left-2{
  position: sticky;
  left: var(--results-col-rank);
  z-index: 6;
  width: var(--results-col-team);
  min-width: var(--results-col-team);
  max-width: var(--results-col-team);
}
.new-results-table .is-sticky-left-3{
  position: sticky;
  left: calc(var(--results-col-rank) + var(--results-col-team));
  z-index: 6;
  width: var(--results-col-score);
  min-width: var(--results-col-score);
}
.new-results-table .is-sticky-left-4{
  position: sticky;
  left: calc(var(--results-col-rank) + var(--results-col-team) + var(--results-col-score));
  z-index: 6;
  width: var(--results-col-time);
  min-width: var(--results-col-time);
}

.new-results-table thead .is-sticky-left,
.new-results-table thead .is-sticky-left-2,
.new-results-table thead .is-sticky-left-3,
.new-results-table thead .is-sticky-left-4{
  z-index: 7;
}

/* Узкий экран: уже «замороженные» колонки, чтобы оставалось место для горизонтального скролла задач */
@media (max-width: 640px) {
  .new-results-fullbleed {
    padding-left: 0.45rem;
    padding-right: 0.45rem;
  }
  .new-results-wrap {
    max-width: 100%;
  }
  .new-results-table {
    font-size: 0.76rem;
    --results-col-rank: 2rem;
    --results-col-team: 6.25rem;
    --results-col-score: 3.15rem;
    --results-col-time: 2.85rem;
  }
  .new-results-table th,
  .new-results-table td {
    padding: 0.22rem 0.28rem;
  }
}

@media (max-width: 380px) {
  .new-results-table {
    --results-col-rank: 1.75rem;
    --results-col-team: 5.25rem;
    --results-col-score: 2.85rem;
    --results-col-time: 2.6rem;
  }
}

.new-rules-trigger {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  padding: 0;
}

.new-rules-trigger:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.new-eye-toggle {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  padding: 0;
}

.new-eye-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.is-hidden {
  display: none !important;
}

/* When hiding solved tasks, keep their grid cell to avoid reflow/jumps. */
.new-taskcard.is-solved-hidden {
  visibility: hidden;
}

/* But if an entire row is solved, remove it completely. */
.new-taskcard.is-hidden-row {
  display: none !important;
}

/* Модальное окно правил */
.new-rules-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.new-rules-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.new-rules-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

.new-rules-modal__box {
  position: relative;
  z-index: 1;
  max-width:  min(900px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  margin: auto;
}

.new-rules-modal__box.pal-card {
  padding-top: 3.25rem;
}

.new-rules-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 50%;
  background: var(--tile);
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.new-rules-modal__close:hover {
  background: var(--border);
  color: var(--text);
}

/* Замены: переключатель режима ввода (слова / строка / весь текст) */
.new-replacements-task {
  margin-top: 0.25rem;
}
.new-replacements-mode-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}
.new-replacements-mode-bar__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.new-replacements-mode-bar__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.new-replacements-mode-btn {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  line-height: 1.3;
}
.new-replacements-mode-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.new-replacements-mode-btn.is-active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.new-replacements-fill-btn {
  font: inherit;
  font-size: 0.8rem;
  padding: 0.2rem 0.45rem;
  margin-left: 0.15rem;
  border: 1px dashed var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  line-height: 1.3;
}
.new-replacements-fill-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.new-replacements-fill-msg {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.35;
}
.new-replacements-fill-msg.is-error {
  color: #b42318;
}
html.new-ui-dark .new-replacements-fill-msg.is-error {
  color: #f5a5a0;
}
/* Панель «весь текст»: авторский display у textarea ломает атрибут hidden без !important */
.new-replacements-whole-panel[hidden] {
  display: none !important;
}
.new-replacements-whole-hint {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}
.new-replacements-whole__textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.45;
  padding: 0.45rem 0.55rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  resize: vertical;
  min-height: 5rem;
}
.new-replacements-line__paste-row {
  margin-top: 0.15rem;
}
.new-replacements-line-paste-row__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.new-replacements-fill-btn--inline {
  flex-shrink: 0;
  margin-left: 0;
}
.new-replacements-line-paste-field {
  font: inherit;
  font-size: 0.95rem;
  flex: 1 1 12rem;
  min-width: 8rem;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
}

/* Замены (replacements_lines): таблица — левый и правый столбцы, строчки напротив друг друга */
.new-replacements-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  table-layout: fixed;
}
.new-replacements-table tr {
  vertical-align: top;
}
.new-replacements-table td {
  padding: 0.5rem 0.6rem;
  line-height: 1.5;
  border-bottom: 1px solid var(--border);
}
.new-replacements-table tr:last-child td {
  border-bottom: none;
}
.new-replacements-table .new-replacements-col--check { width: 72px; }
.new-replacements-table .new-replacements-col--left { width: calc((100% - 72px) / 2); }
.new-replacements-table .new-replacements-col--right { width: calc((100% - 72px) / 2); }

.new-replacements-table .new-replacements-block__left {
  word-break: normal;
  overflow-wrap: normal;
  overflow-x: auto;
  max-width: 100%;
  vertical-align: top;
}
.new-replacements-table .new-replacements-block__check {
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
}
.new-replacements-table .new-replacements-block__check .new-replacements-line__attempts {
  display: block;
  margin-top: 0.2rem;
}
.new-replacements-table .new-replacements-block__check .new-repl-line-answer {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
}
.new-replacements-table .new-replacements-block__right {
  white-space: normal;
  overflow-x: auto;
  overflow-wrap: normal;
  word-break: normal;
  max-width: 100%;
  vertical-align: top;
}
.new-replacements-block__left--solved {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}
.new-replacements-block__right--solved {
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
}
.new-replacements-block__right form.new-replacements-line-form {
  display: inline;
}
.new-replacements-block__right form.new-replacements-line-form .new-replacements-line__meta {
  display: inline-flex;
  vertical-align: middle;
}
.new-replacements-block__right form.new-replacements-line-form .new-replacements-line-msg {
  display: none;
}
.new-replacements-line__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: 0.25rem;
  flex-shrink: 0;
}
.new-replacements-check-btn {
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.new-replacements-check-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.new-replacements-check-btn--done {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  cursor: default;
}
.new-replacements-line__attempts {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}
.new-replacements-line__inputs {
  display: inline;
  white-space: normal;
  font-size: 0; /* убирает пробелы от шаблонных переносов между inline-элементами */
}
.new-replacements-line__inputs .new-replacements-static,
.new-replacements-line__inputs .new-replacements-partial-answer,
.new-replacements-line__inputs .new-replacements-input {
  font-size: 1rem;
}
.new-replacements-line__inputs input {
  margin: 0 0.15rem 0.15rem 0;
}
.new-replacements-input {
  font: inherit;
  padding: 0.15rem 0.3rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  width: auto;
  min-width: 4ch;
  max-width: 16ch;
  display: inline-block;
  margin: 0 0.15rem 0.15rem 0;
}
.new-replacements-static {
  white-space: pre-wrap;
  font-size: 1rem;
}
.new-replacements-line__solved-text {
  font-weight: 500;
  font-size: 0; /* убирает пробелы между токенами, пробелы берём из token.text */
}
.new-replacements-line__solved-text strong {
  text-transform: uppercase;
  font-size: 1rem;
  font-weight: 800;
}

.new-replacements-partial-answer {
  font-weight: 800;
  text-transform: uppercase;
  font-size: 1rem;
}

.new-replacements-line-msg {
  display: none;
  width: 100%;
  margin-top: 0.2rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ─── Тёмная тема: pal-*, стена, оплата (только html.new-ui-dark) ─── */
html.new-ui-dark .pal-fullbleed {
  background: var(--bg);
}

html.new-ui-dark .pal-card {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

html.new-ui-dark .pal-kicker {
  color: var(--muted);
}

html.new-ui-dark .pal-title {
  color: var(--text);
}

html.new-ui-dark .pal-lead {
  color: var(--muted);
}

html.new-ui-dark .pal-rule {
  background: color-mix(in srgb, var(--text) 5%, var(--surface));
  border-color: var(--border);
}

html.new-ui-dark .pal-rule-text {
  color: var(--text);
}

html.new-ui-dark .pal-rule-number {
  background: #3b5bdb;
  box-shadow: 0 6px 18px rgba(59, 91, 219, 0.35);
}

html.new-ui-dark .pal-example-box {
  background: color-mix(in srgb, #60a5fa 12%, var(--surface));
  border-color: color-mix(in srgb, #60a5fa 35%, var(--border));
}

html.new-ui-dark .pal-example-title {
  color: #93c5fd;
}

html.new-ui-dark .pal-example-item {
  background: color-mix(in srgb, var(--text) 6%, var(--surface));
  border-color: var(--border);
}

html.new-ui-dark .pal-label {
  color: #93c5fd;
}

html.new-ui-dark .pal-text {
  color: var(--text);
}

html.new-ui-dark .pal-note {
  color: var(--muted);
}

/* Стена: не неоновые зелёные плитки, читаемый текст */
html.new-ui-dark .wall-tile {
  border-color: var(--border);
  color: var(--text);
}

html.new-ui-dark .wall-tile-not-guessed {
  background: color-mix(in srgb, var(--tile) 80%, var(--bg));
}

html.new-ui-dark .wall-tile-not-guessed:hover {
  background: color-mix(in srgb, var(--surface) 70%, var(--tile));
}

html.new-ui-dark .wall-tile-selected {
  background: #6b4c0a;
  color: #fff8e1;
}

html.new-ui-dark .wall-tile-selected:hover {
  background: #7d5a12;
  color: #fffef5;
}

html.new-ui-dark .wall-tile-guessed-0 {
  background: #1a4d32 !important;
  color: #9ef0b4 !important;
}
html.new-ui-dark .wall-tile-guessed-1 {
  background: #1f5238 !important;
  color: #8ee8a8 !important;
}
html.new-ui-dark .wall-tile-guessed-2 {
  background: #245a3e !important;
  color: #7fd99a !important;
}
html.new-ui-dark .wall-tile-guessed-3 {
  background: #2a6248 !important;
  color: #7dceb0 !important;
}
html.new-ui-dark .wall-tile-guessed-4 {
  background: #1e3d32 !important;
  color: #e2f5ef !important;
}

/* Хаб / десяточки: заголовки секций чуть ярче серого */
html.new-ui-dark .new-heading {
  color: color-mix(in srgb, var(--text) 72%, var(--muted));
}

html.new-ui-dark .new-pay-discount__tip {
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.55);
  border-color: var(--border);
}

/* Контейнер виджета ЮKassa (iframe внутри не красим) */
html.new-ui-dark #new-yookassa-widget {
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  min-height: 2rem;
  overflow: hidden;
}

/*
 * Форма оплаты: yookassa_construct_form.css задаёт #000 / #fff.
 * Перекрываем только в тёмной теме под переменные new-ui.
 */
html.new-ui-dark body.new-ui .yoomoney-payment-form {
  color: var(--text) !important;
  font-family: inherit !important;
}

html.new-ui-dark body.new-ui .yoomoney-payment-form .ym-block-title,
html.new-ui-dark body.new-ui .yoomoney-payment-form .ym-products-title {
  color: var(--text) !important;
}

html.new-ui-dark body.new-ui .yoomoney-payment-form .ym-label-text {
  color: var(--muted) !important;
}

html.new-ui-dark body.new-ui .yoomoney-payment-form .ym-products {
  color: var(--text) !important;
}

html.new-ui-dark body.new-ui .yoomoney-payment-form .ym-products .ym-product:after,
html.new-ui-dark body.new-ui .yoomoney-payment-form .ym-before-line:before {
  background: color-mix(in srgb, var(--text) 12%, transparent) !important;
}

html.new-ui-dark body.new-ui .yoomoney-payment-form .ym-product-description .ym-product-count {
  color: var(--muted) !important;
}

html.new-ui-dark body.new-ui .yoomoney-payment-form .ym-product-description,
html.new-ui-dark body.new-ui .yoomoney-payment-form .ym-product-price {
  color: var(--text) !important;
}

html.new-ui-dark body.new-ui .yoomoney-payment-form .ym-input,
html.new-ui-dark body.new-ui .yoomoney-payment-form .ym-textarea {
  background: var(--tile) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

html.new-ui-dark body.new-ui .yoomoney-payment-form .ym-input::placeholder,
html.new-ui-dark body.new-ui .yoomoney-payment-form .ym-textarea::placeholder {
  color: var(--muted) !important;
  opacity: 1 !important;
}

html.new-ui-dark body.new-ui .yoomoney-payment-form .ym-count-input input {
  background: var(--tile) !important;
  color: var(--text) !important;
}

html.new-ui-dark body.new-ui .yoomoney-payment-form .ym-count-input .ym-count-minus,
html.new-ui-dark body.new-ui .yoomoney-payment-form .ym-count-input .ym-count-plus {
  filter: invert(1) brightness(1.15);
  opacity: 0.75;
}

html.new-ui-dark body.new-ui .yoomoney-payment-form .ym-payment-btn-block .ym-btn-pay {
  background: var(--accent) !important;
  color: #fff !important;
  border: 1px solid color-mix(in srgb, var(--accent) 65%, #000) !important;
}

html.new-ui-dark body.new-ui .yoomoney-payment-form .ym-payment-btn-block .ym-btn-pay:hover {
  background: var(--accent-hover) !important;
}

html.new-ui-dark body.new-ui .yoomoney-payment-form .ym-payment-btn-block .ym-disabled-btn {
  background: var(--tile) !important;
  color: var(--muted) !important;
  opacity: 0.65 !important;
  border: 1px solid var(--border) !important;
}

html.new-ui-dark body.new-ui .yoomoney-payment-form .ym-input-icon-rub:after {
  color: var(--muted) !important;
}

html.new-ui-dark body.new-ui .yoomoney-payment-form .ym-block-with-hint .ym-hint,
html.new-ui-dark body.new-ui .yoomoney-payment-form .ym-block-with-hint .ym-hint:before {
  background: var(--danger) !important;
  color: #fff !important;
}

/* Пропорции: карточка-лист — overflow не трогаем, иначе ломается sticky у пула */
.new-card.new-proportions-sheet {
  overflow: visible;
}

.new-proportions-matrix-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  margin-top: 0.25rem;
}

/* Липкий пул объектов под шапкой new-ui */
.new-proportions-pool-sticky {
  position: sticky;
  top: calc(var(--new-ui-scroll-margin-top, 5.5rem) + 0.35rem);
  z-index: 8;
  margin: 0 -0.35rem;
  padding: 0.5rem 0.5rem 0.65rem;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--text) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
}

html.new-ui-dark .new-proportions-pool-sticky {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* Телефон / узкий экран: не фиксируем пул с подсказками — иначе при скролле занимает весь экран */
@media (max-width: 48rem) {
  .new-proportions-pool-sticky {
    position: static;
    top: auto;
    z-index: auto;
  }
}

button.new-proportions-pool-return-link {
  display: inline-flex;
  align-items: center;
  margin-left: 0.15rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--surface) 85%, var(--accent));
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  line-height: 1.25;
  vertical-align: baseline;
  white-space: nowrap;
  touch-action: manipulation;
  cursor: pointer;
}

button.new-proportions-pool-return-link:hover {
  background: color-mix(in srgb, var(--surface) 70%, var(--accent));
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
}

button.new-proportions-pool-return-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Proportions task group: shared pool + two drop slots per task */
.new-proportions-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.5rem 0.6rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 92%, var(--tile));
  touch-action: manipulation;
}

.new-proportions-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.2;
  cursor: grab;
  user-select: none;
  max-width: 100%;
  word-break: break-word;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--text) 6%, transparent);
  touch-action: manipulation;
}

.new-proportions-chip:active {
  cursor: grabbing;
}

.new-proportions-chip--picked {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}

.new-proportions-answer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  margin-top: 0.75rem;
}

.new-proportions-slot {
  flex: 1 1 6rem;
  min-height: 2.6rem;
  min-width: 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.4rem;
  border: 2px dashed var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, var(--tile));
  transition: border-color 0.15s ease, background 0.15s ease;
  touch-action: manipulation;
}

.new-proportions-slot--filled {
  border-style: solid;
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: var(--success-soft-bg);
}

.new-proportions-slot .new-proportions-chip {
  width: 100%;
  text-align: center;
}

.new-proportions-slash {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--muted);
  flex: 0 0 auto;
}

.new-proportions-submit-row {
  margin-top: 0.75rem;
}

.new-proportions-submit-row .new-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.new-proportions-touch-hint {
  display: none;
}

@media (hover: none) and (pointer: coarse) {
  .new-proportions-touch-hint {
    display: block;
  }
}

/* Пропорции: один лист — таблица как у «Замен» (условие | = | слоты) */
.new-proportions-sheet__intro + .new-login-hint {
  margin-top: 0.25rem;
}

.new-proportions-matrix {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.35rem;
  table-layout: fixed;
}

.new-proportions-matrix tr.new-proportions-matrix__meta-row {
  vertical-align: top;
}

.new-proportions-matrix tr.new-proportions-matrix__row {
  vertical-align: middle;
}

.new-proportions-matrix tr.new-proportions-matrix__row > td {
  vertical-align: middle;
}

.new-proportions-matrix td {
  padding: 0.35rem 0.45rem;
  line-height: 1.35;
  border-bottom: 1px solid var(--border);
}

.new-proportions-matrix tr:last-child td {
  border-bottom: none;
}

.new-proportions-matrix__col--eq {
  width: 1.85rem;
}

.new-proportions-matrix__col--submit {
  width: 2.65rem;
}

.new-proportions-matrix__col--prompt,
.new-proportions-matrix__col--slots {
  width: calc((100% - 1.85rem - 2.65rem) / 2);
}

.new-proportions-matrix__prompt {
  word-break: normal;
  overflow-wrap: break-word;
  max-width: 100%;
}

.new-proportions-matrix__task-text {
  text-align: right;
}

.new-proportions-matrix__task-text > :first-child {
  margin-top: 0;
}

.new-proportions-matrix__task-text > :last-child {
  margin-bottom: 0;
}

.new-proportions-matrix__prompt--solved {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.new-proportions-matrix__eq {
  text-align: center;
  white-space: nowrap;
  padding-left: 0.2rem;
  padding-right: 0.2rem;
}

.new-proportions-matrix__equals {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1;
  position: relative;
  top: -0.26em;
}

.new-proportions-matrix__submit {
  text-align: center;
  white-space: nowrap;
  padding-left: 0.2rem;
  padding-right: 0.2rem;
}

.new-proportions-matrix__submit .new-replacements-check-btn,
.new-proportions-matrix__submit .new-proportions-matrix__check-done {
  width: 1.35rem;
  height: 1.35rem;
  font-size: 0.82rem;
  position: relative;
  top: -0.26em;
}

.new-proportions-matrix__check-done {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.new-proportions-matrix__slots-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  min-height: 0;
}

.new-proportions-matrix__slots-inner .new-proportions-answer-row--matrix {
  position: relative;
  top: 0.26em;
}

.new-proportions-matrix__slots--solved .new-proportions-matrix__slots-inner {
  justify-content: center;
  align-items: stretch;
}

.new-proportions-matrix__slots-inner .new-proportions-matrix__solved-answer {
  position: relative;
  top: -0.35em;
  font-weight: 700;
  text-align: left;
  width: 100%;
  line-height: 1.35;
}

.new-proportions-matrix__slots--solved {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
}

/* Компактная полоса: номер, попытки, баллы, подсказки, ответ, лайки */
.new-proportions-matrix__meta-row td,
.new-proportions-matrix__meta-cell {
  padding: 0.28rem 0.4rem 0.32rem;
  border-bottom: none;
  background: color-mix(in srgb, var(--tile) 35%, var(--surface));
}

.new-proportions-compact-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.45rem;
  font-size: 0.78rem;
  line-height: 1.2;
}

.new-proportions-compact-bar__num {
  font-weight: 700;
  color: var(--text);
}

.new-proportions-compact-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  font-variant-numeric: tabular-nums;
}

/* «ок» в пропорциях: как new-pill, но явный зелёный акцент */
.new-proportions-compact-badge--ok-strong.new-pill--ok {
  color: var(--success);
  border-width: 2px;
  border-color: var(--success-soft-border);
  background: var(--success-soft-bg);
  font-weight: 800;
  font-size: 0.78rem;
  padding: 0.2rem 0.55rem;
  text-transform: lowercase;
  letter-spacing: 0.03em;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--success) 22%, transparent);
}

.new-proportions-compact-points-pill {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.08rem 0.2rem;
  padding: 0.22rem 0.55rem;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--border) 92%, var(--text));
  background: color-mix(in srgb, var(--tile) 50%, var(--surface));
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--text) 5%, transparent),
    0 1px 2px color-mix(in srgb, var(--text) 6%, transparent);
  font-size: 0.78rem;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.new-proportions-compact-stat {
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.25;
}

.new-proportions-compact-points-pill .new-proportions-compact-stat__nums,
.new-proportions-compact-stat__nums {
  font-weight: 800;
}

.new-proportions-compact-stat__sep {
  color: var(--muted);
  font-weight: 500;
}

.new-proportions-compact-stat__paren {
  color: var(--muted);
  font-weight: 500;
}

.new-proportions-compact-stat--plain {
  color: var(--muted);
  font-size: 0.78rem;
}

.new-proportions-attempts-popover {
  margin: 0 !important;
  padding: 0.5rem 0.6rem 0.55rem;
  max-width: min(24rem, calc(100vw - 1rem));
  max-height: min(70vh, 20rem);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 12px 40px color-mix(in srgb, var(--text) 18%, transparent);
  position: fixed;
  inset: auto;
  width: max-content;
  min-width: min(12rem, 100vw - 1rem);
}

.new-proportions-attempts-popover::backdrop {
  background: color-mix(in srgb, var(--text) 12%, transparent);
}

html.new-ui-dark .new-proportions-attempts-popover::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.new-proportions-attempts-popover__title {
  font-size: 0.8rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

.new-proportions-attempts-popover__list {
  margin: 0;
}

.new-proportions-compact-textbtn {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.1rem 0;
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.78rem;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
  touch-action: manipulation;
}

.new-proportions-compact-textbtn:hover {
  color: var(--text);
}

.new-proportions-compact-textbtn--success {
  color: var(--success);
  text-decoration-color: color-mix(in srgb, var(--success) 55%, transparent);
}

.new-proportions-compact-textbtn--success:hover {
  color: color-mix(in srgb, var(--success) 82%, var(--text));
  text-decoration-color: color-mix(in srgb, var(--success) 40%, transparent);
}

.new-like-dislike--compact-bar {
  margin-left: 0;
  gap: 0.28rem;
}

.new-like-dislike--compact-bar .new-likebtn {
  padding: 0.12rem 0.38rem;
  font-size: 0.74rem;
  gap: 0.22rem;
  border-radius: 999px;
}

.new-like-dislike--compact-bar .new-likebtn__icon {
  font-size: 0.8rem;
}

.new-like-dislike--compact-bar .new-likebtn__count {
  font-size: 0.74rem;
}

.new-proportions-compact-bar__fill {
  flex: 1 1 auto;
  min-width: 0.25rem;
}

.new-proportions-compact-img {
  margin-top: 0.35rem;
}

.new-proportions-compact-img img {
  display: block;
  max-width: 100%;
  max-height: 5rem;
  width: auto;
  height: auto;
  border-radius: 6px;
  object-fit: contain;
}

.new-hints--compact {
  margin-top: 0.35rem;
}

.new-hints--compact .new-hints__body:not([hidden]) {
  padding: 0.35rem 0;
}

/* Компактные слоты в строке уравнения */
.new-proportions-answer-row--matrix.new-proportions-answer-row {
  margin-top: 0;
  gap: 0.35rem 0.45rem;
}

.new-attempt-row--matrix-fallback {
  margin-top: 0;
}

.new-proportions-matrix .new-proportions-slot {
  min-height: 2rem;
  min-width: 3.5rem;
  padding: 0.15rem 0.3rem;
}

.new-proportions-matrix .new-proportions-slash {
  font-size: 1rem;
}

tr.new-proportions-matrix__row.is-solved-hidden,
tr.new-proportions-matrix__meta-row.is-solved-hidden {
  display: none !important;
}
