/* Кабинет учителя: спокойная рабочая картотека. Антиква — только в заголовках. */
body {
  background: var(--field);
}
a {
  color: var(--stamp-ink);
}
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  padding: 10px 24px;
  background: var(--ink);
  color: var(--card);
}
.brand {
  color: var(--card);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
}
.brand span {
  font-family: var(--text);
  font-weight: 400;
  font-size: 14px;
  opacity: 0.75;
}
.top nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.top nav a,
.linkish {
  color: var(--card);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--r);
  background: none;
  border: 0;
  font-size: 15px;
}
.top nav a[aria-current='page'] {
  background: var(--stamp);
}
.top nav a:hover,
.top .linkish:hover {
  background: rgb(255 255 255 / 0.12);
}
.view {
  padding: 24px 24px 120px;
}
.page {
  max-width: 1100px;
  margin: 0 auto;
}
.page.narrow {
  max-width: 720px;
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 18px;
}
.page-head h1 {
  font-size: clamp(28px, 4vw, 40px);
}
.crumbs {
  font-size: 14px;
  color: var(--ink-2);
  margin-bottom: 8px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}
.muted {
  color: var(--ink-2);
}
.strong {
  font-weight: 700;
}
.empty {
  padding: 28px;
  background: var(--card);
  border: 1px dashed var(--rule);
  border-radius: var(--r);
  color: var(--ink-2);
}
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 20px 22px;
}
.btn.small {
  min-height: 34px;
  padding: 0 10px;
  font-size: 14px;
  border-width: 1.5px;
}
.btn.huge {
  min-height: 72px;
  min-width: 220px;
  font-size: 26px;
  font-family: var(--display);
}
.error {
  color: var(--danger);
  font-weight: 600;
}
.right {
  color: var(--ok);
}
.wrong {
  color: var(--danger);
}
.warn {
  color: var(--danger);
  font-weight: 700;
}
.section {
  font-size: 24px;
  margin: 30px 0 12px;
}

/* поля */
.field {
  display: grid;
  gap: 6px;
}
.field > span {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
}
input:not([type='checkbox']):not([type='radio']):not([type='file']),
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1.5px solid var(--ink-2);
  border-radius: var(--r);
  background: var(--card);
}
textarea {
  resize: vertical;
  line-height: 1.4;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--stamp);
}
input[type='checkbox'],
input[type='radio'] {
  width: 20px;
  height: 20px;
  accent-color: var(--stamp);
  vertical-align: -4px;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  cursor: pointer;
}

/* вход */
.login-wrap {
  min-height: 80vh;
  display: grid;
  place-items: center;
}
.login {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 30px 28px;
}
.login h1 {
  font-size: 36px;
}
.kicker {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 13px;
  color: var(--ink-2);
}
.small-link {
  color: var(--ink-2) !important;
  font-size: 14px !important;
  justify-self: start;
  padding: 4px 0 !important;
  text-decoration: underline;
}

/* список тестов */
.test-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.test-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 20px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--stamp);
  border-radius: var(--r);
  padding: 16px 18px;
}
.test-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
  text-decoration: none;
}
.test-title:hover {
  text-decoration: underline;
}
.inline-form {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}
.class-input {
  width: 180px !important;
}

/* редактор */
.title-input {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(24px, 3.4vw, 34px) !important;
  min-height: 56px !important;
  border-width: 0 0 2px !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding-left: 0 !important;
}
.q-list {
  list-style: none;
  margin: 16px 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.q-item {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--r);
}
.q-item.open {
  border-color: var(--ink-2);
}
.q-item.dragging {
  opacity: 0.4;
}
.q-item.drop {
  box-shadow: 0 -3px 0 var(--stamp);
}
.q-item-head {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  cursor: grab;
}
.q-n {
  text-align: center;
  font-size: 18px;
  color: var(--stamp);
}
.q-summary {
  display: grid;
  gap: 2px;
  text-align: left;
  background: none;
  border: 0;
  padding: 8px 4px;
  border-radius: var(--r);
  min-width: 0;
}
.q-sum-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}
.q-sum-meta {
  font-size: 12px;
  color: var(--ink-2);
}
.q-move {
  display: flex;
  gap: 4px;
}
.q-editor {
  display: grid;
  gap: 16px;
  padding: 6px 18px 18px 54px;
  border-top: 1px solid var(--rule);
  padding-top: 16px;
}
.row3 {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 12px;
}
.img-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.img-box img {
  max-height: 120px;
  max-width: 240px;
  border: 1px solid var(--rule);
}
.opt-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.opt-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 8px;
}
.opt-correct {
  display: grid;
  place-items: center;
  height: 42px;
  cursor: pointer;
}
.q-editor-foot {
  display: flex;
  justify-content: flex-end;
}
.savebar {
  position: fixed;
  z-index: 4;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: var(--card);
  border-top: 1px solid var(--rule);
}
.save-status {
  color: var(--ink-2);
  font-size: 14px;
}
.save-status.dirty {
  color: var(--danger);
  font-weight: 600;
}

/* таблицы */
.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--r);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.table th {
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  padding: 10px 12px;
  border-bottom: 2px solid var(--ink);
  white-space: nowrap;
}
.table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}
.table tr:last-child td {
  border-bottom: 0;
}
.table td.strong {
  white-space: nowrap;
}
.table .num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.table tr.done td {
  background: #f6f7f3;
}
.table.compact td {
  padding: 6px 12px;
  font-size: 14px;
}
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid currentColor;
  margin-right: 6px;
}
.pill.lobby {
  color: var(--stamp);
}
.pill.running {
  color: var(--card);
  background: var(--stamp);
  border-color: var(--stamp);
}
.pill.finished {
  color: var(--ink-2);
}
.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  vertical-align: 0;
}
.dot.on {
  background: var(--ok);
}
.dot.off {
  background: transparent;
  border: 2px solid var(--ink-2);
}

