/* ==========================================================================
   CodeCheck — общие стили
   ========================================================================== */

:root {
  --bg: #0a0c12;
  --bg-deep: #07090e;
  --bg-soft: #0e1119;
  --surface: #12151f;
  --surface-2: #171b27;
  --surface-3: #1c2130;
  --surface-hover: #1b2030;
  --border: rgba(148, 163, 184, 0.11);
  --border-strong: rgba(148, 163, 184, 0.2);
  --text: #eef1f8;
  --text-soft: #c4cad9;
  --muted: #8b93a8;
  --muted-2: #626b81;
  --accent: #7c7bff;
  --accent-soft: rgba(124, 123, 255, 0.13);
  --accent-line: rgba(124, 123, 255, 0.35);
  --violet: #b06bff;
  --cyan: #4cc9f0;
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.12);
  --red: #fb7185;
  --red-soft: rgba(251, 113, 133, 0.12);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.11);
  --radius: 16px;
  --radius-sm: 11px;
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
  --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, 0.85);
  --shadow-md: 0 14px 36px -18px rgba(0, 0, 0, 0.8);
}

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

html,
body {
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(1100px 650px at 88% -12%, rgba(124, 108, 255, 0.11), transparent 62%),
    radial-gradient(900px 550px at -8% 108%, rgba(76, 201, 240, 0.055), transparent 58%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.no-scroll {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

svg {
  display: block;
}

::selection {
  background: rgba(124, 123, 255, 0.35);
  color: #fff;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #2c3346 transparent;
}

*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: #2a3144;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: #3a4360;
  background-clip: content-box;
}

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

/* --------------------------------------------------------------------------
   Утилиты
   -------------------------------------------------------------------------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  padding: 7px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 500;
  backdrop-filter: blur(8px);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.12);
  animation: pulseDot 2.4s ease-in-out infinite;
}

.text-grad {
  background: linear-gradient(100deg, #a99cff 5%, #d29bff 55%, #7fd9ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.4;
  white-space: nowrap;
}

.pill-success {
  border-color: rgba(52, 211, 153, 0.3);
  background: var(--green-soft);
  color: var(--green);
}

.pill-warn {
  border-color: rgba(251, 191, 36, 0.28);
  background: var(--amber-soft);
  color: var(--amber);
}

.pill-danger {
  border-color: rgba(251, 113, 133, 0.28);
  background: var(--red-soft);
  color: var(--red);
}

.pill-accent {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: #b7b1ff;
}

.diff-easy {
  border-color: rgba(52, 211, 153, 0.26);
  background: var(--green-soft);
  color: #6ee7b7;
}

.diff-medium {
  border-color: rgba(251, 191, 36, 0.25);
  background: var(--amber-soft);
  color: #fcd34d;
}

.diff-hard {
  border-color: rgba(251, 113, 133, 0.25);
  background: var(--red-soft);
  color: #fda4af;
}

.dot-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted-2);
}

.mono {
  font-family: var(--mono);
}

.hidden {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Кнопки, поля, бренд
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease,
    transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none !important;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: linear-gradient(135deg, #7b6cff 0%, #9d5cff 55%, #b45bff 100%);
  color: #fff;
  box-shadow: 0 12px 28px -14px rgba(124, 108, 255, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 16px 34px -14px rgba(124, 108, 255, 1), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-ghost {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-soft);
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
}

.btn-quiet {
  color: var(--muted);
  background: transparent;
}

.btn-quiet:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.btn-danger-ghost {
  border-color: rgba(251, 113, 133, 0.22);
  background: rgba(251, 113, 133, 0.07);
  color: #fda4af;
}

.btn-sm {
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 12.5px;
}

.btn-lg {
  height: 48px;
  border-radius: 12px;
  font-size: 14.5px;
}

.btn-block {
  width: 100%;
}

.btn[data-loading="true"] .btn-text,
.btn[data-loading="true"] .btn-arrow {
  opacity: 0;
}

.btn-spinner {
  display: none;
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn[data-loading="true"] .btn-spinner {
  display: block;
}

.btn[data-loading="true"] {
  position: relative;
}

.btn .btn-spinner {
  left: 50%;
  top: 50%;
  margin: -9px 0 0 -9px;
}

.btn[data-loading="true"] > :not(.btn-spinner) {
  opacity: 0;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--font);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(140deg, #7b6cff, #b45bff 70%, #d06bff);
  color: #fff;
  box-shadow: 0 8px 22px -10px rgba(124, 108, 255, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.brand-mark svg {
  width: 19px;
  height: 19px;
}

.brand-name {
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-name span {
  background: linear-gradient(100deg, #a99cff, #d29bff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-tag {
  margin-left: 6px;
  padding-left: 14px;
  border-left: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 600;
}

.field-control {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 47px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(8, 10, 16, 0.6);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.field-control:focus-within {
  border-color: var(--accent-line);
  background: rgba(8, 10, 16, 0.82);
  box-shadow: 0 0 0 4px rgba(124, 123, 255, 0.1);
}

.field-icon {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  color: var(--muted-2);
}

.field-control:focus-within .field-icon {
  color: var(--accent);
}

.field-control input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.field-control input::placeholder {
  color: #545d72;
}

.field-control input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px #0b0e15 inset;
  caret-color: var(--text);
}

.field-action {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-right: -5px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted-2);
  transition: color 0.15s ease, background 0.15s ease;
}

.field-action:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-soft);
}

.field-action svg {
  width: 17px;
  height: 17px;
}

.field-action .eye-closed {
  display: none;
}

.field-action.is-visible .eye-open {
  display: none;
}

.field-action.is-visible .eye-closed {
  display: block;
}

/* --------------------------------------------------------------------------
   Страница входа
   -------------------------------------------------------------------------- */

.auth-page {
  background: var(--bg-deep);
}

.auth {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(430px, 0.92fr);
  min-height: 100dvh;
}

.auth-showcase {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 40px 56px 28px;
  overflow: hidden;
  background:
    radial-gradient(720px 500px at 8% 0%, rgba(124, 108, 255, 0.2), transparent 62%),
    radial-gradient(560px 480px at 92% 92%, rgba(76, 201, 240, 0.1), transparent 60%),
    linear-gradient(160deg, #0d1018 0%, #0a0c13 55%, #0a0c12 100%);
}

.auth-showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(700px 520px at 20% 12%, #000 20%, transparent 78%);
  pointer-events: none;
}

.auth-showcase > * {
  position: relative;
  z-index: 1;
}

.auth-glow {
  position: absolute;
  top: -180px;
  left: -160px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 108, 255, 0.24), transparent 65%);
  filter: blur(30px);
  z-index: 0;
  pointer-events: none;
}

.auth-brand {
  display: flex;
  align-items: center;
}

.auth-copy {
  max-width: 590px;
  margin-top: auto;
}

.auth-copy h1 {
  margin: 18px 0 16px;
  font-size: clamp(38px, 4.1vw, 56px);
  font-weight: 750;
  line-height: 1.06;
  letter-spacing: -0.035em;
}

.auth-lead {
  max-width: 500px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.auth-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
  max-width: 540px;
  margin: 28px 0 6px;
  padding: 0;
  list-style: none;
}

.auth-features li {
  display: flex;
  align-items: center;
  gap: 11px;
}

.feature-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  color: #a9a2ff;
}

