/* Mafia IT Party — компоненты. Цвета только из tokens.css. */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--text-300);
  background: var(--ink-900);
  background-image:
    radial-gradient(120% 70% at 50% -10%, rgba(194, 161, 90, 0.13) 0%, rgba(194, 161, 90, 0) 55%),
    radial-gradient(90% 60% at 85% 8%, rgba(14, 26, 43, 0.9) 0%, rgba(14, 26, 43, 0) 60%),
    linear-gradient(180deg, var(--ink-850) 0%, var(--ink-900) 45%, #08090c 100%);
  background-attachment: fixed;
}

/* зерно — снимает стерильность плоской заливки */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { max-width: 100%; display: block; }

a { color: var(--brass-300); text-decoration: none; }
a:hover { color: var(--brass-100); }

:focus-visible {
  outline: 2px solid var(--brass-500);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text-100);
  font-weight: 400;
  letter-spacing: -0.015em;
  margin: 0 0 var(--sp-4);
  line-height: 1.12;
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 500; }

p { margin: 0 0 var(--sp-4); text-wrap: pretty; }

/* ---------- служебные ---------- */

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--sp-4); }
.wrap--narrow { max-width: var(--wrap-narrow); }
.stack > * + * { margin-top: var(--sp-4); }
.row { display: flex; align-items: center; gap: var(--sp-3); }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--text-400); }
.dim { color: var(--text-600); }
.center { text-align: center; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass-500);
}

.rule {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--line-strong) 18%, var(--line-strong) 82%, transparent);
  margin: var(--sp-6) 0;
}

/* ---------- шапка ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: blur(10px);
  background: rgba(11, 13, 16, 0.82);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  min-height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-100);
}

.brand:hover { color: var(--brass-300); }

.brand__mark {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 1px solid var(--brass-700);
  border-radius: 4px;
  color: var(--brass-500);
  font-size: 12px;
  background: linear-gradient(160deg, rgba(194, 161, 90, 0.2), rgba(194, 161, 90, 0));
}

.nav { display: none; gap: var(--sp-5); margin-left: var(--sp-5); }
.nav a {
  color: var(--text-400);
  font-size: var(--fs-small);
  letter-spacing: 0.02em;
  padding: var(--sp-2) 0;
  border-bottom: 1px solid transparent;
}
.nav a:hover { color: var(--text-100); }
.nav a[aria-current="page"] { color: var(--text-100); border-bottom-color: var(--brass-500); }

.nav-toggle {
  margin-left: auto;
  min-height: 40px;
  background: none;
  border: 1px solid var(--line);
  color: var(--text-100);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  cursor: pointer;
}

.nav-mobile {
  display: none;
  flex-direction: column;
  padding: var(--sp-3) 0 var(--sp-5);
  border-top: 1px solid var(--line);
}
.nav-mobile.is-open { display: flex; }
.nav-mobile a { padding: var(--sp-3) 0; color: var(--text-300); border-bottom: 1px solid var(--line-cold); }

@media (min-width: 900px) {
  .nav { display: flex; }
  .nav-toggle { display: none; }
  .nav-mobile { display: none !important; }
}

/* на телефоне кнопки аккаунта живут в мобильном меню — в шапке им не хватает места.
   Специфичность двойная: одиночный класс перебивался более поздним `.btn { display }`. */
@media (max-width: 767px) {
  .site-header .header-account { display: none; }
}

/* ---------- кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 11px 20px;
  border-radius: var(--r-sm);
  border: 1px solid var(--brass-700);
  background: linear-gradient(175deg, var(--brass-500), #a8874a);
  color: #17130a;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: var(--fs-body);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.12s var(--ease), filter 0.18s var(--ease), box-shadow 0.18s var(--ease);
  box-shadow: 0 6px 20px rgba(194, 161, 90, 0.16), var(--shadow-inset);
}
.btn:hover { filter: brightness(1.07); color: #17130a; }
.btn:active { transform: scale(0.96); }

.btn--ghost {
  background: transparent;
  color: var(--text-100);
  border-color: var(--line-strong);
  box-shadow: none;
}
.btn--ghost:hover { background: rgba(194, 161, 90, 0.08); color: var(--text-100); }

.btn--danger { background: linear-gradient(175deg, #a33636, #7c2626); border-color: #6d2323; color: #f6e7e7; }
.btn--sm { padding: 7px 13px; font-size: var(--fs-small); }
/* на телефоне маленькая кнопка всё равно остаётся удобной целью нажатия */
@media (max-width: 767px) { .btn--sm { min-height: 40px; } }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }

/* ---------- поверхности ---------- */

.card {
  position: relative;
  background: linear-gradient(180deg, var(--ink-700), var(--ink-800));
  border: 1px solid var(--line-cold);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow-inset);
}

.card--brass { border-color: var(--line-strong); }

.card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.panel {
  background: var(--ink-800);
  border: 1px solid var(--line-cold);
  border-radius: var(--r-md);
  padding: var(--sp-4);
}

.grid { display: grid; gap: var(--sp-4); }
/* элементы грида по умолчанию имеют min-width:auto и не могут ужаться уже своего
   содержимого — из-за этого страница разбора и профиль ехали горизонтально на 375 px */