/* урок */
.panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 22px 24px;
  margin-bottom: 8px;
}
.big-num {
  font-size: 64px;
  line-height: 1;
}
.start-actions {
  display: grid;
  gap: 8px;
  justify-items: start;
}
.run-state {
  font-family: var(--display);
  font-weight: 700;
  font-size: 32px;
}
.people {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px;
}
.people li {
  display: grid;
  grid-template-columns: 22px 14px 1fr auto;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 6px 6px 6px 12px;
}
.pname {
  overflow-wrap: anywhere;
  font-weight: 600;
}
.results-actions {
  margin: 4px 0 0;
}

/* статистика */
.stats {
  display: grid;
  gap: 10px;
}
.stat-q {
  font-family: var(--text);
  font-size: 17px;
  margin: 6px 0 10px;
  white-space: pre-line;
}
.share {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
}
.bar {
  display: block;
  height: 10px;
  background: var(--field);
  border-radius: 5px;
  overflow: hidden;
}
.bar-fill {
  display: block;
  height: 100%;
  background: var(--stamp);
}
.bar-fill.alt {
  background: var(--ink-2);
}
.opt-stats,
.text-stats {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.opt-stats li {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(80px, 1fr) 36px;
  gap: 10px;
  align-items: center;
  font-size: 15px;
}
.opt-stats li.right .o-text {
  font-weight: 700;
}
.text-stats li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--rule);
  padding: 3px 0;
}
.review,
.review:focus-visible {
  outline: none;
  box-shadow: none;
}
.review-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.review-list .card {
  display: grid;
  gap: 4px;
  border-left: 4px solid var(--ok);
}
.review-list .card.bad {
  border-left-color: var(--danger);
}
.codes {
  background: var(--stamp-soft);
  border-radius: var(--r);
  padding: 14px 16px;
}
.code-list {
  margin: 8px 0 0;
  font-size: 17px;
  line-height: 1.8;
}
.form {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  justify-items: start;
}
.form .field {
  width: 100%;
}
.form h2 {
  font-size: 22px;
}

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: var(--r);
  background: var(--ink);
  color: var(--card);
  font-weight: 600;
  box-shadow: 0 8px 24px -8px rgb(0 0 0 / 0.4);
}
.toast.bad {
  background: var(--danger);
}

/* ---------- экран для доски: проектор, последняя парта ---------- */
body.board-mode {
  background: #ffffff;
}
body.board-mode .view {
  padding: 0;
}
.board {
  min-height: 100vh;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4vw;
  padding: 4vh 4vw;
  background: #ffffff;
  color: #000000;
}
.qr-wrap {
  border-right: 3px solid var(--stamp);
  padding-right: 4vw;
}
.qr {
  display: block;
  height: min(86vh, 48vw);
  width: auto;
  aspect-ratio: 1;
  image-rendering: pixelated;
}
.board.no-qr {
  grid-template-columns: 1fr;
}
.board.no-qr .qr-wrap {
  display: none;
}
.board-info {
  display: grid;
  gap: 1.6vh;
  align-content: center;
}
.b-class {
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(28px, 4.4vw, 80px);
  line-height: 1;
  color: var(--stamp);
}
.b-title {
  font-size: clamp(32px, 4.6vw, 96px);
  line-height: 1.02;
}
.b-label {
  font-size: clamp(16px, 1.6vw, 30px);
  margin-top: 2vh;
}
.b-code {
  font-size: clamp(44px, 6.6vw, 150px);
  line-height: 1;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.b-count {
  font-size: clamp(20px, 2.4vw, 46px);
  font-weight: 700;
  margin-top: 1vh;
}
.b-count .mono {
  font-size: 1.3em;
  color: var(--stamp);
}
.b-names {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6vh 1.6vw;
  font-size: clamp(16px, 1.6vw, 30px);
  max-height: 30vh;
  overflow: hidden;
}
.b-names li::after {
  content: ' ·';
  color: var(--rule);
}
.b-names li:last-child::after {
  content: '';
}
.podium {
  list-style: none;
  margin: 2vh 0 0;
  padding: 0;
  display: grid;
  gap: 1.4vh;
}
.podium li {
  display: grid;
  grid-template-columns: 1.4em 1fr auto;
  gap: 1vw;
  align-items: baseline;
  font-size: clamp(26px, 3.6vw, 72px);
  border-bottom: 2px solid var(--rule);
  padding-bottom: 0.8vh;
}
.podium .place {
  color: var(--stamp);
}
.podium .pn {
  font-family: var(--display);
  font-weight: 700;
}

@media (max-width: 760px) {
  .top {
    padding: 8px 16px;
  }
  .brand span {
    display: none;
  }
  .view {
    padding: 16px 16px 120px;
  }
  .test-row {
    grid-template-columns: 1fr;
  }
  .row3 {
    grid-template-columns: 1fr 1fr;
  }
  .row3 > :first-child {
    grid-column: 1 / -1;
  }
  .q-editor {
    padding: 14px 12px 16px;
  }
  .q-item-head {
    grid-template-columns: 30px 1fr;
  }
  .q-move {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
  .savebar {
    padding: 10px 16px;
  }
  .board {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .qr-wrap {
    border-right: 0;
    padding-right: 0;
  }
  .qr {
    height: auto;
    width: min(88vw, 60vh);
  }
}

.guard-panel {
  padding: 14px 24px;
}
.people-head {
  margin: 0;
  align-items: center;
}
.people-head .section {
  margin: 22px 0 12px;
}
