:root {
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
  --background: #edf6ff;
  --paper: #fff;
  --text: #1d3449;
  --muted: #45647d;
  --accent: #275d8d;
  --focus: #286db4;
  --line: #d0e2f1;
  --frame-line: #c1d6e9;
  --frame-radius: .65rem;
  --control-line: #a8c2d8;
  --selected: #e7f2ff;
  --test-width: 44rem;
  --narrow-width: 34rem;
  --login-width: 28rem;
  --content-padding: clamp(1rem, 4vw, 2.5rem);
  --workspace-spacing: clamp(1rem, 3vw, 2rem);
  --card-padding: clamp(1rem, 4vw, 1.85rem);
  --content-gap: .9rem;
  --work-width: min(calc(100% - 2 * clamp(.5rem, 3vw, 2cm)), calc(63rem + 4cm));
  background: var(--paper);
  color: var(--text);
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { display: flex; flex-direction: column; min-height: 100dvh; margin: 0; }
body:has(#screen > .narrow) { --page-content-width: var(--narrow-width); }
body:has(#screen > .question) { --page-content-width: var(--test-width); }
body:has(#screen > .login-card) { --page-content-width: var(--login-width); }
.wrap { max-width: 68rem; margin-inline: auto; padding-inline: var(--content-padding); }
.work-area {
  display: flex;
  flex-direction: column;
  width: var(--work-width);
  flex: 1;
  margin-inline: auto;
  background: var(--background);
  border: 1px solid var(--frame-line);
  border-top: 0;
  border-radius: 0 0 var(--frame-radius) var(--frame-radius);
}
.site-header {
  width: var(--work-width);
  margin-inline: auto;
  background: var(--paper);
  border: 1px solid var(--frame-line);
  border-bottom: 0;
  border-radius: var(--frame-radius) var(--frame-radius) 0 0;
}
.header, #account, .row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.header { width: min(100%, calc(var(--page-content-width, 68rem) + 2 * var(--content-padding))); padding-block: .75rem; }
.brand { display: flex; align-items: center; gap: 1.7rem; max-width: 100%; color: var(--text); text-decoration: none; }
.brand img { width: 3.5rem; height: 3.5rem; object-fit: contain; flex: none; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.275rem; font-weight: 550; line-height: 1.25; }
.brand small { margin-top: .15rem; color: var(--muted); font-size: 1.05rem; }
#account {
  justify-content: space-between;
  flex-wrap: nowrap;
  max-width: var(--page-content-width, 100%);
  margin-inline: auto;
  margin-bottom: var(--workspace-spacing);
  color: var(--muted);
  overflow-wrap: anywhere;
}
#account:empty { display: none; }
#account > button { flex: none; }
.account-identity { min-width: 0; text-align: start; }
.account-name { font-size: 1.075rem; font-weight: 550; }
.account-status { display: block; font-size: .85rem; line-height: 1.3; }
main { width: 100%; padding-block: var(--workspace-spacing); }
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--frame-line);
  border-radius: 0 0 var(--frame-radius) var(--frame-radius);
  background: var(--paper);
  color: var(--muted);
  font-size: .875rem;
}
.footer-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1rem 2rem;
  padding-block: clamp(1rem, 3vw, 1.6rem);
}
.footer-layout h2 { margin-bottom: .35rem; color: var(--text); font-size: .95rem; }
.footer-layout p { margin-bottom: .55rem; }
.footer-authors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem .8rem; margin: 0; padding: 0; list-style: none; }
.footer-layout .footer-copyright { margin: .85rem 0 0; }
#nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .75rem;
  max-width: var(--page-content-width, 100%);
  margin-inline: auto;
  margin-bottom: var(--workspace-spacing);
}
#nav > button { flex: 1 1 8.5rem; min-width: 0; }
#nav > button:hover { background: var(--selected); }
#nav > button[aria-current="page"]:not(.test-launch) { background: var(--selected); border-color: var(--accent); }
.test-start-form > button[type=submit], .exam-start { justify-self: center; margin-block-start: .5rem; }
[hidden] { display: none !important; }
.card, details { background: var(--paper); border: 1px solid var(--line); border-radius: .75rem; padding: var(--card-padding); }
.card > h1 { margin-bottom: var(--card-padding); }
.card > h1:last-child { margin-bottom: 0; }
.narrow { max-width: var(--narrow-width); margin-inline: auto; }
.test-context, .question { max-width: var(--test-width); margin-inline: auto; }
.test-context { margin-bottom: .95rem; }
.test-mode { color: var(--accent); font-size: .875rem; font-weight: 500; }
.test-context .test-discipline { margin: .2rem 0 .55rem; font-size: 1.2rem; line-height: 1.25; }
.test-context .test-counter { margin-bottom: .3rem; color: var(--muted); font-size: .9rem; }
.exam-timer { margin: .75rem 0; color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.exam-timer-low { color: #a12633; }
.question h1 { font-size: clamp(1.125rem, 2.5vw, 1.375rem); line-height: 1.35; }
.question fieldset { border: 0; padding: 0; gap: .4rem; }
.question legend { color: var(--muted); font-size: .9rem; font-weight: 500; margin-bottom: .5rem; padding: 0; }
.question .choice { min-height: 2.75rem; padding: .55rem .75rem; }
h1, h2, h3, p { margin: 0 0 .85rem; }
h1, h2, h3 { font-weight: 550; }
h1, .question-section > h2 { font-size: clamp(1.375rem, 3vw, 1.625rem); line-height: 1.25; }
h2 { font-size: 1.125rem; }
h3 { font-size: 1rem; }
.question-section { margin-top: var(--card-padding); }
.question-section > h2 { margin-bottom: var(--card-padding); }
form, .stack { display: grid; gap: var(--content-gap); }
.group-search { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem .75rem; }
.specialty-search select { width: auto; min-width: 0; margin: 0; }
.specialty-search label { flex-wrap: wrap; }
.profile-settings form, .feedback-form { gap: .6rem; }
.profile-settings form + h2, .profile-feedback { margin-top: 1.15rem; }
.profile-settings .profile-data-form {
  grid-template-columns: minmax(0, 19rem) auto;
  justify-content: start;
  align-items: end;
}
.profile-settings .profile-data-form:has(input[name=group]) { grid-template-columns: minmax(0, 9rem) auto; }
.feedback-form textarea { min-height: 6rem; }
.feedback-confirmation { margin: .6rem 0 0; color: var(--accent); }
.feedback-list details { padding: .75rem 1rem; }
.feedback-text { margin: .6rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.feedback-history { margin-top: var(--content-gap); padding: .75rem 1rem; }
.feedback-thread p { margin: 0; overflow-wrap: anywhere; }
.feedback-replies:empty { display: none; }
.feedback-reply { border-inline-start: 2px solid var(--line); padding-inline-start: .75rem; }
.feedback-reply-meta { font-size: .875rem; }
.feedback-list + button { margin-top: var(--content-gap); }
.teacher-training-note { max-width: 64ch; margin-bottom: var(--content-gap); font-size: .9rem; }
.password-field { display: grid; gap: .25rem; }
.password-field > button { margin-top: .2rem; }
.password-input { position: relative; }
.password-field .password-input > input[name=password] { margin: 0; padding-inline-end: 3rem; }
.password-input > input::-ms-reveal { display: none; }
.password-input .password-toggle {
  display: grid;
  place-items: center;
  position: absolute;
  inset: 0 1px 0 auto;
  width: 2.75rem;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
}
.password-toggle:focus-visible { outline-offset: -3px; }
.password-eye {
  position: relative;
  display: grid;
  place-items: center;
  width: .9rem;
  height: .9rem;
  border: 1.5px solid currentColor;
  border-radius: 75% 0 75% 0;
  transform: rotate(45deg);
}
.password-eye::before { content: ""; width: .3rem; height: .3rem; border: 1.5px solid currentColor; border-radius: 50%; }
.password-visible .password-eye::after {
  content: "";
  position: absolute;
  width: 1.3rem;
  height: 1.5px;
  background: currentColor;
  box-shadow: 0 -1.5px var(--paper);
}
.group-search label { display: inline-flex; align-items: center; gap: .55rem; }
.group-search button { align-self: stretch; }
label { display: block; font-weight: 500; }
input, select, textarea, button { font: inherit; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  display: block; width: 100%; padding: .6rem .75rem; min-height: 2.8rem; margin-top: .25rem;
  border: 1px solid var(--control-line); color: inherit; border-radius: .5rem; background: var(--paper);
}
.group-search input[name=group] { width: 11ch; margin: 0; }
textarea { min-height: 6rem; resize: vertical; }
.profile-settings input[name], .profile-settings select, .feedback-form select { min-height: 2.5rem; padding-block: .4rem; }
fieldset { margin: 0; padding: .5rem .8rem; border: 1px solid var(--line); border-radius: .5rem; min-width: 0; }
legend { font-weight: 500; }
option { color: var(--text); }
button {
  width: fit-content; min-height: 2.75rem; padding: .53rem .9rem; border-radius: .55rem;
  border: 1px solid transparent; background: var(--accent); color: white; font-weight: 500; cursor: pointer;
}
button.secondary, .group-search button { background: var(--paper); border-color: var(--control-line); color: var(--accent); }
button:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 1px solid var(--focus); outline-offset: 2px; }
#screen h1[tabindex="-1"]:focus { outline: none; }
:is(input:not([type=checkbox]):not([type=radio]), select, textarea):focus {
  border-color: var(--focus);
  outline: none;
}
.muted { color: var(--muted); }
.choice {
  display: flex; gap: .65rem; align-items: center; padding: .7rem; border-radius: .45rem;
  border: 1px solid var(--line); font-weight: 400; cursor: pointer; overflow-wrap: anywhere;
}
.choice:has(input:checked) { background: var(--selected); border-color: var(--accent); }
input[type=checkbox], input[type=radio] { width: 1.05rem; height: 1.05rem; flex: none; margin: 0; accent-color: var(--accent); }
progress { display: block; width: 100%; height: .45rem; border: 0; border-radius: 1rem; overflow: hidden; accent-color: var(--accent); }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--accent); border-radius: 1rem; }
progress::-moz-progress-bar { background: var(--accent); }
#message { padding: .7rem 1rem; margin-bottom: 1rem; background: #ddecfd; border-radius: .55rem; }
#message.error { max-width: var(--page-content-width, 100%); margin-inline: auto; background: #fbe8e8; color: #8b2020; }
.table { overflow-x: auto; }
.users-sort { gap: .5rem .75rem; margin-bottom: .75rem; }
.users-sort label { display: flex; align-items: center; gap: .5rem; }
.users-sort select, .users-sort button { width: auto; min-height: 2.25rem; margin: 0; padding: .3rem .55rem; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .65rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.history-table tbody tr { cursor: pointer; }
.history-table tbody tr:is(:hover, :focus-within) td { background: var(--selected); }
.history-row-open { min-height: 0; padding: 0; border: 0; background: transparent; color: var(--text); font: inherit; text-align: left; }
.history-row-open:focus-visible { outline: 1px solid var(--accent); outline-offset: .2rem; }
.users-table { font-size: .875rem; }
.users-table :is(th, td) { padding: .5rem .4rem; }
.users-table form { width: max-content; gap: .3rem; }
.users-table .choice { gap: .4rem; padding: .25rem .4rem; white-space: nowrap; }
.users-table .choice input { width: .875rem; height: .875rem; }
.users-table .user-name > span { display: block; }
.users-table select { min-height: 2rem; margin: 0; padding: .25rem .5rem; }
.users-table td > select { width: auto; min-width: 9rem; }
.users-table td > div > label + label { margin-top: .25rem; }
@media (width > 40rem) {
  .users-table { font-size: .8125rem; }
  .users-table :is(th, td) { padding-inline: .3rem; white-space: nowrap; }
}
th, summary { font-weight: 500; }
summary { cursor: pointer; }
details > div { margin-top: 1rem; }
.review-answer { border: 1px solid var(--line); border-radius: .75rem; }
.review-question {
  display: block;
  width: 100%;
  padding: .8rem 1rem;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.review-question:hover { background: var(--selected); }
.review-answer-body { padding: 0 1rem .8rem; }
.review-answer-incorrect .review-question { color: #a12633; }
.review-options { list-style: none; margin: 0; padding: 0; gap: .4rem; }
.review-option { cursor: default; min-height: 2.75rem; padding: .55rem .75rem; }
.review-option-right { background: var(--selected); color: var(--accent); border-color: var(--accent); }
.review-option-wrong { background: #fbe8e8; color: #a12633; border-color: #a12633; }
.review-option-marker {
  display: grid;
  flex: none;
  place-items: center;
  width: 1rem;
  height: 1rem;
  border: 1px solid var(--control-line);
  border-radius: 50%;
}
.review-option-marker.multiple { border-radius: .2rem; }
.review-option-marker[role=img] { border-color: currentColor; }
.review-option-marker[role=img]::before { content: ""; width: .5rem; height: .5rem; border-radius: inherit; background: currentColor; }
.review-key { margin-inline-start: auto; color: var(--accent); font-weight: 650; flex: none; }
.app-dialog {
  position: fixed;
  width: min(40rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: clamp(1rem, 4vw, 1.65rem);
  border: 1px solid var(--frame-line);
  border-radius: .75rem;
  background: var(--paper);
  color: var(--text);
}
.app-dialog::backdrop { background: rgb(29 52 73 / 28%); }
.app-dialog > h2 { padding-inline-end: 2.5rem; }
.app-dialog .app-dialog-close { position: absolute; top: .4rem; right: .4rem; min-width: 2.75rem; border-color: transparent; font-size: 1.3rem; }
.app-dialog-actions { justify-content: flex-end; margin-top: 1rem; }
.registration-consent { cursor: default; }
.registration-consent > button {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  text-align: left;
  text-decoration: none;
}
.registration-consent > button:hover { color: var(--focus); }
.registration-form :is(input, select):user-invalid,
.registration-form.registration-validated :is(input, select):invalid,
.registration-validated .registration-consent:has(input:invalid) { border-color: #a12633; background-color: #fff4f4; }
.bank-topic { padding: .75rem 1rem; }
.topic-questions { margin-top: .45rem; padding-inline-start: .75rem; }
.topic-questions > details { padding: .6rem 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.topic-questions > details > summary { font-weight: 400; overflow-wrap: anywhere; }
.section-picker { margin-bottom: .9rem; }
.section-row { display: grid; grid-template-columns: minmax(0, 34rem) auto; align-items: end; justify-content: start; gap: .45rem .75rem; }
.question-actions { justify-content: flex-end; }
.edit-question { padding: clamp(.8rem, 2vw, 1.25rem); }
.edit-question > h1 { margin-bottom: .75rem; }
.edit-question form, .edit-question .stack { gap: .55rem; }
.edit-question textarea { min-height: 3.75rem; }
.edit-question :is(.question-options, .question-settings) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.edit-question .question-settings fieldset { display: flex; flex-wrap: wrap; }
.edit-question .question-settings .choice { padding: .4rem .5rem; }
.edit-actions {
  position: sticky;
  bottom: 0;
  justify-content: flex-end;
  z-index: 1;
  padding: .55rem 0;
  background: var(--paper);
  border-top: 1px solid var(--line);
}
.option-row { display: grid; gap: .6rem; grid-template-columns: 1fr auto; align-items: end; }
.option-row label:last-child { padding-bottom: .65rem; }
#screen > .card > :is(form, button, .row, .stack, details) + :is(form, button, .row, .stack, details) {
  margin-block-start: var(--content-gap);
}
#screen > .card > .stack:empty { display: none; }
.login-card {
  max-width: var(--login-width);
  padding: clamp(1.1rem, 5vw, 2.25rem);
  border-radius: 1.25rem;
  box-shadow: 0 .75rem 2rem rgb(39 93 141 / 8%);
}
.login-badge {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1.1rem;
  border-radius: .85rem;
  color: var(--accent);
  background: var(--selected);
}
.login-lock {
  display: block;
  position: relative;
  width: .85rem;
  height: .72rem;
  margin-top: .33rem;
  border: 1.5px solid currentColor;
  border-radius: .2rem;
}
.login-lock::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  width: .45rem;
  height: .42rem;
  border: 1.5px solid currentColor;
  border-bottom: 0;
  border-radius: .35rem .35rem 0 0;
  transform: translateX(-50%);
}
.login-card.card > h1 { margin-bottom: .35rem; }
.login-subtitle { margin-bottom: 1.35rem; }
.login-form { gap: .9rem; }
.login-form input { min-height: 3rem; }
.login-form > button[type=submit] { width: 100%; min-height: 3rem; margin-top: .2rem; }
.login-email { position: relative; }
.login-card .login-email input, .login-card .password-input > input[name=password] { padding-inline-start: 2.6rem; }
.login-email::after {
  content: "";
  position: absolute;
  inset-inline-start: .95rem;
  bottom: 1.12rem;
  width: .95rem;
  height: .68rem;
  border: 1.5px solid var(--muted);
  border-radius: .14rem;
  background: linear-gradient(32deg, transparent 47%, var(--muted) 49% 55%, transparent 57%) left top / 50% 55% no-repeat,
    linear-gradient(-32deg, transparent 47%, var(--muted) 49% 55%, transparent 57%) right top / 50% 55% no-repeat;
  pointer-events: none;
}
.login-password-prefix { display: grid; position: absolute; inset: 0 auto 0 .95rem; place-items: center; color: var(--muted); pointer-events: none; }
.login-links { justify-content: center; gap: .3rem 1rem; margin-top: .75rem; }
.login-links button { background: transparent; border-color: transparent; }
.login-links button:hover { background: var(--selected); }
.card:has(> .group-search + .stack:empty) {
  padding-bottom: calc(var(--card-padding) + .5rem);
}
@media (max-width: 48rem), (hover: none) and (pointer: coarse) {
  .footer-layout, .footer-authors { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 40rem) {
  .profile-settings input[name], .profile-settings select, .feedback-form select { min-height: 2.75rem; }
  .section-row, .edit-question :is(.question-options, .question-settings) { grid-template-columns: minmax(0, 1fr); }
  .brand img { width: 2.75rem; height: 2.75rem; }
  .brand { gap: 1.3rem; }
  .brand small { font-size: .96rem; }
  .table table, .table tbody, .table tr, .table td { display: block; }
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table tr { border-bottom: 1px solid var(--line); padding-block: .5rem; }
  .table td { border: 0; padding: .2rem 0; overflow-wrap: anywhere; }
  .table td::before { content: attr(data-label) " "; font-weight: 500; }
}