.grid > *,
.grid--side > *,
.recap-grid > *,
.role-deck > *,
.plaques > * { min-width: 0; }
@media (min-width: 768px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--side { grid-template-columns: minmax(0, 1fr) 320px; gap: var(--sp-6); }
}

/* ---------- бейджи ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: rgba(194, 161, 90, 0.07);
  color: var(--brass-300);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge--red { border-color: rgba(194, 85, 85, 0.4); background: rgba(142, 43, 43, 0.16); color: var(--red-light); }
.badge--felt { border-color: rgba(63, 125, 99, 0.4); background: rgba(18, 59, 46, 0.35); color: #7cc0a2; }
.badge--cold { border-color: var(--line-cold); background: rgba(255, 255, 255, 0.03); color: var(--text-400); }

.delta { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.delta--up { color: #6fb98f; }
.delta--down { color: var(--red-light); }
.delta--flat { color: var(--text-600); }

/* ---------- герой ---------- */

.hero { padding: var(--sp-7) 0 var(--sp-6); }
.hero__eyebrow { margin-bottom: var(--sp-4); }
.hero__title {
  font-family: var(--font-display);
  font-size: var(--fs-hero);
  font-weight: 200;
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--text-100);
  margin: 0 0 var(--sp-4);
}
.hero__title strong { font-weight: 700; color: var(--brass-300); }
.hero__lead { max-width: 560px; color: var(--text-300); font-size: calc(var(--fs-body) + 1px); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-5); }

@media (min-width: 1024px) {
  .hero { padding: var(--sp-8) 0 var(--sp-7); }
  .hero__grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: var(--sp-7); align-items: center; }
}

/* ---------- лидерборд ---------- */

.plaques { display: grid; gap: var(--sp-4); }
@media (min-width: 720px) { .plaques { grid-template-columns: repeat(3, 1fr); align-items: end; } }

.plaque {
  position: relative;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(194, 161, 90, 0.14), rgba(194, 161, 90, 0) 60%),
    linear-gradient(180deg, var(--ink-700), var(--ink-800));
  padding: var(--sp-5) var(--sp-4);
  text-align: center;
  box-shadow: var(--shadow-inset);
}
.plaque--1 { border-color: var(--line-strong); box-shadow: 0 22px 60px rgba(194, 161, 90, 0.12), var(--shadow-inset); }
@media (min-width: 720px) { .plaque--1 { transform: translateY(-14px); } }

.plaque__place {
  width: 40px; height: 40px; margin: 0 auto var(--sp-3);
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--brass-700);
  background: radial-gradient(circle at 30% 25%, var(--brass-300), #8a6f34);
  color: #16120a;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
}
.plaque__name { font-family: var(--font-display); font-size: var(--fs-h3); color: var(--text-100); margin-bottom: 2px; }
.plaque__rating {
  font-family: var(--font-display);
  font-weight: 200;
  font-size: 46px;
  line-height: 1;
  color: var(--brass-300);
  font-variant-numeric: tabular-nums;
  margin: var(--sp-3) 0 var(--sp-2);
}
.plaque__meta { font-size: var(--fs-small); color: var(--text-400); }

.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--line-cold); }

table.board { width: 100%; border-collapse: collapse; min-width: 620px; background: var(--ink-800); }
table.board th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-600);
  font-weight: 400;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.board td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line-cold);
  vertical-align: middle;
}
table.board tbody tr:hover { background: rgba(194, 161, 90, 0.045); }
table.board tbody tr:last-child td { border-bottom: 0; }
.board__place { font-family: var(--font-mono); color: var(--text-600); width: 52px; }
.board__name { color: var(--text-100); font-weight: 500; }
.board__rating { font-family: var(--font-mono); font-size: 17px; color: var(--brass-300); font-variant-numeric: tabular-nums; }
.board__num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-300); }

/* форма последних игр */
.form-strip { display: inline-flex; gap: 3px; }
.form-strip i {
  width: 6px; height: 18px; border-radius: 2px; display: block;
  background: var(--ink-500);
}
.form-strip i[data-v="w"] { background: var(--win); }
.form-strip i[data-v="l"] { background: var(--red-card); }

/* ---------- профиль ---------- */

.profile-head { display: grid; gap: var(--sp-5); }
@media (min-width: 860px) { .profile-head { grid-template-columns: 1fr auto; align-items: center; } }

.avatar {
  width: 64px; height: 64px; border-radius: 50%;
  border: 1px solid var(--brass-700);
  background: radial-gradient(circle at 30% 25%, var(--ink-600), var(--ink-800));
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 22px; color: var(--brass-300);
}

.numeral {
  font-family: var(--font-display);
  font-weight: 200;
  font-size: var(--fs-numeral);
  line-height: 0.92;
  letter-spacing: -0.04em;
  color: var(--brass-300);
  font-variant-numeric: tabular-nums;
}

