:root {
  --bg: #f7f9fb;
  --surface: #ffffff;
  --surface-soft: #eef3f7;
  --surface-warm: #fff7e8;
  --text: #16202a;
  --muted: #637181;
  --line: #dbe3ea;
  --line-strong: #bfccd7;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #eff6ff;
  --amber: #b86c13;
  --danger: #b42318;
  --danger-soft: #ffe9e7;
  --success-soft: #dbeafe;
  --shadow: 0 18px 45px rgba(20, 32, 42, 0.09);
  --radius: 8px;
  --nav-rail-space: 104px;
  --viewport-gutter: clamp(14px, 1.8vw, 28px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(238, 243, 247, 0.75), rgba(247, 249, 251, 0) 260px),
    var(--bg);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.auth-page {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(320px, 0.85fr) minmax(420px, 1.15fr);
}

.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 48px;
  overflow: hidden;
  background: #050c18;
  color: #fff;
}

.auth-brand::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  content: "";
  background:
    radial-gradient(circle at 18% 14%, rgba(37, 99, 235, 0.24), transparent 32%),
    linear-gradient(90deg, rgba(3, 7, 18, 0.52), rgba(3, 7, 18, 0.06) 58%, rgba(3, 7, 18, 0.44)),
    linear-gradient(180deg, rgba(3, 7, 18, 0.72), rgba(3, 7, 18, 0.08) 42%, rgba(3, 7, 18, 0.64));
  pointer-events: none;
}

.auth-brand > * {
  position: relative;
  z-index: 1;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-home-button {
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.brand-home-button:hover span:last-child {
  color: var(--primary);
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  color: #fff;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.16);
}

.brand-icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-visual {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #050c18;
}

.auth-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% 50%;
}

.auth-panel {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 44px;
}

.auth-panel-brand {
  width: min(100%, 520px);
  margin: 0 auto;
  justify-content: center;
  color: var(--text);
  font-size: 18px;
}

.auth-panel-brand .brand-mark {
  width: 42px;
  height: 42px;
}

.auth-box {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.tab {
  flex: 1;
  padding: 10px 14px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
}

.tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 4px 16px rgba(20, 32, 42, 0.08);
}

.form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: #3d4b57;
  font-size: 13px;
  font-weight: 800;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 12px 13px;
  outline: none;
}

