/* ============================================================
   Экраны: вход, приветствие, профили, задание, итоги, админка
   ============================================================ */

/* ---------- 1. Вход ---------- */

.welcome {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding: 40px clamp(18px, 5vw, 40px);
  position: relative; z-index: 1;
}
.welcome__in { width: 100%; max-width: 720px; text-align: center; }

.welcome__crest {
  display: inline-flex; align-items: center; gap: 11px;
  padding: 8px 8px 8px 16px; margin-bottom: clamp(26px, 5vh, 44px);
  border: 1px solid var(--line-2); border-radius: 100px;
  background: rgba(255, 255, 255, .03);
  font-size: .82rem; color: var(--ink-2); letter-spacing: .01em;
  animation: reveal-in .8s var(--ease-out) both;
}
.welcome__crest span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(140deg, var(--gold), var(--rose)); color: var(--accent-ink);
  font-family: var(--font-mono); font-size: .64rem; font-weight: 600; }

.welcome__title {
  font-size: clamp(2.3rem, 8vw, 4.6rem); font-weight: 900; letter-spacing: -.045em;
  line-height: 1.02; margin-bottom: .34em;
}
.welcome__title i {
  font-style: normal;
  background: linear-gradient(103deg, var(--gold) 4%, #ff8f6b 34%, var(--rose) 58%, var(--violet) 88%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  background-size: 200% 100%;
  animation: hue-slide 9s ease-in-out infinite alternate;
}
@keyframes hue-slide { to { background-position: 100% 0; } }

.welcome__sub { color: var(--ink-2); font-size: clamp(1rem, 2vw, 1.14rem); max-width: 52ch; margin: 0 auto clamp(30px, 5vh, 46px); }

.namebox { max-width: 520px; margin: 0 auto; text-align: left; }
.namebox__label {
  display: block; font-family: var(--font-mono); font-size: .74rem;
  letter-spacing: .16em; text-transform: uppercase; color: var(--ink-4); margin-bottom: 12px;
}
.namebox__row { position: relative; display: flex; align-items: center; gap: 12px; }
.namebox__input {
  flex: 1 1 auto; width: 100%;
  background: transparent; border: 0;
  border-bottom: 2px solid var(--line-2);
  padding: 12px 2px; color: var(--ink);
  font-family: var(--font-display); font-size: clamp(1.35rem, 4.5vw, 1.95rem);
  font-weight: 500; letter-spacing: -.02em;
  transition: border-color .25s;
}
.namebox__input::placeholder { color: var(--ink-4); font-weight: 400; }
.namebox__input:focus { outline: 0; border-bottom-color: var(--gold); }
.namebox__go {
  flex: none; width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--gold), #ff8f6b); color: var(--accent-ink);
  box-shadow: 0 6px 26px -8px rgba(255, 160, 70, .9);
  transition: transform .18s var(--ease-out), opacity .2s;
}
.namebox__go:hover { transform: scale(1.07); }
.namebox__go[disabled] { opacity: .35; pointer-events: none; }
.namebox__go svg { width: 20px; height: 20px; }
.namebox__hint { margin-top: 14px; font-size: .86rem; color: var(--ink-4); }
.namebox__err { margin-top: 12px; font-size: .9rem; color: #ff8f88; }

.welcome__facts {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  margin-top: clamp(34px, 6vh, 56px);
}
.welcome__facts .tag { animation: reveal-in .8s var(--ease-out) both; }

/* ---------- 2. Здравствуйте, имя ---------- */

.hello {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center; text-align: center;
  padding: 40px 20px; position: relative; z-index: 1;
}
.hello__in { max-width: 900px; }
.hello__greet {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.1rem, 3.4vw, 1.7rem); color: var(--ink-3);
  letter-spacing: .02em; margin-bottom: .5em;
  opacity: 0; animation: reveal-in .7s var(--ease-out) .15s both;
}
.hello__name {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(2.6rem, 11vw, 6.2rem); line-height: 1.02; letter-spacing: -.05em;
  margin: 0 0 .3em; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 .18em;
}
.hello__name span { display: inline-block; }
.hello__name .ch {
  display: inline-block;
  background: linear-gradient(150deg, #fff 10%, var(--gold) 48%, var(--rose) 82%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  opacity: 0; transform: translateY(.42em) rotate(4deg);
  animation: ch-in .62s var(--ease-out) both;
}
@keyframes ch-in { to { opacity: 1; transform: none; } }

.hello__line {
  width: 0; height: 2px; margin: 0 auto 26px;
  background: linear-gradient(90deg, transparent, var(--gold), var(--rose), transparent);
  animation: line-grow .9s var(--ease-out) .55s both;
}
@keyframes line-grow { to { width: min(420px, 78vw); } }

.hello__text { color: var(--ink-2); font-size: clamp(1rem, 2.1vw, 1.16rem); max-width: 56ch; margin: 0 auto 34px;
  opacity: 0; animation: reveal-in .8s var(--ease-out) .8s both; }
.hello__cta { opacity: 0; animation: reveal-in .8s var(--ease-out) 1.05s both; }
.hello__id {
  margin-top: 26px; font-family: var(--font-mono); font-size: .82rem; color: var(--ink-4);
  opacity: 0; animation: reveal-in .8s var(--ease-out) 1.3s both;
}
.hello__id b { color: var(--gold); font-weight: 600; }

/* ---------- 3. Главная: выбор профиля ---------- */

.hero { margin-bottom: clamp(34px, 6vw, 58px); }
.hero__title { max-width: 20ch; }
.hero__title i { font-style: normal; color: var(--gold); }
.hero__row { display: flex; flex-wrap: wrap; gap: 14px 26px; align-items: center; margin-top: 22px; }

.scorebar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 16px 22px; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(100deg, rgba(255, 176, 59, .07), rgba(167, 139, 250, .05));
}
.scorebar__big { font-family: var(--font-mono); font-size: 1.65rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; }
.scorebar__big b { color: var(--gold); font-weight: 600; }
.scorebar__big span { color: var(--ink-4); font-size: 1rem; }
.scorebar__bar { flex: 1 1 210px; min-width: 150px; }
.scorebar__meta { font-size: .86rem; color: var(--ink-3); }