.skill { margin-bottom: var(--sp-3); }
.skill__top { display: flex; justify-content: space-between; font-size: var(--fs-small); margin-bottom: 5px; }
.skill__name { color: var(--text-300); }
.skill__val { font-family: var(--font-mono); color: var(--brass-300); font-variant-numeric: tabular-nums; }
.skill__bar { height: 6px; border-radius: 3px; background: var(--ink-600); overflow: hidden; }
.skill__fill {
  /* span по умолчанию inline — ширина и высота к нему не применяются, и полоска
     схлопывалась в 0×0 при корректном style="width:57%" в разметке */
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--brass-700), var(--brass-300));
}

.rank-track { height: 6px; border-radius: 3px; background: var(--ink-600); overflow: hidden; margin-top: var(--sp-2); }
.rank-track > span { display: block; height: 100%; background: linear-gradient(90deg, var(--felt-light), var(--brass-500)); }

/* ---------- карточки разборов ---------- */

.recap-grid {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .recap-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .recap-grid { grid-template-columns: repeat(3, 1fr); } }

.recap {
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-cold);
  background: linear-gradient(180deg, var(--ink-700), var(--ink-800));
  overflow: hidden;
  color: inherit;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.recap:hover { border-color: var(--line-strong); transform: translateY(-2px); color: inherit; }

.recap__media {
  position: relative;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(80% 120% at 25% 0%, rgba(194, 161, 90, 0.22), rgba(194, 161, 90, 0) 62%),
    linear-gradient(140deg, var(--night), var(--ink-900));
  overflow: hidden;
}
.recap__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}
.recap:hover .recap__media img { transform: scale(1.03); }
.recap__media::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 55%;
  background: linear-gradient(180deg, rgba(11, 13, 16, 0), rgba(11, 13, 16, 0.85));
  pointer-events: none;
}
.recap__side { position: absolute; left: var(--sp-3); bottom: var(--sp-3); z-index: 1; }

.recap__body { padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); }
.recap__title {
  font-size: var(--fs-h3);
  color: var(--text-100);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.recap__lead {
  margin: 0;
  font-size: var(--fs-small);
  color: var(--text-400);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- карточки ролей ---------- */

.role-section { margin-bottom: var(--sp-7); }
.role-section__head { margin-bottom: var(--sp-4); }
.role-section__head h2 { margin-bottom: var(--sp-1); display: flex; align-items: center; gap: var(--sp-3); }
.role-section__head h2::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--brass-500);
  display: block;
}
.role-section__head h2[data-side="black"]::before { background: var(--red-card); }
.role-section__head h2[data-side="neutral"]::before { background: var(--felt-light); }
.role-section__head p { margin: 0; font-size: var(--fs-small); }

.role-deck {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: 1fr;
}
@media (min-width: 560px) { .role-deck { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .role-deck { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1360px) { .role-deck { grid-template-columns: repeat(4, 1fr); } }

.role-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
  border-radius: var(--r-lg);
  border: 1px solid var(--line-cold);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(194, 161, 90, 0.09), rgba(194, 161, 90, 0) 60%),
    linear-gradient(180deg, var(--ink-700), var(--ink-850));
  box-shadow: var(--shadow-inset);
  overflow: hidden;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.role-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }

/* рубашка карты: тонкая двойная рамка, как у игральной колоды */
.role-card::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: calc(var(--r-lg) - 4px);
  border: 1px solid rgba(255, 255, 255, 0.045);
  pointer-events: none;
}

.role-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.role-card__pip { font-size: 18px; line-height: 1; color: var(--brass-500); }
.role-card[data-side="black"] .role-card__pip { color: var(--red-light); }
.role-card[data-side="neutral"] .role-card__pip { color: #7cc0a2; }
.role-card__pip--flip { transform: rotate(180deg); opacity: 0.55; }


.role-card__emblem {
  width: 54px;
  height: 74px;
  margin-bottom: var(--sp-3);
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--brass-900);
  background: linear-gradient(160deg, rgba(194, 161, 90, 0.16), rgba(194, 161, 90, 0.02));
  font-family: var(--font-display);
  font-weight: 200;
  font-size: 32px;
  color: var(--brass-300);
}
.role-card[data-side="black"] .role-card__emblem {
  border-color: rgba(142, 43, 43, 0.55);
  background: linear-gradient(160deg, rgba(142, 43, 43, 0.22), rgba(142, 43, 43, 0.03));
  color: #e0a7a7;
}
.role-card[data-side="neutral"] .role-card__emblem {
  border-color: rgba(63, 125, 99, 0.5);
  background: linear-gradient(160deg, rgba(29, 92, 71, 0.28), rgba(29, 92, 71, 0.03));
  color: #8fd0b4;
}

.role-card__name {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  color: var(--text-100);
  margin: 0 0 var(--sp-2);
}
.role-card__text {
  font-size: var(--fs-small);
  color: var(--text-400);
  margin: 0 0 var(--sp-4);
}

.role-card__facts { margin: 0 0 var(--sp-3); display: grid; gap: var(--sp-3); }
.role-card__facts > div { display: grid; gap: 3px; }
.role-card__facts dt {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-600);
}
.role-card__facts dd { margin: 0; font-size: var(--fs-small); color: var(--text-300); }

.role-card__bottom { margin-top: auto; display: flex; justify-content: flex-end; }

/* ---------- порядок ночи ---------- */