.feature-icon svg {
  width: 16px;
  height: 16px;
}

.auth-features li > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.auth-features strong {
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 600;
}

.auth-features small {
  color: var(--muted-2);
  font-size: 11px;
}

.demo-window {
  width: min(100%, 610px);
  margin-top: auto;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(22, 26, 39, 0.95), rgba(13, 16, 24, 0.96));
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  transform: perspective(1200px) rotateX(1.4deg);
}

.demo-window-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 38px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.018);
}

.win-dots {
  display: flex;
  gap: 6px;
}

.win-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #333b4f;
}

.win-dots i:nth-child(1) {
  background: #f87171;
  opacity: 0.8;
}

.win-dots i:nth-child(2) {
  background: #fbbf24;
  opacity: 0.8;
}

.win-dots i:nth-child(3) {
  background: #34d399;
  opacity: 0.8;
}

.demo-file {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
}

.demo-lang {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.demo-code {
  margin: 0;
  padding: 16px 20px 14px;
  overflow: hidden;
  color: #d6dbe8;
  font: 12.5px/1.72 var(--mono);
  white-space: pre;
}

.demo-code .tok-keyword {
  color: #c792ea;
}

.demo-code .tok-builtin {
  color: #ffcb6b;
}

.demo-code .tok-func {
  color: #82aaff;
}

.demo-code .tok-comment {
  color: #5b657c;
  font-style: italic;
}

.demo-result {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 16px;
  border-top: 1px solid rgba(52, 211, 153, 0.16);
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.09), rgba(52, 211, 153, 0.015));
}

.demo-result-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.15);
  color: var(--green);
}

.demo-result-icon svg {
  width: 14px;
  height: 14px;
}

.demo-result-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.demo-result-text strong {
  font-size: 12px;
  font-weight: 600;
}

.demo-result-text span {
  color: var(--muted);
  font-size: 11px;
}

.demo-result .pill {
  margin-left: auto;
}

.auth-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  color: var(--muted-2);
  font-size: 11px;
}

.auth-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 48px 40px;
  border-left: 1px solid var(--border);
  background:
    radial-gradient(520px 420px at 80% 8%, rgba(124, 108, 255, 0.08), transparent 60%),
    #090b11;
  overflow: hidden;
}

.auth-panel-glow {
  position: absolute;
  right: -140px;
  bottom: -160px;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(176, 107, 255, 0.1), transparent 65%);
  pointer-events: none;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 404px;
  animation: fadeUp 0.55s ease both;
}

.auth-card-head {
  margin-bottom: 28px;
}

.auth-card-head h2 {
  margin: 10px 0 8px;
  font-size: 29px;
  font-weight: 730;
  letter-spacing: -0.03em;
}

.auth-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form .btn-primary {
  margin-top: 4px;
}

.btn-lg .btn-spinner {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -9px 0 0 -9px;
}

