.app-shell {
  padding-right: 10px;
  padding-left: 10px;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 44px;
  margin-right: -10px;
  margin-left: -10px;
  padding: 0 10px;
  border-bottom: 1px solid #293241;
  background: #2f3746;
  box-shadow: 0 2px 8px rgb(15 23 42 / 14%);
  color: #f8fafc;
}

.app-topbar__crumbs {
  min-width: 0;
  overflow: hidden;
}

.app-topbar .breadcrumb {
  flex-wrap: nowrap;
  align-items: center;
  margin-bottom: 0;
  overflow: hidden;
  white-space: nowrap;
}

.app-topbar .breadcrumb-item,
.app-topbar .breadcrumb-item::before {
  color: #b9c3d1;
}

.app-topbar .breadcrumb-item a,
.app-topbar__next a {
  color: #eef4ff;
}

.app-topbar .breadcrumb-item {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-topbar__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}

.app-topbar__next a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid #7aa7f7;
  border-radius: 999px;
  background: #e8f0ff;
  color: #173f8a;
  padding: 4px 12px;
  font-weight: 750;
  text-decoration: none;
}

.app-topbar__next a:hover {
  border-color: #a9c4fb;
  background: #f2f6ff;
  color: #102e66;
  text-decoration: none;
}

.app-topbar__menu-button {
  min-height: 30px;
  border: 1px solid #61708a;
  border-radius: 5px;
  background: #3b4658;
  color: #eef4ff;
  padding: 3px 10px;
  font-weight: 700;
}

.app-topbar__account-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid #7c8ba4;
  border-radius: 50%;
  background: #eef4ff;
  color: #223047;
  padding: 0;
}

.app-topbar__account-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.app-topbar__menu-button:hover,
.app-topbar__menu-button:focus,
.app-topbar__account-button:hover,
.app-topbar__account-button:focus {
  background: #465269;
  color: #fff;
}

.study-review {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(320px, 420px) 148px;
  gap: 14px;
  min-height: calc(100vh - 54px);
  padding-top: 8px;
}

.study-review__pdf,
.study-review__question,
.study-review__rail {
  min-height: 0;
}

.study-review__pdf {
  background: #d8d8d8;
}

.study-review--problem {
  grid-template-columns: minmax(620px, 1fr) minmax(220px, 330px) 210px;
}

.study-review__pdf iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 62px);
  border: 0;
}

.study-pdf-stack {
  display: grid;
  grid-auto-rows: minmax(0, 1fr);
  gap: 8px;
  background: transparent;
}

.study-pdf-pane {
  min-height: 0;
  background: #d8d8d8;
}

.study-pdf-pane iframe {
  min-height: 0;
}

.study-pdf-placeholder {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 62px);
  background: #e8eaed;
}

.study-pdf-placeholder--compact {
  min-height: 0;
  height: 100%;
}

.study-pdf-placeholder__page {
  width: min(62%, 520px);
  min-height: 68vh;
  border: 1px solid #c5ccd6;
  border-radius: 3px;
  background: #fff;
  padding: 34px;
  box-shadow: 0 8px 24px rgb(15 23 42 / 12%);
}

.study-pdf-placeholder__title {
  color: #1f2937;
  font-size: 1.3rem;
  font-weight: 700;
}

.study-pdf-placeholder__meta {
  margin-top: 6px;
  color: #6b7280;
}

.study-pdf-placeholder__line {
  height: 12px;
  margin-top: 28px;
  border-radius: 999px;
  background: #dce2ea;
}

.study-pdf-placeholder__line--short {
  width: 64%;
  margin-top: 12px;
}