.night-order { margin-top: var(--sp-6); }
.night-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--sp-2);
}
@media (min-width: 900px) { .night-steps { grid-template-columns: repeat(3, 1fr); } }

.night-step {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--r-md);
  border: 1px solid var(--line-cold);
  background: var(--ink-800);
}
.night-step__no {
  width: 26px;
  height: 26px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--brass-700);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  color: var(--brass-300);
}
.night-step[data-side="black"] .night-step__no { border-color: rgba(142, 43, 43, 0.6); color: var(--red-light); }
.night-step__name { color: var(--text-100); }
.night-step__how { margin-left: auto; font-size: var(--fs-small); color: var(--text-600); text-align: right; }

/* ---------- вечер / партия ---------- */

.evening {
  display: grid;
  gap: var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  background:
    radial-gradient(90% 120% at 100% 0%, rgba(18, 59, 46, 0.35), rgba(18, 59, 46, 0) 60%),
    linear-gradient(180deg, var(--ink-700), var(--ink-800));
}
@media (min-width: 820px) { .evening { grid-template-columns: 1fr auto; align-items: center; } }

.evening__date { font-family: var(--font-display); font-size: var(--fs-h2); color: var(--text-100); }
.evening__meta { display: flex; flex-wrap: wrap; gap: var(--sp-3); color: var(--text-400); font-size: var(--fs-small); }
.evening__meta span { display: inline-flex; align-items: center; gap: 6px; }

.seat-meter { display: flex; gap: 3px; flex-wrap: wrap; margin-top: var(--sp-3); }
.seat-meter i {
  width: 14px; height: 14px; border-radius: 3px; display: block;
  border: 1px solid var(--line-cold); background: var(--ink-600);
}
.seat-meter i[data-taken="1"] { background: linear-gradient(160deg, var(--brass-500), var(--brass-900)); border-color: var(--brass-700); }

.roster { list-style: none; margin: 0; padding: 0; counter-reset: seat; }
.roster li {
  counter-increment: seat;
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--line-cold);
  font-size: var(--fs-body);
}
.roster li::before {
  content: counter(seat);
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--text-600);
  width: 22px;
  text-align: right;
}
.roster li:last-child { border-bottom: 0; }
.roster--reserve li::before { color: var(--warn); }

/* ---------- статья-разбор ---------- */

.article { max-width: 720px; min-width: 0; }
.article h2 { margin-top: var(--sp-6); }
.article p { color: var(--text-300); }
.article blockquote {
  margin: var(--sp-5) 0;
  padding: var(--sp-4) var(--sp-5);
  border-left: 2px solid var(--brass-700);
  background: rgba(194, 161, 90, 0.05);
  color: var(--text-300);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.article__cover {
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  aspect-ratio: 16 / 7;
  background:
    radial-gradient(70% 120% at 20% 0%, rgba(194, 161, 90, 0.28), rgba(194, 161, 90, 0) 60%),
    linear-gradient(140deg, var(--night), var(--ink-900));
  margin-bottom: var(--sp-5);
}

.article__cover--photo { display: block; width: 100%; height: auto; object-fit: cover; aspect-ratio: 16 / 7; }
.article__figure {
  width: 100%;
  border-radius: var(--r-md);
  border: 1px solid var(--line-cold);
  margin: var(--sp-5) 0 var(--sp-2);
}
.article__item {
  position: relative;
  padding-left: var(--sp-4);
  color: var(--text-300);
  margin-bottom: var(--sp-2);
}
.article__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brass-500);
}

.nomination {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line-cold);
}
.nomination:last-child { border-bottom: 0; }
.nomination__label { font-family: var(--font-display); color: var(--text-100); font-size: var(--fs-h3); }
.nomination__who { color: var(--brass-300); font-size: var(--fs-small); }

/* ---------- формы ---------- */

label.field { display: block; margin-bottom: var(--sp-4); }
label.field > span {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-600);
  margin-bottom: 6px;
}
input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[type="time"], input[type="datetime-local"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--ink-850);
  border: 1px solid var(--line-cold);
  border-radius: var(--r-sm);
  color: var(--text-100);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
}
input:focus, select:focus, textarea:focus { border-color: var(--brass-700); outline: none; box-shadow: 0 0 0 3px rgba(194, 161, 90, 0.12); }
textarea { min-height: 120px; resize: vertical; }

/* поле выбора файла: нативный контрол — 21 px высотой, на телефоне в него не попасть */
input[type="file"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  background: var(--ink-850);
  border: 1px dashed var(--line-cold);
  border-radius: var(--r-sm);
  color: var(--text-100);
}
input[type="file"]::file-selector-button {
  margin-right: var(--sp-3);
  padding: 6px 12px;
  background: var(--ink-800);
  border: 1px solid var(--line-cold);
  border-radius: var(--r-sm);
  color: var(--text-100);
  font: inherit;
  cursor: pointer;
}

.switch { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-3) 0; border-bottom: 1px solid var(--line-cold); }

/* ---------- админка: гейты ---------- */