.form-error {
  padding: 10px 12px;
  border: 1px solid rgba(251, 113, 133, 0.28);
  border-radius: 9px;
  background: rgba(251, 113, 133, 0.08);
  color: #fda4af;
  font-size: 12.5px;
  line-height: 1.45;
  animation: shake 0.35s ease;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 26px 0 16px;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.demo-creds {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.demo-cred {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.demo-cred:hover {
  border-color: var(--accent-line);
  background: rgba(124, 123, 255, 0.055);
  transform: translateY(-1px);
}

.demo-cred-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #4c6fff, #8b5cf6);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
}

.demo-cred-avatar.alt {
  background: linear-gradient(135deg, #0ea5e9, #14b8a6);
}

.demo-cred-avatar.teacher {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.demo-cred-avatar.admin {
  background: linear-gradient(135deg, #7c6cff, #4c6fff);
}

.demo-cred-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.demo-cred-info strong {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
}

.demo-cred-info small {
  color: var(--muted-2);
  font-size: 10.5px;
}

.demo-cred-fill {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.18s ease;
}

.demo-cred:hover .demo-cred-fill {
  color: #b7b1ff;
}

.auth-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 22px 0 0;
  color: var(--muted-2);
  font-size: 11px;
}

.auth-note svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.auth-legal {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--muted-2);
  font-size: 11.5px;
  text-align: center;
}

.noscript {
  position: fixed;
  inset: auto 0 0;
  padding: 14px;
  background: #7f1d1d;
  color: #fff;
  text-align: center;
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   Верхняя панель приложения
   -------------------------------------------------------------------------- */

.app-page {
  min-height: 100dvh;
}

.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(9, 11, 17, 0.78);
  backdrop-filter: blur(18px) saturate(140%);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 26px;
  width: 100%;
  max-width: 1280px;
  height: 64px;
  margin: 0 auto;
  padding: 0 24px;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-link:hover {
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.04);
}

.nav-link.active {
  background: rgba(124, 123, 255, 0.1);
  color: #c2bdff;
}

.nav-link svg {
  width: 15px;
  height: 15px;
}

.top-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(251, 146, 60, 0.2);
  border-radius: 999px;
  background: rgba(251, 146, 60, 0.07);
  color: #fdba74;
  font-size: 11.5px;
  font-weight: 650;
}

.streak-pill svg {
  width: 13px;
  height: 13px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 6px 4px 4px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #4c6fff, #9d5cff);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.avatar.teal {
  background: linear-gradient(135deg, #0ea5e9, #14b8a6);
}

.avatar.amber {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.user-meta strong {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.user-meta span {
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.35;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted-2);
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-soft);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.icon-btn.danger:hover {
  border-color: rgba(251, 113, 133, 0.25);
  background: rgba(251, 113, 133, 0.08);
  color: #fda4af;
}

/* --------------------------------------------------------------------------
   Общие контейнеры и карточки
   -------------------------------------------------------------------------- */

.view {
  flex: 1;
  min-height: 0;
}

.app-main {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 30px 24px 72px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.page-head h1 {
  margin: 7px 0 4px;
  font-size: 30px;
  font-weight: 720;
  letter-spacing: -0.032em;
}

.page-head .sub {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.page-context {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 6px;
}

.context-subject {
  color: var(--muted-2);
  font-size: 11px;
}

.context-subject strong {
  color: var(--text-soft);
  font-weight: 600;
}

.greeting-streak {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(251, 146, 60, 0.16);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.08), rgba(251, 146, 60, 0.02));
}

.greeting-streak-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(251, 146, 60, 0.13);
  color: #fdba74;
}

.greeting-streak-icon svg {
  width: 17px;
  height: 17px;
}

.greeting-streak div {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.greeting-streak strong {
  color: #fed7aa;
  font-size: 12.5px;
  font-weight: 650;
}

.greeting-streak span {
  color: var(--muted-2);
  font-size: 10.5px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 17px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(165deg, rgba(23, 27, 39, 0.82), rgba(16, 19, 28, 0.86));
  overflow: hidden;
  animation: fadeUp 0.45s ease both;
}

.stat-card:nth-child(2) {
  animation-delay: 0.04s;
}

.stat-card:nth-child(3) {
  animation-delay: 0.08s;
}

.stat-card:nth-child(4) {
  animation-delay: 0.12s;
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -46px;
  width: 124px;
  height: 124px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 108, 255, 0.12), transparent 66%);
  pointer-events: none;
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stat-label {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 550;
  letter-spacing: 0.01em;
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: #a9a2ff;
}

.stat-icon svg {
  width: 15px;
  height: 15px;
}

.stat-icon.green {
  color: #6ee7b7;
}

.stat-icon.amber {
  color: #fcd34d;
}

.stat-icon.cyan {
  color: #7dd3fc;
}

.stat-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat-value small {
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}

.stat-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.stat-foot .up {
  color: var(--green);
  font-weight: 600;
}

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(170deg, rgba(21, 25, 36, 0.86), rgba(15, 18, 26, 0.9));
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.panel-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.panel-head .muted {
  color: var(--muted-2);
  font-size: 11px;
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 338px;
  gap: 18px;
  align-items: start;
}

/* --------------------------------------------------------------------------
   Список задач
   -------------------------------------------------------------------------- */

.tasks-panel {
  min-width: 0;
}

.tasks-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 150px;
  max-width: 230px;
}

.search-box svg {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  color: var(--muted-2);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 34px;
  padding: 0 10px 0 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: 0;
  background: rgba(8, 10, 16, 0.55);
  color: var(--text);
  font-size: 12px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.search-box input::placeholder {
  color: var(--muted-2);
}

.search-box input:focus {
  border-color: var(--accent-line);
  background: rgba(8, 10, 16, 0.8);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(8, 10, 16, 0.45);
}

.filter-btn {
  height: 26px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 550;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}

.filter-btn:hover {
  color: var(--text-soft);
}

.filter-btn.active {
  background: rgba(124, 123, 255, 0.14);
  color: #c2bdff;
}

.filter-btn .count {
  margin-left: 4px;
  opacity: 0.65;
  font-size: 10px;
}

.task-list {
  display: flex;
  flex-direction: column;
}

.task-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 15px 17px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.075);
  transition: background 0.16s ease;
}

.task-row:last-child {
  border-bottom: 0;
}

.task-row:hover {
  background: rgba(124, 123, 255, 0.045);
}

.task-row:hover .task-arrow {
  transform: translateX(2px);
  color: #b7b1ff;
}

.task-state {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 700;
}

.task-state svg {
  width: 14px;
  height: 14px;
}

.task-state.solved {
  border-color: rgba(52, 211, 153, 0.25);
  background: var(--green-soft);
  color: var(--green);
}

.task-state.attempted {
  border-color: rgba(251, 191, 36, 0.22);
  background: var(--amber-soft);
  color: var(--amber);
}

.state-empty {
  width: 8px;
  height: 8px;
  border: 1.5px solid #4a5368;
  border-radius: 50%;
}

.task-main {
  min-width: 0;
}

.task-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.task-index {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.task-title-line h3 {
  margin: 0;
  color: var(--text-soft);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-row:hover .task-title-line h3 {
  color: var(--text);
}

.task-summary {
  margin: 3px 0 0;
  color: var(--muted-2);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.task-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.task-meta svg {
  width: 11px;
  height: 11px;
  opacity: 0.75;
}

.task-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.task-best {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  color: var(--muted-2);
  font-size: 10px;
  white-space: nowrap;
}

.task-best strong {
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
}

.task-best .ok {
  color: var(--green);
  font-size: 10px;
  font-weight: 600;
}

.task-arrow {
  width: 16px;
  height: 16px;
  color: #4a5165;
  transition: transform 0.18s ease, color 0.18s ease;
}

.empty-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 42px 20px;
  color: var(--muted-2);
  text-align: center;
}

.empty-list svg {
  width: 28px;
  height: 28px;
  margin-bottom: 4px;
  opacity: 0.5;
}

.empty-list strong {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
}

.empty-list span {
  font-size: 11.5px;
}

/* --------------------------------------------------------------------------
   Правая колонка дашборда
   -------------------------------------------------------------------------- */

.side-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.progress-panel {
  padding: 18px;
}

.progress-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.progress-panel-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
}

.progress-panel-head span {
  color: var(--muted-2);
  font-size: 10.5px;
}

.progress-body {
  display: flex;
  align-items: center;
  gap: 18px;
}

.ring {
  position: relative;
  flex: 0 0 auto;
  width: 92px;
  height: 92px;
}

.ring svg {
  width: 92px;
  height: 92px;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: rgba(148, 163, 184, 0.1);
  stroke-width: 7;
}

.ring-value {
  fill: none;
  stroke: url(#ringGradient);
  stroke-width: 7;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.15;
}

.ring-center strong {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.ring-center span {
  color: var(--muted-2);
  font-size: 9.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.progress-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.progress-info-row {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.progress-info-row strong {
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 600;
}

.progress-info-row span {
  color: var(--muted-2);
  font-size: 10.5px;
}

.progress-bar {
  height: 5px;
  margin-top: 14px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.09);
  overflow: hidden;
}

.progress-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6d8bff, #b06bff);
  transition: width 0.8s ease;
}

.recent-list {
  display: flex;
  flex-direction: column;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.06);
  transition: background 0.15s ease;
}

.recent-item:last-child {
  border-bottom: 0;
}

.recent-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.recent-verdict {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
}

.recent-verdict.ok {
  background: rgba(52, 211, 153, 0.13);
  color: var(--green);
}

.recent-verdict.bad {
  background: rgba(251, 113, 133, 0.12);
  color: var(--red);
}

.recent-verdict.warn {
  background: rgba(251, 191, 36, 0.12);
  color: var(--amber);
}

.recent-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.recent-main strong {
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-main span {
  color: var(--muted-2);
  font-size: 10px;
}

.recent-time {
  margin-left: auto;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
  white-space: nowrap;
}

.panel-link {
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 550;
  transition: color 0.15s ease;
}

.panel-link:hover {
  color: #b7b1ff;
}

.empty-mini {
  padding: 24px 16px;
  color: var(--muted-2);
  font-size: 11.5px;
  text-align: center;
}

.leader-list {
  display: flex;
  flex-direction: column;
  padding: 4px 0;
}

.leader-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
}

.leader-row.me {
  background: rgba(124, 123, 255, 0.05);
}

.leader-rank {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
}

.leader-rank.top1 {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #211500;
}

.leader-rank.top2 {
  background: linear-gradient(135deg, #d1d5db, #9ca3af);
  color: #1c1f26;
}

.leader-rank.top3 {
  background: linear-gradient(135deg, #d08a5a, #a8642f);
  color: #211208;
}

.leader-avatar {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: rgba(124, 123, 255, 0.16);
  color: #c2bdff;
  font-size: 8.5px;
  font-weight: 700;
}

.leader-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-soft);
  font-size: 11.5px;
}

.leader-name em {
  display: block;
  color: var(--muted-2);
  font-size: 9.5px;
  font-style: normal;
}

.leader-points {
  margin-left: auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
}

.leader-points strong {
  color: var(--text-soft);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Страница результатов
   -------------------------------------------------------------------------- */

.results-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.results-table-wrap {
  overflow-x: auto;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.results-table th {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.results-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.06);
  color: var(--text-soft);
  vertical-align: middle;
}

.results-table tbody tr {
  cursor: pointer;
  transition: background 0.14s ease;
}

.results-table tbody tr:hover {
  background: rgba(124, 123, 255, 0.04);
}

.results-table tbody tr:last-child td {
  border-bottom: 0;
}

.results-task {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 150px;
}

.results-task-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 auto;
}

.results-task strong {
  font-size: 12.5px;
  font-weight: 550;
}

.results-task small {
  display: block;
  color: var(--muted-2);
  font-size: 10px;
}

.results-score {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
}

.results-score b {
  color: var(--text-soft);
  font-weight: 600;
}

.results-time {
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
}

.results-date {
  color: var(--muted-2);
  font-size: 10.5px;
  white-space: nowrap;
}

.results-table .table-action {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted-2);
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.results-table .table-action:hover {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-soft);
}

.results-table .table-action svg {
  width: 14px;
  height: 14px;
}

.results-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 10px;
}

.results-pagination:empty {
  display: none;
}

.results-summary {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.results-summary div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.results-summary strong {
  font-size: 17px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.results-summary span {
  color: var(--muted-2);
  font-size: 10px;
}

.rs-div {
  width: 1px;
  height: 26px;
  background: var(--border);
}

/* --------------------------------------------------------------------------
   Рабочая область задачи
   -------------------------------------------------------------------------- */

.workspace {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 64px);
  overflow: hidden;
  animation: fadeIn 0.25s ease both;
}

.ws-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
  height: 54px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(12, 15, 22, 0.72);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 9px 0 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 550;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.back-link:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
}

.back-link svg {
  width: 13px;
  height: 13px;
}

.ws-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.ws-title .task-index {
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted-2);
  font-size: 10px;
}

