/* Neurolab — конструктор тестов. Дизайн-токены сняты с neurolabtest.ru */

:root {
  color-scheme: light;

  --bg: #f2f4fa;
  --surface: #ffffff;
  --surface-2: #f8f9fd;
  --surface-3: #eef1f9;

  --text: #323c47;
  --text-2: rgba(50, 60, 71, 0.6);
  --text-3: rgba(50, 60, 71, 0.42);
  --line: rgba(50, 60, 71, 0.14);
  --line-2: rgba(50, 60, 71, 0.4);

  --accent: #ff3364;
  --accent-hover: #ef2a59;
  --accent-soft: rgba(255, 51, 100, 0.1);
  --blue: #5e81f4;
  --blue-hover: #4d72ef;
  --blue-soft: rgba(94, 129, 244, 0.13);
  --gray: #8e949a;

  --ok: #1fa971;
  --ok-soft: rgba(31, 169, 113, 0.12);
  --warn: #e08600;
  --warn-soft: rgba(224, 134, 0, 0.12);

  --shadow: 0 1px 2px rgba(50, 60, 71, 0.04), 0 6px 22px rgba(50, 60, 71, 0.06);
  --shadow-lg: 0 24px 60px rgba(30, 36, 58, 0.22);
  --r: 5px;

  --head-h: 76px;
  --font: "Golos Text", "Golos", -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1e243a;
    --surface: #272d46;
    --surface-2: #232943;
    --surface-3: #2d335016;
    --text: #e7eaf5;
    --text-2: rgba(231, 234, 245, 0.62);
    --text-3: rgba(231, 234, 245, 0.42);
    --line: rgba(255, 255, 255, 0.1);
    --line-2: rgba(255, 255, 255, 0.24);
    --accent: #f65164;
    --accent-hover: #ff6274;
    --accent-soft: rgba(246, 81, 100, 0.16);
    --blue: #4e7cff;
    --blue-hover: #6289ff;
    --blue-soft: rgba(78, 124, 255, 0.18);
    --gray: #868ca8;
    --ok: #38c48b;
    --ok-soft: rgba(56, 196, 139, 0.16);
    --warn: #f0a63c;
    --warn-soft: rgba(240, 166, 60, 0.16);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 26px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1e243a;
  --surface: #272d46;
  --surface-2: #232943;
  --surface-3: #2d335016;
  --text: #e7eaf5;
  --text-2: rgba(231, 234, 245, 0.62);
  --text-3: rgba(231, 234, 245, 0.42);
  --line: rgba(255, 255, 255, 0.1);
  --line-2: rgba(255, 255, 255, 0.24);
  --accent: #f65164;
  --accent-hover: #ff6274;
  --accent-soft: rgba(246, 81, 100, 0.16);
  --blue: #4e7cff;
  --blue-hover: #6289ff;
  --blue-soft: rgba(78, 124, 255, 0.18);
  --gray: #868ca8;
  --ok: #38c48b;
  --ok-soft: rgba(56, 196, 139, 0.16);
  --warn: #f0a63c;
  --warn-soft: rgba(240, 166, 60, 0.16);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 26px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

/* ---------- layout ---------- */

.wrap { max-width: 1380px; margin: 0 auto; padding-inline: 24px; }

.head {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.head__in { display: flex; align-items: center; gap: 28px; height: var(--head-h); }
.head__logo { display: flex; align-items: center; flex: none; }
.head__logo svg { display: block; height: 30px; width: auto; }
.nav { display: flex; align-items: stretch; gap: 22px; height: var(--head-h); overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: flex; align-items: center; white-space: nowrap;
  font-weight: 600; color: var(--text-2);
  border-bottom: 2px solid transparent; transition: color .15s;
}
.nav a:hover { color: var(--text); }
.nav a.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.head__side { margin-left: auto; display: flex; align-items: center; gap: 14px; flex: none; }

.role {
  display: flex; align-items: center; gap: 0;
  border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden;
}
.role button {
  background: none; border: 0; cursor: pointer;
  padding: 7px 12px; font-size: 12px; font-weight: 600; color: var(--text-2);
}
.role button.is-on { background: var(--blue); color: #fff; }

.iconbtn {
  width: 36px; height: 36px; display: grid; place-items: center; flex: none;
  background: none; border: 1px solid var(--line); border-radius: var(--r);
  color: var(--text-2); cursor: pointer;
}
.iconbtn:hover { color: var(--text); border-color: var(--line-2); }
.who { display: flex; align-items: center; gap: 9px; font-weight: 600; white-space: nowrap; }
.who__ava { width: 32px; height: 32px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-size: 12px; font-weight: 700; }

main { padding-block: 34px 80px; }

/* ---------- typography ---------- */

.h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
.h2 { font-size: 18px; font-weight: 600; }
.h3 { font-size: 15px; font-weight: 600; }
.sub { color: var(--text-2); max-width: 68ch; }
.lbl { font-size: 12px; color: var(--text-2); display: block; padding-bottom: 4px; }
.mono { font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--text-3); }

.pagehead { display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; padding-bottom: 22px; }
.pagehead__t { min-width: 0; display: grid; gap: 6px; }
.pagehead__a { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- controls ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 45px; padding: 12px 24px; border: 0; border-radius: var(--r);
  background: var(--accent); color: #fff; font-weight: 600; cursor: pointer;
  transition: background .15s, opacity .15s; white-space: nowrap;
}
.btn:hover { background: var(--accent-hover); }
.btn svg { flex: none; }
.btn--blue { background: var(--blue); }
.btn--blue:hover { background: var(--blue-hover); }
.btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--line-2); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--text-3); }
.btn--soft { background: var(--blue-soft); color: var(--blue); }
.btn--soft:hover { background: var(--blue-soft); filter: brightness(.96); }
.btn--sm { min-height: 34px; padding: 6px 14px; font-size: 13px; }
.btn--icon { min-height: 34px; width: 34px; padding: 0; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.inp, .sel, .ta {
  width: 100%; background: var(--surface); color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--r);
  padding: 12px 13px; min-height: 45px;
}
.ta { min-height: 92px; resize: vertical; line-height: 1.5; }
.inp::placeholder, .ta::placeholder { color: var(--text-3); }
.inp:focus, .sel:focus, .ta:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.sel { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 17px) 20px, calc(100% - 12px) 20px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.inp--sm, .sel--sm { min-height: 36px; padding-block: 7px; }
.sel--sm { background-position: calc(100% - 17px) 16px, calc(100% - 12px) 16px; }