.gate-steps { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-5); }
.gate-steps a, .gate-steps span {
  flex: 1;
  text-align: center;
  padding: var(--sp-3) var(--sp-2);
  border: 1px solid var(--line-cold);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-600);
  background: var(--ink-800);
}
.gate-steps [aria-current="step"] { border-color: var(--brass-700); color: var(--brass-300); background: rgba(194, 161, 90, 0.08); }
.gate-steps [data-done="1"] { color: var(--win); border-color: rgba(63, 125, 99, 0.4); }

.countdown {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--warn);
  border: 1px solid rgba(184, 134, 47, 0.35);
  background: rgba(184, 134, 47, 0.08);
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-3);
  display: inline-flex;
  gap: var(--sp-2);
}

.seat-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--sp-2); }
.seat-picker button {
  padding: var(--sp-3);
  min-height: 52px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-cold);
  background: var(--ink-800);
  color: var(--text-300);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  text-align: left;
  cursor: pointer;
}
.seat-picker button[aria-pressed="true"] { border-color: var(--brass-700); color: var(--text-100); background: rgba(194, 161, 90, 0.1); }

/* ---------- уведомления ---------- */

.notice {
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: rgba(194, 161, 90, 0.07);
  padding: var(--sp-3) var(--sp-4);
  color: var(--text-300);
  font-size: var(--fs-small);
}
.notice--warn { border-color: rgba(184, 134, 47, 0.4); background: rgba(184, 134, 47, 0.1); color: #e2c58a; }
.notice--error { border-color: rgba(194, 85, 85, 0.4); background: rgba(142, 43, 43, 0.14); color: #e8b3b3; }
.notice--success { border-color: var(--felt-light); background: var(--felt); color: var(--text-100); }
.notice--demo { border-style: dashed; }

.empty {
  text-align: center;
  padding: var(--sp-7) var(--sp-4);
  border: 1px dashed var(--line-cold);
  border-radius: var(--r-lg);
  color: var(--text-600);
}

/* ---------- подвал ---------- */

.site-footer {
  margin-top: var(--sp-8);
  border-top: 1px solid var(--line);
  padding: var(--sp-6) 0 var(--sp-7);
  color: var(--text-600);
  font-size: var(--fs-small);
}
.site-footer a { color: var(--text-400); }
.site-footer a:hover { color: var(--brass-300); }

/* ---------- появление ---------- */

@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.reveal { animation: riseIn 0.6s var(--ease) both; }
.reveal[data-i="1"] { animation-delay: 0.09s; }
.reveal[data-i="2"] { animation-delay: 0.18s; }
.reveal[data-i="3"] { animation-delay: 0.27s; }
.reveal[data-i="4"] { animation-delay: 0.36s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .plaque--1 { transform: none; }
}

.section { padding: var(--sp-6) 0; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-5); flex-wrap: wrap; }
/* ссылка «Вся таблица →» — самостоятельная цель нажатия, а не строчка текста */
.section__head a { padding: var(--sp-2) 0; font-size: var(--fs-small); white-space: nowrap; }

.rating-chart {
  display: block;
  width: 100%;
  margin-top: var(--sp-3);
  overflow: visible;
  border-bottom: 1px solid var(--line-cold);
}
.rating-chart polyline {
  fill: none;
  stroke: var(--brass-500);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.share-card {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding: var(--sp-7);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--night);
  box-shadow: var(--shadow-lift), var(--shadow-inset);
}
.share-card--ticket {
  overflow: hidden;
  text-align: center;
  border-style: dashed;
  background: linear-gradient(145deg, var(--night), var(--ink-800));
}
.share-card--ticket::before {
  content: "";
  position: absolute;
  inset: var(--sp-3);
  pointer-events: none;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.share-card__notch {
  position: absolute;
  top: 50%;
  width: var(--sp-6);
  height: var(--sp-6);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--ink-900);
  transform: translateY(-50%);
}
.share-card__notch--left { left: calc(var(--sp-4) * -1); }
.share-card__notch--right { right: calc(var(--sp-4) * -1); }
.share-card__game {
  margin: var(--sp-2) 0 0;
  color: var(--text-400);
  font-family: var(--font-mono);
}
.share-card__result {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: var(--sp-3);
  margin: var(--sp-6) 0;
  font-family: var(--font-mono);
  font-size: clamp(var(--fs-h2), 8vw, var(--fs-numeral));
  line-height: 1;
  letter-spacing: -0.05em;
}
.share-card__delta { font-weight: 700; }
.share-card__dot { color: var(--brass-700); }
.share-card__places { color: var(--brass-100); }
.share-card__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
  padding: var(--sp-5) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.share-card__stats strong {
  display: block;
  margin-top: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--fs-h2);
}
.share-card__serial {
  margin-top: var(--sp-5);
  color: var(--text-600);
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
}
@media (max-width: 560px) {
  .share-card { padding: var(--sp-6) var(--sp-5); }
  .share-card__result { gap: var(--sp-2); }
  .share-card__stats { grid-template-columns: 1fr; }
}