.tracks { display: grid; gap: clamp(14px, 2vw, 20px); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .tracks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.track-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  padding: clamp(22px, 2.6vw, 30px);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .012));
  color: var(--ink); text-decoration: none;
  transition: transform .3s var(--ease-out), border-color .3s, box-shadow .3s;
  isolation: isolate;
}
.track-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0;
  background: radial-gradient(120% 90% at 12% 0%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 62%);
  transition: opacity .35s;
}
.track-card::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 72%);
  transform: scaleX(.16); transform-origin: 0 50%;
  transition: transform .45s var(--ease-out);
}
.track-card:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--accent) 40%, transparent); box-shadow: 0 22px 48px -26px color-mix(in srgb, var(--accent) 80%, transparent); opacity: 1; }
.track-card:hover::before { opacity: 1; }
.track-card:hover::after { transform: scaleX(1); }

.track-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.track-card__icon {
  width: 46px; height: 46px; flex: none; border-radius: 13px; display: grid; place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}
.track-card__icon svg { width: 23px; height: 23px; }
.track-card__title { font-family: var(--font-display); font-weight: 700; font-size: 1.24rem;
  letter-spacing: -.025em; margin: 0 0 8px; hyphens: manual; text-wrap: balance; }
.track-card__short { color: var(--ink-2); font-size: .93rem; margin-bottom: 18px; flex: 1 1 auto; }
.track-card__skills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.track-card__skills span { font-size: .74rem; color: var(--ink-3); border: 1px solid var(--line); border-radius: 100px; padding: 3px 9px; }
.track-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 15px; border-top: 1px solid var(--line); }
.track-card__pts { font-family: var(--font-mono); font-size: .84rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.track-card__pts b { color: var(--accent); font-weight: 600; }
.track-card__go { display: inline-flex; align-items: center; gap: 7px; font-size: .88rem; font-weight: 600; color: var(--accent); }
.track-card__go svg { width: 15px; height: 15px; transition: transform .3s var(--ease-out); }
.track-card:hover .track-card__go svg { transform: translateX(4px); }

.track-card__dots { display: flex; gap: 5px; }
.track-card__dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .14); display: block; }
.track-card__dots i.is-done { background: var(--accent); box-shadow: 0 0 9px color-mix(in srgb, var(--accent) 70%, transparent); }

.finish-strip {
  margin-top: clamp(30px, 5vw, 48px);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px;
  padding: clamp(20px, 3vw, 28px);
  border: 1px dashed var(--line-2); border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .018);
}
.finish-strip h3 { margin-bottom: 6px; }

/* ---------- 4. Профиль (список заданий) ---------- */

.crumbs { display: flex; align-items: center; gap: 9px; font-size: .84rem; color: var(--ink-4); margin-bottom: 20px; flex-wrap: wrap; }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--accent); opacity: 1; }
.crumbs svg { width: 12px; height: 12px; opacity: .5; }

.track-head { display: grid; gap: clamp(22px, 4vw, 42px); grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; margin-bottom: clamp(30px, 5vw, 46px); }
.track-head__intro { color: var(--ink-2); }
.track-head__aside { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; background: rgba(255, 255, 255, .022); }
.track-head__aside h4 { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-4); margin-bottom: 12px; }
.track-head__aside ul { list-style: none; padding: 0; margin: 0; }
.track-head__aside li { display: flex; align-items: center; gap: 9px; font-size: .92rem; color: var(--ink-2); margin-bottom: 9px; }
.track-head__aside li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); flex: none; }