.study-pdf-placeholder__box {
  height: 180px;
  margin-top: 34px;
  border: 1px solid #d7dde6;
  border-radius: 4px;
  background:
    linear-gradient(135deg, transparent 49%, #e2e7ef 50%, transparent 51%),
    linear-gradient(45deg, transparent 49%, #e2e7ef 50%, transparent 51%),
    #f7f9fb;
}

.study-review__question {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  overflow: hidden;
}

.study-review--problem .study-review__question {
  grid-template-rows: auto auto;
  align-content: start;
  overflow: visible;
}

.study-panel {
  min-height: 0;
  overflow: auto;
  border: 1px solid #d7dde4;
  border-radius: 6px;
  background: #fff;
  padding: 14px;
}

.study-panel--form {
  overflow: visible;
}

.study-panel--add-explanation {
  padding: 10px;
}

.study-panel--add-explanation h5 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.study-panel--add-explanation textarea {
  display: block;
  height: 66px !important;
  min-height: 66px !important;
  border: 1px solid #ced4da;
  border-radius: 5px;
  padding: 6px 8px;
  resize: vertical;
}

.study-add-explanation-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.study-add-explanation-actions .btn {
  min-width: 60px;
  padding: 4px 10px;
  font-size: 0.9rem;
  font-weight: 650;
}

.study-panel--problem-heading {
  overflow: visible;
  padding: 10px;
}

.study-panel__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.study-panel__heading h4,
.study-panel--form h5,
.study-answer h5 {
  margin: 0;
  font-weight: 650;
}

.study-problem-number {
  color: #17803a;
  font-size: 2rem;
  line-height: 1;
}

.study-problem-pool {
  margin-top: 4px;
  color: #4b5563;
  font-size: 0.92rem;
}

.study-panel__links {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.study-link-button {
  border: 1px solid #c9d1dc;
  border-radius: 5px;
  background: #f8fafc;
  color: #243044;
  padding: 3px 8px;
  font-size: 0.86rem;
  font-weight: 650;
}

.study-link-button--danger {
  border-color: #e3a6a6;
  background: #fff2f2;
  color: #9c1616;
}

.study-link-button:hover {
  background: #edf1f6;
}

.study-link-button--danger:hover {
  background: #ffe4e4;
}

.study-markdown {
  font-size: 1rem;
  line-height: 1.45;
}

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

.study-answer-toggle,
.study-submit {
  border: 1px solid #aeb8c4;
  border-radius: 5px;
  background: #f8fafc;
  padding: 5px 9px;
}

.study-answer-toggle {
  margin-top: 12px;
}

.study-answer {
  margin-top: 12px;
  border-top: 1px solid #e3e8ee;
  padding-top: 12px;
}

.study-answer--hidden {
  display: none;
}

.study-panel--form label {
  margin-bottom: 4px;
  font-size: 0.88rem;
  font-weight: 600;
}

.study-panel--form textarea,
.study-panel--form input {
  width: 100%;
  font-size: 0.95rem;
}

.study-panel--form #id_text {
  min-height: 64px;
  height: 64px;
}

.study-panel--form #id_answer {
  min-height: 150px;
  height: 150px;
}

.study-submit {
  margin-top: 4px;
  background: #121826;
  color: #fff;
}

.study-hidden-frame {
  display: none;
}

.app-page {
  padding-top: 14px;
}

.app-page--narrow {
  max-width: 680px;
  margin-right: auto;
  margin-left: auto;
}

.app-page--settings {
  max-width: 980px;
  margin-right: auto;
  margin-left: auto;
}

.app-page__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.app-page__header h1,
.app-page__header h2,
.app-page__header h3 {
  margin: 0;
  color: #111827;
  font-weight: 700;
}

.app-page__header h1 {
  font-size: 1.45rem;
}

.app-page__header h2 {
  font-size: 1.25rem;
}

.app-page__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.app-eyebrow {
  margin: 0 0 2px;
  color: #657080;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.app-layout {
  display: grid;
  gap: 14px;
}

.app-layout--sidebar {
  grid-template-columns: minmax(0, 1fr) 240px;
}

.app-layout--left-sidebar {
  grid-template-columns: 220px minmax(0, 1fr);
}

.app-document-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) 260px;
  gap: 14px;
  min-height: calc(100vh - 62px);
  padding-top: 8px;
}

.app-document-layout--wide-sidebar {
  grid-template-columns: minmax(520px, 1fr) 320px;
}

.app-document-layout--split {
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr) 240px;
}

.app-document-main {
  min-height: calc(100vh - 62px);
  background: #d8d8d8;
}

.app-document-main iframe,
.app-document-pane iframe {
  display: block;
  width: 100%;
  min-height: calc(100vh - 62px);
  border: 0;
}

.app-document-pane {
  min-height: calc(100vh - 62px);
  background: #d8d8d8;
}