/* ---------- «за столом»: список вместо таблицы ---------- */
/* В боковой колонке 270 px пять табличных колонок не помещались и уезжали в скролл. */
.seats { list-style: none; margin: var(--sp-3) 0 0; padding: 0; }
.seat {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px 0;
  border-top: 1px solid var(--line-cold);
}
.seat:first-child { border-top: 0; }
.seat__no { font-family: var(--font-mono); font-size: var(--fs-small); color: var(--text-600); }
.seat__who { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.seat__name { font-weight: 600; overflow-wrap: anywhere; }
.seat__name a { text-decoration: none; }
.seat__win { color: var(--win); font-size: var(--fs-label); }
.seat__role { font-size: var(--fs-small); color: var(--text-400); }
.seat__score { display: flex; align-items: baseline; gap: var(--sp-2); font-family: var(--font-mono); }
.seat__score b { font-size: var(--fs-h3); font-weight: 500; }

/* ---------- админка: единый пульт публикации ---------- */

.admin-more { position: relative; }
.admin-more summary {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--text-300);
  font-size: var(--fs-small);
  cursor: pointer;
  list-style: none;
}
.admin-more summary::-webkit-details-marker { display: none; }
.admin-more__menu {
  position: absolute;
  right: 0;
  top: calc(100% + var(--sp-2));
  z-index: 20;
  width: 230px;
  padding: var(--sp-2);
  border-radius: var(--r-md);
  background: var(--ink-800);
  box-shadow: 0 0 0 1px var(--line-cold), var(--shadow-lift);
}
.admin-more__menu a { display: block; min-height: 40px; padding: 9px var(--sp-3); color: var(--text-300); }
.admin-more__menu a:hover { color: var(--text-100); background: var(--ink-700); }

/* --studio-chrome — высота липкой шапки сайта вместе с полосой этапов.
   От неё считаются top предпросмотра и scroll-margin панелей: держать в одном месте,
   иначе якоря уезжают под шапку. */
.studio-shell { --studio-chrome: 126px; padding: var(--sp-4) 0 var(--sp-8); }
.studio-wrap { max-width: 1540px; }
.studio-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3) var(--sp-5);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-lg);
  background:
    radial-gradient(90% 220% at 100% 0%, var(--felt), transparent 64%),
    linear-gradient(135deg, var(--ink-700), var(--ink-850));
  box-shadow: 0 0 0 1px var(--line-cold), var(--shadow-inset);
  overflow: hidden;
}
.studio-hero__title { min-width: 0; margin-right: auto; }
.studio-hero h1 { margin: var(--sp-1) 0 0; font-size: var(--fs-h2); }
.studio-hero__links { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.studio-hero__links a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 var(--sp-3);
  border-radius: var(--r-sm);
  background: var(--ink-850);
  box-shadow: 0 0 0 1px var(--line-cold);
  color: var(--brass-300);
  font-size: var(--fs-small);
}
.studio-hero__links a:hover { color: var(--brass-100); box-shadow: 0 0 0 1px var(--line-strong); }
.studio-stats { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); margin: 0; }
.studio-stats div { padding-left: var(--sp-3); border-left: 1px solid var(--line); }
.studio-stats dt { color: var(--text-600); font-family: var(--font-mono); font-size: var(--fs-label); text-transform: uppercase; }
.studio-stats dd { margin: 2px 0 0; color: var(--text-100); font: var(--fs-small) var(--font-mono); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.studio-nav {
  position: sticky;
  top: 61px;
  z-index: 40;
  display: flex;
  gap: var(--sp-1);
  overflow-x: auto;
  margin: var(--sp-2) 0 var(--sp-3);
  padding: var(--sp-1);
  border-radius: var(--r-md);
  background: var(--ink-850);
  box-shadow: 0 0 0 1px var(--line-cold), 0 12px 30px var(--ink-900);
}
.studio-nav a {
  flex: 1 0 150px;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  color: var(--text-300);
  font-weight: 600;
}
.studio-nav a span { color: var(--text-600); font: var(--fs-label) var(--font-mono); }
.studio-nav a.is-current { color: var(--ink-900); background: var(--brass-300); }
.studio-nav a.is-current span { color: var(--brass-900); }

.studio-grid { display: grid; gap: var(--sp-4); align-items: start; }
.studio-work { min-width: 0; display: grid; gap: var(--sp-4); }
.studio-panel {
  min-width: 0;
  padding: var(--sp-5);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--ink-700), var(--ink-800));
  box-shadow: 0 0 0 1px var(--line-cold), var(--shadow-inset);
  scroll-margin-top: calc(var(--studio-chrome) + var(--sp-2));
}
.studio-panel--brass { box-shadow: 0 0 0 1px var(--line-strong), var(--shadow-inset); }
.studio-panel__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.studio-panel__head h2 { margin: var(--sp-1) 0 0; }
.studio-code { margin: 0; color: var(--brass-500); font: 500 var(--fs-label) var(--font-mono); letter-spacing: 0.14em; }
.studio-state { flex: none; padding: 5px var(--sp-2); border-radius: var(--r-sm); color: var(--text-400); background: var(--ink-850); font: var(--fs-label) var(--font-mono); }
.studio-state--ok { color: var(--text-100); background: var(--felt-light); }
.studio-state--wait { color: var(--brass-100); background: var(--brass-900); }
.studio-state--run { color: var(--ink-900); background: var(--brass-500); }
.studio-panel__footer { margin-top: var(--sp-4); }