.task-list { display: grid; gap: 14px; }
.task-row {
  display: flex; align-items: center; gap: clamp(14px, 2.4vw, 24px); flex-wrap: wrap;
  padding: clamp(18px, 2.4vw, 24px);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .01));
  color: var(--ink); text-decoration: none;
  transition: transform .25s var(--ease-out), border-color .25s, background .25s;
}
.task-row:hover { transform: translateX(5px); border-color: color-mix(in srgb, var(--accent) 40%, transparent); opacity: 1; }
.task-row__no {
  width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 1rem; font-weight: 600;
  border: 1px solid var(--line-2); color: var(--ink-3); background: rgba(255, 255, 255, .03);
}
.task-row.is-solved .task-row__no { border-color: rgba(70, 217, 139, .5); color: var(--green); background: rgba(70, 217, 139, .1); }
.task-row.is-closed .task-row__no { border-color: var(--line-2); color: var(--ink-4); }
.task-row__body { flex: 1 1 240px; min-width: 0; }
.task-row__title { font-family: var(--font-display); font-weight: 700; font-size: 1.08rem; letter-spacing: -.02em; margin-bottom: 3px; }
.task-row__tag { font-size: .87rem; color: var(--ink-3); }
.task-row__right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.task-row__score { font-family: var(--font-mono); font-size: .9rem; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.task-row__score b { color: var(--accent); font-weight: 600; }

/* ---------- 5. Страница задания ---------- */

.task-layout { display: grid; gap: clamp(22px, 3vw, 40px); grid-template-columns: minmax(0, 1fr) 310px; align-items: start; }
.task-layout > * { min-width: 0; }
.task-side { position: sticky; top: 88px; display: grid; gap: 14px; }

.task-hero { margin-bottom: 30px; }
.task-hero__title { margin-bottom: 10px; }
.task-hero__tagline { font-family: var(--font-mono); font-size: .78rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 14px; overflow-wrap: anywhere; }
.task-hero__intro { color: var(--ink-2); font-size: 1.04rem; max-width: 62ch; }

.panel { border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255, 255, 255, .022);
  overflow: hidden; margin-bottom: 18px; min-width: 0; }
.panel__body, .panel__body > * { min-width: 0; }
.panel__head {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 17px clamp(18px, 2.4vw, 24px);
  background: rgba(255, 255, 255, .028); border: 0; cursor: pointer;
  font-family: var(--font-body); color: var(--ink); text-align: left;
  transition: background .2s;
}
.panel__head:hover { background: rgba(255, 255, 255, .05); }
.panel__head[aria-expanded] { }
.panel__icon { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  background: color-mix(in srgb, var(--accent) 11%, transparent); color: var(--accent); }
.panel__icon svg { width: 15px; height: 15px; }
.panel__title { font-family: var(--font-display); font-weight: 700; font-size: 1rem; letter-spacing: -.02em;
  flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.panel__note { font-size: .8rem; color: var(--ink-4); }
.panel__chev { width: 16px; height: 16px; color: var(--ink-4); transition: transform .3s var(--ease-out); flex: none; }
.panel__head[aria-expanded="true"] .panel__chev { transform: rotate(180deg); }
.panel__body { padding: 4px clamp(18px, 2.4vw, 24px) 22px; }
.panel__body > :first-child { margin-top: 14px; }
.panel--static .panel__head { cursor: default; }
.panel--static .panel__head:hover { background: rgba(255, 255, 255, .028); }

.theory-sec { padding: 18px 0; border-top: 1px solid var(--line); }
.theory-sec:first-child { border-top: 0; padding-top: 8px; }
.theory-sec__title { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; letter-spacing: -.02em; color: #fff; margin-bottom: 10px; display: flex; align-items: baseline; gap: 10px; }
.theory-sec__title span { font-family: var(--font-mono); font-size: .76rem; color: var(--accent); font-weight: 600; }
.theory-sec__body { color: var(--ink-2); font-size: .97rem; }
.theory-sec__body strong { color: #fff; }

.statement { font-size: 1.02rem; min-width: 0; }

/* Любая таблица внутри текста прокручивается сама, а не растягивает страницу */
.panel__body table,
.statement table,
.razbor-item__body table,
.modal__box table {
  display: block; width: max-content; max-width: 100%;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.panel__body pre, .statement pre, .razbor-item__body pre { max-width: 100%; }
.theory-sec__body { min-width: 0; }
.statement table { margin: 1em 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.statement th { background: rgba(255, 255, 255, .04); }
.statement td { font-family: var(--font-mono); font-size: .92rem; }

.callout {
  display: flex; gap: 13px; padding: 16px 18px; margin: 18px 0;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  font-size: .93rem; color: var(--ink-2);
}
.callout svg { width: 18px; height: 18px; flex: none; color: var(--accent); margin-top: 2px; }
.callout--fact { border-color: var(--line-2); background: rgba(255, 255, 255, .028); }
.callout--fact svg { color: var(--ink-3); }

/* подсказки */
.hints { display: grid; gap: 11px; }
.hint {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(255, 255, 255, .022); overflow: hidden;
}
.hint__head { display: flex; align-items: center; gap: 12px; padding: 14px 17px; }
.hint__no { font-family: var(--font-mono); font-size: .78rem; color: var(--ink-4); letter-spacing: .1em; text-transform: uppercase; }
.hint__cost { font-family: var(--font-mono); font-size: .8rem; color: #ffbe6b; margin-left: auto; white-space: nowrap; }
.hint__body { padding: 0 17px 16px; color: var(--ink-2); font-size: .95rem; animation: reveal-in .5s var(--ease-out) both; }
.hint.is-open { border-color: rgba(255, 176, 59, .35); background: rgba(255, 176, 59, .045); }

/* форма ответа */
.answer {
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 9%, transparent), rgba(255, 255, 255, .015));
  padding: clamp(20px, 2.8vw, 28px);
  margin-top: 26px;
}
.answer__title { display: flex; align-items: center; gap: 11px; margin-bottom: 6px; }
.answer__title h3 { margin: 0; }
.answer__note { color: var(--ink-3); font-size: .89rem; margin-bottom: 18px; }

.field { display: grid; gap: 7px; }
.field__label { font-family: var(--font-mono); font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-4); }
.input {
  width: 100%; padding: 13px 16px;
  background: rgba(0, 0, 0, .35); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); color: var(--ink);
  font-family: var(--font-mono); font-size: 1rem;
  transition: border-color .2s, background .2s;
}
.input::placeholder { color: var(--ink-4); }
.input:focus { outline: 0; border-color: var(--accent); background: rgba(0, 0, 0, .5); }
.input.is-ok { border-color: rgba(70, 217, 139, .6); }
.input.is-bad { border-color: rgba(255, 95, 86, .6); animation: shake .38s; }
@keyframes shake { 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }

.fields-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 18px; }

.check-list { display: grid; gap: 9px; margin-bottom: 18px; }
.check {
  display: flex; align-items: center; gap: 13px; cursor: pointer;
  padding: 13px 16px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, .28); transition: .2s;
}
.check:hover { border-color: var(--line-3); background: rgba(0, 0, 0, .4); }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check__box {
  width: 21px; height: 21px; flex: none; border-radius: 6px;
  border: 1.5px solid var(--line-3); display: grid; place-items: center;
  transition: .18s;
}
.check__box svg { width: 12px; height: 12px; opacity: 0; transform: scale(.5); transition: .18s; color: var(--accent-ink); }
.check input:checked + .check__box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .check__box svg { opacity: 1; transform: none; }
.check input:focus-visible + .check__box { outline: 2px solid var(--accent); outline-offset: 2px; }
.check__text { font-family: var(--font-mono); font-size: 1.02rem; letter-spacing: .06em; }
.check.is-locked { pointer-events: none; opacity: .75; }
.check.is-right { border-color: rgba(70, 217, 139, .55); background: rgba(70, 217, 139, .08); }
.check.is-wrong { border-color: rgba(255, 95, 86, .55); background: rgba(255, 95, 86, .07); }