.ws-title h1 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.ws-meta .lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10.5px;
}

.ws-meta .lang i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffd43b;
  box-shadow: 0 0 8px rgba(255, 212, 59, 0.45);
}

.ws-meta .lang.js i {
  background: #f7df1e;
}

.ws-split {
  display: flex;
  flex: 1;
  min-height: 0;
  --left: 44%;
}

.task-pane {
  flex: 0 0 var(--left);
  width: var(--left);
  min-width: 0;
  overflow-y: auto;
  background:
    radial-gradient(500px 300px at 20% 0%, rgba(124, 108, 255, 0.04), transparent 70%),
    var(--surface);
  border-right: 1px solid var(--border);
}

.task-pane-inner {
  padding: 26px 30px 60px;
}

.task-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.task-kicker .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted-2);
}

.task-head h1 {
  margin: 10px 0 12px;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.task-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chip-muted {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.chip-muted svg {
  width: 12px;
  height: 12px;
}

.prose {
  margin-top: 22px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.75;
}

.prose p {
  margin: 0 0 12px;
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose ul {
  margin: 0 0 12px;
  padding-left: 18px;
}

.prose li {
  margin-bottom: 4px;
}

.prose code,
.task-spec code,
.hint-text code,
.example-note code {
  padding: 1px 4px;
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.07);
  color: #d3d9e8;
  font-family: var(--mono);
  font-size: 0.88em;
  white-space: nowrap;
}

.task-spec {
  display: grid;
  gap: 12px;
  margin-top: 20px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(8, 10, 16, 0.32);
}

.spec-block h4 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.spec-block p {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.6;
}

.spec-constraints {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 3px;
}

.spec-constraints span {
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.task-section {
  margin-top: 26px;
}

.task-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 11px;
}

.task-section-head h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: -0.005em;
}

.task-section-head h3 svg {
  width: 14px;
  height: 14px;
  color: var(--muted-2);
}

.task-section-head .hint-count {
  color: var(--muted-2);
  font-size: 10.5px;
}

.example {
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 11px;
  overflow: hidden;
  background: rgba(8, 10, 16, 0.4);
}

.example-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.example-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.example-cell {
  min-width: 0;
  padding: 10px 12px;
}

.example-cell + .example-cell {
  border-left: 1px solid var(--border);
}

.example-cell span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted-2);
  font-size: 9.5px;
}