.field select {
  appearance: none;
  padding-right: 42px;
  background-image:
    linear-gradient(45deg, transparent 50%, #657384 50%),
    linear-gradient(135deg, #657384 50%, transparent 50%);
  background-position:
    calc(100% - 20px) 50%,
    calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.custom-select {
  position: relative;
}

.custom-select-trigger {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 12px 13px;
  padding-right: 42px;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.custom-select-trigger > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select.open .custom-select-trigger,
.custom-select-trigger:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.custom-select-arrow {
  position: absolute;
  right: 15px;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #657384;
  transform: translateY(-35%);
  color: transparent;
  font-size: 0;
  line-height: 0;
  pointer-events: none;
}

.custom-select-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: grid;
  gap: 6px;
  border: 1px solid #d8e2f0;
  border-radius: 10px;
  background: #fff;
  padding: 7px;
  box-shadow: 0 18px 38px rgba(20, 32, 42, 0.13);
}

.custom-select-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 10px 11px;
  text-align: left;
  font-weight: 850;
}

.custom-select-menu button:hover,
.custom-select-menu button.selected {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.custom-select-menu small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.check-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
}

.check-row input,
.assignment-user input {
  margin-top: 3px;
  accent-color: var(--accent);
}

.check-row span {
  display: grid;
  gap: 3px;
}

.check-row small,
.assignment-user small,
.table-muted {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  gap: 9px;
  border-radius: var(--radius);
  padding: 10px 15px;
  font-weight: 850;
  text-decoration: none;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
}

.btn.primary:hover {
  background: var(--accent-strong);
}

.btn.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
}

.btn.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.alert {
  border-radius: var(--radius);
  padding: 12px 13px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 14px;
}

.alert.error {
  border-color: #fac8c3;
  background: var(--danger-soft);
  color: var(--danger);
}

.field-error {
  margin-top: 7px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
}

.required-star {
  color: var(--danger);
  font-weight: 900;
}

.field.has-error input,
.field.has-error textarea,
.field.has-error select,
.field.has-error .custom-select-trigger,
.rich-question-input.invalid {
  border-color: #ef8f86;
  background: #fff7f6;
  box-shadow: 0 0 0 3px rgba(218, 73, 62, 0.08);
}

.alert.warm {
  border-color: #f3d38d;
  background: var(--surface-warm);
  color: var(--amber);
}

.app-shell {
  min-height: 100vh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  min-height: 72px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
}

.header-stats {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
}

.header-stats span {
  display: grid;
  min-width: 54px;
  justify-items: center;
  gap: 2px;
}

.header-stats strong {
  color: var(--accent);
  font-size: 17px;
  line-height: 1;
}

.header-stats small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-actions > .btn,
.header-actions > .user-chip {
  height: 44px;
}

.home-page {
  display: grid;
  gap: 16px;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  gap: 18px;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid #cfe0fb;
  border-radius: 18px;
  background:
    linear-gradient(120deg, rgba(37, 99, 235, 0.1), rgba(255, 255, 255, 0.9) 44%, rgba(238, 245, 255, 0.96)),
    #f8fbff;
  padding: 24px;
  box-shadow: 0 18px 42px rgba(37, 99, 235, 0.08);
}

.home-hero-copy {
  display: grid;
  align-content: center;
  gap: 10px;
}

.home-hero h1,
.home-hero p {
  margin: 0;
}

.home-hero h1 {
  font-size: 34px;
  line-height: 1.02;
  letter-spacing: 0;
}

.home-hero p {
  max-width: 720px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.home-stat-card {
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  padding: 18px;
}

.home-stat-card span,
.home-stat-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.home-stat-card strong {
  color: var(--text);
  font-size: 36px;
  line-height: 1;
}

.home-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.home-metrics article {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 16px;
}

.home-metrics strong {
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.home-metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 14px;
  align-items: start;
}

.home-panel {
  padding: 16px;
}

.home-next-list {
  display: grid;
  gap: 10px;
}

.home-next-card {
  display: grid;
  gap: 8px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 14px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.home-next-card:hover {
  border-color: rgba(37, 99, 235, 0.32);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.08);
}

.home-next-card span,
.home-next-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.home-next-card strong {
  font-size: 18px;
  line-height: 1.2;
}

.nav-rail {
  position: fixed;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 12;
  display: grid;
  grid-template-rows: auto auto;
  width: 64px;
  height: auto;
  border: 1px solid rgba(120, 154, 210, 0.26);
  border-radius: 18px;
  background: rgba(248, 251, 255, 0.92);
  box-shadow: 0 18px 44px rgba(37, 99, 235, 0.12);
  backdrop-filter: blur(14px);
  padding: 12px 10px;
  overflow: hidden;
  transition: width 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.nav-rail:hover,
.nav-rail:focus-within {
  width: 236px;
  border-color: rgba(37, 99, 235, 0.32);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 58px rgba(37, 99, 235, 0.16);
}

.nav-rail-list,
.nav-rail-footer {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.nav-rail-footer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(120, 154, 210, 0.2);
}

.nav-rail-button {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  justify-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #53657e;
  padding: 0;
  text-align: left;
  font-weight: 900;
  overflow: hidden;
}

.nav-rail-button:hover,
.nav-rail-button:focus-visible {
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
}

.nav-rail-button.active {
  background: #dceaff;
  color: var(--primary-strong);
}

.nav-rail-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: currentColor;
}

.nav-rail-icon svg {
  width: 22px;
  height: 22px;
}

.nav-rail-label {
  min-width: 0;
  opacity: 0;
  white-space: nowrap;
  transform: translateX(-6px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.nav-rail:hover .nav-rail-label,
.nav-rail:focus-within .nav-rail-label {
  opacity: 1;
  transform: translateX(0);
  justify-self: start;
}

.user-chip {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
}

.user-chip strong,
.user-chip span {
  display: block;
}

.user-chip span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.compact-user {
  min-width: 180px;
  padding: 7px 12px;
}

.user-menu-button {
  display: grid;
  align-content: center;
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.user-menu-button:hover,
.user-menu-button:focus-visible {
  border-color: rgba(37, 99, 235, 0.36);
  background: #f8fbff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.icon-only {
  width: 44px;
  min-width: 44px;
  padding: 9px;
}

.notification-bell {
  position: relative;
}

.notification-count {
  position: absolute;
  right: -5px;
  top: -7px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #d94c3d;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.notifications-popover {
  position: fixed;
  right: 24px;
  top: 82px;
  width: min(420px, calc(100vw - 32px));
  z-index: 30;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 14px;
}

.notification-list,
.section-access-list,
.settings-grid {
  display: grid;
  gap: 10px;
}

.notification-item {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
  text-align: left;
}

.notification-item.unread {
  border-color: #9bbcf8;
  background: var(--accent-soft);
}

.notification-item span,
.section-access-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.section-access-list label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.help-button {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 18;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.22);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.help-button:hover {
  background: var(--accent-strong);
  transform: translateY(-2px);
  box-shadow: 0 20px 42px rgba(37, 99, 235, 0.28);
}

.help-button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.24);
  outline-offset: 3px;
}

.main {
  min-width: 0;
  padding: 28px var(--viewport-gutter) 28px calc(var(--nav-rail-space) + var(--viewport-gutter));
  max-width: 1480px;
  margin: 0 auto;
}

@media (min-width: 981px) {
  .main:has(.course-detail-page) {
    max-width: none;
    margin: 0;
    padding-left: calc(var(--nav-rail-space) + var(--viewport-gutter));
    padding-right: var(--viewport-gutter);
  }
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.topbar h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.08;
  letter-spacing: 0;
}

.topbar p {
  margin: 7px 0 0;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  max-width: 100%;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(230px, 0.42fr) minmax(560px, 1fr);
  gap: 18px;
}

.workspace-wide {
  grid-column: 2;
}

.learning-page {
  display: grid;
  gap: 18px;
}

.learning-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 22px;
  align-items: stretch;
  border: 1px solid #c8d8f3;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(14, 165, 233, 0.06)),
    #fff;
  box-shadow: 0 14px 36px rgba(20, 32, 42, 0.055);
  padding: 22px;
}

.learning-hero h2 {
  margin: 4px 0 8px;
  font-size: 34px;
  line-height: 1.08;
  letter-spacing: 0;
}

.learning-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.learning-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.learning-next-card {
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  padding: 16px;
}

.learning-next-card > span,
.learning-next-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.learning-next-card > span {
  text-transform: uppercase;
}

.learning-next-card strong {
  font-size: 20px;
  line-height: 1.15;
}

.learning-layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.36fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.learning-rail {
  display: grid;
  gap: 14px;
}

.learning-panel {
  box-shadow: none;
}

.learning-library {
  min-height: 420px;
}

.library-head {
  align-items: flex-start;
}

.library-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

.learning-deadline-list {
  display: grid;
  gap: 8px;
}

.learning-deadline-item {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 11px;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.learning-deadline-item:hover {
  border-color: rgba(37, 99, 235, 0.36);
  transform: translateY(-1px);
}

.learning-deadline-item.soon {
  border-color: #efd6aa;
  background: #fffaf1;
}

.learning-deadline-item.overdue {
  border-color: #f0b8b3;
  background: #fff8f7;
}

.learning-deadline-item span,
.learning-deadline-item small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.learning-deadline-item span {
  text-transform: uppercase;
}

.panel,
.course-card,
.admin-block,
.quiz-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(20, 32, 42, 0.045);
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-header h3 {
  margin: 0;
  font-size: 17px;
}

.course-list {
  display: grid;
  gap: 12px;
}

.library-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin-bottom: 18px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(248, 251, 255, 0.96), rgba(255, 255, 255, 0.98)),
    #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 22px rgba(20, 32, 42, 0.04);
  padding: 0 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.library-search span {
  display: grid;
  place-items: center;
  color: var(--accent);
}

.library-search input {
  width: 100%;
  min-width: 0;
  height: 46px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 750;
}

.library-search input::placeholder {
  color: #7c8aa0;
  font-weight: 750;
}

.library-search:focus-within {
  border-color: rgba(37, 99, 235, 0.48);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08), 0 12px 28px rgba(20, 32, 42, 0.06);
}

.learning-section-groups {
  display: grid;
  gap: 18px;
}

.learning-section-group {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.learning-section-group + .learning-section-group {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.learning-section-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.learning-section-group-head h4 {
  margin: 0;
  font-size: 22px;
  line-height: 1.08;
}

.profile-page {
  display: grid;
  gap: 18px;
}

.profile-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.72fr);
  gap: 18px;
  align-items: center;
  border-color: #c8d8f3;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(14, 165, 233, 0.045)),
    #fff;
}

.profile-hero h2 {
  margin: 4px 0 6px;
  font-size: 32px;
  line-height: 1.08;
}

.profile-hero p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.profile-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.profile-summary-grid div {
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  padding: 14px;
}

.profile-summary-grid strong {
  display: block;
  color: var(--text);
  font-size: 26px;
  line-height: 1;
}

.profile-summary-grid span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(250px, 0.42fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.profile-panel {
  min-height: 220px;
}

.profile-panel-wide {
  grid-column: 1 / -1;
}

.profile-section-list,
.profile-progress-list {
  display: grid;
  gap: 10px;
}

.profile-progress-list.two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-section-list article,
.profile-progress-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 13px;
}

.profile-section-list article {
  display: grid;
  gap: 5px;
}

.profile-section-list span,
.profile-progress-card span:not(.pill) {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.profile-progress-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
}

.profile-progress-card strong {
  display: block;
  margin-bottom: 4px;
}

.section-list {
  display: grid;
  gap: 9px;
}

.section-button {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 11px 12px;
  text-align: left;
  font-weight: 850;
}

.section-button.active {
  border-color: var(--accent);
  background: var(--success-soft);
  color: var(--accent-strong);
}

.course-card {
  display: grid;
  color: var(--text);
  text-decoration: none;
  font: inherit;
  gap: 12px;
  padding: 16px;
  text-align: left;
  transition: border-color 160ms ease, transform 160ms ease;
}

.course-card:hover,
.course-card.active {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.course-card h3 {
  margin: 0;
  font-size: 18px;
}

.quiz-draft-notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: var(--radius);
  background: var(--success-soft);
  padding: 12px;
  color: var(--text);
}

.quiz-draft-notice strong,
.quiz-draft-notice span {
  display: block;
}

.quiz-draft-notice span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.modal-draft-notice {
  margin-top: 14px;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--surface-soft);
  color: #475768;
  font-size: 12px;
  font-weight: 850;
}

.pill.success {
  background: var(--success-soft);
  color: var(--accent-strong);
}

.pill.warm {
  background: var(--surface-warm);
  color: var(--amber);
}

.pill.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 10px;
  border: 1px dashed #cbd8ea;
  border-radius: 12px;
  background: #fbfdff;
  padding: 28px;
  color: var(--muted);
  text-align: center;
  font-weight: 760;
}

.empty-state strong {
  color: var(--text);
  font-size: 17px;
}

.calendar-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.calendar-list {
  display: grid;
  gap: 10px;
}