.studio-file-list { display: grid; gap: var(--sp-2); margin: var(--sp-4) 0; }
.studio-file { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--sp-3); align-items: center; padding: var(--sp-3); border-radius: var(--r-md); background: var(--ink-850); }
.studio-file__type { min-width: 58px; color: var(--brass-300); font: var(--fs-label) var(--font-mono); }
.studio-file strong, .studio-file small { display: block; overflow-wrap: anywhere; }
.studio-file small { color: var(--text-600); }
.studio-upload { margin-top: var(--sp-5); }
.studio-drop { display: block; min-height: 132px; padding: var(--sp-5); border: 1px dashed var(--line-strong); border-radius: var(--r-md); background: var(--ink-850); text-align: center; cursor: pointer; transition: border-color .18s var(--ease), transform .18s var(--ease); }
.studio-drop:hover { border-color: var(--brass-500); transform: translateY(-2px); }
.studio-drop:active { transform: scale(.96); }
.studio-drop strong, .studio-drop span { display: block; }
.studio-drop strong { color: var(--text-100); font-family: var(--font-display); }
.studio-drop span { color: var(--text-600); margin-top: var(--sp-1); }
.studio-drop input { margin-top: var(--sp-3); }
.studio-upload__progress { --upload-progress: 0%; height: 5px; margin: var(--sp-3) 0; overflow: hidden; border-radius: var(--r-pill); background: var(--ink-600); }
.studio-upload__progress i { display: block; width: var(--upload-progress); height: 100%; background: var(--felt-light); transition: width .2s var(--ease); }

.studio-jobs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
.studio-job { min-width: 0; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: var(--sp-2); align-items: center; min-height: 76px; padding: var(--sp-3); border-radius: var(--r-md); background: var(--ink-850); box-shadow: 0 0 0 1px var(--line-cold); }
.studio-job > span { color: var(--text-600); font: var(--fs-label) var(--font-mono); font-variant-numeric: tabular-nums; }
.studio-job strong, .studio-job small { display: block; }
.studio-job strong { color: var(--text-300); font-size: var(--fs-small); }
.studio-job small { color: var(--text-600); }
.studio-job[data-status="succeeded"] { box-shadow: 0 0 0 1px var(--felt-light); }
.studio-job[data-status="succeeded"] > span { color: var(--win); }
.studio-job[data-status="ready"], .studio-job[data-status="queued"], .studio-job[data-status="running"] { box-shadow: 0 0 0 1px var(--brass-700); }
.studio-job[data-status="failed"] { box-shadow: 0 0 0 1px var(--red-card); }

.studio-decisions { display: grid; gap: var(--sp-2); }
.studio-decision { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: var(--sp-3); align-items: center; min-height: 70px; padding: var(--sp-3); border-radius: var(--r-md); color: var(--text-300); background: var(--ink-850); box-shadow: 0 0 0 1px var(--line-cold); transition: transform .18s var(--ease), box-shadow .18s var(--ease); }
.studio-decision:hover { color: var(--text-100); transform: translateY(-2px); box-shadow: 0 0 0 1px var(--line-strong); }
.studio-decision:active { transform: scale(.96); }
.studio-decision > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--felt); color: var(--text-100); font-family: var(--font-mono); }
.studio-decision strong, .studio-decision small { display: block; }
.studio-decision small { color: var(--text-600); }
.studio-decision b { color: var(--brass-300); font-size: var(--fs-small); }
.studio-decision.is-disabled { opacity: .45; pointer-events: none; }

.studio-covers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); margin: var(--sp-4) 0; }
.studio-covers label { position: relative; cursor: pointer; }
.studio-covers input { position: absolute; inset: var(--sp-2) auto auto var(--sp-2); z-index: 2; width: 22px; height: 22px; }
.studio-covers img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-md); outline: 1px solid var(--image-outline); outline-offset: -1px; }
.studio-covers span { display: block; margin-top: var(--sp-1); color: var(--text-400); font-size: var(--fs-small); }
.studio-covers label:has(input:checked) img { outline-color: var(--brass-500); outline-width: 2px; }
.studio-check { min-height: 44px; display: flex; align-items: center; gap: var(--sp-3); margin: var(--sp-4) 0; }
.studio-check input { width: 22px; height: 22px; }

.studio-article-fields { padding: var(--sp-4); border-radius: var(--r-md); background: var(--ink-850); }
.studio-details { margin-top: var(--sp-3); border-radius: var(--r-md); background: var(--ink-850); box-shadow: 0 0 0 1px var(--line-cold); }
.studio-details summary { min-height: 48px; display: flex; align-items: center; justify-content: space-between; padding: var(--sp-3) var(--sp-4); color: var(--text-100); cursor: pointer; }
.studio-details summary span { color: var(--brass-300); font-family: var(--font-mono); }
.studio-score-list, .studio-nominations { padding: 0 var(--sp-3) var(--sp-3); }
.studio-score, .studio-nomination { padding: var(--sp-4); border-top: 1px solid var(--line-cold); }
.studio-score header { display: flex; justify-content: space-between; gap: var(--sp-3); align-items: center; margin-bottom: var(--sp-3); }
.studio-score .field, .studio-nomination .field { margin-bottom: var(--sp-3); }

