*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: var(--lh);
  background-color: var(--paper);
  background-image: var(--grid-paper);
  background-size: var(--grid) var(--grid);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  bottom: 0;
  left: var(--margin-x);
  z-index: 2;
  width: var(--rule);
  background: var(--margin-line);
  pointer-events: none;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.blot {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.38;
  animation: drift 22s ease-in-out infinite;
}

.blot.one {
  width: 520px;
  height: 520px;
  top: -220px;
  right: -140px;
  background: var(--blot-blue);
}

.blot.two {
  width: 380px;
  height: 380px;
  top: 30%;
  left: -180px;
  background: var(--blot-pink);
  opacity: 0.3;
  animation-delay: -8s;
}

.blot.three {
  width: 420px;
  height: 420px;
  bottom: -220px;
  right: 18%;
  background: var(--blot-sky);
  animation-delay: -15s;
}

@keyframes drift {
  33% {
    transform: translate(40px, -30px) scale(1.08);
  }

  66% {
    transform: translate(-30px, 30px) scale(0.95);
  }
}

.page {
  position: relative;
  z-index: 1;
  max-width: calc(var(--margin-x) + var(--content) + var(--gutter) * 2);
  padding: 0 var(--gutter) 0 calc(var(--margin-x) + var(--gutter));
}

main {
  display: block;
}

h1,
h2,
h3 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 12px;
}

h1 {
  font-size: var(--fs-h1);
  text-wrap: balance;
}

h2 {
  font-size: var(--fs-h2);
  font-weight: 600;
}

h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
}

p {
  margin: 0 0 12px;
}

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--ink-bright);
}

:focus-visible {
  outline: 3px solid rgba(62, 107, 209, 0.55);
  outline-offset: 2px;
}

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

.small {
  font-size: var(--fs-small);
}

.lead {
  max-width: 62ch;
  font-size: var(--fs-lead);
  color: var(--muted);
}

.shimmer {
  background: var(--grad-text);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 7s linear infinite;
}

@keyframes shimmer {
  to {
    background-position: -250% 0;
  }
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.25s var(--ease);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  margin: 0 calc(var(--gutter) * -1) calc(var(--cell) * 1.25);
  padding: 0 var(--gutter);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.topbar.is-scrolled {
  background: rgba(247, 244, 236, 0.82);
  border-color: rgba(201, 211, 227, 0.7);
  box-shadow: 0 8px 24px rgba(36, 71, 154, 0.06);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 9px;
  box-shadow: 0 6px 16px rgba(36, 71, 154, 0.22);
}

.brand-mark .sheet {
  fill: var(--card);
  stroke: var(--ink);
  stroke-width: 2;
}

.brand-mark .rule {
  stroke: var(--margin-line);
  stroke-width: 2;
}

.brand-mark .lines {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
}

.menu summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.menu summary::-webkit-details-marker {
  display: none;
}

.menu[open] summary {
  border-color: var(--ink);
}

.nav {
  position: absolute;
  top: calc(100% + 8px);
  left: var(--gutter);
  right: var(--gutter);
  display: flex;
  flex-direction: column;
  padding: 8px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: drop 0.3s var(--ease);
}

@keyframes drop {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.nav a,
.nav button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 50px;
  padding: 0 4px;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
}

.nav a[aria-current="page"] {
  color: var(--ink);
}

.nav .logout {
  margin: 0;
}

.nav .logout button {
  color: var(--muted);
  border-bottom: 0;
}

@media (min-width: 900px) {
  .menu.static summary {
    display: none;
  }

  .menu.static .nav {
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
    animation: none;
  }

  .menu.static .nav a,
  .menu.static .nav button {
    width: auto;
    min-height: var(--tap);
    padding: 0 14px;
    border: 0;
    border-radius: var(--radius-small);
    color: var(--muted);
    font-size: 15px;
    transition: background-color 0.2s, color 0.2s;
  }

  .menu.static .nav a:hover,
  .menu.static .nav button:hover {
    background: var(--ink-faint);
    color: var(--ink);
  }

  .menu.static .nav a[aria-current="page"] {
    background: var(--ink-soft);
    color: var(--ink);
  }
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin-top: calc(var(--cell) * 3);
  padding: var(--cell) 0 calc(var(--cell) * 2);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: var(--fs-small);
}

.page-head {
  margin-bottom: calc(var(--cell) * 1.5);
}

.page-head h1 {
  margin-bottom: 10px;
}

.page-head .lead,
.page-head p:last-child {
  margin-bottom: 0;
}

.head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: calc(var(--cell) * 1.5);
}

.head-row > div:first-child {
  min-width: 0;
}

.head-row h1,
.head-row h2 {
  margin: 0;
}

.head-row .sub {
  max-width: 60ch;
  margin: 10px 0 0;
  color: var(--muted);
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 8px;
  margin-bottom: 2px;
  font-size: var(--fs-small);
}

.crumbs a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: var(--tap);
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--ink);
}

.crumbs a:hover .icon {
  transform: translateX(-3px);
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid rgba(201, 211, 227, 0.85);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--cell);
  margin-bottom: var(--cell);
}

@media (min-width: 768px) {
  .card {
    padding: calc(var(--cell) * 1.25) calc(var(--cell) * 1.4);
  }
}

.card > :last-child {
  margin-bottom: 0;
}

a.card,
.card.hoverable {
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s;
}

a.card:hover,
.card.hoverable:hover {
  transform: translateY(-4px);
  border-color: rgba(36, 71, 154, 0.35);
  box-shadow: var(--shadow-lg);
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-soft);
}

.card-head h2,
.card-head h3 {
  margin: 0;
}

.card-head .count {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--ink-soft);
  color: var(--ink);
  font-size: var(--fs-small);
  font-weight: 700;
}

.card-head .title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-tile {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: var(--radius-md);
  background: var(--grad-tile);
  box-shadow: 0 8px 18px rgba(36, 71, 154, 0.28);
  color: var(--on-ink);
}

.icon-tile .icon {
  width: 22px;
  height: 22px;
}

.icon-tile.big {
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
}

.icon-tile.big .icon {
  width: 30px;
  height: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 22px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  background: var(--grad-ink);
  box-shadow: var(--shadow-ink);
  color: var(--on-ink);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s, border-color 0.25s, color 0.25s;
}