.calendar-item {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  padding: 13px;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.calendar-item:hover {
  transform: translateY(-1px);
  border-color: #9bbcf8;
  box-shadow: 0 12px 26px rgba(20, 32, 42, 0.07);
}

.calendar-item.overdue {
  border-color: #f0b8b3;
  background: #fff8f7;
}

.calendar-item.soon {
  border-color: #efd6aa;
  background: #fffaf1;
}

.calendar-kind,
.deadline-line {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.deadline-line {
  text-transform: none;
}

.notification-item.deadline {
  border-color: #efd6aa;
  background: #fff9ef;
}

.version-warning {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  border: 1px solid #efd6aa;
  border-radius: 10px;
  background: #fff9ef;
  padding: 12px;
  color: #7a4a12;
  font-weight: 800;
}

.version-warning span {
  color: #8b6b39;
  font-size: 13px;
  font-weight: 750;
}

.admin-filters {
  display: grid;
  grid-template-columns: 1fr 190px;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.admin-filters input,
.admin-filters select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  font-weight: 750;
}

.editor-layout {
  display: grid;
  gap: 16px;
}

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

.question-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.question-chip-row {
  display: inline-flex;
  align-items: stretch;
  gap: 8px;
  max-width: 100%;
}

.question-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  font-weight: 850;
  text-align: left;
}

.question-chip small {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 850;
}

.question-groups {
  display: grid;
  gap: 16px;
}

.question-group-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
}

.question-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.question-group-head h4,
.question-group-head p {
  margin: 0;
}

.question-group-head p {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.4;
}

.question-group-panel .question-chip-list {
  display: grid;
}

.question-group-panel .question-chip-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.question-group-panel .question-chip {
  width: 100%;
  justify-content: flex-start;
}

.btn.compact {
  min-height: 0;
  padding: 8px 10px;
  font-size: 13px;
}

.question-chip span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--accent-strong);
  font-size: 12px;
}

.check-row.passive {
  cursor: default;
}

.check-row.passive small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 700;
}

.course-create-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
}

.course-create-layout .panel:nth-child(2),
.course-create-layout .panel:nth-child(3) {
  grid-column: auto;
}

.content-block-list {
  position: relative;
  display: grid;
  gap: 0;
}

.course-chapter-editor {
  display: grid;
  gap: 14px;
}

.course-chapter-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px;
}

.course-chapter-tabs button {
  min-width: 176px;
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-areas:
    "mark title"
    "mark meta";
  align-items: center;
  gap: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  padding: 10px;
  text-align: left;
  box-shadow: 0 8px 18px rgba(20, 32, 42, 0.04);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease, transform 160ms ease;
}

.course-chapter-tabs button:hover {
  transform: translateY(-1px);
  border-color: #a9c6f8;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.09);
}

.course-chapter-tabs button.active {
  border-color: #7ca7f4;
  background: linear-gradient(180deg, #f7fbff 0%, #eef5ff 100%);
}

.course-chapter-tabs button span {
  grid-area: mark;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--primary);
  font-weight: 900;
}

.course-chapter-tabs button strong {
  grid-area: title;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.course-chapter-tabs button small {
  grid-area: meta;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.course-chapter-tabs .add-chapter-button {
  min-width: 126px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border-style: dashed;
  color: var(--primary);
  font-weight: 900;
}

.course-chapter-tabs .add-chapter-button.empty {
  min-width: 150px;
}

.course-chapter-empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 1px dashed #bed2f1;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fbfdff 0%, #f6f9ff 100%);
  padding: 24px;
  text-align: center;
}

.course-chapter-empty strong {
  font-size: 18px;
}

.course-chapter-empty span {
  max-width: 440px;
  color: var(--muted);
  font-weight: 750;
}

.chapter-editor-card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.5fr) auto;
  align-items: end;
  gap: 12px;
  border: 1px solid #cfe0fb;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8ff 100%);
  padding: 12px;
}

.chapter-fallback-note {
  display: grid;
  gap: 4px;
  border: 1px dashed #c7d8f6;
  border-radius: 12px;
  background: #fbfdff;
  padding: 13px 14px;
}

.chapter-fallback-note strong {
  font-size: 14px;
}

.chapter-fallback-note span {
  color: var(--muted);
  font-weight: 750;
}

.content-block-editor {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
  transition: transform 190ms ease, margin 190ms ease, border-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.content-block-editor.dragging {
  opacity: 0.62;
  border-color: var(--accent);
  box-shadow: 0 16px 34px rgba(22, 120, 83, 0.16);
}

.content-block-editor.drop-before {
  margin-top: 48px;
  transform: translateY(6px);
  border-color: #9bbcf8;
  box-shadow: 0 12px 30px rgba(22, 120, 83, 0.12);
}

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

.content-block-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.content-block-actions .btn { min-height: 44px; }

.drag-handle {
  cursor: grab;
  user-select: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.block-insert-zone {
  display: grid;
  place-items: center;
  transition: height 180ms ease, opacity 160ms ease, margin 180ms ease;
}

.block-insert-zone.between {
  height: 12px;
  opacity: 0;
}

.content-block-list:hover .block-insert-zone.between,
.block-insert-zone.between:hover,
.block-insert-zone.after {
  height: 46px;
  opacity: 1;
}

.block-insert-zone.empty {
  min-height: 112px;
  border: 1px dashed #c6d8d2;
  border-radius: var(--radius);
  background: radial-gradient(circle at 50% 50%, #f2f7ff 0%, #fbfdff 68%);
  padding: 18px;
}

.block-insert-zone.after {
  margin-top: 12px;
}

.block-insert-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #cddbd6;
  border-radius: 999px;
  background: #fff;
  color: var(--accent-strong);
  padding: 9px 14px;
  font-weight: 900;
  box-shadow: 0 10px 26px rgba(20, 32, 42, 0.06);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.block-insert-button.plus-only {
  width: 42px;
  height: 42px;
  justify-content: center;
  padding: 0;
  border-radius: 14px;
  color: var(--primary);
}

.block-insert-zone.empty .block-insert-button.plus-only {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.12);
}

.block-insert-button:hover {
  transform: translateY(-1px);
  border-color: #8fc7b2;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.12);
}

.block-insert-zone.empty p {
  margin: 9px 0 0;
  color: var(--muted);
  font-weight: 750;
  text-align: center;
}

.block-palette-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  background: rgba(23, 34, 45, 0.32);
  padding: 24px;
}

.block-palette {
  width: min(760px, 100%);
  border: 1px solid #d6e2dd;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(20, 32, 42, 0.22);
  padding: 18px;
}

.block-palette-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.block-palette-head h4 {
  margin: 0;
  font-size: 18px;
}

.block-palette-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 750;
}

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

.block-type-card {
  display: grid;
  gap: 6px;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
  color: var(--text);
  padding: 14px;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.block-type-card:hover {
  transform: translateY(-2px);
  border-color: #91c9b4;
  background: #f2faf6;
  box-shadow: 0 14px 30px rgba(20, 32, 42, 0.08);
}

.block-type-card strong {
  font-size: 14px;
}

.block-type-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.file-import-button {
  position: relative;
  overflow: hidden;
}

.file-import-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.privacy-settings {
  display: grid;
  gap: 12px;
  border: 1px solid #cfe2da;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f6fbf8 0%, #eef7f2 100%);
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.assignment-list {
  display: grid;
  gap: 10px;
}

.assignment-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
}

.assignment-summary div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.assignment-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.assignment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  border: 1px dashed #bfd6ce;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
  padding: 10px;
}

.assignment-user {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
  font-weight: 800;
  transition: border-color 160ms ease, background 160ms ease;
}

.assignment-user:has(input:checked) {
  border-color: #9bbcf8;
  background: var(--accent-soft);
}

.assignment-user span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.assignment-user span,
.assignment-user small {
  overflow-wrap: anywhere;
}

.completion-rules {
  display: grid;
  gap: 10px;
  border: 1px solid #d8e8e1;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfefd 0%, #f3faf6 100%);
  padding: 12px;
}

.completion-rule-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  border: 1px solid #dbe6e2;
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.completion-rule-card:hover {
  transform: translateY(-1px);
  border-color: #a8d0c1;
  box-shadow: 0 10px 24px rgba(20, 32, 42, 0.06);
}

.completion-rule-card:has(input:checked) {
  border-color: #9bbcf8;
  background: var(--accent-soft);
}

.completion-rule-card span {
  display: grid;
  gap: 3px;
}