.example-cell pre {
  margin: 0;
  color: var(--text-soft);
  font: 11.5px/1.6 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.example-note {
  padding: 7px 12px;
  border-top: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 10.5px;
}

.hints {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hint {
  border: 1px dashed rgba(148, 163, 184, 0.18);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.012);
  overflow: hidden;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.hint.open {
  border-style: solid;
  border-color: rgba(124, 123, 255, 0.24);
  background: rgba(124, 123, 255, 0.045);
}

.hint-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
}

.hint-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: rgba(251, 191, 36, 0.09);
  color: var(--amber);
  flex: 0 0 auto;
}

.hint-icon svg {
  width: 13px;
  height: 13px;
}

.hint-title {
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 550;
}

.hint-open-btn {
  margin-left: auto;
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 550;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.hint-open-btn:hover {
  border-color: var(--accent-line);
  color: #c2bdff;
}

.hint-text {
  padding: 0 12px 11px 45px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.65;
  animation: fadeIn 0.2s ease both;
}

.hint-text code {
  white-space: pre-wrap;
}

.history-block .history-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 11px;
  overflow: hidden;
  background: rgba(8, 10, 16, 0.3);
}

.history-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.06);
  font-size: 11px;
}

.history-row:last-child {
  border-bottom: 0;
}

.history-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.history-dot.ok {
  background: var(--green);
}

.history-dot.bad {
  background: var(--red);
}

.history-dot.warn {
  background: var(--amber);
}

.history-verdict {
  color: var(--text-soft);
  font-weight: 550;
}

.history-score {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
}

.history-time {
  margin-left: auto;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
}

.history-date {
  color: #4d566b;
  font-size: 10px;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Редактор и консоль
   -------------------------------------------------------------------------- */

.split-resizer {
  position: relative;
  z-index: 5;
  flex: 0 0 6px;
  width: 6px;
  margin-left: -3px;
  margin-right: -3px;
  cursor: col-resize;
  background: transparent;
  touch-action: none;
}

.split-resizer::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 2px;
  width: 2px;
  border-radius: 2px;
  background: transparent;
  transition: background 0.15s ease;
}

.split-resizer:hover::after,
body.is-resizing .split-resizer::after {
  background: var(--accent-line);
}

body.is-resizing {
  cursor: col-resize;
  user-select: none;
}

.editor-pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  background: #0a0d14;
  scroll-margin-top: 74px;
}

.to-editor {
  display: none;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  height: 50px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(17, 21, 31, 0.78);
}

.file-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 11.5px;
}

.file-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: #ffd43b;
  box-shadow: 0 0 9px rgba(255, 212, 59, 0.35);
}

.file-dot.js {
  background: #f7df1e;
  box-shadow: 0 0 9px rgba(247, 223, 30, 0.3);
}

.file-dot.cpp {
  background: #659ad2;
  box-shadow: 0 0 9px rgba(101, 154, 210, 0.35);
}

.ws-meta .lang.cpp i {
  background: #659ad2;
  box-shadow: 0 0 8px rgba(101, 154, 210, 0.45);
}

.save-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted-2);
  font-size: 9.5px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.save-state.show {
  opacity: 1;
}

.save-state svg {
  width: 10px;
  height: 10px;
  color: var(--green);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}

.toolbar-actions .btn {
  height: 32px;
  padding: 0 11px;
  font-size: 11.5px;
  border-radius: 8px;
}

.toolbar-actions kbd {
  margin-left: 2px;
  height: 17px;
  font-size: 9px;
  opacity: 0.75;
}

.editor-full {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.editor-host {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 140px;
  overflow: hidden;
  background:
    radial-gradient(700px 300px at 80% 0%, rgba(124, 108, 255, 0.035), transparent 70%),
    #0a0d14;
}

.editor-gutter {
  flex: 0 0 51px;
  width: 51px;
  overflow: hidden;
  border-right: 1px solid rgba(148, 163, 184, 0.055);
  background: rgba(255, 255, 255, 0.012);
  user-select: none;
}

.editor-gutter pre {
  min-height: 100%;
  margin: 0;
  padding: 17px 11px 80px 0;
  color: #474f63;
  font: 13px/22px var(--mono);
  text-align: right;
  tab-size: 4;
}

.editor-main {
  position: relative;
  flex: 1;
  min-width: 0;
}

.editor-highlight,
.editor-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 17px 20px 90px;
  border: 0;
  font: 13.5px/22px var(--mono);
  letter-spacing: 0;
  tab-size: 4;
  white-space: pre;
  overflow-wrap: normal;
}