.btn:hover {
  color: var(--on-ink);
  background: var(--grad-ink-hover);
  box-shadow: var(--shadow-ink-hover);
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn:hover .icon {
  transform: translateX(3px);
}

.btn.ghost,
.btn.quiet {
  background: var(--card);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
}

.btn.ghost {
  border-color: rgba(36, 71, 154, 0.45);
}

.btn.ghost:hover,
.btn.quiet:hover {
  background: var(--white);
  border-color: var(--ink);
  box-shadow: var(--shadow);
  color: var(--ink);
  transform: translateY(-1px);
}

.btn.plain {
  padding: 0 6px;
  background: none;
  border-color: transparent;
  box-shadow: none;
  color: var(--ink);
  font-weight: 600;
}

.btn.plain:hover {
  background: none;
  box-shadow: none;
  color: var(--ink-bright);
  text-decoration: underline;
  text-underline-offset: 4px;
  transform: none;
}

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

.btn.wide {
  width: 100%;
}

.btn.big {
  min-height: 54px;
  padding: 0 28px;
  border-radius: 16px;
  font-size: 17px;
}

@media (max-width: 420px) {
  .btn {
    max-width: 100%;
    white-space: normal;
  }

  .btn.big {
    padding: 8px 22px;
  }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: var(--cell);
}

.actions.flush {
  margin-top: 0;
}

.actions + .card {
  margin-top: var(--cell);
}

.inline-form {
  display: inline;
  margin: 0;
}

.field {
  margin-bottom: var(--cell);
}

.field > label,
.field > .label,
.label {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.help {
  margin-top: 6px;
  color: var(--muted);
  font-size: var(--fs-small);
}

.errorlist {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  color: var(--text);
  font-size: var(--fs-small);
  font-weight: 600;
}

.errorlist li {
  position: relative;
  padding-left: 22px;
}

.errorlist li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 4px;
  width: 12px;
  height: 12px;
  border: 2px dashed var(--text);
  border-radius: 50%;
}

.form-errors {
  margin-bottom: var(--cell);
  padding: 14px 18px;
  border: 2px dashed var(--text);
  border-radius: var(--radius-md);
  background: var(--card);
  font-weight: 500;
  animation: rise 0.4s var(--ease);
}

.form-errors p:last-child {
  margin-bottom: 0;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
input[type="url"],
select,
textarea {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--text);
  font: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

select {
  appearance: none;
  padding-right: 40px;
  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='%2324479A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.55;
}

textarea[rows="2"] {
  min-height: 80px;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #A9B6CC;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--ink);
  outline: none;
  box-shadow: var(--ring-focus);
}

input[type="file"] {
  display: block;
  width: 100%;
  padding: 14px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  font: inherit;
  font-size: var(--fs-small);
}

input[type="file"]:hover {
  border-color: var(--ink);
}

input[type="file"]::file-selector-button {
  min-height: 38px;
  margin-right: 12px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: var(--radius-small);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.field.invalid input,
.field.invalid select,
.field.invalid textarea {
  border: 2px dashed var(--text);
}

.field > label.check,
.check {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
  min-height: var(--tap);
  cursor: pointer;
  font-weight: 500;
}

.check input {
  width: 22px;
  height: 22px;
  margin: 0;
  flex: none;
  accent-color: var(--ink);
}

.bare {
  border: 0;
  padding: 0;
  margin: 0 0 var(--cell);
  min-width: 0;
}

.choices {
  margin: 0;
  padding: 0;
  list-style: none;
}

.choices.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choices.row .check {
  padding: 0 16px 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  transition: border-color 0.2s, background-color 0.2s;
}

.choices.row .check:hover {
  border-color: var(--ink);
}

.choices.row .check:has(input:checked) {
  border-color: var(--ink);
  background: var(--ink-faint);
  color: var(--ink);
}

.form-grid {
  display: grid;
  gap: 0 var(--cell);
}

@media (min-width: 640px) {
  .form-grid.two {
    grid-template-columns: 1fr 1fr;
  }

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

.form-section .card-head p {
  width: 100%;
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-small);
}

.form-top {
  margin-top: var(--cell);
}

.messages {
  position: relative;
  z-index: 5;
  margin: 0 0 var(--cell);
  padding: 0;
  list-style: none;
}

.messages li {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding: 14px 18px;
  border: 1px solid rgba(36, 71, 154, 0.3);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--shadow);
  font-weight: 500;
  animation: rise 0.5s var(--ease);
}

.messages li::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 4px var(--ink-soft);
}

.messages li.error,
.messages li.warning {
  border: 2px dashed var(--text);
}

.messages li.error::before,
.messages li.warning::before {
  background: var(--text);
  box-shadow: none;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.list > li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  min-height: 60px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
}

.list > li:first-child {
  padding-top: 0;
}

.list > li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.list .grow {
  flex: 1 1 0;
  min-width: 0;
}

.list .sub {
  display: block;
  color: var(--muted);
  font-size: var(--fs-small);
}

.person {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  background: var(--ink-soft);
  color: var(--ink);
  font-family: var(--font-head);
  font-weight: 700;
}

.facts {
  margin: 0;
  padding: 0;
  list-style: none;
}

.facts li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-soft);
}

.facts li:last-child {
  border-bottom: 0;
}

.facts span:first-child {
  color: var(--muted);
}

.facts span:last-child {
  font-weight: 600;
  text-align: right;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--ink-soft);
  color: var(--ink);
  font-size: var(--fs-small);
  font-weight: 600;
  white-space: nowrap;
}

.tag .icon {
  width: 16px;
  height: 16px;
}

.tag.dashed {
  background: transparent;
  border: 1px dashed var(--muted);
  color: var(--muted);
}

.tag.solid {
  background: var(--grad-ink);
  color: var(--on-ink);
  box-shadow: 0 4px 10px rgba(36, 71, 154, 0.25);
}

.empty {
  padding: calc(var(--cell) * 2.5) var(--cell);
  text-align: center;
}

.empty .icon-tile {
  margin-bottom: 20px;
  animation: floaty 6s ease-in-out infinite;
}

.empty h1 {
  font-size: var(--fs-h2);
}

.empty h1,
.empty h2 {
  margin-bottom: 10px;
}

.empty p {
  max-width: 440px;
  margin: 0 auto var(--cell);
  color: var(--muted);
}

.empty.narrow {
  margin: calc(var(--cell) * 2) auto;
}

@keyframes floaty {
  50% {
    transform: translateY(-10px) rotate(-1.5deg);
  }
}

.auth .page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  max-width: none;
  padding-top: calc(var(--cell) * 2);
  padding-bottom: calc(var(--cell) * 2);
}

@media (min-width: 768px) {
  .auth .page {
    padding-right: calc(var(--margin-x) + var(--gutter));
  }
}

.auth main {
  width: 100%;
  max-width: var(--narrow);
  margin: 0 auto;
}

.auth .messages {
  width: 100%;
  max-width: var(--narrow);
  margin-left: auto;
  margin-right: auto;
}

.auth-brand,
.auth main > .reveal {
  position: relative;
  z-index: 1;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: calc(var(--cell) * 1.25);
  text-align: center;
  text-decoration: none;
}

.auth-brand .brand-mark {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  box-shadow: 0 14px 30px rgba(36, 71, 154, 0.28);
}