.completion-rule-card small,
.completion-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.completion-empty {
  border: 1px dashed #c5d8d1;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  padding: 14px;
  text-align: center;
}

.compact-empty {
  padding: 14px;
  background: #fff;
}

.course-materials {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.course-materials h3 {
  margin: 0;
}

.course-detail-page {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: none;
  margin: 0;
}

.course-detail-back-row {
  display: flex;
  align-items: center;
  min-height: 34px;
}

.course-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(100, 116, 139, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #607086;
  padding: 8px 12px 8px 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.course-detail-back span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #edf3fb;
  color: #30425a;
  font-size: 17px;
  line-height: 1;
}

.course-detail-back strong {
  line-height: 1;
}

.course-detail-back:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.28);
  color: var(--text);
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.12);
}

.course-detail-head {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  border: 1px solid #cfe0fb;
  border-radius: 18px;
  background:
    linear-gradient(120deg, rgba(37, 99, 235, 0.1) 0%, rgba(255, 255, 255, 0.88) 44%, rgba(238, 245, 255, 0.96) 100%),
    linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
  padding: 22px 24px;
  box-shadow: 0 18px 42px rgba(37, 99, 235, 0.08);
}

.course-detail-head::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 4px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.7), rgba(125, 211, 252, 0.45), rgba(37, 99, 235, 0));
  opacity: 0.42;
}

.course-detail-head h1,
.course-detail-head p,
.course-detail-head span {
  margin: 0;
}

.course-detail-head h1 {
  margin-top: 8px;
  font-size: 32px;
  line-height: 1.02;
  letter-spacing: 0;
}