.editor-highlight {
  overflow: hidden;
  color: #dde3f0;
  pointer-events: none;
}

.editor-highlight code {
  font: inherit;
  tab-size: inherit;
  white-space: inherit;
}

.editor-input {
  z-index: 1;
  resize: none;
  outline: 0;
  background: transparent;
  color: transparent;
  caret-color: #eef1f8;
  overflow: auto;
}

.editor-input::selection {
  background: rgba(124, 123, 255, 0.3);
}

.editor-input::-moz-selection {
  background: rgba(124, 123, 255, 0.3);
}

.tok-keyword {
  color: #c792ea;
}

.tok-builtin {
  color: #ffcb6b;
}

.tok-func {
  color: #82aaff;
}

.tok-string {
  color: #9fd67e;
}

.tok-number {
  color: #f2a272;
}

.tok-comment {
  color: #5b657c;
  font-style: italic;
}

.tok-decorator {
  color: #f78c6c;
}

.editor-statusbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
  height: 26px;
  padding: 0 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.06);
  background: rgba(17, 21, 31, 0.6);
  color: #4f586d;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.01em;
}

.editor-statusbar .push {
  margin-left: auto;
}

.editor-statusbar .status-lang {
  color: #6b7488;
}

/* Консоль */

.console {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  height: 304px;
  border-top: 1px solid var(--border);
  background: #0b0e15;
}

.console-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(17, 21, 31, 0.55);
}

.console-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.console-title svg {
  width: 13px;
  height: 13px;
  color: var(--muted-2);
}

.console-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9.5px;
}

.console-meta .badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font);
  font-size: 9.5px;
  font-weight: 600;
}

.console-meta .badge.ok {
  border-color: rgba(52, 211, 153, 0.24);
  background: var(--green-soft);
  color: var(--green);
}

.console-meta .badge.bad {
  border-color: rgba(251, 113, 133, 0.24);
  background: var(--red-soft);
  color: #fda4af;
}

.console-meta .badge.warn {
  border-color: rgba(251, 191, 36, 0.24);
  background: var(--amber-soft);
  color: #fcd34d;
}

.console-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 15px 24px;
}

.console-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 100%;
  min-height: 120px;
  color: var(--muted-2);
  text-align: center;
}

.console-empty svg {
  width: 25px;
  height: 25px;
  margin-bottom: 2px;
  opacity: 0.45;
}

.console-empty strong {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 550;
}

.console-empty span {
  font-size: 10.5px;
}

.console-empty kbd {
  height: 18px;
  font-size: 9.5px;
}

.verdict {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  animation: fadeUp 0.25s ease both;
}

.verdict.ok {
  border-color: rgba(52, 211, 153, 0.26);
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.12), rgba(52, 211, 153, 0.02));
}

.verdict.bad {
  border-color: rgba(251, 113, 133, 0.24);
  background: linear-gradient(90deg, rgba(251, 113, 133, 0.1), rgba(251, 113, 133, 0.015));
}

.verdict.warn {
  border-color: rgba(251, 191, 36, 0.24);
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.09), rgba(251, 191, 36, 0.015));
}

.verdict-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.verdict-icon svg {
  width: 15px;
  height: 15px;
}

.verdict.ok .verdict-icon {
  background: rgba(52, 211, 153, 0.16);
  color: var(--green);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.05);
}

.verdict.bad .verdict-icon {
  background: rgba(251, 113, 133, 0.14);
  color: var(--red);
}

.verdict.warn .verdict-icon {
  background: rgba(251, 191, 36, 0.14);
  color: var(--amber);
}

.verdict-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.verdict-text strong {
  font-size: 12px;
  font-weight: 600;
}

.verdict-text span {
  color: var(--muted-2);
  font-size: 10.5px;
}

.verdict-time {
  margin-left: auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
}

.test-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.test-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--text-soft);
  font-size: 11px;
  transition: background 0.12s ease;
}

.test-row:hover {
  background: rgba(255, 255, 255, 0.025);
}

.test-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 8.5px;
  font-weight: 700;
}

.test-row.pass .test-icon {
  background: rgba(52, 211, 153, 0.14);
  color: var(--green);
}

.test-row.fail .test-icon {
  background: rgba(251, 113, 133, 0.14);
  color: var(--red);
}

.test-row.skip .test-icon {
  background: rgba(251, 191, 36, 0.12);
  color: var(--amber);
}

.test-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.test-name .mini {
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.09);
  color: var(--muted-2);
  font-size: 8.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.test-time {
  margin-left: auto;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9.5px;
  white-space: nowrap;
}

.test-detail {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  animation: fadeUp 0.22s ease both;
}

.test-list .test-detail {
  margin: 4px 0 8px;
}

.io-block {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(8, 10, 16, 0.5);
  overflow: hidden;
}