.auth-brand .name {
  font-family: var(--font-head);
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.auth-brand .tagline {
  color: var(--muted);
  font-size: var(--fs-lead);
}

.auth .card {
  padding: calc(var(--cell) * 1.25);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

@media (min-width: 768px) {
  .auth .card {
    padding: calc(var(--cell) * 1.6);
  }
}

.auth h1 {
  font-size: 26px;
  margin-bottom: 6px;
}

.auth .intro {
  margin-bottom: var(--cell);
  color: var(--muted);
}

.auth-alt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 16px var(--cell);
  border: 1px dashed rgba(36, 71, 154, 0.35);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.75);
}

.auth-alt p {
  margin: 0;
  font-weight: 500;
}

.below {
  margin-top: 16px;
  text-align: center;
  color: var(--muted);
}

.chips {
  display: none;
}

@media (min-width: 1240px) and (min-height: 640px) {
  .chips {
    position: fixed;
    inset: 0;
    z-index: 0;
    display: block;
    pointer-events: none;
  }
}

.chip {
  position: absolute;
  top: var(--y);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 12px;
  border: 1px solid rgba(201, 211, 227, 0.9);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  animation: floaty 7s ease-in-out infinite;
  animation-delay: var(--d);
}

.chip.left {
  left: max(calc(var(--margin-x) + 40px), var(--x));
}

.chip.right {
  right: var(--x);
}

.chip small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.chip .icon-tile {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.chip .icon-tile .icon {
  width: 18px;
  height: 18px;
}

.chip .math-chip {
  font-family: var(--font-head);
  font-size: 18px;
  color: var(--ink);
}

.chip .mini-cells {
  display: flex;
  gap: 3px;
}

.chip .mini-cells i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 2px solid var(--ink);
}

.chip .mini-cells i.on {
  background: var(--ink);
}

.code-input,
input.code-input {
  min-height: 68px;
  font-family: var(--font-head);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-align: center;
  text-transform: uppercase;
  color: var(--ink);
}

.greet {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: calc(var(--cell) * 1.5);
}

.greet h1 {
  margin: 0;
}

.greet .today {
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 500;
}

.subject {
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.subject-top {
  padding: var(--cell);
  border-bottom: 1px solid var(--border-soft);
}

.subject-next {
  padding: var(--cell);
  background: rgba(241, 244, 250, 0.5);
}

@media (min-width: 768px) {
  .subject-top,
  .subject-next {
    padding: calc(var(--cell) * 1.25) calc(var(--cell) * 1.4);
  }
}

@media (min-width: 900px) {
  .subject {
    display: grid;
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  }

  .subject-top {
    border-bottom: 0;
    border-right: 1px solid var(--border-soft);
  }
}

.subject-title {
  display: block;
  color: inherit;
  text-decoration: none;
}

.subject-title h2 {
  margin-bottom: 4px;
  font-size: 24px;
}

.subject-title:hover {
  color: inherit;
}

.subject-title:hover h2 {
  color: var(--ink);
}

.subject-kind {
  display: inline-flex;
  gap: 8px;
  color: var(--muted);
  font-size: var(--fs-small);
  font-weight: 500;
}

.progress-line {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 18px 0;
}

.ring {
  position: relative;
  width: 112px;
  height: 112px;
  flex: none;
}

.ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring .ring-bg {
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 9;
}

.ring .ring-val {
  fill: none;
  stroke: var(--ink);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: calc(100 - var(--p, 0));
  transition: stroke-dashoffset 1.4s var(--ease);
}

.js .ring:not(.is-in) .ring-val {
  stroke-dashoffset: 100;
}

.ring .ring-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  font-family: var(--font-head);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}

.ring .ring-label small {
  margin-top: 4px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.ring.big {
  width: 140px;
  height: 140px;
}

.ring.big .ring-label {
  font-size: 38px;
}

.progress-text strong {
  display: block;
  font-family: var(--font-head);
  font-size: 22px;
  line-height: 1.2;
}

.progress-text span {
  color: var(--muted);
  font-size: var(--fs-small);
}

.cells {
  display: grid;
  grid-template-columns: repeat(10, var(--cell));
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cells li {
  width: var(--cell);
  height: var(--cell);
  border-radius: 5px;
}

.js .cells li {
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
  transition-delay: calc(var(--i, 0) * 35ms + 200ms);
}

.js .cells.is-in li {
  opacity: 1;
  transform: none;
}

.cells .done {
  background: var(--grad-tile);
  box-shadow: 0 3px 8px rgba(36, 71, 154, 0.3);
}

.cells .progress {
  background: var(--white);
  border: 2px solid var(--ink);
}

.cells .new {
  border: 2px dashed var(--faint);
}

.cells .none {
  border: 1px dotted var(--faint);
}

.subject-next h3 {
  margin-bottom: 10px;
}

.next-list {
  margin: 0 0 4px;
  padding: 0;
  list-style: none;
}

.next-list a {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 -10px;
  padding: 10px;
  border-radius: var(--radius-md);
  color: var(--text);
  text-decoration: none;
  transition: background-color 0.2s, transform 0.25s var(--ease);
}

.next-list a:hover {
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transform: translateX(4px);
}

.next-list a:hover .icon {
  transform: translateX(3px);
}

.num-tile {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1.5px solid rgba(36, 71, 154, 0.35);
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
}

.next-list .what {
  flex: 1;
  min-width: 0;
  font-weight: 600;
}

.next-list .sub {
  display: block;
  color: var(--muted);
  font-size: var(--fs-small);
  font-weight: 400;
}

.next-list .icon {
  color: var(--ink);
}

.tiles {
  display: grid;
  gap: 0 var(--cell);
}

@media (min-width: 640px) {
  .tiles.two {
    grid-template-columns: 1fr 1fr;
  }
}

.stub {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
}

.stub > div {
  flex: 1 1 230px;
  min-width: 0;
}

.stub h3 {
  margin-bottom: 4px;
}

.stub p {
  margin: 0;
}

.week {
  display: flex;
  gap: 6px;
  margin: 10px 0 8px;
  padding: 0;
  list-style: none;
}

.week li {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1.5px dashed var(--faint);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.level-bar {
  height: 12px;
  margin: 14px 0 8px;
  border-radius: 999px;
  background: var(--ink-soft);
  overflow: hidden;
}

.level-bar i {
  display: block;
  height: 100%;
  min-width: 6px;
  border-radius: inherit;
  background: var(--grad-ink);
  transition: width 1.2s var(--ease);
}

.week li.on {
  border: 0;
  background: var(--grad-tile);
  color: var(--on-ink);
  box-shadow: 0 4px 10px rgba(36, 71, 154, 0.25);
}

.week li.today {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.exam-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px 32px;
  margin-bottom: calc(var(--cell) * 1.25);
  padding: var(--cell);
  border-radius: var(--radius-lg);
}

@media (min-width: 768px) {
  .exam-hero {
    padding: calc(var(--cell) * 1.25) calc(var(--cell) * 1.5);
  }
}

.exam-hero .stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  margin: 0;
}

.exam-hero .stats div {
  min-width: 90px;
}

.exam-hero dt {
  font-family: var(--font-head);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
}

.exam-hero dd {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-small);
}

.num-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 768px) {
  .num-grid {
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 14px;
  }
}

