@font-face {
  font-family: "Sofia Sans";
  src: url("/assets/sofia-sans-cyrillic-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: "Sofia Sans";
  src: url("/assets/sofia-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Sofia Sans";
  src: url("/assets/sofia-sans-cyrillic-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: "Sofia Sans";
  src: url("/assets/sofia-sans-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Sofia Display";
  src: url("/assets/sofia-sans-extra-condensed-cyrillic-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
  unicode-range: U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: "Sofia Display";
  src: url("/assets/sofia-sans-extra-condensed-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: Caveat;
  src: url("/assets/caveat-cyrillic-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
  unicode-range: U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: Caveat;
  src: url("/assets/caveat-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --paper: #fdfdfb;
  --ink: #151515;
  --muted: #56544e;
  --line: #bcb9b0;
  --wash: #f1efe7;
  --marker: #ffe34e;
  --red: #a9261b;
  --display: "Sofia Display", "Sofia Sans", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 400 17px/1.45 "Sofia Sans", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
::selection { background: var(--marker); color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, p, figure, blockquote { margin: 0; }
h1 { font: 800 clamp(2.8rem, 7.5vw, 3.85rem)/1 var(--display); letter-spacing: -.012em; }
h2 { font-size: 1.24rem; line-height: 1.2; font-weight: 600; }
p + p { margin-top: .55em; }
section + section { margin-top: 36px; }
strong, b { font-weight: 600; }
a { color: inherit; text-underline-offset: .22em; }
a:hover { text-decoration-thickness: 2px; }
mark { padding: 0 .2em; color: var(--ink); background: var(--marker); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
button, input, textarea, select { font: inherit; color: inherit; }
input, textarea, select { width: 100%; min-width: 0; background: var(--paper); border: 1px solid var(--ink); border-radius: 5px; padding: 10px 12px; }
input, select { min-height: 46px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--ink); }
input[type="checkbox"] { width: 21px; height: 21px; min-height: 0; margin: 0; flex: none; }
textarea { resize: vertical; }
button { cursor: pointer; }
.icon { flex: none; display: block; }
.muted { color: var(--muted); }
.late, .error { color: var(--red); }
.error { margin: 12px 0; }
.skip { position: fixed; inset: 10px auto auto 10px; transform: translateY(-200%); background: var(--marker); padding: 8px 12px; z-index: 2; }
.skip:focus { transform: none; }
.visually-hidden { position: absolute; clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px; }

.button {
  min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink); border-radius: 6px;
  padding: 10px 16px; font-weight: 600; text-decoration: none; line-height: 1.2;
}
.button:hover { background: #393830; }
.button .icon { color: var(--marker); }
.button.secondary { background: var(--paper); color: var(--ink); }
.button.secondary:hover { background: var(--wash); }
.button.secondary .icon { color: var(--ink); }
.button.wide { display: flex; width: 100%; }
.text-button { background: transparent; border: none; padding: 4px 0; text-decoration: underline; text-underline-offset: .2em; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; text-decoration: none; }
.back .icon { margin-left: -5px; }
.back:hover, .student-bar a:hover { text-decoration: underline; }

.student { width: min(100%, 680px); margin-inline: auto; }
.student-bar, .task-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 60px; padding: 8px clamp(16px, 5vw, 30px); border-bottom: 1px solid var(--line);
}
.student-bar a, .task-bar a { color: inherit; }
.student-bar a { text-decoration: none; }
.student-bar > span { color: var(--muted); text-align: right; }
.student main { padding: 28px clamp(16px, 5vw, 30px) 28px; }
.student main > h1 + p, .student main > h1 + section { margin-top: 12px; }
.student main > section { margin-top: 34px; }
.student .login { margin: 30px 0 0; max-width: 420px; }
.login h1 + p, .login form { margin-top: 20px; }
.login p + a { margin-top: 24px; }
.today-work { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--ink); }
.today-title { display: flex; align-items: center; gap: 15px; margin-bottom: 10px; }
.today-title h2 { font: 800 clamp(2.35rem, 9vw, 3.4rem)/.98 var(--display); }
.count { display: grid; flex: none; justify-items: center; font-weight: 600; line-height: 1; }
.count mark { font: 800 2.8rem/.83 var(--display); padding: 4px 7px; rotate: -3deg; }
.count > span { margin-top: 6px; font-size: .8rem; }
.note { margin: 20px 0; padding-top: 12px; border-top: 1px solid var(--ink); }
.note blockquote { color: var(--red); font: 500 clamp(1.6rem, 5.5vw, 2rem)/1.12 Caveat, cursive; white-space: pre-wrap; }
.note figcaption { color: var(--muted); font-size: .875rem; margin-top: 6px; }
.today-work > .button { margin-top: 24px; flex-direction: row-reverse; justify-content: space-between; }
.progress { display: flex; flex-wrap: wrap; gap: 6px; }
.today-work .progress { margin: 18px 0 6px; }
.progress > span {
  display: grid; place-items: center; width: 22px; height: 22px; border: 1.5px solid var(--ink); border-radius: 4px;
}
.progress > span.current { background: var(--marker); }
.progress .icon { width: 16px; height: 16px; }
.ruled { padding: 0; margin: 12px 0 0; list-style: none; border-top: 1px solid var(--ink); }
.ruled > li { border-bottom: 1px solid var(--line); }
.ruled > li > a { display: flex; align-items: center; gap: 12px; padding: 14px 0; min-height: 48px; text-decoration: none; }
.ruled > li > a:hover strong, .ruled > li > a:hover { text-decoration: underline; }
.ruled > li > a .icon { margin-left: auto; }
.ruled strong, .review a > span:nth-child(2) > span { display: block; }
.student .ruled:not(.review) a { flex-wrap: wrap; }

.task-bar { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; font-size: .9rem; border: 0; }
.task-bar > a:last-child { justify-self: end; }
.task-bar strong { font: 800 1.6rem/1 var(--display); vertical-align: baseline; }
.problem main { min-height: calc(100svh - 60px); display: flex; flex-direction: column; padding-top: 8px; padding-bottom: 0; }
.task-title { font: 600 1rem/1.3 "Sofia Sans", sans-serif; color: var(--muted); margin: 18px 0 8px; }
.prompt { font-size: clamp(1.1rem, 4.5vw, 1.25rem); line-height: 1.45; }
.prompt p + p { margin-top: .6em; }
.solve-form { display: flex; flex-direction: column; flex: 1; }
.options { margin: 18px 0 8px; padding: 0; border: 0; min-inline-size: 0; display: grid; gap: 8px; }
.option {
  position: relative; display: flex; align-items: center; gap: 12px; cursor: pointer; min-height: 55px;
  padding: 10px 11px; border: 1.5px solid var(--ink); border-radius: 6px;
}
.option:hover { background: var(--wash); }
.option input { opacity: 0; position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; }
.option:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 3px; }
.option:has(input:checked) { box-shadow: inset 0 0 0 1px var(--ink); }
.option-number, .item-index {
  width: 29px; height: 29px; flex: none; border: 1.5px solid var(--ink); border-radius: 4px; display: grid; place-items: center;
  font: 800 1.32rem/1 var(--display);
}
.option input:checked + .option-number { background: var(--ink); color: var(--paper); }
.plain-options { padding-left: 25px; margin: 16px 0 0; }
.plain-options li { padding: 3px 0 3px 3px; }
.material { width: 100%; margin: 14px 0 0; border-collapse: collapse; font-size: 1rem; }
.material th, .material td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; }
.material th { font-weight: 600; background: var(--wash); }
.fields { display: grid; gap: 14px; }
.fields input, .fields textarea, .fields select { display: block; margin-top: 4px; }
.fields .button { justify-self: start; }
.answer-fields { margin: 18px 0 6px; }
.two-fields { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sticky { position: sticky; bottom: 0; background: var(--paper); padding: 12px 0 max(14px, env(safe-area-inset-bottom)); }
.solve-actions { margin-top: auto; }
.solve-buttons { display: flex; gap: 8px; }
.solve-buttons .direction { justify-content: space-between; }
.save-state { display: block; font-size: .875rem; margin-bottom: 5px; }
.save-state:empty { display: none; }
.review { margin-bottom: 18px; }
.review + .sticky { padding-top: 8px; }
.score { display: flex; align-items: baseline; gap: 8px; margin: 24px 0; font-size: 1.16rem; }
.score mark { font: 800 3.4rem/.86 var(--display); padding: 5px 10px; rotate: -2deg; }
.results { border-top: 1px solid var(--ink); margin-top: 12px; }
.result { border-bottom: 1px solid var(--line); }
.result summary { display: grid; list-style: none; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; min-height: 52px; padding: 10px 0; cursor: pointer; }
.result summary::-webkit-details-marker { display: none; }
.result summary::after { grid-column: 3; grid-row: 1; content: ""; width: 7px; height: 7px; border: solid var(--ink); border-width: 0 1.5px 1.5px 0; rotate: 45deg; align-self: center; }
.result[open] summary::after { rotate: 225deg; }
.result summary .grade { grid-column: 2; line-height: 1.2; font-size: .9rem; }
.grade.correct { text-decoration: underline; text-decoration-color: var(--marker); text-decoration-thickness: 3px; text-underline-offset: 3px; }
.result-body { padding: 0 0 14px 37px; }
.result-body > * + * { margin-top: 8px; }
.result-body .prompt { max-width: 65ch; }
.source { font-size: .86rem; }

.tutor { display: grid; min-height: 100svh; grid-template-columns: 228px minmax(0, 1fr); }
.rail { display: flex; flex-direction: column; gap: 26px; border-right: 1px solid var(--ink); padding: 24px 20px 20px; }
.brand { font-weight: 600; text-decoration: none; }
.brand span { display: block; font-weight: 400; font-size: .9rem; margin-top: 3px; color: var(--muted); }
.rail nav { display: grid; gap: 2px; }
.rail nav a { min-height: 42px; display: flex; align-items: center; gap: 10px; text-decoration: none; }
.rail nav a span { padding: 0 4px; line-height: 1.2; }
.rail nav a[aria-current] span, .rail nav a:hover span { background: var(--marker); }
.rail form { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--ink); padding-top: 9px; margin-top: auto; }
.rail form button { color: var(--muted); font-size: .9rem; }
.desk { width: min(100%, 1320px); padding: clamp(20px, 4vw, 44px); }
.desk-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--ink); margin-bottom: 28px; }
.desk-head .button { min-height: 44px; }
.desk > .back { margin-top: -12px; margin-bottom: 3px; }
.worktable { margin-top: 14px; }
.workrow { display: grid; grid-template-columns: minmax(160px, 1.5fr) minmax(120px, 1fr) minmax(75px, .65fr) minmax(105px, .7fr); align-items: center; gap: 12px; padding: 12px 0; min-height: 58px; border-bottom: 1px solid var(--ink); }
.workrow.tablehead { min-height: 32px; padding: 0 0 8px; color: var(--muted); }
.due-mobile { display: none; }
.workrow a { display: inline-block; font-weight: 600; }
.progress-cell { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 7px; }
.progress-cell .progress { gap: 2px; max-width: 144px; }
.progress-cell .progress > span { width: 14px; height: 14px; border-radius: 3px; }
.progress-cell .progress .icon { width: 11px; height: 11px; }
.empty { margin-top: 14px; }
.student-admin { display: grid; grid-template-columns: 1fr minmax(180px, .7fr); gap: 28px; }
.student-admin section + section { margin-top: 0; }
.student-admin .fields { margin-top: 12px; }
.student-admin .ruled { margin-top: 0; }
.work-meta { margin: -12px 0 9px; }
.copy-wrap { margin: 14px 0 24px; max-width: 650px; }
.copy-line { display: flex; gap: 8px; margin-top: 4px; }
.copy-line input { flex: 1; }
.copy-line button { flex: none; white-space: nowrap; }
.confirmation { margin: 14px 0; }
.confirmation::first-letter { font-weight: 600; }
.desk .note { max-width: 650px; }
.work-form { max-width: 800px; }
.work-form > .fields { max-width: 540px; }
.bank { margin-top: 28px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 8px; }
.bank-group { border-top: 1px solid var(--ink); }
.bank-group:last-child { border-bottom: 1px solid var(--ink); }
.bank-group summary { position: relative; display: grid; list-style: none; grid-template-columns: 1.8rem 1fr auto; gap: 10px; padding: 10px 20px 10px 0; align-items: baseline; min-height: 45px; cursor: pointer; }
.bank-group summary::-webkit-details-marker { display: none; }
.bank-group summary::after { content: ""; position: absolute; right: 2px; top: 15px; width: 7px; height: 7px; border: solid var(--ink); border-width: 0 1.5px 1.5px 0; rotate: 45deg; }
.bank-group[open] summary::after { rotate: 225deg; }
.bank-group summary strong { font: 800 1.2rem/1 var(--display); }
.choices { padding-left: 12px; }
.bank-item { border-top: 1px solid var(--line); padding: 7px 0; }
.pick-task { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 5px 0; }
.pick-task input { margin-top: 2px; }
.bank-item .material { margin-top: 4px; }
.tutor-actions { margin-top: 8px; }
@media (max-width: 830px) {
  .tutor { display: block; }
  .rail { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 10px 20px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--ink); }
  .rail nav { display: flex; gap: 8px 14px; order: 1; flex-basis: 100%; }
  .rail form { margin: 0 0 0 auto; padding: 0; border: 0; }
  .rail form span { display: none; }
}
@media (max-width: 560px) {
  .desk-head { margin-bottom: 22px; }
  .workrow { grid-template-columns: minmax(0, 1fr) minmax(72px, .5fr) minmax(74px, .55fr); gap: 8px; }
  .workrow > :nth-child(3) { display: none; }
  .due-mobile { display: block; font-size: .9rem; }
  .workrow:first-child { font-size: .9rem; }
  .student-admin { grid-template-columns: 1fr; gap: 24px; }
  .section-head { align-items: baseline; }
  .choices { padding-left: 0; }
  .copy-line .icon { display: none; }
  .review li a { align-items: flex-start; }
  .review li .icon { margin-top: 4px; }
}

.pairs { display: grid; gap: 12px; margin-top: 16px; }
.pairs h2 { font-size: 1rem; }
.pairs h2::first-letter { text-transform: uppercase; }
.lettered { list-style: none; padding: 0; margin: 6px 0 0; }
.lettered li { display: flex; gap: 8px; padding: 2px 0; }
.lettered li > b { flex: none; min-width: 1.2em; }
.pairs .plain-options { margin-top: 4px; }
.task-preview { margin: 0 0 3px 31px; }
.task-preview > summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.task-preview .plain-options { margin-top: 7px; }

.link-settings { max-width: 650px; margin: -10px 0 28px; }
.link-settings summary { width: fit-content; min-height: 32px; cursor: pointer; }
.link-settings p { margin: 2px 0 10px; color: var(--muted); }