.app-panel {
  border: 1px solid #d7dde4;
  border-radius: 6px;
  background: #fff;
  padding: 14px;
}

.app-panel + .app-panel {
  margin-top: 12px;
}

.app-panel h2,
.app-panel h3,
.app-panel h4,
.app-panel h5 {
  margin-top: 0;
  color: #111827;
  font-weight: 700;
}

.app-panel h2 {
  font-size: 1.2rem;
}

.app-panel h3 {
  font-size: 1.05rem;
}

.app-panel h4,
.app-panel h5 {
  font-size: 1rem;
}

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

.app-action-list a,
.app-action-list button,
.app-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid #c9d1dc;
  border-radius: 5px;
  background: #f8fafc;
  color: #243044;
  padding: 6px 10px;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
}

.app-action-list a:hover,
.app-action-list button:hover,
.app-button:hover {
  background: #edf1f6;
  color: #111827;
  text-decoration: none;
}

.app-button--primary {
  border-color: #7aa7f7;
  background: #e8f0ff;
  color: #173f8a;
}

.app-button--success {
  border-color: #9fd6ad;
  background: #e7f6e7;
  color: #176c22;
}

.app-button--danger {
  border-color: #e3a6a6;
  background: #fff2f2;
  color: #9c1616;
}

.app-button--small {
  min-height: 28px;
  padding: 3px 8px;
  font-size: 0.86rem;
}

.student-today {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(420px, 1.6fr);
  gap: 14px;
  align-items: stretch;
}

.student-dashboard {
  display: grid;
  grid-template-columns: minmax(240px, 0.78fr) minmax(520px, 1.6fr);
  gap: 14px;
  align-items: start;
}

.student-dashboard__today {
  grid-row: span 2;
}

.student-today__main h2,
.student-dashboard__today h2 {
  margin-bottom: 2px;
  font-size: 1.4rem;
}

.student-today__period {
  margin-bottom: 6px;
  color: #334155;
  font-size: 0.95rem;
  font-weight: 700;
}

.student-streak {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 14px;
  border: 1px solid #9fd6ad;
  border-radius: 999px;
  background: #e7f6e7;
  padding: 7px 13px;
  color: #0f5f1a;
}

.student-streak span {
  color: #176c22;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.student-streak strong {
  color: #0b3f12;
  font-size: 1.15rem;
}

.semester-progress {
  max-width: 340px;
  margin-top: 14px;
}

.semester-progress__label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #334155;
  font-size: 0.82rem;
}

.semester-progress__label span {
  color: #657080;
  font-weight: 800;
  text-transform: uppercase;
}

.semester-progress__bar {
  height: 8px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3e8ee;
}

.semester-progress__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #7aa7f7;
}

.student-today__metrics {
  align-content: stretch;
}

.student-dashboard__coach,
.student-dashboard__limits {
  min-width: 0;
}

.coach-state-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.coach-state-card {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 132px;
  border: 1px solid #e3e8ee;
  border-radius: 6px;
  padding: 12px;
  background: #fbfcfe;
}

.coach-state-card span {
  color: #657080;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.coach-state-card strong {
  color: #111827;
  font-size: 1.05rem;
  line-height: 1.25;
}

.coach-state-card p {
  margin: 0;
  color: #475569;
  font-size: 0.88rem;
  line-height: 1.35;
}

.training-status-card {
  display: grid;
  width: 100%;
  min-height: 108px;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.training-status-card > span:first-child {
  color: #657080;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.training-status-icon {
  display: block;
  width: 38px;
  height: 38px;
  margin-top: 4px;
  color: #1f2937;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.training-status-icon--calibration {
  color: #7c3aed;
}

.training-status-icon--deload,
.training-status-icon--rest {
  color: #2563eb;
}

.training-status-icon--training {
  color: #0f766e;
}

.training-status-icon--focus {
  color: #b45309;
}

.training-status-card strong {
  margin-top: 4px;
  color: #111827;
  font-size: 1.05rem;
  line-height: 1.2;
}

.training-status-card small {
  color: #475569;
  font-size: 0.82rem;
  line-height: 1.25;
}

.training-confidence-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  margin-top: 8px;
}

.training-confidence-strip__bar {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3e8ee;
}