.js .num-grid li {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  transition-delay: calc(var(--i, 0) * 30ms);
}

.js .num-grid.is-in li {
  opacity: 1;
  transform: none;
}

.num-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  aspect-ratio: 1;
  padding: 6px 4px;
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  text-align: center;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s;
}

.num-cell .n {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

@media (min-width: 768px) {
  .num-cell .n {
    font-size: 36px;
  }
}

.num-cell .s {
  display: flex;
  align-items: center;
  min-height: 18px;
  font-size: var(--fs-tiny);
  font-weight: 500;
  line-height: 1.2;
}

.num-cell .s .icon {
  width: 18px;
  height: 18px;
}

.dots {
  display: flex;
  gap: 4px;
}

.dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
}

.dots i.on {
  background: var(--ink);
}

.num-cell.new {
  border: 2px dashed var(--faint);
  color: var(--muted);
}

.num-cell.progress {
  border: 2px solid var(--ink);
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.num-cell.done {
  background: var(--grad-tile);
  color: var(--on-ink);
  box-shadow: 0 10px 22px rgba(36, 71, 154, 0.3);
}

.num-cell.empty-num {
  border: 1px dotted var(--faint);
  background: transparent;
  color: var(--muted);
}

a.num-cell:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  color: inherit;
}

a.num-cell.new:hover {
  border-color: var(--ink);
  color: var(--ink);
}

a.num-cell.done:hover {
  color: var(--on-ink);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: var(--cell) 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-small);
  color: var(--muted);
}

.legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend i {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

.legend .new {
  border: 2px dashed var(--faint);
}

.legend .progress {
  border: 2px solid var(--ink);
}

.legend .done {
  background: var(--grad-tile);
}

.legend .none {
  border: 1px dotted var(--faint);
}

.task-num {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
}

.task-num.big {
  font-size: var(--fs-number);
  letter-spacing: -0.03em;
}

.task-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  margin-bottom: var(--cell);
}

.task-head.flush {
  margin-bottom: 0;
}

.task-head h1 {
  margin: 0;
}

.task-head .what {
  color: var(--muted);
  font-size: var(--fs-lead);
  font-weight: 500;
}

.task-card {
  position: relative;
}

.task-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 12px;
}

.task-card .meta .grow {
  flex: 1;
}

.task-card .exam-line {
  margin: -4px 0 10px;
  color: var(--muted);
  font-size: var(--fs-small);
}

.task-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.task-link:hover {
  color: inherit;
}

.task-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.task-card:has(.task-link) {
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s;
}

.task-card:has(.task-link):hover {
  transform: translateY(-3px);
  border-color: rgba(36, 71, 154, 0.35);
  box-shadow: var(--shadow-lg);
}

.task-card form {
  position: relative;
  z-index: 1;
}

@media (min-width: 900px) {
  .task-card .task-num {
    position: absolute;
    top: calc(var(--cell) * 1.25);
    right: calc(100% + var(--gutter) + 14px);
    font-size: 26px;
  }
}

.task-body {
  overflow-wrap: anywhere;
  white-space: pre-line;
  line-height: 1.65;
}

.statement {
  font-size: var(--fs-lead);
}

.task-body p:last-child {
  margin-bottom: 0;
}

.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-images {
  display: grid;
  gap: 12px;
  margin-top: var(--cell);
}

.task-images img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
}

.katex {
  font-size: 1.08em;
}

.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0;
}

.answer-card {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.answer-card .label {
  font-family: var(--font-head);
  font-size: var(--fs-h3);
}

.answer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: stretch;
}

.answer-row input {
  flex: 1 1 180px;
  width: auto;
  min-width: 0;
  min-height: 58px;
  border-radius: 16px;
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.answer-row .btn {
  flex: 0 0 auto;
  min-height: 58px;
}

.choice-list {
  display: grid;
  gap: 10px;
  margin: 0 0 var(--cell);
  padding: 0;
  list-style: none;
}

.choice-list label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 54px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, transform 0.25s var(--ease);
}

.choice-list label:hover {
  border-color: var(--ink);
  transform: translateX(3px);
}

.choice-list label:has(input:checked) {
  border-color: var(--ink);
  background: var(--ink-faint);
}

.choice-list input {
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--ink);
}

.choice-list .n {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--ink);
}

.verdict {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: var(--cell);
  padding: 18px var(--cell);
  border-radius: var(--radius-lg);
  background: var(--card);
  animation: rise 0.5s var(--ease);
}

.verdict .mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 50%;
}

.verdict .mark .icon {
  width: 26px;
  height: 26px;
  stroke-width: 2.5;
}

.verdict strong {
  display: block;
  font-family: var(--font-head);
  font-size: 24px;
  line-height: 1.2;
}

.verdict p {
  margin: 4px 0 0;
}

.verdict .key {
  font-family: var(--font-head);
  font-weight: 700;
  white-space: nowrap;
}

.verdict.ok {
  border: 1px solid rgba(36, 71, 154, 0.35);
  box-shadow: 0 14px 34px rgba(36, 71, 154, 0.16);
}

.verdict.ok .mark {
  background: var(--grad-tile);
  box-shadow: 0 8px 18px rgba(36, 71, 154, 0.35);
  color: var(--on-ink);
  animation: pop 0.6s var(--ease);
}

.verdict.ok .mark path {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: draw 0.5s 0.25s var(--ease) forwards;
}

.verdict.ok strong {
  color: var(--ink);
}

.verdict.no {
  border: 2px dashed var(--text);
}

.verdict.no .mark {
  border: 2px dashed var(--text);
}

.verdict.wait {
  border: 2px dotted var(--muted);
}

.verdict.wait .mark {
  background: var(--ink-faint);
  color: var(--ink);
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes pop {
  0% {
    transform: scale(0.4);
  }

  60% {
    transform: scale(1.12);
  }
}

.teacher {
  border-color: rgba(184, 50, 42, 0.25);
  border-left: 4px solid var(--red);
  background: var(--grad-red);
  color: var(--red);
}

.teacher h2,
.teacher h3 {
  color: var(--red);
}

.teacher .katex {
  color: var(--red);
}

.hand {
  font-family: var(--font-hand);
  font-size: 24px;
  line-height: 1.3;
  color: var(--red);
}

.history {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-small);
}

.history td {
  padding: 11px 12px 11px 0;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: baseline;
}

.history tr:last-child td {
  border-bottom: 0;
}

.history .when {
  color: var(--muted);
  white-space: nowrap;
}

.history .given {
  width: 100%;
  font-family: var(--font-head);
  font-size: var(--fs-base);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.history .mark {
  padding-right: 0;
  text-align: right;
  white-space: nowrap;
}

.mark-ok {
  display: inline-flex;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--ink-soft);
  color: var(--ink);
  font-weight: 700;
}