.course-detail-head p {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.course-detail-head span {
  display: block;
  max-width: 760px;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 750;
  font-size: 15px;
  line-height: 1.42;
}

.course-detail-aside {
  display: grid;
  align-content: center;
  gap: 6px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px;
}

.course-detail-aside strong {
  font-size: 26px;
}

.course-detail-aside span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.course-detail-meta {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 8px;
}

.course-detail-meta.compact {
  gap: 6px;
}

.course-detail-tests {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 16px;
}

.course-player {
  display: grid;
  grid-template-columns: minmax(190px, 236px) minmax(0, 1fr);
  gap: 16px;
  margin-top: 6px;
  align-items: start;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.course-player-nav {
  position: sticky;
  top: 104px;
  display: grid;
  align-content: start;
  gap: 12px;
  border: 1px solid rgba(205, 219, 229, 0.76);
  border-radius: 18px;
  background: linear-gradient(180deg, #f8fbff 0%, #f2f6fb 100%);
  padding: 12px;
  box-shadow: 0 18px 45px rgba(20, 32, 42, 0.07);
}

.course-player-nav button {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  grid-template-areas:
    "mark title"
    "mark meta";
  align-items: start;
  column-gap: 10px;
  row-gap: 4px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  padding: 10px 9px;
  text-align: left;
}

.course-player-nav button span {
  grid-area: mark;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.course-player-nav button em {
  grid-area: title;
  min-width: 0;
  display: -webkit-box;
  overflow: hidden;
  font-style: normal;
  font-weight: 850;
  line-height: 1.16;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.course-player-nav button small {
  grid-area: meta;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-player-nav button.active {
  border-color: rgba(124, 167, 244, 0.78);
  background: #e8f1ff;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}

.course-player-nav button.done span {
  background: var(--success-soft);
  color: var(--accent-strong);
}

.course-player-stage {
  min-width: 0;
  display: grid;
  gap: 18px;
  padding: 0;
  background: transparent;
}

.course-chapter-pager {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 10px;
}

.course-chapter-pager.bottom {
  margin-top: 14px;
  padding: 10px 2px 2px;
  border-top: 1px solid var(--line);
}

.course-chapter-pager button {
  min-width: 150px;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  padding: 9px;
  text-align: left;
}

.course-chapter-pager button.active {
  border-color: #7ca7f4;
  background: var(--accent-soft);
}

.course-chapter-pager span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eef5ff;
  color: var(--primary);
  font-weight: 900;
}

.course-chapter-pager strong {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-chapter-pager small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.course-chapter-head {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 18px;
  background: linear-gradient(180deg, #f8fbff 0%, #f2f7ff 100%);
  padding: 20px 22px;
}

.course-chapter-head span {
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.course-chapter-head h3,
.course-chapter-head p {
  margin: 0;
}

.course-chapter-head h3 {
  font-size: 30px;
}

.course-chapter-head p {
  color: var(--muted);
  font-weight: 750;
}

.course-block-flow {
  display: grid;
  gap: 18px;
}

.course-player-stage .material-block,
.course-player-stage .material-divider {
  margin: 0;
  min-height: 0;
}

.course-player-stage .material-block {
  position: relative;
  padding: 28px 30px;
}

.material-block-number {
  position: absolute;
  top: 18px;
  right: 18px;
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #eef5ff;
  color: var(--primary);
  font-weight: 950;
}

.course-nav-summary {
  display: grid;
  gap: 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  padding: 16px;
}

.course-nav-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.course-nav-summary strong {
  font-size: 28px;
  line-height: 1;
}

.course-nav-title {
  padding: 0 4px;
  font-size: 13px;
  text-transform: uppercase;
  color: var(--muted);
}

.course-chapter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.course-player-progress strong {
  font-size: 24px;
}

.course-player-progress span {
  color: var(--muted);
  font-weight: 750;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf1;
}

.progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 220ms ease;
}

.deadline-card {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}

.deadline-card.soon {
  border-color: #efd6aa;
  background: #fff9ef;
}

.deadline-card.overdue {
  border-color: #f0b8b3;
  background: #fff8f7;
}

.material-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 20px;
}

.material-block h4,
.material-block p {
  margin: 0;
}

.material-block h4 {
  font-size: 24px;
  line-height: 1.18;
}

.material-block p {
  margin-top: 12px;
  color: #405060;
  font-size: 16px;
  line-height: 1.68;
  white-space: pre-wrap;
}

.material-image {
  display: block;
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  margin-top: 10px;
}

.material-image.preview {
  max-height: 220px;
}

.material-frame {
  width: 100%;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  margin-top: 10px;
}

.note-block {
  border-color: #efd6aa;
  background: #fff8e8;
}

.material-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 900;
}

.material-divider::before,
.material-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.question-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px;
  background: #fff;
}

.question-item strong {
  display: block;
  margin-bottom: 8px;
}

.question-options {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.option-line {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #fff;
}

.option-line.correct {
  border-color: #93c5fd;
  background: var(--success-soft);
  color: var(--accent-strong);
}

.option-line.wrong {
  border-color: #f4aaa2;
  background: var(--danger-soft);
  color: var(--danger);
}

.quiz-panel {
  padding: 20px;
}

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

.quiz-title h3 {
  margin: 0;
}

.answer-button {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 13px 14px;
  text-align: left;
  font-weight: 750;
}

.answer-button:hover {
  border-color: var(--accent);
}

.answer-button.correct {
  border-color: #60a5fa;
  background: var(--success-soft);
  color: var(--accent-strong);
}

.answer-button.selected {
  border-color: var(--accent);
  background: #f3fbf7;
}

.answer-button.wrong {
  border-color: #f0a099;
  background: var(--danger-soft);
  color: var(--danger);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(560px, 1.18fr);
  gap: 18px;
  align-items: start;
}

.access-admin-grid {
  grid-template-columns: minmax(360px, 0.95fr) minmax(360px, 1.05fr);
}

.admin-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 18px;
  box-shadow: 0 8px 28px rgba(20, 32, 42, 0.04);
}

.management-page {
  display: grid;
  gap: 18px;
}

.management-page.editor-mode {
  gap: 14px;
}

.admin-topbar {
  margin-bottom: 0;
}

.admin-workbench {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-side-nav {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 10px 30px rgba(20, 32, 42, 0.045);
  padding: 14px;
}

.admin-side-title {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.admin-side-title .brand-mark {
  width: 34px;
  height: 34px;
}

.admin-side-title strong,
.admin-side-title small {
  display: block;
}

.admin-side-title small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.admin-side-nav nav {
  display: grid;
  gap: 6px;
}

.admin-side-nav nav button {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
  text-align: left;
  font-weight: 850;
}

.admin-side-nav nav button:hover,
.admin-side-nav nav button.active {
  border-color: rgba(37, 99, 235, 0.22);
  background: var(--success-soft);
  color: var(--accent-strong);
}

.admin-side-nav nav small {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
}

.admin-side-note {
  display: grid;
  gap: 4px;
  border: 1px dashed rgba(37, 99, 235, 0.32);
  border-radius: var(--radius);
  background: #fbfdff;
  padding: 11px;
}

.admin-side-note strong {
  color: var(--accent-strong);
}

.admin-side-note span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.admin-workspace {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.admin-workspace-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 10px 30px rgba(20, 32, 42, 0.045);
  padding: 18px;
}

.admin-workspace-head h2 {
  margin: 4px 0 5px;
  font-size: 30px;
  line-height: 1.08;
  letter-spacing: 0;
}

.admin-workspace-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.admin-tabs button {
  min-height: 38px;
  border-radius: 6px;
  padding: 8px 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.admin-tabs button.active {
  background: var(--surface-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}

.admin-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(20, 32, 42, 0.045);
}

.admin-card + .admin-card {
  margin-top: 16px;
}

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

.admin-card-head.flat {
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
}

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

.admin-card-head p {
  margin-top: 4px;
  color: var(--muted);
}

.admin-card-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.admin-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.admin-list-row {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
}

.row-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--accent);
}

.row-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.row-main strong,
.row-main span {
  overflow-wrap: anywhere;
}

.row-main span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.compact-form {
  margin: 0;
  padding: 16px;
}

.sticky-save-bar {
  position: sticky;
  bottom: 92px;
  z-index: 3;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  padding: 12px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

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

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 9px;
  text-align: left;
  vertical-align: middle;
}

.table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.report-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.report-table td,
.report-table th {
  min-width: 120px;
}

.report-table th {
  background: #fbfcfd;
}

.report-table td:first-child,
.report-table th:first-child,
.report-table td:nth-child(2),
.report-table th:nth-child(2) {
  min-width: 190px;
}

.attempts-list {
  display: grid;
  gap: 8px;
}

.attempt-row-card {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) minmax(190px, 1.4fr) minmax(82px, 0.45fr) minmax(150px, 0.8fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
}

.attempt-row-card:hover {
  border-color: rgba(37, 99, 235, 0.24);
  box-shadow: 0 10px 24px rgba(15, 24, 33, 0.06);
}

.attempt-row-user,
.attempt-row-item,
.attempt-row-result,
.attempt-row-meta {
  min-width: 0;
}

.attempt-row-user strong,
.attempt-row-user span,
.attempt-row-item strong,
.attempt-row-item span,
.attempt-row-result strong,
.attempt-row-result span,
.attempt-row-meta small {
  display: block;
}

.attempt-row-user strong,
.attempt-row-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attempt-row-user span,
.attempt-row-item span,
.attempt-row-result span,
.attempt-row-meta small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.attempt-row-result strong {
  font-size: 18px;
}

.attempt-row-meta {
  display: grid;
  justify-items: start;
  gap: 4px;
}

.attempt-row-actions {
  justify-content: flex-end;
  min-width: 220px;
}

.report-panel {
  overflow: hidden;
}

.report-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.report-content {
  min-width: 0;
}

.report-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  margin: 0;
}

.report-metrics div,
.report-drawer-metrics span {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 13px;
}

.report-metrics strong,
.report-drawer-metrics strong {
  display: block;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}

.report-metrics span,
.report-drawer-metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.report-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
  margin: 0;
}

.report-filter-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.report-filter-field.wide {
  grid-column: span 2;
}

.report-filter-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.report-filter-field input,
.report-filter-field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.report-filter-field input:focus,
.report-filter-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.report-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 4px;
  margin-bottom: 0;
}

.report-tabs button {
  min-height: 36px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 13px;
  font-weight: 850;
}

.report-tabs button.active {
  background: var(--accent);
  color: #fff;
}

.matrix-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.matrix-table {
  min-width: 820px;
}

.matrix-table th {
  vertical-align: top;
  background: var(--surface-soft);
}

.matrix-cell,
.link-button {
  width: 100%;
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  text-align: left;
}

.link-button {
  padding: 0;
  font-weight: 850;
}

.link-button span {
  color: var(--muted);
  font-size: 12px;
}

.matrix-cell {
  min-width: 112px;
  border: 1px solid var(--line);
  padding: 9px;
}

.matrix-cell strong,
.matrix-cell span {
  display: block;
}

.matrix-cell span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.matrix-cell.passed {
  border-color: rgba(37, 99, 235, 0.32);
  background: var(--success-soft);
  color: var(--accent-strong);
}

.matrix-cell.failed,
.matrix-cell.timeout {
  border-color: rgba(180, 35, 24, 0.24);
  background: var(--danger-soft);
  color: var(--danger);
}

.matrix-cell.not_started {
  background: var(--surface-warm);
  color: var(--amber);
}

.report-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.report-mini-card,
.question-analytics-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 15px;
}

.report-mini-card h4,
.question-analytics-card h4 {
  margin: 0;
  font-size: 16px;
}

.report-mini-card p,
.question-analytics-card p {
  margin: 0;
  color: var(--muted);
}

.mini-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-metrics span,
.option-stats span {
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 850;
}

.question-analytics {
  display: grid;
  gap: 12px;
}

.question-analytics-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.question-score {
  display: grid;
  min-width: 68px;
  min-height: 42px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--success-soft);
  color: var(--accent-strong);
  font-weight: 900;
}

.question-score.warm {
  background: var(--surface-warm);
  color: var(--amber);
}

.question-score.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.option-stats {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.attempt-review-directory {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.attempt-review-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 11px;
  text-align: left;
}

.attempt-review-button.active {
  border-color: rgba(37, 99, 235, 0.4);
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.attempt-review-button strong,
.attempt-review-button small {
  display: block;
}

.attempt-review-button small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.report-review-backdrop {
  z-index: 45;
  padding: 24px;
  place-items: center;
  background: rgba(15, 24, 33, 0.42);
}

.modal.report-review-modal {
  position: relative;
  width: min(1360px, calc(100vw - 48px));
  max-width: none;
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border-radius: 12px;
  padding: 0;
}

.report-review-scroll {
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 34px;
  scrollbar-gutter: stable;
}

.modal.report-review-modal .modal-close {
  position: absolute;
  top: 18px;
  right: 28px;
  z-index: 2;
}

.attempt-review-card {
  display: grid;
  gap: 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.attempt-review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 0 56px 18px 0;
  border-bottom: 1px solid var(--line);
}

.attempt-review-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.attempt-review-head h4 {
  margin: 4px 0 5px;
  font-size: 22px;
  line-height: 1.15;
}

.attempt-review-head p {
  margin: 0;
  color: var(--muted);
}

.attempt-review-score {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.attempt-review-score span {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.attempt-review-score strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-size: 18px;
}

.attempt-answer-list {
  display: grid;
  gap: 14px;
}

.attempt-answer-card {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 18px 20px 18px 22px;
}

.attempt-answer-card.is-correct {
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow: inset 4px 0 0 rgba(37, 99, 235, 0.28);
}

.attempt-answer-card.is-wrong {
  border-color: rgba(180, 35, 24, 0.2);
  box-shadow: inset 4px 0 0 rgba(180, 35, 24, 0.24);
}

.attempt-answer-card.is-pending {
  border-color: rgba(217, 119, 6, 0.22);
  box-shadow: inset 4px 0 0 rgba(217, 119, 6, 0.28);
}

.attempt-answer-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  align-items: start;
}

.attempt-answer-title span,
.attempt-answer-title em,
.attempt-answer-lines span {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.attempt-answer-title em {
  justify-self: end;
  border-radius: 999px;
  background: var(--surface-soft);
  padding: 5px 8px;
}

.attempt-answer-title em.correct {
  color: var(--accent-strong);
}

.attempt-answer-title em.wrong {
  color: var(--danger);
}

.attempt-answer-title em.pending {
  color: #b45309;
}

.attempt-answer-title strong {
  grid-column: 1 / -1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.4;
}

.attempt-answer-lines {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.attempt-answer-lines > div {
  display: grid;
  gap: 7px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 12px;
}

.answer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.answer-chips b {
  max-width: 100%;
  overflow-wrap: anywhere;
  border-radius: 0;
  background: transparent;
  padding: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
}

.answer-chips b.correct {
  color: var(--accent-strong);
}

.answer-chips b.wrong {
  color: var(--danger);
}

.answer-chips b.pending {
  color: #b45309;
}

.attempt-review-actions {
  justify-content: flex-start;
  margin-top: -2px;
}

.open-answer-field textarea {
  min-height: 150px;
  max-height: clamp(180px, 32dvh, 340px);
  overflow: auto;
  resize: none;
  margin-bottom: 14px;
  padding-bottom: 16px;
}

.attempt-answer-explanation {
  margin: 0;
  border-top: 1px solid rgba(15, 24, 33, 0.08);
  padding-top: 10px;
  color: var(--muted);
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.users-admin-panel {
  overflow: hidden;
}

.access-key-table {
  max-width: 100%;
  overflow: hidden;
  margin-top: 18px;
}

.access-key-table .table {
  table-layout: fixed;
}

.access-key-table th,
.access-key-table td {
  overflow-wrap: anywhere;
}

.access-key-table th:first-child,
.access-key-table td:first-child {
  width: 48%;
}

.access-key-table th:nth-child(2),
.access-key-table td:nth-child(2) {
  width: 30%;
}

.access-key-table th:nth-child(3),
.access-key-table td:nth-child(3) {
  width: 22%;
}

.access-key-table code {
  display: block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}

.user-management-layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.85fr) minmax(420px, 1.4fr);
  gap: 16px;
  padding-top: 14px;
}

.user-directory {
  display: grid;
  align-content: start;
  gap: 8px;
}

.user-directory-grid {
  grid-template-columns: 1fr;
  padding-top: 14px;
}

.user-card-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 10px;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.user-card-row:hover,
.user-card-row.is-active {
  border-color: rgba(37, 99, 235, 0.38);
  background: var(--accent-soft);
}

.user-card-row:hover {
  transform: translateY(-1px);
}

.user-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.user-card-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.user-card-main strong,
.user-card-main small {
  overflow-wrap: anywhere;
}

.user-card-main small,
.user-card-stats small {
  color: var(--muted);
  font-size: 12px;
}

.user-card-stats {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.user-card-stats small {
  border-radius: 999px;
  background: var(--surface);
  padding: 3px 7px;
}

.user-detail-panel,
.user-detail-placeholder {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #fff, #fbfcfe);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.user-detail-panel.in-modal {
  border: 0;
  max-height: min(860px, calc(100vh - 72px));
  overflow: auto;
  border-radius: inherit;
  background: transparent;
  padding: 24px 30px 24px 24px;
  box-shadow: none;
  box-sizing: border-box;
  scrollbar-gutter: stable;
}

.user-detail-placeholder {
  display: grid;
  min-height: 260px;
  place-items: center;
  color: var(--muted);
  border-style: dashed;
  box-shadow: none;
}

.user-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.user-detail-head h3 {
  margin: 3px 0;
}

.user-detail-head p {
  margin: 0;
  color: var(--muted);
}

.user-detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.user-detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.user-detail-metrics div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px;
}

.user-detail-metrics strong {
  display: block;
  font-size: 22px;
  line-height: 1;
}

.user-detail-metrics span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.user-detail-section {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.user-detail-section h4 {
  margin: 0;
}

.user-profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.user-profile-grid label {
  display: grid;
  gap: 5px;
}

.user-profile-grid label.wide {
  grid-column: span 2;
}

.user-profile-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.user-profile-grid input,
.user-profile-grid select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  outline: none;
}

.user-profile-grid input:focus,
.user-profile-grid select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.assignment-check-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  padding-right: 2px;
}

.assignment-check-list.compact {
  max-height: 180px;
}

.assignment-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.assignment-section-head h4 {
  margin: 0;
}

.assignment-picker-panel {
  display: grid;
  gap: 9px;
  border: 1px dashed rgba(37, 99, 235, 0.32);
  border-radius: var(--radius);
  background: var(--accent-soft);
  padding: 10px;
}

.assignment-picker-panel > strong {
  color: var(--accent-strong);
  font-size: 12px;
  text-transform: uppercase;
}

.access-check-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
}

.access-check-card:has(input:checked) {
  border-color: rgba(37, 99, 235, 0.34);
  background: var(--accent-soft);
}

.access-check-card span {
  display: grid;
  min-width: 0;
}

.access-check-card strong,
.access-check-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.access-check-card small {
  color: var(--muted);
}

.user-attempt-list {
  display: grid;
  gap: 8px;
}

.user-attempt-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
}

.user-attempt-item div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.user-attempt-item span:not(.status-pill) {
  color: var(--muted);
  font-size: 12px;
}

.users-table {
  table-layout: fixed;
}

.users-table th:first-child,
.users-table td:first-child {
  width: 34%;
}

.users-table th:nth-child(2),
.users-table td:nth-child(2) {
  width: 150px;
}

.users-table th:nth-child(3),
.users-table td:nth-child(3) {
  width: 190px;
}

.user-edit-fields {
  display: grid;
  grid-template-columns: minmax(120px, 1.2fr) minmax(100px, 1fr) minmax(100px, 1fr);
  gap: 8px;
}

.users-table input,
.users-table select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  outline: none;
}

