:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #5d6b80;
  --line: #d9e1ec;
  --line-strong: #c6d1df;
  --accent: #1f6feb;
  --accent-dark: #195fc7;
  --accent-soft: #eaf2ff;
  --ok: #147d3f;
  --ok-soft: #eaf8ef;
  --warn: #9a6700;
  --warn-soft: #fff7df;
  --danger: #b42318;
  --danger-soft: #fff1f0;
  --shadow: 0 10px 30px rgba(28, 44, 68, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #f8fbff 0, var(--bg) 260px),
    var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.public-page {
  background: #eef3f8;
}

.public-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px min(5vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
}

.public-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  text-decoration: none;
}

.public-brand img {
  flex: 0 0 auto;
}

.public-brand-title,
.public-brand-subtitle {
  display: block;
}

.public-brand-title {
  font-size: 1.05rem;
  font-weight: 900;
}

.public-brand-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.public-main {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.public-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 36px;
  align-items: center;
  min-height: 520px;
  padding: 52px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.public-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  border-left: 8px solid var(--accent);
  pointer-events: none;
}

.public-hero-content {
  position: relative;
  z-index: 1;
}

.public-hero h1 {
  max-width: 780px;
  margin-bottom: 20px;
  font-size: clamp(2.4rem, 5vw, 5.2rem);
}

.public-lead {
  max-width: 720px;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
}

.public-hero-mark {
  display: grid;
  place-items: center;
  width: 270px;
  height: 270px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #f8fbff;
  justify-self: end;
}

.public-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.public-feature {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.public-feature h2 {
  margin-bottom: 10px;
  font-size: 1.25rem;
}

.public-feature p {
  margin-bottom: 0;
  color: var(--muted);
}

.feature-number {
  display: inline-flex;
  margin-bottom: 16px;
  color: var(--accent);
  font-weight: 900;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 34px min(5vw, 56px);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(28, 44, 68, 0.02);
}

.eyebrow,
.label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0 0 14px;
  line-height: 1.2;
}

h1 {
  font-size: clamp(1.8rem, 3.2vw, 2.8rem);
  letter-spacing: 0;
}

h2 {
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  letter-spacing: 0;
}

h3 {
  font-size: 1.1rem;
}

p,
li {
  line-height: 1.6;
}

code {
  padding: 2px 6px;
  border-radius: 4px;
  background: #eef3f8;
}

.badge {
  display: inline-flex;
  min-width: 30px;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  background: #ffffff;
}

.nav-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.nav-actions a,
.button-link,
button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.nav-actions a:hover,
.button-link:hover,
button:hover,
.small-button:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  box-shadow: 0 8px 18px rgba(31, 111, 235, 0.18);
  transform: translateY(-1px);
}

.button-link.secondary,
.small-button.secondary {
  border-color: var(--line);
  background: #ffffff;
  color: var(--text);
}

.button-link.secondary:hover,
.small-button.secondary:hover {
  border-color: var(--line-strong);
  background: #f8fbff;
  color: var(--text);
  box-shadow: 0 6px 14px rgba(28, 44, 68, 0.08);
}

.layout {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 64px;
}

.wide-layout {
  width: min(1380px, calc(100% - 32px));
}