.studio-preview { min-width: 0; overflow: hidden; scroll-margin-top: calc(var(--studio-chrome) + var(--sp-2)); border-radius: var(--r-lg); background: var(--ink-850); box-shadow: 0 0 0 1px var(--line-cold), var(--shadow-lift); }
.studio-preview > header { display: flex; justify-content: space-between; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line-cold); color: var(--text-600); font: var(--fs-label) var(--font-mono); text-transform: uppercase; }
.studio-preview > header b { color: var(--brass-500); font-weight: 500; }
.studio-preview__cover { min-height: 260px; display: flex; align-items: flex-end; padding: var(--sp-5); background-image: radial-gradient(50% 60% at 70% 28%, var(--brass-900), transparent), linear-gradient(145deg, var(--night), var(--ink-900)); background-position: center; background-size: cover; outline: 1px solid var(--image-outline); outline-offset: -1px; position: relative; }
.studio-preview__cover::after { content: ""; position: absolute; inset: 35% 0 0; background: linear-gradient(transparent, var(--ink-900)); }
.studio-preview__cover > div { position: relative; z-index: 1; }
.studio-preview__cover h2 { font-size: clamp(var(--fs-h2), 4vw, var(--fs-h1)); margin: var(--sp-2) 0 0; }
.studio-preview article { padding: var(--sp-5); }
.studio-preview__meta { color: var(--brass-500); font: var(--fs-label) var(--font-mono); text-transform: uppercase; }
.studio-preview__body { max-height: 240px; overflow: auto; color: var(--text-400); white-space: pre-wrap; }
.studio-preview article footer { display: flex; justify-content: space-between; gap: var(--sp-3); margin-top: var(--sp-5); padding-top: var(--sp-3); border-top: 1px solid var(--line-cold); color: var(--text-600); font: var(--fs-label) var(--font-mono); }

.studio-actions { position: sticky; bottom: var(--sp-2); z-index: 45; display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-4); padding: var(--sp-2); border-radius: var(--r-md); background: var(--ink-900); box-shadow: 0 0 0 1px var(--line-strong), 0 -12px 32px var(--ink-900); }
.studio-actions > span { color: var(--text-600); font-size: var(--fs-small); }
.studio-actions .btn:first-of-type { margin-left: auto; }
.studio-password { flex: 1 1 240px; margin: 0; }

@media (max-width: 620px) {
  /* полоса этапов на телефоне занимает две строки — якоря считаются от неё */
  .studio-shell { --studio-chrome: 168px; }
  .studio-panel { padding: var(--sp-4); }
  .studio-hero { padding: var(--sp-3); }
  .studio-hero__title, .studio-stats, .studio-hero__links { flex: 1 1 100%; }
  .studio-hero h1 { font-size: var(--fs-h3); }
  .studio-stats { gap: var(--sp-2) var(--sp-3); }
  .studio-stats div { flex: 1 1 84px; }
  .studio-panel__head h2 { font-size: var(--fs-h3); }
  .studio-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow-x: visible; }
  .studio-nav a { min-height: 40px; padding: var(--sp-1) var(--sp-2); }
  .studio-file { grid-template-columns: 1fr; }
  .studio-jobs, .studio-covers { grid-template-columns: 1fr; }
  .studio-decision { grid-template-columns: 32px minmax(0, 1fr); }
  .studio-decision b { grid-column: 2; }
  .studio-score .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); align-items: end; }
  .studio-score .grid--3 .field { margin-bottom: 0; }
  /* нижняя панель: подсказка и запасная форма в одной строке, публикация — во второй.
     Раньше три строки подряд съедали треть экрана телефона. */
  .studio-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .studio-actions > span { font-size: var(--fs-label); }
  .studio-actions .btn { padding: 11px var(--sp-3); font-size: var(--fs-small); }
  .studio-actions .btn--ghost { margin-left: 0; }
  .studio-actions .btn:last-child { grid-column: 1 / -1; margin-left: 0; }
}

@media (min-width: 980px) {
  .studio-grid { grid-template-columns: minmax(0, 7fr) minmax(380px, 5fr); }
  /* Предпросмотр выше экрана — липкий блок пришлось бы прокручивать «до низа страницы»,
     чтобы увидеть конец статьи. Ограничиваем высоту вьюпортом и скроллим текст внутри. */
  .studio-preview {
    position: sticky;
    top: calc(var(--studio-chrome) + var(--sp-2));
    align-self: start;
    max-height: calc(100vh - var(--studio-chrome) - var(--sp-4));
    display: flex;
    flex-direction: column;
  }
  .studio-preview > header, .studio-preview__cover { flex: none; }
  .studio-preview__cover { min-height: clamp(180px, 26vh, 330px); }
  .studio-preview article { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
  .studio-preview__body { max-height: none; overflow: visible; }
  .studio-hero__links a.studio-hero__links-preview { display: none; }
  .studio-jobs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1440px) {
  .studio-grid { grid-template-columns: minmax(700px, 7fr) minmax(500px, 5fr); }
  .studio-jobs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .studio-preview__cover { min-height: clamp(220px, 32vh, 430px); }
}