.users-table input:focus,
.users-table select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.report-drawer {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 24, 33, 0.28);
}

.report-drawer-panel {
  width: min(560px, 100%);
  height: 100%;
  overflow: auto;
  border-left: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 22px;
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h3 {
  margin: 4px 0 6px;
  font-size: 24px;
}

.drawer-head p {
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.report-drawer-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.drawer-section {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.drawer-section h4 {
  margin: 0;
}

.drawer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 11px;
}

.drawer-row strong,
.drawer-row span {
  display: block;
}

.drawer-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.drawer-actions {
  display: flex;
  justify-content: flex-start;
}

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

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px 20px 20px var(--nav-rail-space);
  background: rgba(15, 24, 33, 0.44);
  z-index: 40;
}

.modal {
  width: min(620px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 22px;
}

.confirm-backdrop {
  z-index: 64;
  background: rgba(15, 24, 33, 0.5);
  backdrop-filter: blur(2px);
}

.confirm-dialog {
  width: min(480px, calc(100vw - var(--nav-rail-space) - 44px));
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: calc(var(--radius) + 4px);
  background: #fff;
  box-shadow: 0 26px 70px rgba(15, 24, 33, 0.24);
  padding: 22px;
}

.confirm-dialog-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  font-size: 22px;
  font-weight: 900;
}

.confirm-dialog-icon.primary {
  background: var(--accent-soft);
  color: var(--accent);
}

.confirm-dialog-icon.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.confirm-dialog-content h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.2;
}

.confirm-dialog-content p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.confirm-dialog-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
  margin-top: 4px;
}

.user-modal-backdrop {
  z-index: 42;
  align-items: start;
  padding-top: 44px;
}

.user-modal {
  position: relative;
  width: min(1040px, calc(100vw - 40px));
  max-height: min(860px, calc(100vh - 72px));
  overflow: hidden;
  border-radius: var(--radius);
  padding: 0;
}

.user-modal .modal-close {
  position: absolute;
  top: 14px;
  right: 22px;
  z-index: 2;
}

.user-modal .user-detail-head {
  padding-right: 48px;
}