.mark-no {
  display: inline-flex;
  padding: 1px 9px;
  border: 1px dashed var(--text);
  border-radius: 999px;
  font-weight: 700;
}

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

.group-grid {
  display: grid;
  gap: 0 var(--cell);
}

@media (min-width: 768px) {
  .group-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.group-card {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}

.group-card:hover {
  color: inherit;
}

.group-card .top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.group-card h2 {
  margin-bottom: 4px;
}

.group-card:hover h2 {
  color: var(--ink);
}

.group-card .exam {
  color: var(--muted);
  font-size: var(--fs-small);
}

.group-card .bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-top: auto;
  padding-top: var(--cell);
}

.group-card .people {
  color: var(--muted);
  font-size: var(--fs-small);
}

.group-card .people strong {
  display: block;
  font-family: var(--font-head);
  font-size: 32px;
  line-height: 1.1;
  color: var(--text);
}

.code-cells {
  display: inline-flex;
  gap: 6px;
  margin: 0;
}

.code-cells span {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 50px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-small);
  background: var(--white);
  box-shadow: 0 4px 10px rgba(36, 71, 154, 0.12);
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
}

.code-cells.small {
  gap: 4px;
}

.code-cells.small span {
  width: 26px;
  height: 32px;
  border-width: 1.5px;
  border-radius: 7px;
  box-shadow: none;
  font-size: 16px;
}

.code-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
}

.link-line {
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-small);
  background: var(--white);
  color: var(--muted);
  font-size: var(--fs-small);
  overflow-wrap: anywhere;
}

.note {
  margin-top: 16px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 var(--cell);
}

@media (min-width: 900px) {
  .layout.side {
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: start;
  }
}

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
  align-items: end;
}

.filters .field {
  margin-bottom: 12px;
}

.filters .field:nth-child(n + 3) {
  grid-column: 1 / -1;
}

@media (min-width: 768px) {
  .filters {
    grid-template-columns: 1fr 1fr 1.4fr auto;
  }

  .filters .field {
    margin-bottom: 0;
  }

  .filters .field:nth-child(n + 3) {
    grid-column: auto;
  }
}

.editor-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.editor-tools button {
  min-width: var(--tap);
  min-height: var(--tap);
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 16px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}

.editor-tools button:hover {
  border-color: var(--ink);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.preview {
  min-height: 76px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--ink);
  border-radius: var(--radius-md);
  background: var(--white);
  font-size: var(--fs-lead);
}

.preview:empty::before {
  content: "Здесь появится условие с формулами";
  color: var(--muted);
  font-size: var(--fs-base);
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.thumbs label {
  flex-direction: column;
  align-items: flex-start;
}

.thumbs img {
  width: 100%;
  height: 100px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--white);
}

.formset-row {
  display: grid;
  gap: 0 12px;
  align-items: end;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}

.formset-row .field {
  margin-bottom: 8px;
}

.formset-row .row-tools {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px 12px;
}

.formset-row .row-tools .btn {
  min-width: 108px;
}

.formset-row.numbers {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.formset-row.numbers > .field:nth-of-type(n + 4) {
  grid-column: 1 / -1;
}

.formset-row.scale {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.formset-row.topics {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

.formset-row.scale > .field:nth-of-type(3),
.formset-row.topics > .field:nth-of-type(3) {
  grid-column: 1 / -1;
}

@media (min-width: 768px) {
  .formset-row.numbers {
    grid-template-columns: 76px 76px 92px minmax(0, 2fr) minmax(0, 1fr) 150px auto;
  }

  .formset-row.numbers > .field:nth-of-type(n + 4) {
    grid-column: auto;
  }

  .formset-row.topics {
    grid-template-columns: minmax(0, 1fr) 120px 130px;
  }

  .formset-row.scale {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 130px;
  }

  .formset-row.scale > .field:nth-of-type(3),
  .formset-row.topics > .field:nth-of-type(3) {
    grid-column: auto;
  }

  .formset-row + .formset-row .field > label:not(.check) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .formset-row + .formset-row {
    padding-top: 4px;
  }
}

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

table.plain {
  width: 100%;
  border-collapse: collapse;
}

table.plain th,
table.plain td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  vertical-align: top;
}

table.plain th {
  font-weight: 600;
  color: var(--muted);
}

.narrow {
  max-width: var(--narrow);
}

.medium {
  max-width: 760px;
}

.pager {
  justify-content: space-between;
}

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--grad-ink);
  color: var(--on-ink);
  font-size: 12px;
  font-weight: 700;
}

.section-title {
  margin: calc(var(--cell) * 1.5) 0 var(--cell);
}

.spaced {
  margin-top: var(--cell);
}

@media (min-width: 900px) {
  .layout.side.wide-side {
    grid-template-columns: minmax(0, 1fr) 400px;
  }
}

.works-strip {
  margin-bottom: var(--cell);
}

.strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.strip-head h2 {
  margin: 0;
}

.work-card {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
  color: inherit;
  text-decoration: none;
}

.work-card:hover {
  color: inherit;
}

.work-card .grow {
  flex: 1 1 220px;
  min-width: 0;
}

.work-card h2 {
  margin: 0 0 2px;
  font-size: 20px;
}

.work-state {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
}

.due {
  color: var(--ink);
  font-weight: 600;
  font-size: var(--fs-small);
}

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

.coverage {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.coverage li {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1.5px dashed var(--faint);
  border-radius: var(--radius-small);
  color: var(--muted);
  font-family: var(--font-head);
  font-weight: 700;
}

.coverage li.on {
  border: 0;
  background: var(--grad-tile);
  color: var(--on-ink);
  box-shadow: 0 4px 10px rgba(36, 71, 154, 0.25);
}

.coverage .x {
  position: absolute;
  right: 3px;
  bottom: 1px;
  font-family: var(--font-ui);
  font-size: 10px;
}

.work-items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-items li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}

.work-items li:last-child {
  border-bottom: 0;
}

.work-items .body {
  flex: 1;
  min-width: 0;
}

.item-tools {
  display: flex;
  gap: 2px;
}

.item-tools form {
  margin: 0;
}

.tool {
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border: 0;
  border-radius: var(--radius-small);
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.tool:hover:not(:disabled) {
  background: var(--ink-faint);
  color: var(--ink);
}

.tool:disabled {
  opacity: 0.35;
  cursor: default;
}

.pick-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pick-list li {
  padding: 14px 0;
  border-top: 1px solid var(--border-soft);
}

.pick-list .pick-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.pick-list form {
  margin-top: 10px;
}

.results {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-small);
}

.results th,
.results td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border-soft);
  text-align: center;
  white-space: nowrap;
}

.results thead th {
  color: var(--muted);
  font-weight: 600;
}

.results th[scope="row"],
.results thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 170px;
  background: var(--card);
  text-align: left;
  font-weight: 600;
  white-space: normal;
}