.training-confidence-strip__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #1f7ae0;
}

.training-status-modal__hero {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-bottom: 22px;
  text-align: center;
}

.training-status-modal__hero .training-status-icon {
  width: 48px;
  height: 48px;
  margin-top: 0;
}

.training-status-modal__hero h2 {
  margin: 0;
  color: #111827;
  font-size: 1.25rem;
}

.training-status-modal__hero p {
  margin: 0;
  color: #475569;
}

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

.training-factor-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #e3e8ee;
  border-radius: 6px;
  padding: 12px;
  background: #fff;
}

.training-factor-row strong {
  display: block;
  color: #111827;
  font-size: 0.95rem;
}

.training-factor-row small {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.35;
}

.training-factor-row > span {
  color: #111827;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: right;
}

.training-factor-row--stacked {
  align-items: start;
}

.student-limits {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid #e3e8ee;
  border-radius: 6px;
  padding: 12px;
}

.student-dashboard__limits {
  margin-top: 14px;
}

.student-limits__header,
.limit-gauge__label,
.coach-state {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.student-limits__header span,
.limit-gauge__label span,
.coach-state span {
  color: #657080;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.student-limits__header strong {
  color: #111827;
  font-size: 1.1rem;
}

.student-limits__rule {
  margin: -4px 0 0;
  color: #475569;
  font-size: 0.9rem;
}

.limit-gauges {
  display: grid;
  gap: 10px;
}

.limit-gauge {
  display: grid;
  gap: 6px;
}

.limit-gauge__label strong {
  color: #111827;
  font-size: 1rem;
}

.limit-gauge__label small {
  min-width: 78px;
  color: #475569;
  font-size: 0.84rem;
  text-align: right;
}

.limit-gauge__bar {
  height: 14px;
  overflow: hidden;
  border: 1px solid #d4dce7;
  border-radius: 999px;
  background: #f6f8fb;
}

.limit-gauge__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #7aa7f7;
}

.limit-gauge--met .limit-gauge__label span,
.limit-gauge--met .limit-gauge__label strong,
.limit-gauge--met .limit-gauge__label small {
  color: #176c22;
}

.limit-gauge--met .limit-gauge__bar {
  border-color: #9fd6ad;
  background: #e7f6e7;
}

.limit-gauge--met .limit-gauge__bar span {
  background: #30a64a;
}

.coach-state {
  border-top: 1px solid #e3e8ee;
  padding-top: 10px;
}

.coach-state div {
  min-width: 120px;
}

.coach-state strong {
  display: block;
  color: #111827;
  font-size: 1rem;
}

.student-plan-summary {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(420px, 1.8fr);
  gap: 14px;
  align-items: center;
}

.student-plan-summary__reason {
  margin: 8px 0 0;
}

.coach-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.coach-summary__item {
  border: 1px solid #e3e8ee;
  border-radius: 6px;
  padding: 10px;
}