.question-modal {
  width: min(920px, 100%);
}

.readonly-field {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 12px 14px;
  color: var(--text);
  font-weight: 850;
}

.rich-question-field {
  gap: 9px;
}

.rich-editor-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 6px;
}

.rich-tool {
  min-width: 34px;
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-weight: 900;
  line-height: 1;
}

.rich-tool:hover {
  background: #eaf1ff;
  color: var(--primary);
}

.rich-tool.wide {
  min-width: 86px;
  justify-content: space-between;
  padding: 0 10px;
  font-size: 13px;
}

.rich-tool.italic {
  font-style: italic;
}

.rich-tool.underline {
  text-decoration: underline;
}

.rich-tool.strike {
  text-decoration: line-through;
}

.rich-tool-divider {
  width: 1px;
  align-self: stretch;
  background: var(--line);
  margin: 0 4px;
}

.rich-question-input {
  display: block;
  min-height: 220px;
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 13px 14px;
  line-height: 1.55;
  outline: none;
}

.rich-question-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.rich-question-input:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
}

.rich-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 14px;
}

.rich-content {
  color: var(--text);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.rich-content h3,
.rich-content h4,
.rich-content h5,
.rich-content h6,
.rich-content p,
.rich-content div {
  margin: 0 0 10px;
}

.rich-content strong,
.rich-content b {
  font-weight: 900;
}

.rich-content h3 {
  font-size: 24px;
}

.rich-content h4 {
  font-size: 21px;
}

.rich-content h5 {
  font-size: 17px;
}

.rich-content h6 {
  font-size: 15px;
}

.rich-content ul,
.rich-content ol {
  display: grid;
  gap: 6px;
  margin: 8px 0 14px;
  padding-left: 30px;
  list-style-position: outside;
}

.rich-content li {
  min-width: 0;
  padding-left: 3px;
}

.rich-content li::marker {
  color: var(--accent);
  font-weight: 900;
}

.question-prompt {
  margin: 0 0 14px;
  max-width: 980px;
}

.quiz-question-title,
.attempt-question-title {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 26px;
  line-height: 1.12;
}

.quiz-stage .quiz-question-title {
  position: relative;
  width: fit-content;
  max-width: min(720px, 100%);
  margin: 0 0 20px;
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 12px;
  background: rgba(239, 246, 255, 0.58);
  box-shadow: 0 6px 18px rgba(20, 32, 42, 0.04);
  padding: 13px 16px;
  color: #132235;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.12;
}

.attempt-question-title {
  grid-column: 1 / -1;
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  background: var(--accent-soft);
  padding: 11px 13px;
  font-size: 18px;
}

.attempt-answer-prompt {
  grid-column: 1 / -1;
}

.help-backdrop {
  z-index: 42;
}

.help-modal {
  width: min(920px, calc(100vw - 40px));
}

.help-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.help-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 14px;
}

.help-block h4 {
  margin: 0 0 9px;
  color: var(--text);
  font-size: 15px;
}

.help-block ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.45;
}

.help-block li::marker {
  color: var(--accent);
}

.course-modal {
  width: min(1340px, calc(100vw - var(--nav-rail-space) - 36px));
  transition: width 180ms ease, max-height 180ms ease;
}

.course-modal.quiz-active {
  display: flex;
  flex-direction: column;
  width: min(1480px, calc(100vw - var(--nav-rail-space) - 44px));
  min-height: min(820px, 82dvh);
  max-height: min(940px, calc(100dvh - 44px));
  overflow: hidden;
  border-radius: calc(var(--radius) + 2px);
}

.modal-subtitle {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.course-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.summary-metric {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 14px;
}

.summary-metric strong {
  display: block;
  color: var(--text);
  font-size: 26px;
  line-height: 1;
}

.summary-metric span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 750;
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.modal-question-list {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.quiz-head {
  align-items: flex-start;
  gap: 16px;
}

.quiz-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.quiz-stat {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  border-radius: 10px;
  padding: 9px 14px;
  background: var(--surface-soft);
  color: #475768;
  font-weight: 850;
}

.quiz-stat.success {
  background: var(--success-soft);
  color: var(--accent-strong);
}

.quiz-stat.warm {
  background: var(--surface-warm);
  color: var(--amber);
}

.quiz-stat.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.quiz-stage {
  display: flex;
  flex-direction: column;
  align-content: stretch;
  flex: 1;
  min-height: clamp(420px, 58dvh, 720px);
  overflow-y: auto;
  padding: 0 8px 2px 0;
  scrollbar-gutter: stable;
}

.quiz-question-body {
  display: flex;
  flex-direction: column;
  min-height: clamp(260px, 34dvh, 520px);
  padding-bottom: 18px;
}

.quiz-stage h3 {
  margin: 0 0 12px;
  font-size: 24px;
  line-height: 1.2;
}

.question-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 18px;
  max-width: 100%;
}

.question-nav button {
  width: 38px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 850;
}

.question-nav button.active {
  border-color: var(--accent);
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.question-nav button.answered {
  background: var(--success-soft);
  color: var(--accent-strong);
}

.quiz-footer-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: auto;
  border-top: 1px solid rgba(15, 24, 33, 0.08);
  background: #fff;
  box-shadow: 0 -12px 20px rgba(255, 255, 255, 0.92);
  padding: 14px 0 8px;
}

.quiz-actions,
.quiz-finish-actions {
  justify-content: flex-end;
  margin: 0;
}

.modal-close {
  min-height: 38px;
  width: 38px;
  min-width: 38px;
  border-radius: 8px;
}

.course-tests {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.course-tests h3 {
  margin: 0;
}

.linked-test-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
}

.linked-test-block h4,
.linked-test-block p {
  margin: 0;
}

.linked-test-block p {
  margin-top: 5px;
  color: var(--muted);
}

.result-card {
  display: grid;
  gap: 7px;
  place-items: center;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  text-align: center;
}

.result-card.passed {
  border-color: #60a5fa;
  background: var(--success-soft);
  color: var(--accent-strong);
}

.result-card.failed {
  border-color: #f0a099;
  background: var(--danger-soft);
  color: var(--danger);
}

.result-card.review {
  border-color: #f3d38d;
  background: var(--surface-warm);
  color: var(--amber);
}

.result-card strong {
  font-size: 48px;
  line-height: 1;
}

.option-editor {
  display: grid;
  gap: 9px;
}

.option-editor-row {
  display: grid;
  grid-template-columns: 1fr 46px;
  gap: 8px;
  align-items: center;
}

.correct-toggle {
  display: grid;
  height: 46px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.correct-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.correct-toggle span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-soft);
  font-weight: 900;
}

.correct-toggle input:checked + span {
  background: var(--accent);
  color: #fff;
}

.question-image {
  display: block;
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  margin: 10px 0 14px;
}

.question-image.preview {
  max-height: 180px;
}

.modal h3 {
  margin: 0;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: 420px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--text);
  color: #fff;
  padding: 13px 15px;
  box-shadow: var(--shadow);
  z-index: 20;
}

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

.profile-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 18px;
}

.profile-tabs button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  padding: 10px 14px;
  cursor: pointer;
}

.profile-tabs button.active {
  border-color: rgba(37, 99, 235, 0.38);
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
}

.achievement-list {
  display: grid;
  gap: 10px;
}

.achievement-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.achievement-card.earned {
  border-color: rgba(37, 99, 235, 0.26);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.06), #fff);
}

.achievement-card span,
.achievement-card small {
  color: var(--muted);
}

.achievement-card code {
  justify-self: start;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
  padding: 4px 8px;
  font-weight: 800;
}

.admin-list.stacked {
  gap: 14px;
}

.group-row {
  align-items: start;
}

.row-wide {
  grid-column: 1 / -1;
}

.compact-editor {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  background: #fbfdff;
  padding: 14px;
}

.group-picker-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.group-picker-card {
  display: grid;
  grid-template-columns: 1fr 38px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 11px;
  min-width: 0;
}