.results .sub {
  display: block;
  color: var(--muted);
  font-size: var(--fs-tiny);
  font-weight: 400;
}

.results .num {
  min-width: 34px;
  font-family: var(--font-head);
}

.results .total {
  text-align: right;
  padding-left: 14px;
}

.score-cell {
  font-family: var(--font-head);
  font-weight: 700;
}

.score-cell.full {
  color: var(--ink);
  background: var(--ink-soft);
}

.score-cell.part {
  color: var(--ink);
  background: var(--ink-faint);
}

.score-cell.zero {
  color: var(--text);
  text-decoration: underline dashed;
  text-underline-offset: 4px;
}

.score-cell.wait a {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px dotted var(--ink);
  border-radius: 50%;
  text-decoration: none;
}

.score-cell.none {
  color: var(--faint);
}

.legend .full {
  background: var(--ink-soft);
}

.legend .part {
  background: var(--ink-faint);
  border: 1px solid var(--ink-soft);
}

.legend .zero {
  border: 1px dashed var(--text);
}

.legend .wait {
  border: 2px dotted var(--ink);
  border-radius: 50%;
}

.progress-table th,
.progress-table td {
  padding: 6px 3px;
}

.pcell {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.pcell.new {
  border: 1.5px dashed var(--faint);
}

.pcell.progress {
  border: 2px solid var(--ink);
  color: var(--ink);
}

.pcell.done {
  background: var(--grad-tile);
}

.pcell.none {
  border: 1px dotted var(--faint);
}

.timer {
  position: sticky;
  top: 80px;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-bottom: var(--cell);
  padding: 12px 18px;
  border: 1px solid rgba(36, 71, 154, 0.3);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 247, 0.92);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--ink);
}

.timer strong {
  font-family: var(--font-head);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.timer.soon {
  border: 2px dashed var(--text);
  color: var(--text);
}

.work-task-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-bottom: 14px;
}

.work-task-head .num-tile {
  width: 44px;
  height: 44px;
}

.work-task-head .tag,
.work-task-head .mark-no {
  margin-left: auto;
}

.work-answer {
  margin-top: var(--cell);
  padding-top: var(--cell);
  border-top: 1px dashed var(--border);
}

.answer-input {
  max-width: 360px;
  min-height: 56px;
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
}

.finish-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  border-style: dashed;
}

.finish-bar p {
  margin: 0;
  max-width: 46ch;
}

.given-line {
  margin: 14px 0 0;
}

.given-line .key {
  font-family: var(--font-head);
  font-weight: 700;
}

.teacher-note {
  margin-top: 14px;
  padding: 10px 16px;
  border-left: 4px solid var(--red);
  border-radius: var(--radius-small);
  background: var(--red-soft);
}

.teacher-note .hand {
  margin: 0;
}

.solution {
  margin-top: 14px;
  border-top: 1px solid var(--border-soft);
  padding-top: 10px;
}

.solution summary {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--red);
  font-family: var(--font-head);
  font-weight: 600;
  cursor: pointer;
}

.solution .task-body {
  color: var(--red);
}

.student-answer {
  padding: 14px 16px;
  border-left: 4px solid var(--ink);
  border-radius: var(--radius-small);
  background: var(--white);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.photos img,
.thumbs a img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--white);
}

.thumbs {
  margin-top: 12px;
}

.verdict.review {
  border: 1px solid rgba(184, 50, 42, 0.3);
  background: var(--grad-red);
}

.verdict.review .mark {
  background: var(--red-soft);
  color: var(--red);
}

.verdict.review .hand {
  margin: 2px 0 0;
}

.history .hand {
  font-size: 20px;
  text-decoration: none;
}

.review-form {
  position: sticky;
  top: 90px;
}

.tries {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: var(--muted);
  font-size: var(--fs-small);
  font-weight: 500;
}

.tries i {
  width: 12px;
  height: 12px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--card);
}

.tries i.used {
  background: var(--ink);
}

.tries span {
  margin-left: 4px;
}

.score-cell.wait {
  color: var(--ink);
}

.results .act {
  padding-left: 14px;
  text-align: right;
  white-space: nowrap;
}

.work-about {
  max-width: 640px;
  margin: 10px 0 0;
  color: var(--muted);
}

.rules {
  margin: 8px 0 var(--cell);
  padding-left: 22px;
  color: var(--muted);
}

.rules li {
  margin-bottom: 6px;
}

.check.ready {
  margin-bottom: 8px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--ink-faint);
}

.work-task > .label {
  display: block;
  margin: 16px 0 6px;
}

.work-intro h2 {
  margin-top: calc(var(--cell) * 1.5);
}

.check-row {
  display: grid;
  gap: 0 var(--gutter);
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}

@media (min-width: 768px) {
  .check-row {
    grid-template-columns: 140px 1fr;
  }
}

.actions.center {
  justify-content: center;
}

.empty .actions.center {
  margin-top: 0;
}

.draft-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}

.draft .preview {
  margin: -6px 0 var(--cell);
}

.draft .thumbs {
  margin-bottom: var(--cell);
}

.draft .thumbs img {
  height: 140px;
}

.more {
  margin-top: 4px;
}

.more summary,
.skipped summary {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}

.more[open] summary {
  margin-bottom: 8px;
}

.skipped p {
  margin: 8px 0 0;
}

.answer-files {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0;
}

.answer-photo {
  display: block;
  width: 132px;
  height: 132px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--white);
  overflow: hidden;
  cursor: zoom-in;
}

.answer-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.answer-doc {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 180px;
  min-height: 72px;
  padding: 10px 14px;
  border: 1px dashed var(--ink);
  border-radius: var(--radius-small);
  background: var(--ink-faint);
  color: var(--text);
  text-decoration: none;
}

.answer-doc .doc-kind {
  color: var(--ink);
  font-weight: 700;
  font-size: var(--fs-small);
}

.answer-doc .doc-name {
  font-size: var(--fs-small);
  overflow-wrap: anywhere;
}

.answer-doc .doc-action {
  color: var(--ink);
  font-size: var(--fs-tiny);
  text-decoration: underline;
}

.upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}

.upload-row label.btn {
  position: relative;
  cursor: pointer;
}

.upload-row label.btn:focus-within {
  box-shadow: var(--ring-focus);
}

.upload-count {
  flex-basis: 100%;
  overflow-wrap: anywhere;
}

.js [data-file-picker] .upload-count {
  flex-basis: auto;
}

.picked {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.picked li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--tap);
  padding: 6px 6px 6px 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-small);
  background: var(--white);
}

.picked img {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-xs);
  object-fit: cover;
}

.picked-name {
  flex: 1;
  min-width: 0;
  font-size: var(--fs-small);
  overflow-wrap: anywhere;
}

.picker-note {
  margin: 10px 0 0;
  font-weight: 600;
}