.answer__actions { display: flex; flex-wrap: wrap; gap: 11px; align-items: center; }
.answer__result {
  margin-top: 16px; padding: 14px 17px; border-radius: var(--radius-sm);
  font-size: .95rem; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03);
  animation: reveal-in .45s var(--ease-out) both;
}
.answer__result.is-ok { border-color: rgba(70, 217, 139, .45); background: rgba(70, 217, 139, .09); color: #a5f3c8; }
.answer__result.is-bad { border-color: rgba(255, 95, 86, .45); background: rgba(255, 95, 86, .08); color: #ffb3ad; }

.solved-banner {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 18px 22px; margin-bottom: 22px;
  border: 1px solid rgba(70, 217, 139, .4); border-radius: var(--radius-lg);
  background: linear-gradient(100deg, rgba(70, 217, 139, .13), rgba(70, 217, 139, .03));
}
.solved-banner__icon { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(70, 217, 139, .18); color: var(--green); flex: none; }
.solved-banner__icon svg { width: 19px; height: 19px; }
.solved-banner--zero { border-color: var(--line-2); background: rgba(255, 255, 255, .03); }
.solved-banner--zero .solved-banner__icon { background: rgba(255, 255, 255, .07); color: var(--ink-3); }

/* боковая колонка задания */
.side-card { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255, 255, 255, .025); padding: 19px 21px; }
.side-card__label { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-4); margin-bottom: 12px; }
.side-stat { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: .9rem; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.side-stat:last-child { border-bottom: 0; }
.side-stat b { font-family: var(--font-mono); color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.side-nav { display: grid; gap: 7px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 9px; font-size: .89rem; color: var(--ink-2); border: 1px solid transparent; }
.side-nav a:hover { background: rgba(255, 255, 255, .045); color: var(--ink); opacity: 1; }
.side-nav a.is-current { border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }
.side-nav i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-3); flex: none; }
.side-nav a.is-done i { background: var(--green); }

