/* Социометрия — общий стиль. Основа: apple-design.md (off-white панели, один синий акцент, пилюли). */
:root {
  --bg: #F5F5F7;
  --surface: #FFFFFF;
  --surface-2: #FBFBFD;
  --text: #1D1D1F;
  --text-2: #6E6E73;
  --text-3: #86868B;
  --line: rgba(0, 0, 0, 0.1);
  --line-strong: rgba(0, 0, 0, 0.18);
  --accent: #0071E3;
  --accent-hover: #0076DF;
  --link: #0066CC;
  --accent-soft: rgba(0, 113, 227, 0.1);
  --nav-bg: rgba(245, 245, 247, 0.8);
  --pos: #248A3D;
  --pos-soft: rgba(36, 138, 61, 0.12);
  --neg: #D70015;
  --neg-soft: rgba(215, 0, 21, 0.1);
  --leader: #C93400;
  --leader-fill: #FF9F0A;
  --preferred-fill: #34C759;
  --accepted-fill: #AEAEB2;
  --outcast-fill: #FF3B30;
  --isolated-stroke: #8E8E93;
  --ring-0: #FFFFFF;
  --ring-1: #F5F5F7;
  --shadow: rgba(0, 0, 0, 0.22) 3px 5px 30px 0px;
  --radius-card: 8px;
  --radius-field: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.4, 0, 0.6, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
    --bg: #000000;
    --surface: #1D1D1F;
    --surface-2: #161617;
    --text: #F5F5F7;
    --text-2: #A1A1A6;
    --text-3: #86868B;
    --line: rgba(255, 255, 255, 0.12);
    --line-strong: rgba(255, 255, 255, 0.22);
    --accent: #0071E3;
    --accent-hover: #0077ED;
    --link: #2997FF;
    --accent-soft: rgba(41, 151, 255, 0.16);
    --nav-bg: rgba(22, 22, 23, 0.8);
    --pos: #30D158;
    --pos-soft: rgba(48, 209, 88, 0.16);
    --neg: #FF453A;
    --neg-soft: rgba(255, 69, 58, 0.16);
    --leader: #FFB340;
    --leader-fill: #FF9F0A;
    --preferred-fill: #30D158;
    --accepted-fill: #636366;
    --outcast-fill: #FF453A;
    --isolated-stroke: #8E8E93;
    --ring-0: #1D1D1F;
    --ring-1: #161617;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.47 var(--font);
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  min-height: 100dvh;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); letter-spacing: 0; }
.muted { color: var(--text-2); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  height: 52px;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(1.8) blur(20px);
  backdrop-filter: saturate(1.8) blur(20px);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  max-width: 1120px; height: 100%; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; gap: 16px;
}
.nav__brand { font-weight: 600; font-size: 17px; letter-spacing: -0.02em; white-space: nowrap; }
.nav__links { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav__links::-webkit-scrollbar { display: none; }
.nav__link {
  border: 0; background: none; color: var(--text); font: inherit; font-size: 14px;
  padding: 6px 12px; border-radius: 980px; cursor: pointer; white-space: nowrap;
  transition: background-color 0.24s var(--ease), color 0.24s var(--ease);
}
.nav__link:hover { background: var(--line); }
.nav__link[aria-current="page"] { background: var(--text); color: var(--bg); }

/* ---------- layout ---------- */
.page { max-width: 1120px; margin: 0 auto; padding: 28px 16px 64px; }
.page--narrow { max-width: 620px; }
.hero-title { font-size: 40px; line-height: 1.1; font-weight: 600; letter-spacing: -0.03em; margin: 0 0 8px; }
.section-title { font-size: 28px; line-height: 1.14; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 6px; }
.lead { font-size: 19px; line-height: 1.42; color: var(--text-2); margin: 0 0 24px; }
.panel {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 24px;
}
.panel + .panel { margin-top: 16px; }
.panel__title { margin: 0 0 4px; font-size: 21px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; }
.footnote { font-size: 13px; color: var(--text-3); margin: 12px 0 0; line-height: 1.4; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- buttons ---------- */
.btn {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 11px 21px;
  border: 1px solid transparent; border-radius: 980px;
  font: inherit; font-size: 17px; line-height: 1.2; font-weight: 400; letter-spacing: -0.02em;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color 0.24s var(--ease), color 0.24s var(--ease), opacity 0.24s var(--ease), transform 0.1s ease-out;
  touch-action: manipulation; user-select: none;
}
.btn:hover { text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.38; cursor: default; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn--secondary { background: var(--surface); color: var(--text); }
.panel .btn--secondary, .sheet .btn--secondary, .mini .btn--secondary, .survey__footer .btn--secondary { background: var(--bg); }
.btn--secondary:hover:not(:disabled) { background: var(--line); }
.panel .btn--secondary:hover:not(:disabled) { background: var(--line); }
.btn--outline { background: transparent; color: var(--link); border-color: currentColor; }
.btn--danger { background: var(--neg); color: #fff; }
.btn--ghost { background: transparent; color: var(--link); padding-left: 8px; padding-right: 8px; }
.btn--sm { min-height: 36px; padding: 8px 15px; font-size: 14px; }
.btn--block { width: 100%; }
.icon-btn {
  width: 36px; height: 36px; flex: none; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--bg); color: var(--text-2); font-size: 15px; display: inline-grid; place-items: center;
  transition: transform 0.1s ease-out, background-color 0.24s var(--ease);
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn:disabled { opacity: 0.3; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: 0; text-transform: uppercase; }
.field--grow { flex: 1 1 200px; }
.input, .field select, .field input, .field textarea {
  -webkit-appearance: none; appearance: none;
  width: 100%; min-height: 44px; padding: 10px 14px;
  font: inherit; font-size: 17px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-field);
  transition: border-color 0.24s var(--ease), box-shadow 0.24s var(--ease);
}
.field select {
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2386868B' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
textarea { resize: vertical; min-height: 88px; line-height: 1.4; }
.input:focus, .field select:focus, .field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.input--big { font-size: 28px; min-height: 64px; padding: 12px 18px; letter-spacing: 0.04em; font-family: var(--mono); text-align: center; }
.form-error { color: var(--neg); font-size: 15px; min-height: 22px; margin: 8px 0 0; }
.form-ok { color: var(--pos); }

/* ---------- survey (student) ---------- */
.survey { min-height: calc(100dvh - 52px); display: flex; flex-direction: column; }
.survey__body { flex: 1; width: 100%; max-width: 620px; margin: 0 auto; padding: 28px 16px 24px; display: flex; flex-direction: column; }
.survey__footer {
  position: sticky; bottom: 0; z-index: 10;
  background: var(--nav-bg); -webkit-backdrop-filter: saturate(1.8) blur(20px); backdrop-filter: saturate(1.8) blur(20px);
  border-top: 1px solid var(--line);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
.survey__footer-inner { max-width: 620px; margin: 0 auto; display: flex; gap: 10px; }
.survey__footer-inner .btn { flex: 1; }
.survey__footer-inner .btn--secondary { flex: 0 0 auto; }
.progress { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.progress__label { font-size: 14px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.progress__track { flex: 1; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.progress__fill { display: block; height: 100%; background: var(--text); border-radius: 4px; transition: width 0.32s var(--ease); }
.question { font-size: 28px; line-height: 1.18; font-weight: 600; letter-spacing: -0.025em; margin: 0 0 8px; }
.question-hint { color: var(--text-2); font-size: 15px; margin: 0 0 20px; }
.screen { animation: screen-in 0.32s var(--ease) both; }
.screen--back { animation-name: screen-in-back; }
@keyframes screen-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes screen-in-back { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
.center-screen { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-bottom: 8vh; }
.who { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; color: var(--text-2); background: var(--surface); padding: 6px 12px; border-radius: 980px; margin-bottom: 20px; align-self: flex-start; }
.done-mark { width: 72px; height: 72px; border-radius: 50%; background: var(--pos); color: #fff; display: grid; place-items: center; font-size: 36px; margin-bottom: 20px; animation: pop 0.32s var(--ease) both; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
.notice { background: var(--surface); border-radius: var(--radius-card); padding: 16px; font-size: 15px; line-height: 1.45; margin: 0 0 20px; }
.notice--warn { border-left: 3px solid var(--leader-fill); }

/* combobox */
.combo { position: relative; }
.combo__input-wrap { position: relative; }
.combo__input { font-family: var(--mono); font-size: 24px; letter-spacing: 0.04em; min-height: 60px; padding-right: 52px; }
.combo__clear { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.combo__state { min-height: 24px; margin: 10px 2px 0; font-size: 15px; }
.combo__state.is-ok { color: var(--pos); }
.combo__state.is-err { color: var(--neg); }
.combo__list {
  list-style: none; margin: 12px 0 0; padding: 0;
  background: var(--surface); border-radius: var(--radius-card); overflow: hidden;
}
.combo__opt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 52px; padding: 12px 16px; border: 0; background: none; cursor: pointer;
  font: inherit; color: var(--text); text-align: left;
  border-top: 1px solid var(--line);
  transition: background-color 0.16s var(--ease);
}
.combo__opt:first-child { border-top: 0; }
.combo__opt:active, .combo__opt:hover { background: var(--bg); }
.combo__opt[aria-selected="true"] { background: var(--accent-soft); }
.combo__opt-id { font-family: var(--mono); font-size: 19px; letter-spacing: 0.03em; }
.combo__opt-id mark { background: none; color: var(--link); font-weight: 600; }
.combo__opt-group { font-size: 13px; color: var(--text-2); }
.combo__more { display: block; width: 100%; margin-top: 4px; }
.combo__all { max-height: 46vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.skip-row { margin-top: 16px; display: flex; justify-content: center; }
.chosen {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border-radius: var(--radius-card); padding: 14px 16px;
}
.chosen__check { width: 28px; height: 28px; border-radius: 50%; background: var(--pos); color: #fff; display: grid; place-items: center; font-size: 15px; flex: none; }
.chosen__id { font-family: var(--mono); font-size: 24px; letter-spacing: 0.04em; }
.chosen .btn { margin-left: auto; }

.review { list-style: none; margin: 0 0 8px; padding: 0; background: var(--surface); border-radius: var(--radius-card); overflow: hidden; }
.review__item { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line); cursor: pointer; transition: background-color 0.16s var(--ease); }
.review__item:first-child { border-top: 0; }
.review__item:active { background: var(--bg); }
.review__q { flex: 1; font-size: 15px; line-height: 1.35; }
.review__a { font-family: var(--mono); font-size: 17px; white-space: nowrap; }
.review__a--skip { font-family: var(--font); color: var(--text-3); font-size: 15px; }
.review__chev { color: var(--text-3); }

/* ---------- admin: stats / filters / tabs ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  background: var(--surface); border: 1px solid transparent; border-radius: var(--radius-card); padding: 16px;
  font: inherit; color: var(--text); cursor: pointer;
  transition: transform 0.1s ease-out, border-color 0.24s var(--ease);
}
.stat:disabled { cursor: default; }
.stat:active:not(:disabled) { transform: scale(0.98); }
.stat:hover:not(:disabled) { border-color: var(--line-strong); }
.stat__label { font-size: 13px; color: var(--text-2); }
.stat__value { font-size: 34px; line-height: 1.1; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat__hint { font-size: 12px; color: var(--text-3); }
.stat--isolated .stat__value { color: var(--text-2); }
.stat--outcast .stat__value { color: var(--neg); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.filters .field { flex: 1 1 160px; }
.filters .field--grow { flex: 2 1 200px; }
.tabs-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.segmented { display: inline-flex; background: var(--line); border-radius: 980px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; }
.segmented button {
  border: 0; background: none; font: inherit; font-size: 14px; color: var(--text);
  padding: 7px 16px; border-radius: 980px; cursor: pointer; white-space: nowrap;
  transition: background-color 0.24s var(--ease), box-shadow 0.24s var(--ease);
}
.segmented button[aria-selected="true"], .segmented button[aria-pressed="true"] { background: var(--accent); color: #fff; box-shadow: 0 1px 4px rgba(0, 113, 227, 0.35); font-weight: 600; }

/* table */
.table-wrap { background: var(--surface); border-radius: var(--radius-card); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { position: sticky; top: 0; background: var(--surface); text-align: left; font-weight: 600; font-size: 12px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0; border-bottom: 1px solid var(--line); padding: 0; white-space: nowrap; }
.table th button { border: 0; background: none; font: inherit; color: inherit; text-transform: inherit; padding: 12px 14px; cursor: pointer; width: 100%; text-align: inherit; }
.table th.num, .table td.num { text-align: right; }
.table td { padding: 10px 14px; border-top: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.table tbody tr { cursor: pointer; transition: background-color 0.16s var(--ease); }
.table tbody tr:hover { background: var(--surface-2); }
.table td.sticky { position: sticky; left: 0; background: inherit; }
.table tbody tr { background: var(--surface); }
.table td.strong { font-weight: 600; }
.table .empty { text-align: center; color: var(--text-2); padding: 32px; cursor: default; }
.tick { color: var(--pos); font-weight: 600; }
.person { display: flex; flex-direction: column; line-height: 1.25; }
.person b { font-weight: 500; }
.person small { color: var(--text-3); font-family: var(--mono); font-size: 12px; }
.more { display: flex; justify-content: center; margin-top: 12px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 980px; font-size: 13px; font-weight: 500; white-space: nowrap; background: var(--bg); color: var(--text-2); }
.badge--leader { background: rgba(255, 159, 10, 0.16); color: var(--leader); }
.badge--preferred { background: var(--pos-soft); color: var(--pos); }
.badge--outcast { background: var(--neg-soft); color: var(--neg); }
.badge--isolated { background: transparent; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line-strong); }

/* progress list */
.progress-list { list-style: none; margin: 0; padding: 0; }
.progress-item {
  display: grid; grid-template-columns: minmax(110px, 1fr) auto; grid-template-areas: "name count" "bar pct";
  gap: 6px 12px; align-items: center; width: 100%; padding: 12px 0; border: 0; border-top: 1px solid var(--line);
  background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer;
}
.progress-list li:first-child .progress-item { border-top: 0; }
.progress-item__name { grid-area: name; font-weight: 500; }
.progress-item__count { grid-area: count; color: var(--text-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.progress-item__pct { grid-area: pct; font-size: 14px; font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; }
.bar { grid-area: bar; height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.bar__fill { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.bar__fill.is-done { background: var(--pos); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip { border: 0; background: var(--bg); color: var(--text); font: inherit; font-size: 15px; padding: 8px 14px; border-radius: 980px; cursor: pointer; transition: transform 0.1s ease-out, background-color 0.24s var(--ease); }
.chip:hover { background: var(--line); }
.chip:active { transform: scale(0.96); }

/* target */
.target-panel { padding: 20px; }
.target-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.target-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 8px; }
.toggles { display: flex; gap: 8px; flex-wrap: wrap; flex: 1 1 auto; }
.toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 980px; background: var(--bg); cursor: pointer; font-size: 14px; user-select: none; }
.toggle input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.toggle--pos input { accent-color: var(--pos); }
.toggle--neg input { accent-color: var(--neg); }
.target-box { width: 100%; max-width: 680px; margin: 0 auto; }
.target-svg { display: block; width: 100%; height: auto; touch-action: manipulation; font-family: var(--font); }
.tg-ring { stroke: var(--line); stroke-width: 1; }
.tg-ring--0, .tg-ring--2 { fill: var(--ring-1); }
.tg-ring--1, .tg-ring--3 { fill: var(--ring-0); }
.tg-ring--3 { stroke: var(--line-strong); }
.tg-ring-title { font-size: 11px; fill: var(--text-3); font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.tg-edge { fill: none; opacity: 0.45; transition: opacity 0.24s var(--ease); }
.tg-edge.is-hl { opacity: 1; }
.tg-edge--pos { stroke: var(--pos); }
.tg-edge--neg { stroke: var(--neg); stroke-dasharray: 5 4; }
.tg-edge--mutual { opacity: 0.7; }
.tg-edge.is-dim { opacity: 0.06; }
.tg-arrow--pos { fill: var(--pos); }
.tg-arrow--neg { fill: var(--neg); }
.tg-node { cursor: pointer; transition: opacity 0.24s var(--ease); outline: none; }
.tg-node.is-dim { opacity: 0.25; }
.tg-hit { fill: transparent; }
.tg-dot { stroke: var(--surface); stroke-width: 2; transition: transform 0.16s ease-out; }
.tg-node:hover .tg-dot, .tg-node:focus-visible .tg-dot { transform: scale(1.12); }
.tg-node.is-selected .tg-dot { stroke: var(--text); stroke-width: 3; transform: scale(1.15); }
.tg-node--leader .tg-dot { fill: var(--leader-fill); }
.tg-node--preferred .tg-dot { fill: var(--preferred-fill); }
.tg-node--accepted .tg-dot { fill: var(--accepted-fill); }
.tg-node--outcast .tg-dot { fill: var(--outcast-fill); }
.tg-node--isolated .tg-dot { fill: var(--surface); stroke: var(--isolated-stroke); stroke-dasharray: 3 2; stroke-width: 2; }
.tg-score { font-size: 10px; font-weight: 700; fill: #fff; pointer-events: none; letter-spacing: 0; }
.tg-node--isolated .tg-score, .tg-node--accepted .tg-score { fill: var(--text); }
.tg-label { font-size: 9.5px; fill: var(--text-2); pointer-events: none; letter-spacing: 0; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; margin: 12px 0 4px; font-size: 13px; color: var(--text-2); }
.legend__item { display: inline-flex; align-items: center; gap: 6px; }
.legend__dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.legend__dot--leader { background: var(--leader-fill); }
.legend__dot--preferred { background: var(--preferred-fill); }
.legend__dot--accepted { background: var(--accepted-fill); }
.legend__dot--outcast { background: var(--outcast-fill); }
.legend__dot--isolated { border: 2px dashed var(--isolated-stroke); }
.legend__line { width: 20px; height: 0; border-top: 2px solid var(--pos); display: inline-block; }
.legend__line--neg { border-top: 2px dashed var(--neg); }
.target-info { margin-top: 12px; min-height: 52px; }
.target-info .muted { text-align: center; font-size: 14px; }
.mini { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--bg); border-radius: var(--radius-card); padding: 10px 14px; }
.mini__score { font-weight: 600; font-variant-numeric: tabular-nums; }
.mini .btn { margin-left: auto; }

/* sheet (student details) */
.sheet {
  border: 0; padding: 0; margin: auto; width: min(640px, 100% - 32px); max-height: min(86vh, 900px);
  background: var(--surface); color: var(--text); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden;
}
.sheet[open] { animation: sheet-in 0.28s var(--ease) both; display: flex; }
.sheet::backdrop { background: rgba(0, 0, 0, 0.4); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
.sheet__inner { padding: 24px; overflow-y: auto; width: 100%; -webkit-overflow-scrolling: touch; }
.sheet__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sheet__title { margin: 0; font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; word-break: break-word; }
.sheet__summary { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 16px 0 8px; font-variant-numeric: tabular-nums; }
.sheet__h { margin: 24px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0; color: var(--text-2); }
.qlist { list-style: none; margin: 0; padding: 0; }
.qrow { padding: 12px 0; border-top: 1px solid var(--line); }
.qrow:first-child { border-top: 0; }
.qrow__q { font-size: 15px; line-height: 1.35; display: flex; gap: 8px; align-items: baseline; }
.qrow__people { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; padding-left: 30px; }
.qnum { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); display: inline-grid; place-items: center; font-size: 12px; font-weight: 600; }
.qscore { font-size: 12px; font-weight: 600; }
.pill-link { border: 0; background: var(--accent-soft); color: var(--link); font: inherit; font-size: 14px; padding: 4px 12px; border-radius: 980px; cursor: pointer; }
.pill-link:active { transform: scale(0.96); }

/* questions editor */
.q-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.q-card { background: var(--surface); border-radius: var(--radius-card); padding: 16px; display: grid; grid-template-columns: auto 1fr; gap: 12px; }
.q-card__num { width: 32px; height: 32px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-weight: 600; }
.q-card__body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.q-card__row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.stepper { display: inline-flex; align-items: center; gap: 6px; }
.stepper__val { min-width: 48px; text-align: center; font-weight: 600; font-size: 19px; font-variant-numeric: tabular-nums; }
.stepper__val.pos { color: var(--pos); } .stepper__val.neg { color: var(--neg); }
.q-card__tools { display: flex; gap: 6px; }
.locked-note { display: flex; gap: 10px; align-items: flex-start; }

/* settings */
.setting { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; padding: 16px 0; border-top: 1px solid var(--line); }
.setting:first-of-type { border-top: 0; padding-top: 4px; }
.setting__text { flex: 1 1 260px; }
.setting__title { font-weight: 600; margin: 0 0 2px; }
.setting__desc { margin: 0; color: var(--text-2); font-size: 15px; }
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--line-strong); border-radius: 31px; transition: background-color 0.24s var(--ease); }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); transition: transform 0.24s var(--ease); }
.switch input:checked + span { background: var(--pos); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* drop zone (offline) */
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  min-height: 160px; padding: 24px; border: 2px dashed var(--line-strong); border-radius: var(--radius-card);
  background: var(--surface); cursor: pointer; transition: border-color 0.24s var(--ease), background-color 0.24s var(--ease);
}
.drop:hover, .drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.drop.is-done { border-style: solid; border-color: var(--pos); }
.drop__step { font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; }
.drop__title { font-size: 19px; font-weight: 600; }
.drop__hint { font-size: 14px; color: var(--text-2); }
.drop input { display: none; }
.drops { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 100;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: 980px; font-size: 15px; max-width: calc(100% - 32px);
  box-shadow: var(--shadow); transition: opacity 0.24s var(--ease), transform 0.24s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast--err { background: var(--neg); color: #fff; }

.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--text-2); animation: spin 0.8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 12px; }
  .stat__value { font-size: 28px; }
  .drops { grid-template-columns: 1fr; }
  .hero-title { font-size: 34px; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .page { padding: 20px 16px 48px; }
  .panel { padding: 16px; }
  .target-panel { padding: 12px; }
  .question { font-size: 24px; }
  .filters { gap: 8px; }
  .filters .field { flex: 1 1 calc(50% - 4px); }
  .filters .field--grow { flex-basis: 100%; }
  .tabs-row .segmented { flex: 1 1 100%; }
  .nav__brand--admin { display: none; }
  .nav__brand--admin ~ .nav__links { margin-left: 0; flex: 1; justify-content: space-between; }
  .nav__link { padding: 6px 7px; font-size: 13px; }
  .nav__brand--admin ~ .nav__links { gap: 0; }
  .nav__inner { gap: 6px; }
  .tabs-row .segmented button { flex: 1; padding: 7px 10px; }
  .table { font-size: 14px; }
  .table td, .table th button { padding: 10px; }
  .sheet { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 18px 18px 0 0; max-height: 90vh; }
  .sheet[open] { animation-name: sheet-up; }
  @keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
  .sheet__inner { padding: 20px 16px calc(24px + env(safe-area-inset-bottom)); }
  .qrow__people { padding-left: 0; }
  .nav__brand small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* theme toggle */
.theme-btn { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; background: transparent; color: var(--text); display: inline-grid; place-items: center; font-size: 17px; line-height: 1; transition: background-color 0.24s var(--ease), transform 0.1s ease-out; }
.theme-btn:hover { background: var(--line); }
.theme-btn:active { transform: scale(0.92); }
.nav__inner > .theme-btn:last-child { margin-left: 4px; }

/* multiple choice per question */
.picked { margin-bottom: 16px; }
.picked__head { font-size: 15px; color: var(--text-2); margin-bottom: 8px; }
.picked__head .is-ok, .picked__head span.is-ok { color: var(--pos); }
.picked__list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius-card); overflow: hidden; }
.picked__list:empty { display: none; }
.picked__item { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 8px 8px 16px; border-top: 1px solid var(--line); animation: pop 0.22s var(--ease) both; }
.picked__item:first-child { border-top: 0; }
.picked__num { width: 24px; height: 24px; flex: none; border-radius: 50%; background: var(--pos); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 600; }
.picked__id { font-family: var(--mono); font-size: 20px; letter-spacing: 0.03em; }
.picked__group { font-size: 13px; color: var(--text-2); }
.picked__del { margin-left: auto; }
.combo__state { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.combo__opt-add { margin-left: auto; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--link); display: grid; place-items: center; font-size: 20px; line-height: 1; flex: none; }
.review__body { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.review__ids { display: flex; flex-wrap: wrap; gap: 6px; }
.review__ids .review__a { font-size: 15px; background: var(--bg); padding: 2px 10px; border-radius: 980px; }
.review__ids .review__a--skip { background: none; padding: 0; color: var(--neg); }
.tabs-row__actions { display: flex; gap: 8px; margin-left: auto; }
.minmax { display: flex; gap: 16px; flex-wrap: wrap; }
.tg-dense .tg-edge { opacity: 0.2; }
.tg-dense .tg-edge.is-hl { opacity: 1; }
.tg-dense .tg-edge.is-dim { opacity: 0.04; }

/* ---------- вход студента и ФИО ---------- */
.check { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 15px; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.key-paste { margin-top: 16px; }
.key-paste summary { cursor: pointer; color: var(--link); font-size: 15px; padding: 8px 0; list-style-position: inside; }
.key-paste form { margin-top: 8px; }
#key-skip { margin-top: 8px; white-space: normal; height: auto; min-height: 44px; line-height: 1.3; }
.who-group { margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.person-name { font-size: 17px; line-height: 1.3; }
.people .combo__opt[aria-disabled="true"] { opacity: 0.5; }
.people__empty { padding: 16px; color: var(--text-2); font-size: 15px; }
.combo__input--text { font-family: var(--font); font-size: 19px; letter-spacing: 0; }
.picked__id--name { font-family: var(--font); font-size: 17px; letter-spacing: 0; line-height: 1.3; }
.review__a--name { font-family: var(--font); white-space: normal; }
.dir-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: 15px; }
.dir-status__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accepted-fill); flex: none; }
.dir-status__dot.is-on { background: var(--pos); }
.row-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-top: 14px; }
.locked-list { list-style: none; margin: 12px 0 0; padding: 0; background: var(--bg); border-radius: var(--radius-card); }
.locked-list li { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; border-top: 1px solid var(--line); font-size: 15px; }
.locked-list li:first-child { border-top: 0; }
.locked-list .btn { margin-left: auto; }
.mode-switch { margin: 0 0 24px; }
.key-out { margin-top: 18px; }
.key-out code { display: block; font-family: var(--mono); font-size: 13px; background: var(--bg); border-radius: var(--radius-field); padding: 10px 12px; word-break: break-all; margin-top: 8px; }
.key-ok { color: var(--pos); }