.answer-file {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.save-status {
  margin-left: auto;
  color: var(--muted);
}

.save-status.failed {
  color: var(--text);
  font-weight: 600;
}

@media (pointer: fine) {
  .camera-btn {
    display: none;
  }
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 16px 48px;
  background: rgba(20, 26, 40, 0.88);
  overflow: auto;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-small);
  background: var(--white);
  cursor: zoom-in;
}

.lightbox.zoomed {
  align-items: flex-start;
  justify-content: flex-start;
}

.lightbox.zoomed img {
  max-width: none;
  max-height: none;
  width: 200%;
  cursor: zoom-out;
}

.lightbox-close {
  position: fixed;
  top: 12px;
  right: 16px;
  min-height: var(--tap);
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.lightbox-hint {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--on-ink);
  font-size: var(--fs-small);
}

.lightbox-open {
  overflow: hidden;
}

.criteria-rows {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: criterion;
}

.criteria-rows li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 96px;
  gap: 8px 10px;
  align-items: center;
  margin-bottom: 10px;
  counter-increment: criterion;
}

.criteria-rows li::before {
  content: counter(criterion) ".";
  color: var(--muted);
  font-weight: 600;
}

.criteria-rows li .check,
.criteria-rows li .errorlist {
  grid-column: 2 / -1;
}

.criteria-rows li.invalid input {
  border: 2px dashed var(--text);
}

.criteria-list {
  margin: 8px 0 12px;
  padding: 0;
  list-style: none;
}

.criteria-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
}

.criteria-list li:last-child {
  border-bottom: 0;
}

.criteria-list .pts {
  flex: none;
  font-weight: 600;
}

.criteria-list.given {
  margin: 4px 0 6px;
}

.criteria-list.given .pts {
  color: var(--red);
  font-size: 20px;
}

@media (min-width: 768px) {
  .check-row.criteria-check {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.criteria-check .field {
  margin-bottom: 10px;
}

.pick-students summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}

.student-choices {
  max-height: 320px;
  margin-top: 8px;
  padding: 4px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-small);
  background: var(--white);
  overflow-y: auto;
}

.list .person.grow {
  flex-basis: 220px;
}

.grade-pick select {
  width: auto;
  min-width: 112px;
  min-height: var(--tap);
  padding: 8px 32px 8px 12px;
}

.grades-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: var(--cell);
}

.grades-form .help {
  flex: 1 1 260px;
  margin: 0;
}

.scale-note {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 12px;
  border: 1px dashed var(--text);
  border-radius: var(--radius-small);
  font-weight: 600;
}

.forecast {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}

.forecast-value {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 18px;
  white-space: nowrap;
}

.forecast-value.muted {
  font-family: var(--font-ui);
  font-size: var(--fs-small);
  font-weight: 500;
}

.forecast-note {
  color: var(--muted);
  font-size: var(--fs-tiny);
  white-space: nowrap;
}

.forecast.risk .forecast-value {
  text-decoration: underline dashed;
  text-underline-offset: 4px;
}

.forecast.risk .forecast-note {
  color: var(--text);
  font-weight: 600;
}

.forecast-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: var(--fs-small);
}

.risk-card {
  margin-top: var(--cell);
}

.messages li.reward::before {
  content: none;
}

.messages li.reward .icon {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--ink);
}

.messages li.reward a {
  color: var(--text);
  text-decoration: none;
}

.messages li.reward a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.badge-mark {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.badge-mark .icon,
.badge-key .icon {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.badge-key {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  color: var(--ink);
}

.goal-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
}

.goal-figures {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 40px;
  margin: 0;
}

.goal-figures dt {
  font-family: var(--font-head);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
}

.goal-figures dd {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-small);
}

.goal-forecast .forecast {
  align-items: flex-start;
}

.goal-forecast .forecast-value {
  font-size: 34px;
}

.goal-forecast .forecast-value.muted {
  font-size: var(--fs-lead);
}

.goal-forecast .forecast-note {
  font-family: var(--font-ui);
  font-weight: 500;
}

.goal-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0 12px;
}

.goal-form .field {
  width: 200px;
  margin-bottom: 0;
}

.goal-form .btn {
  margin-top: 12px;
}

.goal-gap {
  margin: var(--cell) 0 12px;
  font-weight: 500;
}

.goal h3 {
  margin: var(--cell) 0 6px;
}

.level-card {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: flex-start;
}

.level-card > div {
  flex: 1 1 260px;
  min-width: 0;
}

.level-card h2 {
  margin: 0;
}

.level-card p {
  margin: 0 0 6px;
}

.achievements {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.achievement {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--white);
}

.achievement .sub {
  display: block;
  color: var(--muted);
  font-size: var(--fs-small);
}

.achievement.off {
  border: 1.5px dashed var(--faint);
  background: transparent;
  color: var(--muted);
}

.achievement.off .icon-tile {
  border: 1.5px dashed var(--faint);
  background: transparent;
  box-shadow: none;
  color: var(--faint);
}

.badge-exam {
  margin: 0 0 10px;
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 var(--cell);
  padding: 0;
  list-style: none;
}

.badge-list:last-child {
  margin-bottom: 0;
}

.badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 14px;
  border-radius: 999px;
  background: var(--grad-tile);
  color: var(--on-ink);
  font-weight: 600;
  text-decoration: none;
}

.badge-chip:hover {
  color: var(--on-ink);
  box-shadow: var(--shadow-ink);
}

.badge-chip .icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.badge-chip small {
  font-size: var(--fs-tiny);
  font-weight: 500;
  opacity: 0.85;
}

.goal-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.goal-list a {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: var(--tap);
  margin: 0 -10px;
  padding: 10px;
  border-radius: var(--radius-md);
  color: var(--text);
  text-decoration: none;
}

.goal-list a:hover {
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.goal-list .what {
  flex: 1;
  min-width: 0;
  font-weight: 600;
}

.goal-list .sub {
  display: block;
  color: var(--muted);
  font-size: var(--fs-small);
  font-weight: 400;
}

.goal-list > li > a > .icon {
  flex: none;
  color: var(--ink);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--cell);
}

.tabs a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 16px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.tabs a[aria-current="page"] {
  border-color: var(--ink);
  background: var(--ink-soft);
  color: var(--ink);
}

.goal-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 40px;
}

.goal-strip > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.goal-strip .forecast {
  align-items: flex-start;
}

.goal-strip strong {
  font-family: var(--font-head);
  font-size: 18px;
}

.goal-strip .btn,
.hero-link {
  margin-left: auto;
}

.chart {
  margin: 0 0 var(--cell);
}

.chart svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 320px;
}

.chart-grid {
  stroke: var(--border-soft);
  stroke-width: 1;
}

.chart-threshold {
  stroke: var(--muted);
  stroke-width: 1.5;
  stroke-dasharray: 6 5;
}

.chart-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-dot {
  fill: var(--card);
  stroke: var(--ink);
  stroke-width: 3;
}

.chart-axis {
  fill: var(--muted);
  font-family: var(--font-ui);
  font-size: 12px;
}