.io-block > span {
  display: block;
  padding: 5px 9px;
  border-bottom: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.io-block.good > span {
  color: #6ee7b7;
}

.io-block.bad > span {
  color: #fda4af;
}

.io-block.wide {
  grid-column: 1 / -1;
}

.io-block.wide > span {
  color: var(--muted);
}

.io-block pre {
  margin: 0;
  padding: 8px 9px;
  max-height: 120px;
  overflow: auto;
  color: var(--text-soft);
  font: 10.5px/1.55 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.io-block pre:empty::after {
  content: "(пусто)";
  color: var(--muted-2);
}

.stderr-block {
  margin-top: 10px;
  border: 1px solid rgba(251, 113, 133, 0.2);
  border-radius: 8px;
  background: rgba(251, 113, 133, 0.055);
  overflow: hidden;
}

.stderr-block span {
  display: block;
  padding: 5px 9px;
  border-bottom: 1px solid rgba(251, 113, 133, 0.14);
  color: #fda4af;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stderr-block pre {
  max-height: 140px;
  margin: 0;
  padding: 8px 9px;
  overflow: auto;
  color: #fecdd3;
  font: 10.5px/1.6 var(--mono);
  white-space: pre-wrap;
}

.hidden-note {
  margin-top: 10px;
  padding: 9px 11px;
  border: 1px dashed rgba(251, 191, 36, 0.22);
  border-radius: 8px;
  background: rgba(251, 191, 36, 0.055);
  color: #fcd34d;
  font-size: 10.5px;
  line-height: 1.55;
}

.run-output {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.run-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-2);
  font-size: 10px;
}

.run-line .ok {
  color: var(--green);
}

.run-line .bad {
  color: var(--red);
}

.run-stdout {
  margin: 0;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(8, 10, 16, 0.55);
  color: #d7dce9;
  font: 11px/1.65 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 220px;
  overflow: auto;
}

.run-stdout:empty::after {
  content: "Программа ничего не вывела";
  color: var(--muted-2);
  font-family: var(--font);
  font-size: 10.5px;
}

.console-loading {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 4px 0;
}

.loading-line {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
}

.loading-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(124, 123, 255, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.skeleton-row {
  height: 24px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.055), rgba(148, 163, 184, 0.1), rgba(148, 163, 184, 0.055));
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

.skeleton-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* --------------------------------------------------------------------------
   Скелетоны, уведомления, прочее
   -------------------------------------------------------------------------- */

.skeleton-page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 24px;
}

.skeleton-block {
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.045), rgba(148, 163, 184, 0.09), rgba(148, 163, 184, 0.045));
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}

.ws-loading {
  display: grid;
  place-items: center;
  height: calc(100dvh - 64px);
  color: var(--muted-2);
  gap: 10px;
  font-size: 12px;
}

.ws-loading .loading-spinner {
  width: 22px;
  height: 22px;
  border-width: 2.5px;
}

.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 420px;
  padding: 40px 24px;
  color: var(--muted);
  text-align: center;
}

.error-state svg {
  width: 34px;
  height: 34px;
  color: var(--red);
  opacity: 0.8;
}

.error-state h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
}

.error-state p {
  margin: 0;
  font-size: 12px;
  color: var(--muted-2);
}

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: rgba(23, 27, 40, 0.96);
  box-shadow: var(--shadow-md);
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
  backdrop-filter: blur(12px);
  animation: toastIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
  pointer-events: auto;
}

.toast.is-hiding {
  animation: toastOut 0.25s ease both;
}

.toast-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 0;
  border-radius: 50%;
  background: rgba(124, 123, 255, 0.13);
  color: #b7b1ff;
}

.toast-icon svg {
  width: 11px;
  height: 11px;
}

.toast.ok {
  border-color: rgba(52, 211, 153, 0.25);
}

.toast.ok .toast-icon {
  background: rgba(52, 211, 153, 0.13);
  color: var(--green);
}

.toast.error {
  border-color: rgba(251, 113, 133, 0.26);
}

.toast.error .toast-icon {
  background: rgba(251, 113, 133, 0.13);
  color: var(--red);
}

.toast.warn .toast-icon {
  background: rgba(251, 191, 36, 0.13);
  color: var(--amber);
}

/* --------------------------------------------------------------------------
   Модальные окна студента
   -------------------------------------------------------------------------- */

.app-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 6, 10, 0.74);
  backdrop-filter: blur(7px);
  animation: fadeIn 0.18s ease both;
}

.app-modal {
  display: flex;
  flex-direction: column;
  width: min(760px, 100%);
  max-height: calc(100dvh - 40px);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: #10131c;
  box-shadow: 0 34px 90px -30px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: fadeUp 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
  overflow: hidden;
}

.app-modal.app-modal-sm {
  width: min(440px, 100%);
}

.app-modal-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.app-modal-title {
  min-width: 0;
}

.app-modal-title h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.app-modal-title p {
  margin: 3px 0 0;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.45;
}

.app-modal-close {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted-2);
}

.app-modal-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.app-modal-close svg {
  width: 15px;
  height: 15px;
}

.app-modal-body {
  flex: 1;
  min-height: 0;
  padding: 18px 20px 22px;
  overflow-y: auto;
}

.app-modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: rgba(8, 10, 16, 0.35);
}

.app-modal-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.answer-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.answer-meta .pill {
  margin-left: auto;
}

.code-view {
  max-height: 300px;
  margin: 0;
  padding: 12px 14px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #090c13;
  color: #dde3f0;
  font: 11.5px/1.65 var(--mono);
  white-space: pre;
  tab-size: 4;
}

.code-view code {
  font: inherit;
  white-space: inherit;
  tab-size: inherit;
}

.result-section {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.result-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
  border-bottom: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-section-head span:last-child {
  font-family: var(--mono);
  letter-spacing: 0;
  text-transform: none;
}

.result-section-body {
  padding: 6px 8px;
}

.test-io {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  padding: 3px 7px 8px;
}

.test-io .io-block.wide {
  grid-column: 1 / -1;
}

.test-io .io-block pre {
  max-height: 130px;
}

@media (max-width: 640px) {
  .app-modal-backdrop {
    padding: 10px;
  }

  .app-modal {
    max-height: calc(100dvh - 20px);
  }

  .test-io {
    grid-template-columns: 1fr;
  }

  .test-io .io-block.wide {
    grid-column: auto;
  }

  .app-modal-head,
  .app-modal-body {
    padding-left: 15px;
    padding-right: 15px;
  }
}

/* --------------------------------------------------------------------------
   Анимации
   -------------------------------------------------------------------------- */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulseDot {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.1);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(52, 211, 153, 0.16);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  50% {
    transform: translateX(3px);
  }
  75% {
    transform: translateX(-2px);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
}

/* --------------------------------------------------------------------------
   Адаптивность
   -------------------------------------------------------------------------- */

@media (max-width: 1240px) {
  .toolbar-actions kbd {
    display: none;
  }
}

@media (min-width: 901px) and (max-width: 1100px) {
  #reset-btn {
    display: none;
  }
}

@media (max-width: 1180px) {
  .auth-showcase {
    padding: 34px 40px 24px;
  }

  .auth-features {
    gap: 12px 18px;
  }

  .dash-grid {
    grid-template-columns: minmax(0, 1fr) 312px;
  }

  .task-pane-inner {
    padding: 24px 24px 50px;
  }
}