.layout.compact {
  max-width: 760px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.panel {
  margin-bottom: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero {
  padding: 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.student-dashboard-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.student-dashboard-hero h2 {
  margin-bottom: 10px;
}

.student-dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.student-available-panel {
  padding: 0;
  overflow: hidden;
}

.student-available-panel .section-heading {
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.student-test-list {
  display: grid;
  gap: 0;
}

.student-test-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.student-test-card:last-child {
  border-bottom: 0;
}

.student-test-card h3 {
  margin-bottom: 6px;
}

.student-test-card-actions {
  display: flex;
  justify-content: flex-end;
  min-width: 150px;
}

.empty-state {
  padding: 28px 24px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
}

.status.ok {
  color: var(--ok);
  background: var(--ok-soft);
}

.status.warn {
  color: var(--warn);
  background: var(--warn-soft);
}

.alert {
  padding: 12px 14px;
  border: 1px solid #f0b8b2;
  border-radius: 6px;
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 700;
}

.import-summary {
  display: grid;
  gap: 14px;
  margin-bottom: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.summary-grid span {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.import-errors summary {
  cursor: pointer;
  font-weight: 700;
}

.muted {
  color: var(--muted);
}

.compact-text {
  margin: 4px 0 0;
  font-size: 0.9rem;
}

.auth-layout {
  width: min(100% - 32px, 520px);
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  align-items: center;
  padding: 32px 0;
}

.branded-auth-layout {
  width: min(1180px, calc(100% - 32px));
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  gap: 22px;
}

.auth-brand-panel {
  display: grid;
  align-content: space-between;
  min-height: 520px;
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.auth-brand-panel h1 {
  max-width: 680px;
  margin-bottom: 18px;
  font-size: clamp(2rem, 4.5vw, 4.4rem);
}

.auth-panel {
  align-self: center;
}

.auth-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-panel.wide {
  width: min(920px, calc(100vw - 32px));
  justify-self: center;
}

.form {
  display: grid;
  gap: 16px;
}

.form.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form .full-span {
  grid-column: 1 / -1;
}

.form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

.form input,
.form select,
.form textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

.form input:focus,
.form select:focus,
.form textarea:focus,
.filters input:focus,
.filters select:focus {
  outline: 3px solid rgba(31, 111, 235, 0.14);
  border-color: var(--accent);
}

.form textarea {
  resize: vertical;
}

.nested-form {
  margin: 0;
}

.answer-set {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.answer-set legend {
  padding: 0 6px;
  font-weight: 700;
}

.answer-row {
  display: grid !important;
  grid-template-columns: auto 90px minmax(180px, 1fr) minmax(170px, 240px);
  align-items: center;
  gap: 10px !important;
}

.answer-row.text-answer-row {
  grid-template-columns: 110px minmax(0, 1fr) minmax(170px, 240px);
}

.answer-row.text-answer-row span {
  white-space: nowrap;
}

.answer-row.text-answer-row input[type="text"] {
  width: 100%;
}

.answer-row input[type="hidden"] {
  display: none;
}

.answer-image-control {
  display: grid;
  gap: 8px;
}

.answer-image-control input[type="file"] {
  width: 100%;
}

.paste-image-target {
  display: grid;
  gap: 4px;
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  text-align: left;
  color: var(--text);
  background: #f8fbff;
  border: 1px dashed #9bb7e8;
  border-radius: 6px;
  cursor: pointer;
}

.paste-image-target strong {
  font-size: 14px;
}

.paste-image-target span {
  color: var(--muted);
  font-size: 13px;
}

.paste-image-target:focus,
.paste-image-target.is-active {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  background: #eef5ff;
}

.question-image-preview,
.answer-image-preview,
.question-display-image,
.answer-display-image,
.paste-image-preview {
  display: block;
  max-width: min(100%, 520px);
  max-height: 320px;
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: contain;
  background: #ffffff;
}

.answer-image-preview,
.answer-display-image,
.answer-image-control .paste-image-preview {
  max-width: 180px;
  max-height: 120px;
  margin: 0;
}

.answer-row-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 2px;
}

.answer-row input[type="radio"] {
  width: 18px;
  min-height: 18px;
}

.bulk-question-list {
  display: grid;
  gap: 18px;
}

.bulk-question-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.bulk-question-card .section-heading h2 {
  margin: 0;
  font-size: 20px;
}

.form-actions {
  grid-column: 1 / -1;
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: #22314d;
  background: #f8fbff;
  font-size: 0.92rem;
  font-weight: 800;
}

tbody tr {
  transition: background 0.12s ease;
}

tbody tr:hover {
  background: #fbfdff;
}

td[colspan] {
  padding: 22px 24px;
  color: var(--muted);
  background: #fbfdff;
  font-weight: 700;
}

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

.table-panel {
  padding: 0;
}

.table-panel .section-heading {
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.table-panel table {
  min-width: 900px;
}

.result-details-panel {
  overflow: hidden;
}

.result-group {
  border-top: 1px solid var(--line);
}

.result-group-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: var(--accent-soft);
}

.result-group-heading h3 {
  margin-bottom: 6px;
}

.result-group .table-wrap {
  border-top: 1px solid var(--line);
}

.empty-result {
  padding: 22px 24px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 180px 220px auto;
  gap: 14px;
  align-items: end;
}

.filters.user-filters {
  grid-template-columns: minmax(240px, 1fr) 170px 210px 120px auto;
}

.filters.topic-form {
  grid-template-columns: minmax(240px, 1.4fr) minmax(220px, 1.2fr) 110px 110px 110px 150px auto;
}

.filters.level-block-form {
  grid-template-columns: minmax(240px, 1.4fr) minmax(180px, 1fr) 140px 100px 100px 150px auto;
}

.level-block-description-field {
  grid-column: 1 / -1;
}

.filters .compact-check {
  align-self: center;
}

.filters label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

.filters input,
.filters select,
.filters textarea {
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

.filters textarea {
  min-height: 84px;
  resize: vertical;
}

.actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions-cell form {
  margin: 0;
}

.letter-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0 4px;
}

.letter-filter a {
  display: inline-flex;
  min-width: 34px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.letter-filter a:hover,
.letter-filter a.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.print-sheet-body {
  background: #e9edf4;
}

.print-sheet-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  width: min(100% - 32px, 210mm);
  margin: 18px auto;
}

.login-sheet-page {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto 20px;
  padding: 14mm 16mm;
  box-sizing: border-box;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
  color: #111827;
}

.login-sheet-header {
  text-align: center;
  margin-bottom: 18px;
}

.login-sheet-header h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.login-sheet-header h2 {
  margin: 8px 0 0;
  font-size: 28px;
  line-height: 1.1;
}

.login-sheet-header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.login-sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.login-sheet-table th,
.login-sheet-table td {
  padding: 8px 9px;
  border: 1px solid #111827;
  text-align: left;
  vertical-align: top;
}

.login-sheet-table th {
  background: #f1f5f9;
  font-weight: 800;
}

.login-sheet-table th:first-child,
.login-sheet-table td:first-child {
  width: 42px;
  text-align: center;
}

.pagination-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 24px;
  border-top: 1px solid var(--line);
}

.pagination-bar p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.pagination a,
.pagination span {
  display: inline-flex;
  min-width: 34px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.pagination a:hover,
.pagination .current-page {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-actions form {
  margin: 0;
}

.points-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.points-inline-form input {
  width: 86px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-weight: 700;
}

.points-inline-form input:focus {
  outline: 3px solid rgba(31, 111, 235, 0.14);
  border-color: var(--accent);
}

.small-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.small-button.danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #ffffff;
}

.small-button.danger:hover {
  border-color: #8f1d14;
  background: #8f1d14;
}

.danger-button {
  border-color: var(--danger);
  background: var(--danger);
  color: #ffffff;
}

.danger-button:hover {
  border-color: #8f1d14;
  background: #8f1d14;
}

.pause-control-panel {
  border-left: 4px solid var(--accent);
}

.pause-control-panel.is-paused {
  border-left-color: var(--danger);
  background: var(--danger-soft);
}

.pause-control-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.test-form {
  display: grid;
  gap: 16px;
}

.test-timer-panel {
  position: sticky;
  top: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(31, 111, 235, 0.16);
  color: var(--text);
  font-weight: 700;
}

.test-timer-panel strong {
  font-size: 1.5rem;
  letter-spacing: 0;
}

.test-timer-panel.is-warning {
  border-color: var(--warn);
  background: var(--warn-soft);
}

.test-timer-panel.is-expired {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.test-timer-panel.is-paused {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.test-paused-notice {
  padding: 18px 24px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
}

.test-paused-notice h2 {
  margin: 0 0 8px;
}

.test-paused-notice p {
  margin: 0;
}

.question-group-panel {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: none;
}

.question-group-panel h2 {
  margin-bottom: 12px;
}

.level-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.level-summary span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  font-weight: 700;
  font-size: 0.92rem;
}

.question-card h2 {
  font-size: 1.2rem;
}

.answer-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.answer-option {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.answer-option:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.answer-option input {
  margin-top: 4px;
}

.answer-option-grid {
  grid-template-columns: minmax(110px, auto) 1fr;
  align-items: center;
  cursor: default;
}

.answer-option-grid input[type="number"],
.answer-option-grid input[type="text"],
.answer-option-grid select {
  width: 100%;
  margin-top: 0;
}

.test-form .answer-option-grid input[type="number"],
.test-form .answer-option-grid input[type="text"],
.test-form .answer-option-grid select,
.test-form textarea {
  min-height: 44px;
  padding: 10px 12px;
  border: 2px solid #a8b7cc;
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

.test-form .answer-option-grid input[type="number"]:focus,
.test-form .answer-option-grid input[type="text"]:focus,
.test-form .answer-option-grid select:focus,
.test-form textarea:focus {
  outline: 3px solid rgba(31, 111, 235, 0.18);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(31, 111, 235, 0.16);
}

.test-form .fill-blank-option {
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
}

.test-form .fill-blank-option > span {
  color: var(--text);
  font-weight: 800;
}

.ordering-help {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfdff;
  color: var(--muted);
}

.ordering-option {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 260px);
}

.matching-option {
  grid-template-columns: minmax(180px, 1fr) minmax(260px, 420px);
}

.protocol-body {
  background: #e9edf4;
  color: #111827;
  font-family: "Times New Roman", Times, serif;
  line-height: 1.12;
}

.protocol-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  width: min(100% - 32px, 900px);
  margin: 18px auto;
  font-family: var(--font);
}

.protocol-page {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto 20px;
  padding: 10mm 12mm;
  background: #ffffff;
  border: 1px solid #c8cdd8;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
  box-sizing: border-box;
  page-break-after: always;
}

.protocol-page:last-child {
  page-break-after: auto;
}

.protocol-header {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 14px;
  align-items: center;
  text-align: center;
  font-size: 12px;
  line-height: 1.04;
}

.protocol-header img {
  width: 70px;
  height: 70px;
}

.protocol-header p:first-child {
  font-size: 10.5px;
}

.protocol-header strong {
  font-size: 12.8px;
  letter-spacing: 0;
}

.protocol-header p,
.protocol-title h1,
.protocol-title h2,
.protocol-meta p,
.protocol-level h4,
.protocol-block-title,
.protocol-question p,
.protocol-signatures p {
  margin: 0;
}

.protocol-title {
  margin-top: 8px;
  text-align: center;
  text-transform: uppercase;
}

.protocol-title h1 {
  font-size: 15px;
  line-height: 1.05;
}

.protocol-title h2 {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.05;
  text-decoration: underline;
}

.protocol-meta {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  font-size: 12px;
}

.protocol-meta span,
.protocol-signatures span {
  display: inline-block;
  min-width: 240px;
  border-bottom: 1px solid #111827;
  padding: 0 6px 2px;
}

.protocol-subject-heading {
  margin: 12px 0 7px;
  text-align: center;
  text-transform: uppercase;
  font-size: 14px;
  line-height: 1.08;
}

.protocol-level {
  margin-top: 8px;
}

.protocol-level h4 {
  text-align: center;
  font-size: 13px;
  line-height: 1.08;
}

.protocol-block {
  margin-top: 5px;
}

.protocol-block-title {
  font-weight: 700;
  font-size: 12px;
  line-height: 1.12;
}

.protocol-question {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.12;
  break-inside: avoid;
  page-break-inside: avoid;
}

.protocol-question-points {
  color: #475569;
}

.protocol-answer,
.protocol-score-line {
  margin-top: 1px !important;
}

.protocol-question-image {
  display: block;
  max-width: 95px;
  max-height: 72px;
  margin: 2px 0;
}

.protocol-signatures {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  font-size: 12px;
  page-break-inside: avoid;
}

@media print {
  @page {
    size: A4;
    margin: 0;
  }

  body.protocol-body {
    background: #ffffff;
  }

  .protocol-toolbar {
    display: none;
  }

  .protocol-page {
    width: 210mm;
    min-height: 297mm;
    margin: 0;
    padding: 10mm 12mm;
    border: 0;
    box-shadow: none;
  }

  .print-sheet-body {
    background: #ffffff;
  }

  .print-sheet-toolbar {
    display: none;
  }

  .login-sheet-page {
    width: 210mm;
    min-height: 297mm;
    margin: 0;
    padding: 14mm 16mm;
    border: 0;
    box-shadow: none;
  }

  .login-sheet-table {
    font-size: 12px;
  }

  .login-sheet-table th,
  .login-sheet-table td {
    padding: 5px 6px;
  }
}

.checkbox-label {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 10px !important;
  margin-top: 28px;
}

.checkbox-label input {
  width: 18px;
  min-height: 18px;
}

select {
  max-width: 100%;
}

@media (max-width: 680px) {
  .topbar {
    display: block;
    padding: 26px 20px;
  }

  .public-header {
    display: grid;
    padding: 20px;
  }

  .public-main {
    width: min(100% - 24px, 1280px);
    padding: 20px 0 42px;
  }

  .public-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 28px 24px;
  }

  .public-hero-mark {
    width: 160px;
    height: 160px;
    justify-self: start;
  }

  .public-hero-mark img {
    width: 132px;
    height: 132px;
  }

  .public-feature-grid {
    grid-template-columns: 1fr;
  }

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

  .auth-brand-panel {
    min-height: 0;
    padding: 24px;
  }

  .badge {
    display: inline-block;
    margin-top: 12px;
  }

  .nav-actions {
    justify-content: flex-start;
    margin-top: 16px;
  }

  .form.two-columns {
    grid-template-columns: 1fr;
  }

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

  .filters.user-filters {
    grid-template-columns: 1fr;
  }

  .filters.topic-form {
    grid-template-columns: 1fr;
  }

  .test-form .fill-blank-option {
    grid-template-columns: 1fr;
  }

  .matching-option {
    grid-template-columns: 1fr;
  }

  .filters.level-block-form {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 18px;
  }

  .table-panel {
    padding: 0;
  }

  .pagination-bar {
    display: grid;
  }

  .pagination {
    justify-content: flex-start;
  }

  .pause-control-content {
    display: grid;
  }

  .student-dashboard-hero,
  .student-test-card {
    display: grid;
  }

  .student-dashboard-actions,
  .student-test-card-actions {
    justify-content: flex-start;
    min-width: 0;
  }

  th,
  td {
    padding: 11px 12px;
  }
}