.group-picker-card strong,
.group-picker-card span {
  display: block;
}

.group-picker-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-hidden-checks {
  display: none;
}

.inline-picker-popover {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.inline-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.assignment-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

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

.assignment-check-column {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.assignment-check-column > strong {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
}

.review-queue-row .row-main p {
  margin: 8px 0 0;
  color: var(--text);
  line-height: 1.45;
}

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

.weak-topic-card .mini-metrics,
.service-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.service-status-grid {
  margin-top: 0;
}

.service-status-grid .summary-metric {
  min-height: 96px;
}

.study-hint {
  margin-top: 12px;
}

@media (max-width: 1320px) {
  :root {
    --nav-rail-space: 92px;
    --viewport-gutter: 18px;
  }

  .app-header {
    gap: 14px;
    padding: 12px 18px;
  }

  .header-stats {
    gap: 10px;
  }

  .header-stats span {
    min-width: 46px;
  }

  .header-actions {
    gap: 8px;
  }

  .header-actions .user-chip {
    max-width: 260px;
  }

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

  .main {
    padding-left: calc(var(--nav-rail-space) + var(--viewport-gutter));
    padding-right: var(--viewport-gutter);
  }

  .course-modal.quiz-active {
    min-height: min(760px, 82dvh);
  }

  .quiz-stage .quiz-question-title {
    font-size: 24px;
  }

  .question-nav {
    gap: 6px;
  }

  .question-nav button {
    width: 34px;
    height: 32px;
    border-radius: 7px;
  }

  .answer-button {
    min-height: 48px;
    padding: 12px 14px;
  }
}

@media (max-width: 1280px) {
  :root {
    --nav-rail-space: 0px;
  }

  .nav-rail,
  .nav-rail:hover,
  .nav-rail:focus-within {
    left: 14px;
    right: 14px;
    top: auto;
    bottom: 14px;
    transform: none;
    width: auto;
    height: 62px;
    grid-template-columns: 1fr auto;
    grid-template-rows: 1fr;
    border-radius: 18px;
    padding: 8px;
  }

  .nav-rail-list {
    grid-auto-flow: column;
    grid-auto-columns: 46px;
    align-content: center;
    overflow-x: auto;
  }

  .nav-rail-footer {
    align-content: center;
  }

  .nav-rail-button {
    grid-template-columns: 42px;
  }

  .nav-rail-label,
  .nav-rail:hover .nav-rail-label,
  .nav-rail:focus-within .nav-rail-label {
    display: none;
  }

  .main {
    padding: 18px 18px 92px;
  }

  .home-hero,
  .home-metrics {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    padding: 14px 14px 88px;
  }

  .course-modal,
  .course-modal.quiz-active {
    width: calc(100vw - 28px);
    max-width: none;
  }

  .course-modal.quiz-active {
    min-height: auto;
    max-height: calc(100dvh - 102px);
  }

  .quiz-head {
    display: grid;
  }

  .quiz-toolbar {
    justify-content: flex-start;
  }

  .quiz-stat {
    min-height: 36px;
    padding: 7px 11px;
  }

  .quiz-stage {
    padding-right: 4px;
  }

  .quiz-footer-actions {
    padding-top: 16px;
  }
}

@media (max-width: 980px) {
  .auth-page,
  .workspace,
  .learning-hero,
  .learning-layout,
  .course-detail-head,
  .profile-hero,
  .profile-grid,
  .course-create-layout,
  .calendar-board,
  .course-player,
  .admin-workbench,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-side-nav {
    position: static;
  }

  .profile-progress-list.two-column {
    grid-template-columns: 1fr;
  }

  .profile-progress-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .quiz-draft-notice {
    grid-template-columns: 1fr;
  }

  .quiz-draft-notice .actions {
    justify-content: flex-start;
  }

  .admin-side-nav nav {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .admin-workspace-head {
    grid-template-columns: 1fr;
  }

  .report-metrics {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .report-filter-field.wide {
    grid-column: span 2;
  }

  .attempt-row-card,
  .attempt-answer-lines {
    grid-template-columns: 1fr;
  }

  .attempt-row-actions {
    justify-content: flex-start;
    min-width: 0;
  }

  .report-review-backdrop {
    padding: 18px;
  }

  .modal.report-review-modal {
    width: calc(100vw - 36px);
    max-width: none;
    max-height: calc(100vh - 36px);
  }

  .user-management-layout,
  .user-profile-grid {
    grid-template-columns: 1fr;
  }

  .user-profile-grid label.wide {
    grid-column: auto;
  }

  .user-detail-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .user-modal {
    width: calc(100vw - 28px);
    max-height: calc(100vh - 36px);
  }

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

  .users-admin-panel {
    overflow-x: auto;
  }

  .auth-brand {
    min-height: 460px;
  }

  .app-header {
    position: static;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .header-stats,
  .header-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .main {
    padding: 20px 20px 92px;
  }

  .course-modal,
  .course-modal.quiz-active {
    width: calc(100vw - 32px);
    min-height: auto;
    max-height: calc(100dvh - 104px);
  }

  .course-summary-grid {
    grid-template-columns: 1fr;
  }

  .course-player-nav {
    position: static;
    max-height: none;
    overflow: auto;
  }

  .course-detail-page {
    width: 100%;
  }

  .course-detail-head h1 {
    font-size: 24px;
  }

  .course-chapter-tabs {
    padding-bottom: 6px;
  }

  .course-chapter-tabs button {
    min-width: 156px;
  }

  .chapter-editor-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .course-player-nav,
  .course-player-progress {
    border: 0;
  }

  .course-player-stage {
    padding: 16px;
  }

  .admin-list-row {
    grid-template-columns: 42px 1fr;
  }

  .row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .assignment-columns,
  .assignment-columns.two,
  .service-status-grid,
  .weak-topic-card .mini-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .user-modal-backdrop {
    padding: 12px;
  }

  .user-modal {
    width: 100%;
    padding: 0;
  }

  .user-detail-panel.in-modal {
    padding: 18px 22px 18px 18px;
  }

  .confirm-dialog {
    width: 100%;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    padding: 18px;
  }

  .confirm-dialog-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .confirm-dialog-actions {
    justify-content: stretch;
  }

  .confirm-dialog-actions .btn {
    flex: 1;
  }

  .user-detail-head {
    display: grid;
  }

  .user-modal .user-detail-head {
    padding-right: 40px;
  }

  .help-button {
    left: 14px;
    bottom: 14px;
    width: 48px;
    height: 48px;
  }

  .auth-page .help-button {
    top: 18px;
    right: 18px;
    bottom: auto;
    left: auto;
  }

  .help-content {
    grid-template-columns: 1fr;
  }

  .auth-brand,
  .auth-panel {
    padding: 24px;
  }

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

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

  .learning-hero {
    padding: 18px;
  }

  .learning-hero h2,
  .admin-workspace-head h2 {
    font-size: 26px;
  }

  .report-metrics,
  .report-drawer-metrics,
  .question-analytics-card,
  .attempt-review-score,
  .attempt-answer-title {
    grid-template-columns: 1fr;
  }

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

  .report-filter-field.wide {
    grid-column: auto;
  }

  .report-drawer-panel {
    width: 100%;
  }

  .report-review-backdrop {
    padding: 10px;
  }

  .modal.report-review-modal {
    width: calc(100vw - 20px);
    max-width: none;
    max-height: calc(100vh - 20px);
  }

  .report-review-scroll {
    max-height: calc(100vh - 20px);
    padding: 18px;
  }

  .attempt-review-head {
    display: grid;
    padding-right: 42px;
  }

  .attempt-answer-title em {
    justify-self: start;
  }

  .drawer-row {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    display: grid;
  }

  .actions {
    justify-content: stretch;
  }

  .actions .btn {
    flex: 1;
  }

  .quiz-stage h3 {
    font-size: 22px;
  }

  .answer-button {
    min-height: 56px;
    font-size: 16px;
  }

  .quiz-footer-actions {
    justify-content: stretch;
  }
}