@media (max-width: 1024px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-grid {
    grid-template-columns: 1fr;
  }

  .side-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .side-col .panel:last-child {
    grid-column: 1 / -1;
  }

  .auth {
    grid-template-columns: minmax(0, 1fr) minmax(390px, 0.9fr);
  }

  .auth-showcase {
    padding: 30px 32px 22px;
  }

  .auth-features {
    grid-template-columns: 1fr;
  }

  .demo-window {
    display: none;
  }

  .auth-copy {
    margin-top: 0;
  }
}

@media (max-width: 900px) {
  .auth {
    grid-template-columns: 1fr;
  }

  .auth-showcase {
    display: none;
  }

  .auth-panel {
    border-left: 0;
    min-height: 100dvh;
    padding: 34px 22px;
    background:
      radial-gradient(600px 420px at 50% 0%, rgba(124, 108, 255, 0.13), transparent 65%),
      #090b11;
  }

  .auth-brand-mobile {
    display: flex;
  }

  .topbar-inner {
    gap: 14px;
    padding: 0 16px;
  }

  .user-meta {
    display: none;
  }

  .ws-split {
    flex-direction: column;
  }

  .task-pane {
    flex: 0 0 38%;
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .task-pane-inner {
    padding: 20px 20px 32px;
  }

  .task-head h1 {
    font-size: 21px;
  }

  .split-resizer {
    display: none;
  }

  .editor-pane {
    flex: 1;
    min-height: 0;
  }

  .workspace {
    height: auto;
    min-height: calc(100dvh - 64px);
    overflow: visible;
  }

  .task-pane {
    flex: 0 0 auto;
    max-height: none;
    overflow: visible;
  }

  .editor-full {
    min-height: 470px;
  }

  .to-editor {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    right: 16px;
    bottom: 18px;
    z-index: 80;
    height: 44px;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: linear-gradient(135deg, #7b6cff, #a35bff);
    color: #fff;
    font-size: 12.5px;
    font-weight: 650;
    box-shadow: 0 14px 30px -10px rgba(124, 108, 255, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .to-editor.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
  }

  .console {
    height: 260px;
  }

  .task-spec {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-main {
    padding: 22px 16px 60px;
  }

  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .page-head h1 {
    font-size: 25px;
  }

  .stats {
    gap: 10px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-value {
    font-size: 22px;
  }

  .greeting-streak {
    display: none;
  }

  .top-nav {
    display: none;
  }

  .top-user {
    gap: 2px;
  }

  .streak-pill {
    display: none;
  }

  .tasks-toolbar {
    padding: 11px 12px;
  }

  .search-box {
    max-width: none;
    flex-basis: 100%;
    order: 2;
  }

  .filter-btn {
    padding: 0 8px;
  }

  .task-row {
    grid-template-columns: 30px minmax(0, 1fr);
    padding: 13px;
  }

  .task-right {
    display: none;
  }

  .task-summary {
    display: none;
  }

  .task-title-line h3 {
    white-space: normal;
  }

  .side-col {
    grid-template-columns: 1fr;
  }

  .side-col .panel:last-child {
    grid-column: auto;
  }

  .results-summary {
    width: 100%;
    justify-content: space-between;
  }

  .ws-bar {
    height: auto;
    min-height: 50px;
    flex-wrap: wrap;
    padding: 8px 12px;
    gap: 8px;
  }

  .ws-title {
    flex: 1;
    min-width: 0;
  }

  .ws-meta .lang {
    display: none;
  }

  .editor-toolbar {
    height: auto;
    min-height: 50px;
    flex-wrap: wrap;
    padding: 8px 10px;
    gap: 8px;
  }

  .toolbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .toolbar-actions .btn {
    flex: 1;
  }

  .save-state {
    display: none;
  }

  .console {
    height: 240px;
  }

  .verdict {
    flex-wrap: wrap;
  }

  .test-detail {
    grid-template-columns: 1fr;
  }

  .results-table .hide-sm {
    display: none;
  }

  .auth-card-head h2 {
    font-size: 25px;
  }

  .auth-panel {
    padding: 28px 18px;
  }

  .demo-cred-fill {
    display: none;
  }

  .example-grid {
    grid-template-columns: 1fr;
  }

  .example-cell + .example-cell {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 480px) {
  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .stat-label {
    font-size: 10.5px;
  }

  .stat-icon {
    width: 26px;
    height: 26px;
  }

  .task-badges .chip-muted {
    display: none;
  }

  .task-pane {
    flex-basis: auto;
    max-height: none;
  }

  .ws-title h1 {
    font-size: 12.5px;
  }

  .topbar-inner {
    height: 58px;
  }

  .brand-name {
    font-size: 15px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .workspace {
    height: auto;
  }

  .editor-host {
    min-height: 320px;
  }

  .console {
    height: 250px;
  }

  .auth-legal {
    max-width: 320px;
  }
}

@media (max-height: 820px) and (min-width: 901px) {
  .console {
    height: 260px;
  }
}

@media (max-height: 880px) and (min-width: 901px) {
  .auth-showcase {
    gap: 18px;
    padding: 28px 48px 20px;
  }

  .auth-copy h1 {
    margin: 14px 0 12px;
    font-size: 45px;
  }

  .auth-lead {
    font-size: 14px;
  }

  .auth-features {
    margin-top: 18px;
    gap: 9px 20px;
  }

  .demo-window {
    transform: none;
  }

  .auth-footer {
    margin-top: 0;
  }
}

@media (max-height: 800px) and (min-width: 901px) {
  .demo-window {
    display: none;
  }
}

@media (max-height: 760px) {
  .auth-panel {
    align-items: center;
    padding: 26px 24px;
    overflow-y: auto;
  }

  .auth-card-head {
    margin-bottom: 20px;
  }

  .auth-divider {
    margin: 20px 0 12px;
  }

  .auth-note {
    margin-top: 16px;
  }
}

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