.chart-value {
  fill: var(--ink);
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
}

.stat-table th[scope="row"] {
  min-width: 200px;
}

.num-label {
  font-family: var(--font-head);
  color: var(--ink);
}

.tier {
  display: inline-grid;
  place-items: center;
  min-width: 52px;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  font-family: var(--font-head);
  font-size: 15px;
}

.tier.high {
  background: var(--ink-soft);
  color: var(--ink);
  font-weight: 700;
}

.tier.middle {
  border: 1.5px solid var(--ink-soft);
  background: var(--ink-faint);
  color: var(--ink);
  font-weight: 600;
}

.tier.low {
  color: var(--text);
  font-weight: 500;
  font-style: italic;
  text-decoration: underline dashed;
  text-underline-offset: 4px;
}

.tier.none {
  color: var(--faint);
}

.legend .tier {
  min-width: 44px;
  min-height: 24px;
  font-size: 13px;
}

.status-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
}

.status-text.done {
  color: var(--ink);
  font-weight: 600;
}

.status-text .icon {
  width: 16px;
  height: 16px;
}

.exam-table th[scope="row"] a {
  color: var(--ink);
}

.feedback-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.feedback-list > li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}

.feedback-list > li:last-child {
  border-bottom: 0;
}

.feedback-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}

.teacher-score {
  margin-left: auto;
  color: var(--red);
  font-family: var(--font-hand);
  font-size: 22px;
  line-height: 1;
}

@media (min-width: 900px) {
  .layout.side.group-board {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

.share-table td {
  padding: 4px 2px;
}

.share-table th[scope="row"] a {
  color: var(--text);
}

.share-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 40px;
  padding: 2px 4px;
  border-radius: 8px;
  line-height: 1.05;
}

.share-cell b {
  font-family: var(--font-head);
  font-size: 16px;
}

.share-cell small {
  color: var(--muted);
  font-size: 11px;
}

.share-cell.high {
  background: var(--ink-soft);
  color: var(--ink);
}

.share-cell.middle {
  border: 1.5px solid var(--ink-soft);
  background: var(--ink-faint);
  color: var(--ink);
}

.share-cell.middle b {
  font-weight: 600;
}

.share-cell.low {
  border: 1.5px dashed var(--faint);
  color: var(--text);
}

.share-cell.low b {
  font-style: italic;
  font-weight: 500;
}

.share-cell.none {
  color: var(--faint);
}

.legend .share-cell {
  min-width: 36px;
  min-height: 28px;
}

.weak-list,
.idle-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.weak-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.weak-list .num-tile {
  width: 44px;
  height: 44px;
  font-size: 18px;
}

.weak-list .what,
.idle-list li {
  font-weight: 600;
}

.weak-list .sub,
.idle-list .sub {
  display: block;
  color: var(--muted);
  font-size: var(--fs-small);
  font-weight: 400;
}

.idle-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
}

.idle-list li:last-child {
  border-bottom: 0;
}

.idle-list a {
  color: var(--text);
}

.attempt-table .where {
  max-width: 220px;
  white-space: normal;
  text-align: left;
}

.attempt-table .answer {
  max-width: 260px;
  white-space: normal;
  text-align: left;
}

.verdict-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text);
  font-weight: 500;
}

.verdict-text.ok {
  color: var(--ink);
  font-weight: 700;
}

.verdict-text .icon {
  width: 16px;
  height: 16px;
}

.week-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.week-bar strong {
  font-family: var(--font-head);
  font-size: 18px;
  text-align: center;
}

.summary-table th[scope="row"] {
  min-width: 190px;
}

.number-shares {
  margin-top: 14px;
}

.number-shares summary {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}

.share-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.share-strip li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-small);
  background: var(--white);
}

.share-strip .n {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--ink);
}

.share-strip .sub {
  color: var(--muted);
  font-size: var(--fs-tiny);
}

.filters-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0 16px;
}

.filters-bar .field {
  flex: 1 1 200px;
  margin-bottom: 12px;
}

.filters-bar .btn {
  margin-bottom: 12px;
}

.topic-table th[scope="row"],
.risk-table th[scope="row"] {
  min-width: 220px;
}

.risk-table td {
  white-space: normal;
}

.build-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.build-card h2 {
  margin: 0 0 4px;
}

.build-card p {
  margin: 0;
}

.report-list a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.report-list a .sub {
  display: block;
  color: var(--muted);
  font-size: var(--fs-small);
  font-weight: 400;
}

.report-list > li > .icon {
  color: var(--ink);
}

.report-text {
  max-width: 760px;
  font-size: 17px;
  line-height: 1.65;
}

.report-origin {
  margin-top: var(--cell);
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
}

.teacher-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.list li.off .person {
  color: var(--muted);
}


.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--delay, 0s);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }

  .js .reveal,
  .js .cells li,
  .js .num-grid li {
    opacity: 1;
    transform: none;
  }
}

@media print {
  .topbar,
  .footer,
  .ambient,
  .messages,
  .no-print,
  body::before {
    display: none;
  }

  body,
  .card {
    background: #fff;
    box-shadow: none;
  }

  .card {
    border: 0;
    padding: 0;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

.num-group-title {
  margin: var(--cell) 0 10px;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.num-group-title:first-child {
  margin-top: 0;
}

.part-row th {
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--muted);
  font-size: var(--fs-tiny);
  font-weight: 600;
  text-align: center;
}

.grid-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.answer-grid {
  border-collapse: separate;
  border-spacing: 8px;
  margin: -8px;
}

.answer-grid th {
  color: var(--muted);
  font-size: var(--fs-small);
  font-weight: 600;
}

.answer-grid input {
  width: 112px;
  min-height: var(--tap);
  font-size: 17px;
  text-align: center;
}

.player {
  display: block;
  width: 100%;
  max-width: 520px;
  min-height: var(--tap);
  margin: 12px 0;
  border-radius: var(--radius-small);
}

.recorder {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}

.record-time {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.shared-text {
  margin-bottom: var(--cell);
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--ink-faint);
}

.shared-text > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}

.shared-text[open] > summary {
  margin-bottom: 8px;
}

.text-link {
  margin: 0 0 12px;
}

.text-link a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
}

.task-files {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.task-files .file-name {
  max-width: 220px;
  overflow: hidden;
  color: var(--muted);
  font-weight: 500;
  text-overflow: ellipsis;
}

.statement-table {
  margin: 12px 0;
  border-collapse: collapse;
  font-size: var(--fs-base);
  line-height: 1.4;
  white-space: normal;
}

.statement-table th,
.statement-table td {
  min-width: 64px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  vertical-align: top;
}

.statement-table th {
  background: var(--ink-faint);
  font-weight: 600;
  text-align: left;
}

.text-tasks {
  display: grid;
  gap: 10px;
  margin: 0 0 var(--cell);
  padding: 0;
  list-style: none;
}

.text-tasks li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