.field { display: block; }
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row--tight { gap: 6px; }
.spacer { flex: 1 1 auto; }

.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.seg button {
  background: var(--surface); border: 0; cursor: pointer; padding: 11px 18px;
  font-weight: 600; color: var(--text-2); border-right: 1px solid var(--line-2);
}
.seg button:last-child { border-right: 0; }
.seg button.is-on { background: var(--blue); color: #fff; }

.check { display: flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.check input { appearance: none; width: 18px; height: 18px; flex: none; margin: 0;
  border: 1px solid var(--line-2); border-radius: 4px; background: var(--surface); cursor: pointer; }
.check input:checked { background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.4l3 3 6-6.4'/%3E%3C/svg%3E") center/13px no-repeat; border-color: var(--blue); }
.check input[type="radio"] { border-radius: 50%; }
.check input[type="radio"]:checked { background: var(--blue); box-shadow: inset 0 0 0 3.5px var(--surface); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { appearance: none; width: 38px; height: 22px; margin: 0; flex: none;
  background: var(--line-2); border-radius: 11px; position: relative; cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked { background: var(--blue); }
.switch input:checked::after { transform: translateX(16px); }

/* ---------- surfaces ---------- */

.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); }
.card__h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card__b { padding: 22px; }
.card__b--flush { padding: 0; }

.pane { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 22px; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button, .tabs a {
  border: 0; background: transparent; cursor: pointer; padding: 9px 15px;
  border-radius: var(--r); font-weight: 600; color: var(--text-2);
}
.tabs button:hover, .tabs a:hover { background: var(--surface-2); color: var(--text); }
.tabs .is-on, .tabs .is-on:hover { background: var(--blue); color: #fff; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px;
  border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2);
}
.chip--ok { background: var(--ok-soft); color: var(--ok); }
.chip--warn { background: var(--warn-soft); color: var(--warn); }
.chip--accent { background: var(--accent-soft); color: var(--accent); }
.chip--blue { background: var(--blue-soft); color: var(--blue); }
.chip__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- table ---------- */

.tablewrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; min-width: 720px; }
table.t th {
  text-align: left; font-size: 12px; font-weight: 400; color: var(--text-2);
  padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.t td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tbody tr:hover { background: var(--surface-2); }
table.t tbody tr:last-child td { border-bottom: 0; }
.t__name { font-weight: 600; }
.t__sub { font-size: 12px; color: var(--text-2); }
.t__acts { display: flex; gap: 4px; justify-content: flex-end; }

.rowbtn {
  width: 32px; height: 32px; display: grid; place-items: center; flex: none;
  background: none; border: 1px solid transparent; border-radius: var(--r);
  color: var(--text-2); cursor: pointer;
}
.rowbtn:hover { border-color: var(--line-2); color: var(--text); background: var(--surface); }
.rowbtn--danger:hover { color: var(--accent); border-color: var(--accent-soft); background: var(--accent-soft); }

.empty { padding: 56px 24px; text-align: center; color: var(--text-2); display: grid; gap: 14px; justify-items: center; }

/* ---------- editor ---------- */

.edit { display: grid; grid-template-columns: 244px minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .edit { grid-template-columns: 1fr; } }

.steps { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 8px; position: sticky; top: calc(var(--head-h) + 16px); }
@media (max-width: 900px) { .steps { position: static; display: flex; overflow-x: auto; } }
.steps button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: 0; cursor: pointer; padding: 11px 13px; border-radius: var(--r);
  color: var(--text-2); font-weight: 600; white-space: nowrap;
}
.steps button:hover { background: var(--surface-2); color: var(--text); }
.steps button.is-on { background: var(--blue-soft); color: var(--blue); }
.steps .n { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; background: var(--surface-3); color: var(--text-2); }
.steps button.is-on .n { background: var(--blue); color: #fff; }
.steps .cnt { margin-left: auto; font-size: 12px; color: var(--text-3); font-weight: 400; }

.block { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.block__h { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.block__idx { width: 26px; height: 26px; border-radius: 50%; background: var(--blue-soft); color: var(--blue);
  display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.block__b { padding: 20px; display: grid; gap: 18px; }

.q { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.q__h { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; }
.q__n { font-size: 12px; color: var(--text-3); font-weight: 600; flex: none; width: 22px; }
.q__t { flex: 1 1 200px; min-width: 0; font-weight: 500; }
.q__b { padding: 4px 14px 18px 48px; display: grid; gap: 16px; border-top: 1px solid var(--line); padding-top: 16px; }
@media (max-width: 640px) { .q__b { padding-left: 14px; } }

.opt { display: flex; align-items: center; gap: 8px; }
.opt__h { width: 26px; flex: none; text-align: center; font-size: 12px; color: var(--text-3); }

.hint { font-size: 12px; color: var(--text-2); }
.flag { border-left: 3px solid var(--warn); background: var(--warn-soft); padding: 10px 12px; border-radius: 0 var(--r) var(--r) 0; font-size: 13px; }

.scale__items { display: flex; flex-wrap: wrap; gap: 6px; }
.scale__item {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px 5px 10px;
  border: 1px solid var(--line-2); border-radius: 20px; font-size: 12px; background: var(--surface);
}
.scale__item.is-rev { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.scale__item button { background: none; border: 0; cursor: pointer; color: inherit; opacity: .6; padding: 0; line-height: 1; }
.scale__item button:hover { opacity: 1; }

.band { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }

/* ---------- agent ---------- */

.drop {
  border: 2px dashed var(--line-2); border-radius: var(--r); background: var(--surface-2);
  padding: 40px 24px; text-align: center; display: grid; gap: 12px; justify-items: center;
  transition: border-color .15s, background .15s;
}
.drop.is-over { border-color: var(--blue); background: var(--blue-soft); }
.file { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.file__ic { width: 34px; height: 34px; flex: none; border-radius: var(--r); display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 700; }

.log { display: grid; gap: 2px; font-size: 13px; }
.log__i { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; color: var(--text-2); }
.log__i.is-done { color: var(--text); }
.log__s { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2px solid var(--line-2); margin-top: 1px; }
.log__i.is-run .log__s { border-color: var(--blue); border-top-color: transparent; animation: spin .7s linear infinite; }
.log__i.is-done .log__s { border-color: var(--ok); background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.4l3 3 6-6.4'/%3E%3C/svg%3E") center/11px no-repeat; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .log__i.is-run .log__s { animation: none; } }

.stat { display: grid; gap: 2px; }
.stat__v { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat__l { font-size: 12px; color: var(--text-2); }

/* ---------- modal ---------- */

.veil { position: fixed; inset: 0; z-index: 90; background: rgba(30, 36, 58, 0.5);
  display: grid; place-items: center; padding: 20px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-lg);
  width: min(560px, 100%); max-height: 90vh; overflow-y: auto; }
.modal__h { padding: 20px 22px 0; }
.modal__b { padding: 18px 22px; display: grid; gap: 16px; }
.modal__f { padding: 0 22px 22px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

.toasts { position: fixed; z-index: 95; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; }
.toast { background: var(--text); color: var(--surface); padding: 12px 16px; border-radius: var(--r);
  box-shadow: var(--shadow-lg); font-weight: 500; max-width: 340px; }
.toast--bad { background: var(--accent); color: #fff; }

/* ---------- preview (респондент) ---------- */

.pv { --pv-bg: #1e243a; --pv-card: #272d46; --pv-line: rgba(255,255,255,.1); --pv-text: #e7eaf5;
  --pv-blue: #4e7cff; --pv-red: #f65164;
  background: var(--pv-bg); color: var(--pv-text); border-radius: var(--r); overflow: hidden; }
.pv__bar { display: flex; align-items: center; gap: 14px; padding: 14px 22px; border-bottom: 1px solid var(--pv-line); flex-wrap: wrap; }
.pv__bar .chip { background: rgba(255,255,255,.08); color: rgba(231,234,245,.75); }
.pv__body { padding: 36px 22px 44px; display: grid; justify-items: center; }
.pv__card { width: min(720px, 100%); background: var(--pv-card); border-radius: 12px; padding: 32px; display: grid; gap: 22px; }
.pv__q { font-size: 19px; font-weight: 600; text-wrap: balance; text-align: center; }
.pv__opts { display: grid; gap: 10px; }
.pv__opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  background: rgba(255,255,255,.05); border: 1px solid var(--pv-line); color: inherit;
  border-radius: 8px; padding: 13px 16px; transition: background .12s, border-color .12s; }
.pv__opt:hover { background: rgba(255,255,255,.09); }
.pv__opt.is-on { background: var(--pv-blue); border-color: var(--pv-blue); color: #fff; }
.pv__opts--h { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pv__opts--h .pv__opt { width: auto; flex: 1 1 120px; min-width: 0; justify-content: center; text-align: center; font-size: 13px; }
.pv__prog { height: 4px; border-radius: 4px; background: rgba(255,255,255,.12); overflow: hidden; }
.pv__prog i { display: block; height: 100%; background: var(--pv-blue); transition: width .2s; }
.pv__note { background: rgba(246,81,100,.14); border: 1px solid rgba(246,81,100,.3); color: #ffb9c2;
  padding: 12px 16px; border-radius: 8px; font-size: 13px; }
.pv__ok { background: rgba(56,196,139,.14); border: 1px solid rgba(56,196,139,.3); color: #9de7c6;
  padding: 12px 16px; border-radius: 8px; font-size: 13px; }
.pv table.t { min-width: 0; }
.pv table.t th, .pv table.t td { border-color: var(--pv-line); }
.pv table.t th { color: rgba(231,234,245,.6); }
.pv table.t tbody tr:hover { background: transparent; }
.pv .tabs button { color: rgba(231,234,245,.6); }
.pv .tabs button:hover { background: rgba(255,255,255,.06); color: var(--pv-text); }
.pv .tabs .is-on, .pv .tabs .is-on:hover { background: var(--pv-blue); color: #fff; }
.pv .btn--ghost { border-color: rgba(255,255,255,.28); color: var(--pv-text); }
.pv .btn--ghost:hover { background: rgba(255,255,255,.08); }
.pv__ta { width: 100%; background: rgba(255,255,255,.05); border: 1px solid var(--pv-line); color: inherit;
  border-radius: 8px; padding: 14px; min-height: 110px; resize: vertical; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- плитки тестов (как карточки в кабинете респондента) ---------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.tile {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.tile:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(50, 60, 71, .06), 0 14px 34px rgba(50, 60, 71, .1); }
@media (prefers-reduced-motion: reduce) { .tile:hover { transform: none; } }

.tile__h {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 22px 24px 16px; border-bottom: 1px solid var(--line);
}
.tile__name { flex: 1 1 auto; min-width: 0; font-size: 17px; font-weight: 600; text-wrap: balance; }
.tile__num { flex: none; padding-top: 4px; font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.tile__b { flex: 1 1 auto; display: grid; align-content: start; gap: 12px; padding: 18px 24px; }
.tile__desc { color: var(--text-2); }
.tile__desc--empty { color: var(--text-3); font-style: italic; }
.tile__for { font-size: 12px; color: var(--text-3); }
.tile__meta { display: flex; flex-wrap: wrap; gap: 6px; }

.tile__f {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 24px; border-top: 1px solid var(--line);
}
.tile__f .spacer { flex: 1 1 auto; }

.viewswitch { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; flex: none; }
.viewswitch button {
  display: grid; place-items: center; width: 42px; height: 45px;
  background: var(--surface); border: 0; border-right: 1px solid var(--line-2);
  color: var(--text-2); cursor: pointer;
}
.viewswitch button:last-child { border-right: 0; }
.viewswitch button.is-on { background: var(--blue); color: #fff; }

/* ---------- личный кабинет респондента ---------- */
/* Метрики сняты с neurolabtest.ru: карточка 223×337, скругление 6px, слайд с отступом 10px. */

.cab {
  --c-bg: #1e243a; --c-line: rgba(255, 255, 255, .1);
  --c-text: #e7eaf5; --c-mute: rgba(231, 234, 245, .62); --c-dim: rgba(231, 234, 245, .38);
  --c-red: #f65164;
  background: var(--c-bg); color: var(--c-text); border-radius: var(--r); overflow: hidden;
}
.cab__in { padding: 44px 68px 52px; max-width: 1340px; margin: 0 auto; }
@media (max-width: 900px) { .cab__in { padding: 40px 28px 44px; } }
@media (max-width: 640px) { .cab__in { padding: 32px 20px 40px; } }

.cab__hi { font-size: 30px; font-weight: 600; line-height: 1.25; padding-bottom: 26px; }
.cab__hi span { display: block; padding-top: 6px; font-size: 14px; font-weight: 400; color: var(--c-mute); }
@media (max-width: 640px) { .cab__hi { font-size: 23px; } }

.cab__tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--c-line); margin-bottom: 26px; flex-wrap: wrap; }
.cab__tabs button {
  background: none; border: 0; cursor: pointer; padding: 0 0 13px;
  color: var(--c-mute); font-weight: 500; border-bottom: 2px solid transparent;
}
.cab__tabs button:hover { color: var(--c-text); }
.cab__tabs button.is-on { color: var(--c-text); border-bottom-color: var(--c-red); }
.cab__tabs b { color: var(--c-dim); font-weight: 500; padding-left: 5px; }
.cab__tabs button.is-on b { color: var(--c-red); }

/* карусель */
.cab__carousel { position: relative; }
.cab__track {
  display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 2px 10px; scrollbar-width: none; -ms-overflow-style: none;
}
.cab__track::-webkit-scrollbar { display: none; }

.cab__arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: #fff; color: #1e243a; display: grid; place-items: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35); transition: opacity .15s;
}
/* Стрелки стоят в полях, не наезжая на карточки. */
.cab__arrow--prev { left: -54px; }
.cab__arrow--next { right: -54px; }
.cab__arrow[disabled] { opacity: 0; pointer-events: none; }
@media (max-width: 900px) { .cab__arrow { display: none; } }

/* карточка */
.cab__card {
  flex: 0 0 223px; scroll-snap-align: start;
  display: flex; flex-direction: column; min-height: 337px;
  border-radius: 6px; color: #fff; overflow: hidden;
  background:
    radial-gradient(circle at 82% 78%, rgba(255, 255, 255, .17), transparent 46%),
    radial-gradient(circle at 18% 96%, rgba(255, 255, 255, .1), transparent 42%),
    radial-gradient(circle at 96% 8%, rgba(0, 0, 0, .12), transparent 38%),
    var(--card, #7536e5);
}
.cab__card.is-lock { opacity: .85; }
.cab__card .spacer { flex: 1 1 auto; }

.cab__head { display: flex; align-items: flex-start; gap: 10px; padding: 22px 16px 12px; }
.cab__name { flex: 1 1 auto; min-width: 0; font-size: 19px; font-weight: 600; line-height: 1.2; text-wrap: balance; }
.cab__num { flex: none; font-size: 14px; font-weight: 500; line-height: 14px; padding-top: 4px; opacity: .9; font-variant-numeric: tabular-nums; }

.cab__desc { padding: 0 16px; margin: 0; font-size: 12px; line-height: 16px; color: rgba(255, 255, 255, .92); }

.cab__foot { padding: 16px; display: grid; gap: 10px; }
.cab__btn {
  width: 100%; min-height: 38px; padding: 9px 17px; border: 0; border-radius: 6px;
  background: #fff; font-size: 14px; font-weight: 500; cursor: pointer;
}
.cab__btn:hover { background: rgba(255, 255, 255, .88); }
.cab__lock { margin: 0; font-size: 14px; line-height: 1.35; color: #fff; }
.cab__passed { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, .95); }

.cab__empty { padding: 60px 20px; text-align: center; color: var(--c-mute); }

.swatch {
  width: 34px; height: 34px; border-radius: 6px; cursor: pointer;
  border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}
.swatch.is-on { border-color: var(--text); box-shadow: inset 0 0 0 2px var(--surface); }

/* кликабельные плитки, строки и карточки */
.tile { cursor: pointer; }
.tile:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
table.t tbody tr { cursor: pointer; }
table.t tbody tr:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.cab__card.is-open { cursor: pointer; }
.cab__card.is-open:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* ---------- вход ---------- */

/* ——— страница входа ———
   Оформление снято с neurolabtest.ru: тёмный фон, логотип, подчёркнутые поля.
   Фон собран градиентами, картинка с сайта не используется. */

.login {
  position: fixed;
  inset: 0;
  overflow: auto;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 40px 24px 24px;
  background: #1b2143;
  color: #fff;
}

.login__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 70% at 78% 28%, rgba(94, 129, 244, .36), transparent 62%),
    radial-gradient(42% 52% at 12% 84%, rgba(255, 51, 100, .2), transparent 66%),
    radial-gradient(90% 80% at 50% 0%, rgba(42, 52, 110, .9), transparent 70%),
    linear-gradient(160deg, #161c3b 0%, #1d2550 52%, #141937 100%);
}

/* Сетка нейронных связей — тонкие линии поверх градиента. */
.login__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .5;
  background-image:
    linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 68px 68px, 68px 68px;
  mask-image: radial-gradient(70% 60% at 70% 35%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(70% 60% at 70% 35%, #000 0%, transparent 75%);
}

.login__box {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  align-self: center;
  display: grid;
  gap: 18px;
}

.login__brand { padding-bottom: 10px; }
.login__word { display: block; width: 186px; color: #fff; }
.login__word svg { width: 100%; height: auto; display: block; }

.login__h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.22;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login__sub { margin: 0; font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, .78); }
.login__lead { margin: 0 0 6px; font-size: 14px; font-weight: 600; }

.login__form { display: grid; gap: 22px; padding-top: 34px; max-width: 320px; }

/* Поле с подчёркиванием и подписью, уезжающей наверх. */
.login__field { position: relative; }

.login__input {
  width: 100%;
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .45);
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 15px;
  border-radius: 0;
}

.login__input:focus { outline: none; border-bottom-color: #8aa4ff; }
.login__input:-webkit-autofill { -webkit-text-fill-color: #fff; transition: background-color 9999s; }

.login__label {
  position: absolute;
  left: 0;
  top: 6px;
  font-size: 15px;
  color: rgba(255, 255, 255, .7);
  pointer-events: none;
  transition: transform .16s ease, font-size .16s ease, color .16s ease;
  transform-origin: left top;
}

.login__input:focus + .login__label,
.login__input:not(:placeholder-shown) + .login__label {
  transform: translateY(-18px);
  font-size: 12px;
  color: rgba(255, 255, 255, .55);
}

.login__btn {
  justify-self: start;
  min-width: 112px;
  padding: 11px 24px;
  border: 0;
  border-radius: 7px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .14s ease, opacity .14s ease;
}

.login__btn:hover:not(:disabled) { background: var(--blue-hover); }
.login__btn:disabled { opacity: .6; cursor: default; }

.login__forgot {
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.login__forgot:hover { color: #b9c7ff; }

.login__err {
  margin: -8px 0 0;
  font-size: 13px;
  color: #ffb3c4;
}

.login__foot {
  position: relative;
  margin: 0;
  padding-top: 28px;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, .55);
}

@media (max-width: 560px) {
  .login { padding: 28px 18px 18px; }
  .login__h1 { font-size: 24px; }
  .login__form { padding-top: 24px; max-width: none; }
}
.login__foot .hint { max-width: 60ch; margin: 0; }


/* ---------- статистика ---------- */

.stat__filters { padding: 14px 16px; margin-bottom: 18px; }
.stat__f { flex: 0 1 260px; min-width: 190px; }
.stat__f--sm { flex: 0 1 200px; min-width: 160px; }

.stat__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.stat__tile { padding: 18px; display: grid; gap: 2px; align-content: start; }
.stat__v { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.stat__l { font-size: 13px; color: var(--text-2); }

.stat__grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.lvl { display: grid; gap: 5px; }
.lvl__t { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.lvl__bar { height: 7px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.lvl__bar i { display: block; height: 100%; border-radius: 4px; background: var(--blue); }

@media (max-width: 560px) {
  .stat__v { font-size: 23px; }
}