.coach-summary__item span,
.coach-table .coach-learning {
  display: block;
  color: #657080;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

.coach-summary__item strong {
  display: block;
  color: #111827;
  font-size: 1.15rem;
}

.coach-table td {
  white-space: nowrap;
}

.forecast-table td {
  white-space: nowrap;
}

.forecast-table td:last-child {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.forecast-table td a {
  color: inherit;
  text-decoration: none;
}

.forecast-table td a:hover {
  color: #173f8a;
  text-decoration: underline;
}

.forecast-row-link:hover {
  text-decoration: none;
}

.forecast-detail-table td:nth-child(4) {
  max-width: 520px;
  white-space: normal;
}

.student-paused {
  background: #fbfcfe;
}

.coach-pill,
.coach-learning--open {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid #d7dde4;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.8rem;
  font-weight: 750;
}

.coach-pill--recovery {
  border-color: #e3a6a6;
  background: #fff2f2;
  color: #9c1616;
}

.coach-pill--base {
  border-color: #c9d1dc;
  background: #f8fafc;
  color: #243044;
}

.coach-pill--quality,
.coach-learning--open {
  border-color: #7aa7f7;
  background: #e8f0ff;
  color: #173f8a;
}

.workout-complete {
  display: grid;
  gap: 16px;
}

.workout-complete__stats,
.workout-feedback {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.workout-log-table td,
.workout-item-table td {
  white-space: nowrap;
}

.workout-log-table th:first-child,
.workout-log-table td:first-child {
  width: 72px;
  font-variant-numeric: tabular-nums;
}

.workout-year-row td {
  border-top: 1px solid #cbd5e1;
  background: #f1f5f9;
  color: #243044;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
}

.workout-log-table td:nth-child(2),
.workout-item-table td:nth-child(2),
.workout-item-table td:nth-child(3) {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workout-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-left-width: 5px;
}

.workout-hero h2 {
  margin: 10px 0 2px;
  font-size: 1.8rem;
}

.workout-hero--recovery {
  border-left-color: #e3a6a6;
}

.workout-hero--base {
  border-left-color: #c9d1dc;
}

.workout-hero--quality {
  border-left-color: #7aa7f7;
}

.workout-hero__score {
  min-width: 160px;
  border: 1px solid #e3e8ee;
  border-radius: 6px;
  padding: 12px;
  text-align: right;
}

.workout-hero__score span,
.workout-metrics small {
  display: block;
  color: #657080;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.workout-hero__score strong {
  display: block;
  color: #111827;
  font-size: 1.3rem;
}

.workout-metrics {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.workout-complete__stats .study-stat {
  min-width: 160px;
}

.app-table {
  width: 100%;
  margin-bottom: 0;
  border-collapse: collapse;
}

.app-table th,
.app-table td {
  border-bottom: 1px solid #e3e8ee;
  padding: 7px 8px;
  vertical-align: top;
}

.app-table th {
  color: #657080;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

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

.app-table--compact th,
.app-table--compact td {
  padding: 5px 6px;
}

.assignment-difficulty-table td:nth-child(6) {
  min-width: 320px;
}

.assignment-difficulty-rank {
  color: #657080;
  font-weight: 750;
  text-align: right;
  width: 1%;
}

.assignment-difficulty-bar {
  display: flex;
  overflow: hidden;
  height: 12px;
  border: 1px solid #d7dde4;
  border-radius: 999px;
  background: #eef2f6;
  text-decoration: none;
}

.assignment-difficulty-bar__segment {
  min-width: 5px;
}

.assignment-difficulty-bar__segment--easy,
.assignment-difficulty-dot--easy {
  background: #64a46b;
}

.assignment-difficulty-bar__segment--normal,
.assignment-difficulty-dot--normal {
  background: #7398d3;
}

.assignment-difficulty-bar__segment--hard,
.assignment-difficulty-dot--hard {
  background: #d6a23f;
}

.assignment-difficulty-bar__segment--very-hard,
.assignment-difficulty-dot--very-hard {
  background: #c96f45;
}

.assignment-difficulty-bar__segment--challenge,
.assignment-difficulty-dot--challenge {
  background: #293241;
}

.assignment-difficulty-bar__segment--new,
.assignment-difficulty-dot--new {
  background: #cbd2dc;
}

.assignment-difficulty-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin-top: 5px;
  color: #4b5563;
  font-size: 0.74rem;
}

.assignment-difficulty-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.assignment-difficulty-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.assignment-difficulty-hardest {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid #d7dde4;
  border-radius: 999px;
  padding: 2px 8px;
  color: #243044;
  font-size: 0.78rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.assignment-difficulty-hardest:hover {
  color: #111827;
  text-decoration: none;
}

.assignment-difficulty-hardest--hard {
  border-color: #d6a23f;
  background: #fff6df;
}

.assignment-difficulty-hardest--very-hard {
  border-color: #c96f45;
  background: #fff0e8;
}

.assignment-difficulty-hardest--challenge {
  border-color: #293241;
  background: #293241;
  color: #fff;
}

.assignment-difficulty-hardest--challenge:hover {
  color: #fff;
}

.assignment-hard-items td:nth-child(3) {
  min-width: 320px;
}

.review-schedule-table td:nth-child(4) {
  min-width: 220px;
}

.review-schedule-table .app-button {
  min-height: 28px;
  padding: 3px 8px;
}

.review-schedule-mix {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  color: #4b5563;
  font-size: 0.78rem;
}

.review-schedule-mix span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.review-day-table td:nth-child(2) {
  min-width: 320px;
}

.app-form-grid p {
  margin-bottom: 10px;
}

.app-form-grid label {
  display: block;
  margin-bottom: 4px;
  color: #4b5563;
  font-weight: 650;
}

.app-form-grid input,
.app-form-grid select,
.app-form-grid textarea {
  width: 100%;
  border: 1px solid #ced4da;
  border-radius: 5px;
  padding: 6px 8px;
}

.app-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.app-muted {
  color: #657080;
}

.app-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #fff4db;
  color: #7a5600;
  padding: 1px 7px;
  font-size: 0.76rem;
  font-weight: 700;
}

.login-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: #eef2f6;
  padding: 20px;
}

.login-card {
  width: min(100%, 360px);
  border: 1px solid #d7dde4;
  border-radius: 8px;
  background: #fff;
  padding: 22px;
  box-shadow: 0 10px 28px rgb(15 23 42 / 10%);
}

.login-card h1 {
  margin: 0 0 16px;
  color: #111827;
  font-size: 1.35rem;
  font-weight: 750;
}

.login-card label {
  margin-top: 10px;
  margin-bottom: 4px;
  color: #4b5563;
  font-weight: 650;
}

.login-card .btn,
.login-card .app-button {
  margin-top: 14px;
}

.study-review__rail {
  position: sticky;
  top: 52px;
  align-self: start;
}

.study-grade-stack {
  display: grid;
  gap: 6px;
}

.study-grade {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 5px 7px;
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
}

.study-review--problem .study-grade {
  min-height: 30px;
  padding: 4px 7px;
  font-size: 0.88rem;
}

.study-review--problem .study-grade--rewind {
  min-height: 26px;
}

.study-grade:hover {
  filter: brightness(0.96);
  text-decoration: none;
}

.study-grade--easy {
  background: #e7f6e7;
  border-color: #a7d8a7;
  color: #176c22;
}

.study-grade--good {
  background: #e8f0ff;
  border-color: #aebff4;
  color: #1b49a0;
}

.study-grade--hard {
  background: #f7e8e8;
  border-color: #deb0b0;
  color: #801c1c;
}

.study-grade--calc {
  background: #fff4db;
  border-color: #e3c179;
  color: #7a5600;
}

.study-grade--major {
  background: #ffeddc;
  border-color: #ebb27a;
  color: #a24905;
}

.study-grade--miss {
  background: #ffe7e5;
  border-color: #eaa09a;
  color: #b01818;
}

.study-grade--rewind {
  min-height: 28px;
  margin-top: 5px;
  background: #f5f6f8;
  border-color: #d6dbe1;
  color: #7a828c;
  font-size: 0.82rem;
}

.study-stats {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.study-stat,
.study-page-link {
  border: 1px solid #d7dde4;
  border-radius: 5px;
  background: #fff;
}

.study-stat {
  padding: 7px 8px;
}

.study-stat span {
  display: block;
  color: #657080;
  font-size: 0.74rem;
  line-height: 1;
  text-transform: uppercase;
}

.study-stat strong {
  display: block;
  margin-top: 4px;
  color: #111827;
  font-size: 0.94rem;
  line-height: 1.18;
}

.study-difficulty__meter {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  margin-top: 7px;
}

.study-difficulty__meter i {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: #d9dee6;
}

.study-difficulty--level-1 .study-difficulty__meter i:nth-child(-n + 1),
.study-difficulty--level-2 .study-difficulty__meter i:nth-child(-n + 2),
.study-difficulty--level-3 .study-difficulty__meter i:nth-child(-n + 3),
.study-difficulty--level-4 .study-difficulty__meter i:nth-child(-n + 4),
.study-difficulty--level-5 .study-difficulty__meter i:nth-child(-n + 5) {
  background: #253041;
}

.study-stats--problem {
  gap: 8px;
}

.study-stat-box {
  overflow: hidden;
  border: 1px solid #d7dde4;
  border-radius: 5px;
  background: #fff;
}

.study-stat-box__title {
  border-bottom: 1px solid #e3e8ee;
  background: #f8fafc;
  padding: 5px 7px;
  color: #3f4a5a;
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1;
  text-transform: uppercase;
}

.study-stats--problem .study-stat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 8px;
  align-items: baseline;
  border: 0;
  border-bottom: 1px solid #e3e8ee;
  border-radius: 0;
  padding: 5px 7px;
  white-space: nowrap;
}

.study-stats--problem .study-stat:last-child {
  border-bottom: 0;
}

.study-stats--problem .study-stat span {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.66rem;
}

.study-stats--problem .study-stat strong {
  margin-top: 0;
  font-size: 0.84rem;
  line-height: 1.1;
  text-align: right;
  white-space: nowrap;
}

.study-stats--problem .study-difficulty {
  grid-template-columns: minmax(0, 1fr) max-content;
}

.study-stats--problem .study-difficulty__meter {
  grid-column: 1 / -1;
  margin-top: 0;
}

.study-stats--problem + .study-page-link {
  margin-top: 8px;
}

.study-page-link {
  display: block;
  width: 100%;
  margin-top: 12px;
  border-color: #d7dde4;
  background: #f8fafc;
  padding: 8px;
  color: #243044;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
}

.study-page-link:hover {
  background: #edf1f6;
}

.study-problem-answer-row {
  display: grid;
  grid-template-columns: minmax(620px, 1fr) minmax(220px, 330px) 210px;
  gap: 14px;
  margin-top: 12px;
}

.study-answer-document {
  min-height: calc(100vh - 54px);
  background: #d8d8d8;
}

.study-answer-document iframe {
  display: block;
  width: 100%;
  min-height: calc(100vh - 54px);
  border: 0;
}

.study-modal textarea {
  min-height: 140px;
}

.study-modal #id_answer {
  min-height: 260px;
}

.study-modal__preview {
  border: 1px solid #e1e6ed;
  border-radius: 5px;
  background: #f8fafc;
  padding: 10px;
  color: #1f2937;
}

.study-explanation-list__text {
  font-weight: 650;
}

.study-explanation-list__meta {
  margin-top: 3px;
  font-size: 0.82rem;
  opacity: 0.78;
}

.study-edit {
  display: grid;
  grid-template-columns: minmax(420px, 760px) 180px;
  gap: 14px;
  max-width: 980px;
  padding-top: 16px;
}

.study-edit__main .study-panel {
  overflow: visible;
}

.study-edit__main #id_text {
  min-height: 140px;
}

.study-edit__main #id_answer {
  min-height: 320px;
}