/* песочница Python */
.sandbox { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-deep); }
.sandbox__bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: rgba(255, 255, 255, .035); border-bottom: 1px solid var(--line); }
.sandbox__dots { display: flex; gap: 6px; }
.sandbox__dots i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.sandbox__dots i:nth-child(1) { background: #ff5f56; }
.sandbox__dots i:nth-child(2) { background: #ffbd2e; }
.sandbox__dots i:nth-child(3) { background: #27c93f; }
.sandbox__name { font-family: var(--font-mono); font-size: .78rem; color: var(--ink-4); }
.sandbox__run { margin-left: auto; }
.sandbox__code {
  width: 100%; min-height: 168px; resize: vertical; display: block;
  background: transparent; border: 0; padding: 15px 16px; color: #d9e6ff;
  font-family: var(--font-mono); font-size: .89rem; line-height: 1.6; tab-size: 4;
}
.sandbox__code:focus { outline: 0; }
.sandbox__io { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); background: rgba(255, 255, 255, .015); }
.sandbox__io label { font-family: var(--font-mono); font-size: .76rem; color: var(--ink-4); white-space: nowrap; }
.sandbox__io input { flex: 1 1 auto; background: rgba(0, 0, 0, .4); border: 1px solid var(--line); border-radius: 7px; padding: 7px 11px; color: var(--ink); font-family: var(--font-mono); font-size: .85rem; }
.sandbox__io input:focus { outline: 0; border-color: var(--accent); }
.sandbox__out { border-top: 1px solid var(--line); padding: 13px 16px; font-family: var(--font-mono); font-size: .86rem; white-space: pre-wrap; word-break: break-word; color: #9fe8c0; min-height: 44px; max-height: 220px; overflow: auto; }
.sandbox__out.is-err { color: #ff9d95; }
.sandbox__out .dim { color: var(--ink-4); }

/* ---------- 6. Завершение и итоги ---------- */

.finish-wrap { max-width: 760px; margin: 0 auto; }
.finish-card { border: 1px solid var(--line-2); border-radius: var(--radius-lg); padding: clamp(26px, 4vw, 40px); background: linear-gradient(170deg, rgba(255, 176, 59, .06), rgba(255, 255, 255, .015)); }
.finish-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin: 26px 0; }
.finish-stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; background: rgba(0, 0, 0, .25); }
.finish-stat__num { font-family: var(--font-mono); font-size: 1.6rem; font-weight: 600; color: var(--gold); font-variant-numeric: tabular-nums; line-height: 1.1; }
.finish-stat__label { font-size: .82rem; color: var(--ink-4); margin-top: 3px; }

.confirm-box { display: flex; gap: 13px; align-items: flex-start; padding: 17px 19px; border: 1px solid var(--line-2); border-radius: var(--radius); background: rgba(0, 0, 0, .3); margin-bottom: 22px; cursor: pointer; }
.confirm-box input { position: absolute; opacity: 0; width: 0; height: 0; }
.confirm-box__text { font-size: .94rem; color: var(--ink-2); }

.podium { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); margin-bottom: 30px; align-items: end; }
.podium__item { border: 1px solid var(--line-2); border-radius: var(--radius-lg); padding: 20px 16px; text-align: center; background: rgba(255, 255, 255, .028); position: relative; overflow: hidden; }
.podium__item:nth-child(1) { order: 2; border-color: rgba(255, 176, 59, .5); background: linear-gradient(180deg, rgba(255, 176, 59, .16), rgba(255, 176, 59, .03)); padding-top: 30px; padding-bottom: 30px; }
.podium__item:nth-child(2) { order: 1; }
.podium__item:nth-child(3) { order: 3; }
.podium__medal { font-size: 1.5rem; line-height: 1; margin-bottom: 8px; }
.podium__name { font-family: var(--font-display); font-weight: 700; font-size: .98rem; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium__score { font-family: var(--font-mono); font-size: 1.28rem; font-weight: 600; color: var(--gold); font-variant-numeric: tabular-nums; margin-top: 5px; }

.board { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.board__row { display: flex; align-items: center; gap: 14px; padding: 15px clamp(16px, 2.2vw, 22px); border-bottom: 1px solid var(--line); transition: background .2s; }
.board__row:last-child { border-bottom: 0; }
.board__row:hover { background: rgba(255, 255, 255, .022); }
.board__row.is-me { background: linear-gradient(90deg, rgba(255, 176, 59, .13), transparent); border-left: 2px solid var(--gold); }
.board__place { width: 36px; flex: none; font-family: var(--font-mono); font-size: .95rem; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.board__row.is-top .board__place { color: var(--gold); font-weight: 600; }
.board__name { flex: 1 1 auto; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board__meta { font-size: .82rem; color: var(--ink-4); font-family: var(--font-mono); white-space: nowrap; }
.board__score { font-family: var(--font-mono); font-size: 1.02rem; font-weight: 600; color: var(--gold); font-variant-numeric: tabular-nums; width: 62px; text-align: right; flex: none; }

.empty-state { text-align: center; padding: 50px 20px; color: var(--ink-3); }
.empty-state svg { width: 44px; height: 44px; color: var(--ink-4); margin-bottom: 16px; }

/* ---------- 7. Персональная страница ---------- */

.person {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: clamp(30px, 6vw, 60px) 20px; position: relative; z-index: 1;
}
.person__greet {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(1.7rem, 6vw, 3.2rem); letter-spacing: -.04em; line-height: 1.08;
  text-align: center; margin-bottom: .55em; max-width: 20ch;
}
.person__greet i { font-style: normal; background: linear-gradient(120deg, var(--gold), var(--rose)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.badge-card {
  width: min(460px, 100%);
  border: 1px solid var(--line-2); border-radius: 20px; overflow: hidden;
  background: linear-gradient(165deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .018));
  box-shadow: 0 32px 70px -34px rgba(0, 0, 0, .9);
}
.badge-card__top { display: flex; align-items: center; gap: 14px; padding: 20px 22px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .03); }
.badge-card__avatar { width: 52px; height: 52px; flex: none; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 1.28rem; color: var(--accent-ink); background: linear-gradient(140deg, var(--gold), var(--rose)); }
.badge-card__who { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.badge-card__name { font-family: var(--font-display); font-weight: 700; font-size: 1.16rem; letter-spacing: -.025em; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; }
.badge-card__role { font-size: .82rem; color: var(--ink-4); line-height: 1.3; }
.badge-card__rows { padding: 6px 22px 18px; }
.badge-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.badge-row:last-child { border-bottom: 0; }
.badge-row__k { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-4); }
.badge-row__v { font-family: var(--font-mono); font-size: .98rem; color: var(--ink); text-align: right; word-break: break-all; }
.badge-row__v.is-user { color: var(--gold); font-weight: 600; }
.badge-card__foot { padding: 14px 22px; border-top: 1px solid var(--line); background: rgba(0, 0, 0, .25); font-size: .78rem; color: var(--ink-4); font-family: var(--font-mono); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.person__url { margin-top: 22px; font-family: var(--font-mono); font-size: .82rem; color: var(--ink-4); text-align: center; word-break: break-all; }
.person__url b { color: var(--ink-2); }
.person__actions { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 11px; justify-content: center; }
.person__hintline { margin-top: 18px; font-size: .86rem; color: var(--ink-4); text-align: center; max-width: 48ch; }

.srcview { width: min(880px, 100%); margin-top: 26px; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; background: var(--bg-deep); }
.srcview__bar { display: flex; align-items: center; gap: 10px; padding: 11px 15px; background: rgba(255, 255, 255, .035); border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: .78rem; color: var(--ink-3); }
.srcview__body { max-height: 340px; overflow: auto; padding: 14px 16px; margin: 0; font-family: var(--font-mono); font-size: .78rem; line-height: 1.62; color: #93a4c4; white-space: pre; }
.srcview__body .cmt { color: #6f7f9e; }

/* ---------- 8. Админка ---------- */

.admin-shell { max-width: 1240px; margin: 0 auto; padding: clamp(22px, 4vw, 40px) clamp(16px, 4vw, 32px) 60px; position: relative; z-index: 1; }
.admin-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; justify-content: space-between; margin-bottom: 28px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.admin-head__title { display: flex; align-items: center; gap: 13px; }
.admin-head__title h1 { font-size: clamp(1.5rem, 3.4vw, 2rem); margin: 0; }
.admin-badge { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--rose); border: 1px solid rgba(255, 77, 109, .45); background: rgba(255, 77, 109, .1); padding: 4px 10px; border-radius: 100px; }

.kpis { display: grid; gap: 13px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 26px; }
.kpi { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; background: linear-gradient(170deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .012)); }
.kpi__num { font-family: var(--font-mono); font-size: 1.85rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi__label { font-size: .82rem; color: var(--ink-4); margin-top: 4px; }
.kpi--gold .kpi__num { color: var(--gold); }
.kpi--teal .kpi__num { color: var(--teal); }
.kpi--violet .kpi__num { color: var(--violet); }

.admin-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
.admin-grid--three { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.admin-grid--three > * { min-width: 0; }
.admin-panel { border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255, 255, 255, .022); overflow: hidden; }
.admin-panel__head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-panel__head h2 { font-size: 1.02rem; margin: 0; }
.admin-panel__body { padding: 6px 0; }
.admin-panel__body--pad { padding: 20px; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-table { width: 100%; min-width: 780px; font-size: .9rem; }
.admin-table td.name { min-width: 130px; }
.admin-table th { position: sticky; top: 0; background: var(--surface); z-index: 1; font-size: .72rem; }
.admin-table td { font-variant-numeric: tabular-nums; }
.admin-table td.name { font-weight: 600; }
.admin-table td.num { font-family: var(--font-mono); }
.admin-table tr:hover td { background: rgba(255, 255, 255, .022); }
.admin-table .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; }
.dot--live { background: var(--green); box-shadow: 0 0 8px rgba(70, 217, 139, .8); }
.dot--done { background: var(--gold); }
.dot--idle { background: var(--ink-4); }

.taskstat { padding: 14px 20px; border-bottom: 1px solid var(--line); }
.taskstat:last-child { border-bottom: 0; }
.taskstat__top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.taskstat__name { font-weight: 600; font-size: .94rem; }
.taskstat__val { font-family: var(--font-mono); font-size: .84rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.taskstat__meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--ink-4); font-family: var(--font-mono); margin-top: 7px; }

.danger-zone { border: 1px solid rgba(255, 95, 86, .3); border-radius: var(--radius-lg); background: rgba(255, 95, 86, .045); padding: 20px; }
.danger-zone h3 { color: #ff8f88; font-size: 1rem; }
.danger-form { display: grid; gap: 11px; margin-top: 14px; }
.danger-form .input { font-family: var(--font-body); }

.login-shell { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 30px 20px; position: relative; z-index: 1; }
.login-card { width: min(400px, 100%); border: 1px solid var(--line-2); border-radius: var(--radius-lg); padding: clamp(26px, 5vw, 36px); background: linear-gradient(170deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .015)); box-shadow: 0 30px 70px -34px rgba(0, 0, 0, .9); }
.login-card h1 { font-size: 1.5rem; margin-bottom: 6px; }
.login-form { display: grid; gap: 13px; margin-top: 22px; }

/* ---------- разбор после финиша ---------- */
.razbor-item { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 16px; background: rgba(255, 255, 255, .022); }
.razbor-item__head { display: flex; align-items: center; gap: 13px; padding: 17px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.razbor-item__title { font-family: var(--font-display); font-weight: 700; font-size: 1.06rem; letter-spacing: -.02em; flex: 1 1 auto; }
.razbor-item__body { padding: 20px 22px; }

/* ---------- адаптив ---------- */

@media (max-width: 1000px) {
  .task-layout { grid-template-columns: minmax(0, 1fr); }
  .task-side { position: static; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
  .track-head { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .podium { grid-template-columns: 1fr; }
  .podium__item:nth-child(1), .podium__item:nth-child(2), .podium__item:nth-child(3) { order: 0; padding: 16px; }
  .board__meta { display: none; }
  .finish-strip { flex-direction: column; align-items: stretch; }
  .finish-strip .btn { width: 100%; }
  .answer__actions .btn { flex: 1 1 auto; }
  .person__greet { font-size: clamp(1.5rem, 8vw, 2.2rem); }
}

/* ---------- редактор кода ---------- */

.verdicts { border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; background: rgba(0, 0, 0, .28); }
.verdicts__head { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; padding: 13px 16px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .03); }
.verdicts__title { font-family: var(--font-display); font-weight: 700; font-size: .96rem; letter-spacing: -.02em; }
.verdicts__sum { margin-left: auto; font-family: var(--font-mono); font-size: .82rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.verdicts__list { display: grid; }
.vd { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: .89rem; }
.vd:last-child { border-bottom: 0; }
.vd__no { font-family: var(--font-mono); font-size: .8rem; color: var(--ink-4); width: 74px; flex: none; }
.vd__badge { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: .78rem; font-weight: 600; padding: 3px 9px; border-radius: 100px; white-space: nowrap; }
.vd--ok .vd__badge { color: #8ff0be; background: rgba(70, 217, 139, .14); border: 1px solid rgba(70, 217, 139, .42); }
.vd--bad .vd__badge { color: #ffa79f; background: rgba(255, 95, 86, .12); border: 1px solid rgba(255, 95, 86, .42); }
.vd--skip { opacity: .45; }
.vd--skip .vd__badge { color: var(--ink-4); background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.vd__note { color: var(--ink-3); font-size: .84rem; min-width: 0; }
.vd__io { font-family: var(--font-mono); font-size: .78rem; color: var(--ink-4); margin-left: auto; text-align: right; white-space: nowrap; }
.vd__io b { color: var(--ink-2); font-weight: 600; }

@media (max-width: 620px) {
  .vd { flex-wrap: wrap; gap: 8px; }
  .vd__io { margin-left: 0; width: 100%; text-align: left; white-space: normal; }
  .vd__no { width: auto; }
}

/* ============================================================
   Редактор кода: подсветка синтаксиса поверх текстового поля
   ============================================================ */

.ide {
  --ide-font: .875rem;
  --ide-line: 1.65;
  --ide-pad: 16px;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  overflow: hidden; background: #06060c; margin-bottom: 18px;
}

.ide__bar {
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  padding: 10px 14px; background: rgba(255, 255, 255, .04);
  border-bottom: 1px solid var(--line);
}
.ide__dots { display: flex; gap: 6px; flex: none; }
.ide__dots i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.ide__dots i:nth-child(1) { background: #ff5f56; }
.ide__dots i:nth-child(2) { background: #ffbd2e; }
.ide__dots i:nth-child(3) { background: #27c93f; }
.ide__file { font-family: var(--font-mono); font-size: .8rem; color: var(--ink-2); }
.ide__meta { margin-left: auto; font-family: var(--font-mono); font-size: .7rem; color: var(--ink-4); white-space: nowrap; }
.ide__reset {
  border: 1px solid var(--line); background: rgba(255, 255, 255, .04);
  color: var(--ink-3); font-family: var(--font-body); font-size: .74rem;
  padding: 4px 10px; border-radius: 100px; cursor: pointer; transition: .18s; flex: none;
}
.ide__reset:hover { color: var(--ink); border-color: var(--line-2); }
.ide__reset[disabled] { opacity: .4; pointer-events: none; }

.ide__pane {
  display: flex; align-items: stretch;
  height: 330px; min-height: 180px; max-height: 70vh;
  resize: vertical; overflow: hidden;
}

.ide__gutter {
  flex: none; width: 48px; padding: var(--ide-pad) 10px var(--ide-pad) 0;
  text-align: right; overflow: hidden; user-select: none;
  font-family: var(--font-mono); font-size: var(--ide-font); line-height: var(--ide-line);
  color: #4a4a63; background: rgba(255, 255, 255, .022);
  border-right: 1px solid var(--line); white-space: pre;
}

.ide__stack { position: relative; flex: 1 1 auto; min-width: 0; }

/* Оба слоя обязаны совпадать по метрике до пикселя */
.ide__hl,
.ide__area {
  margin: 0; border: 0; padding: var(--ide-pad);
  font-family: var(--font-mono); font-size: var(--ide-font);
  line-height: var(--ide-line); letter-spacing: 0; tab-size: 4;
  white-space: pre; word-break: normal; overflow-wrap: normal;
  box-sizing: border-box;
}

.ide__hl {
  position: absolute; inset: 0; z-index: 1;
  overflow: hidden; pointer-events: none; color: #d7e2f7;
  background: transparent;
}
.ide__hl code { font: inherit; background: none; border: 0; padding: 0; color: inherit; }

.ide__area {
  position: relative; z-index: 2;
  width: 100%; height: 100%; display: block; resize: none;
  background: transparent; color: transparent; caret-color: var(--gold);
  -webkit-text-fill-color: transparent;
  overflow: auto;
}
.ide__area:focus { outline: 0; }
.ide__area::selection { background: rgba(255, 176, 59, .28); }
.ide__area[readonly] { caret-color: transparent; }

/* Токены Python */
.tok-kw   { color: #ff8fb1; font-weight: 600; }
.tok-bi   { color: #7fd4ff; }
.tok-str  { color: #a5e3a0; }
.tok-num  { color: #ffc46b; }
.tok-com  { color: #5f6b86; font-style: italic; }
.tok-op   { color: #b9b9cd; }
.tok-def  { color: #ffd79a; }

.ide__foot {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 14px; border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .022);
}
.ide__foot label {
  font-family: var(--font-mono); font-size: .7rem; color: var(--ink-4);
  text-transform: uppercase; letter-spacing: .12em; white-space: nowrap;
}
.ide__foot input {
  flex: 1 1 140px; min-width: 100px;
  background: rgba(0, 0, 0, .5); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 12px; color: var(--ink);
  font-family: var(--font-mono); font-size: .84rem;
}
.ide__foot input:focus { outline: 0; border-color: var(--accent); }
.ide__foot .btn svg { width: 13px; height: 13px; }

.ide__out {
  border-top: 1px solid var(--line); padding: 13px 16px;
  font-family: var(--font-mono); font-size: .84rem; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
  color: #9fe8c0; min-height: 46px; max-height: 220px; overflow: auto;
}
.ide__out.is-err { color: #ff9d95; }
.ide__out .dim { color: var(--ink-4); }
.ide__out .meta { color: var(--ink-4); font-size: .76rem; }

/* ============================================================
   Пусковая карточка и модальное окно заданий по ИБ
   ============================================================ */

.launch {
  display: flex; align-items: center; gap: clamp(14px, 2.4vw, 22px); flex-wrap: wrap;
  padding: clamp(20px, 3vw, 28px); margin-top: 26px; margin-bottom: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 12%, transparent), rgba(255, 255, 255, .02));
}
.launch__icon {
  width: 50px; height: 50px; flex: none; border-radius: 14px; display: grid; place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent);
}
.launch__icon svg { width: 25px; height: 25px; }
.launch__body { flex: 1 1 240px; min-width: 0; }
.launch__body h3 { margin: 0 0 4px; font-size: 1.14rem; }
.launch .btn { flex: none; }

.modal { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 20px; }
.modal__backdrop {
  position: absolute; inset: 0; background: rgba(4, 4, 10, .82);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fade-in .25s ease both;
}
@keyframes fade-in { from { opacity: 0; } }

.modal__box {
  position: relative; z-index: 1;
  width: min(560px, 100%); max-height: calc(100dvh - 40px); overflow: auto;
  padding: clamp(24px, 4vw, 34px);
  border: 1px solid var(--line-2); border-radius: var(--radius-lg);
  background: linear-gradient(168deg, #16161f, #0d0d15);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .95);
  animation: modal-in .34s var(--ease-out) both;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(20px) scale(.97); } }

.modal__x {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .04);
  color: var(--ink-3); cursor: pointer; transition: .18s;
}
.modal__x:hover { color: var(--ink); border-color: var(--line-2); background: rgba(255, 255, 255, .09); }
.modal__x svg { width: 15px; height: 15px; }

.modal__eyebrow { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; }
.modal__title { font-size: 1.42rem; margin: 0 0 10px; padding-right: 40px; }
.modal__lead { color: var(--ink-2); font-size: .95rem; margin-bottom: 20px; }
.modal__link { margin-bottom: 8px; }
.modal__link svg { width: 15px; height: 15px; }
.modal__note { margin-bottom: 20px; }

/* внутри окна блок ответа без собственной рамки */
.answer--flat {
  border: 0; border-radius: 0; background: none;
  margin-top: 0; padding: 20px 0 0;
  border-top: 1px solid var(--line);
}
/* в модальном окне заголовок и пояснение уже есть выше */
.answer--flat .answer__title,
.answer--flat .answer__note { display: none; }
.answer--flat .answer__actions { margin-top: 4px; }

body.modal-open { overflow: hidden; }

@media (max-width: 560px) {
  .ide__bar { padding: 9px 12px; gap: 9px; }
  .ide__meta { display: none; }
  .ide__reset { margin-left: auto; }
  .ide__gutter { width: 34px; padding-right: 7px; }
  .ide { --ide-pad: 12px; --ide-font: .82rem; }
  .ide__pane { height: 280px; }
  .ide__foot { gap: 8px; }
  .ide__foot .btn { width: 100%; justify-content: center; }
  .launch { flex-direction: column; align-items: stretch; text-align: left; }
  .launch .btn { width: 100%; }
  .modal { padding: 12px; }
  .modal__box { padding: 22px 18px; }
  .modal__title { font-size: 1.24rem; }
}