.study-edit__side {
  display: grid;
  align-self: start;
  gap: 8px;
}

@media (max-width: 1100px) {
  .app-layout--sidebar,
  .app-layout--left-sidebar,
  .app-document-layout,
  .app-document-layout--wide-sidebar,
  .app-document-layout--split {
    display: block;
  }

  .app-document-main,
  .app-document-pane,
  .app-document-main iframe,
  .app-document-pane iframe {
    min-height: 62vh;
  }

  .app-document-layout > aside,
  .app-layout > aside,
  .app-layout > main {
    margin-top: 12px;
  }

  .workout-metrics {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }

  .study-review {
    grid-template-columns: minmax(420px, 1fr) minmax(300px, 380px);
  }

  .study-review--problem {
    grid-template-columns: minmax(420px, 1fr) minmax(260px, 340px);
  }

  .study-problem-answer-row {
    display: block;
  }

  .study-review__rail {
    position: static;
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
  }

  .study-stats {
    margin-top: 0;
  }

  .study-page-link {
    align-self: start;
    margin-top: 0;
  }

  .student-dashboard {
    grid-template-columns: 1fr;
  }

  .student-dashboard__today {
    grid-row: auto;
  }
}

@media (max-width: 760px) {
  .study-edit {
    display: block;
  }

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

@media (max-width: 760px) {
  .workout-hero {
    display: block;
  }

  .workout-hero__score {
    margin-top: 12px;
    text-align: left;
  }

  .workout-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .coach-state-grid {
    grid-template-columns: 1fr;
  }

  .coach-state-card {
    min-height: auto;
  }
}

@media (max-width: 760px) {
  .study-review {
    display: block;
  }

  .study-review__pdf iframe {
    min-height: 62vh;
  }

  .study-review__question,
  .study-review__rail {
    margin-top: 12px;
  }

  .study-review__rail {
    display: block;
  }

  .study-stats,
  .study-page-link {
    margin-top: 12px;
  }
}
