.student-detail-frame[data-page="works"] {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

.works-page {
  width: min(100%, 1240px);
  min-height: 100%;
  margin: 0 auto;
  padding: 24px 20px 48px;
  color: #2D2D2D;
  -webkit-font-smoothing: antialiased;
}

.works-header {
  min-height: 108px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
}

.works-heading { min-width: 0; }
.works-heading > .student-back-button { margin-bottom: 8px; }
.layout-desktop .works-heading > .student-back-button { margin-bottom: 8px; }
.works-heading p,
.works-section-head p {
  margin: 0 0 5px;
  color: #999893;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}
.works-heading h1 {
  margin: 0;
  color: #2D2D2D;
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 760;
  line-height: 1.04;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.works-heading > span {
  display: block;
  margin-top: 8px;
  color: #777671;
  font-size: 13px;
  line-height: 1.45;
  text-wrap: pretty;
}

.works-status,
.works-list-state {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  background: #EFEEEA;
  color: #696863;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.works-status.active,
.works-list-state.active { background: #EAF6EE; color: #39764D; }
.works-status.submitted,
.works-list-state.submitted { background: #EEF0FB; color: #555EC0; }
.works-status.accepted,
.works-list-state.accepted { background: #DFF4E8; color: #246B49; }
.works-status.revision_requested,
.works-list-state.revision { background: #FFE7DF; color: #9A3D28; }
.works-status.draft,
.works-list-state.draft { background: #FFF4DA; color: #9B6B18; }
.works-status.overdue,
.works-list-state.overdue { background: #FBEDEC; color: #A94E49; }

.works-list,
.works-surface {
  overflow: hidden;
  border-radius: 22px;
  background: #FFFFFF;
  box-shadow:
    0 1px 2px rgba(29, 29, 27, 0.025),
    0 14px 38px rgba(29, 29, 27, 0.055);
}

.works-list-item {
  width: 100%;
  min-height: 88px;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 17px 20px;
  border: 0;
  border-bottom: 1px solid #EFEFEC;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition-property: background-color, transform;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}
.works-list-item:last-child { border-bottom: 0; }
.works-list-item:hover { background: #FAFAF8; }
.works-list-item:active { transform: scale(0.96); }
.works-list-type {
  color: #888782;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}
.works-list-main { min-width: 0; }
.works-list-main strong,
.works-list-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.works-list-main strong { color: #363632; font-size: 14px; font-weight: 700; }
.works-list-main small { margin-top: 5px; color: #8D8C87; font-size: 11px; }

.works-empty,
.works-loading {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 32px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.64);
  color: #92918C;
  text-align: center;
}
.works-empty strong { color: #44443F; font-size: 16px; }
.works-empty span { max-width: 440px; font-size: 12px; line-height: 1.55; text-wrap: pretty; }

.works-detail-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.86fr) minmax(420px, 1.14fr);
  align-items: start;
  gap: 16px;
}
.works-surface { padding: 22px; }
.works-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.works-section-head h2 {
  margin: 0;
  color: #383834;
  font-size: 17px;
  font-weight: 730;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.works-muted { margin: 0; color: #83827D; font-size: 13px; line-height: 1.6; text-wrap: pretty; }

.works-markdown {
  color: #494944;
  font-size: 14px;
  line-height: 1.68;
  overflow-wrap: anywhere;
}
.works-markdown h1,
.works-markdown h2,
.works-markdown h3,
.works-markdown h4 { margin: 22px 0 10px; color: #31312D; line-height: 1.25; text-wrap: balance; }
.works-markdown h1:first-child,
.works-markdown h2:first-child,
.works-markdown h3:first-child { margin-top: 0; }
.works-markdown p,
.works-markdown ul,
.works-markdown ol,
.works-markdown blockquote { margin: 0 0 14px; }
.works-markdown ul,
.works-markdown ol { padding-left: 23px; }
.works-markdown blockquote {
  padding: 12px 14px;
  border-left: 3px solid #A8AFE4;
  border-radius: 0 12px 12px 0;
  background: #F5F5FA;
  color: #5F5E59;
}
.works-markdown img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 16px 0;
  border-radius: 14px;
  outline: 1px solid rgba(0, 0, 0, 0.1);
  outline-offset: -1px;
}
.works-markdown a { color: #5E63CA; text-decoration: underline; text-underline-offset: 3px; }
.works-markdown .md-table-scroll { max-width: 100%; overflow-x: auto; margin: 16px 0; }
.works-markdown table,
.works-editor table { width: 100%; border-collapse: collapse; font-size: 12px; }
.works-markdown th,
.works-markdown td,
.works-editor th,
.works-editor td { min-width: 92px; padding: 9px 10px; border: 1px solid #E6E5E1; vertical-align: top; }
.works-markdown th { background: #F4F4F1; color: #3F3F3A; font-weight: 700; }

.works-prompt-files { margin-top: 22px; padding-top: 18px; border-top: 1px solid #EFEFEC; }
.works-prompt-files h3 { margin: 0 0 10px; color: #555550; font-size: 12px; font-weight: 700; }
.works-file-row {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 7px;
  padding: 7px 8px;
  border-radius: 13px;
  background: #F5F5F2;
}
.works-file-link {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  color: inherit;
  text-decoration: none;
}
.works-file-icon {
  width: 36px;
  height: 36px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: #FFFFFF;
  color: #666BCB;
}
.works-file-copy { min-width: 0; }
.works-file-copy strong,
.works-file-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.works-file-copy strong { color: #4A4A45; font-size: 11px; font-weight: 700; }
.works-file-copy small { margin-top: 2px; color: #999893; font-size: 10px; }
.works-file-remove {
  min-width: 40px;
  min-height: 40px;
  padding: 0 7px;
  border: 0;
  background: transparent;
  color: #AA5C57;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  transition: transform 140ms ease-out;
}
.works-file-remove:active { transform: scale(0.96); }

.works-save-state {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #F1F1EE;
  color: #85847F;
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}
.works-save-state.saving,
.works-save-state.pending { background: #FFF5DF; color: #9A711F; }
.works-save-state.restored { background: #EAF5EC; color: #3E6948; }
.works-save-state.offline,
.works-save-state.error { background: #FFF0E6; color: #8A5633; }

.works-editor-shell {
  overflow: hidden;
  border: 1px solid #E2E2DE;
  border-radius: 16px;
  background: #FFFFFF;
  transition-property: border-color, box-shadow;
  transition-duration: 150ms;
}
.works-editor-shell:focus-within {
  border-color: #A7AADE;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.09);
}
.works-editor-shell.is-disabled { border-color: transparent; background: #F8F8F5; }
.works-editor-toolbar {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding: 5px;
  border-bottom: 1px solid #ECECE8;
  background: #F7F7F4;
  scrollbar-width: none;
}
.works-editor-toolbar::-webkit-scrollbar { display: none; }
.works-editor-toolbar button {
  min-width: 40px;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #666661;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  transition-property: background-color, color, transform;
  transition-duration: 140ms;
}
.works-editor-toolbar button:hover { background: #FFFFFF; color: #353531; }
.works-editor-toolbar button:active { transform: scale(0.96); }
.works-editor-toolbar button:disabled { opacity: 0.55; cursor: wait; }
.works-editor {
  min-height: 330px;
  padding: 18px;
  outline: none;
  color: #3F3F3A;
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.works-editor:empty::before { color: #AAA9A4; content: attr(data-placeholder); pointer-events: none; }
.works-editor h2 { margin: 18px 0 9px; color: #343430; font-size: 19px; line-height: 1.25; text-wrap: balance; }
.works-editor p { margin: 0 0 11px; }
.works-editor ul,
.works-editor ol { margin: 0 0 11px; padding-left: 24px; }
.works-editor img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 14px 0;
  border-radius: 13px;
  outline: 1px solid rgba(0, 0, 0, 0.1);
  outline-offset: -1px;
}

.works-attachments { margin-top: 18px; }
.works-attachments-head {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.works-attachments-head strong,
.works-attachments-head span { display: block; }
.works-attachments-head strong { color: #4B4B46; font-size: 12px; }
.works-attachments-head span { margin-top: 3px; color: #979691; font-size: 10px; line-height: 1.4; text-wrap: pretty; }
.works-attachment-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.works-upload-state {
  min-height: 42px;
  display: inline-flex !important;
  align-items: center;
  margin: 0 !important;
  padding: 0 8px;
  color: #777671 !important;
  font-size: 10px !important;
  font-weight: 650;
}
.works-attach-button,
.works-submit {
  min-height: 42px;
  border: 0;
  border-radius: 13px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition-property: background-color, box-shadow, transform;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}
.works-attach-button { padding: 0 13px; background: #F0F0EC; color: #565651; }
.works-attach-button:hover { background: #E8E8E3; }
.works-attach-button:active,
.works-submit:active { transform: scale(0.96); }
.works-attach-button:disabled,
.works-submit:disabled { opacity: 0.58; cursor: wait; }
.works-no-files { margin-top: 9px; color: #A09F9A; font-size: 11px; }

.works-error {
  margin-top: 14px;
  padding: 11px 13px;
  border-radius: 12px;
  background: #FBEDEC;
  color: #9C4844;
  font-size: 11px;
  line-height: 1.45;
}
.works-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding-top: 17px;
  border-top: 1px solid #EFEFEC;
}
.works-submit-row p { margin: 0; color: #989792; font-size: 10px; line-height: 1.45; text-wrap: pretty; }
.works-submit { min-width: 154px; padding: 0 17px; background: #2D2D2D; color: #FFFFFF; box-shadow: 0 7px 20px rgba(29, 29, 27, 0.14); }
.works-submit:hover { background: #1F1F1F; box-shadow: 0 9px 25px rgba(29, 29, 27, 0.18); }
.works-submitted-note {
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 15px;
  background: #EDF6EF;
  color: #43805A;
}
.works-submitted-note strong,
.works-submitted-note span { display: block; }
.works-submitted-note strong { font-size: 12px; }
.works-submitted-note span { margin-top: 3px; color: #699078; font-size: 10px; font-variant-numeric: tabular-nums; }
.works-review-note {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
  padding: 15px 16px;
  border-radius: 14px;
  line-height: 1.5;
}
.works-review-note span { font-size: 12px; font-weight: 700; }
.works-review-note strong { font-size: 15px; }
.works-review-note p { margin: 0; }
.works-review-note.revision { background: #FFF0EB; color: #843B2B; }
.works-review-note.accepted { background: #E8F7EF; color: #275E44; }
.works-review-files {
  margin-bottom: 18px;
}
.works-review-files > strong {
  display: block;
  margin-bottom: 9px;
  color: #555550;
  font-size: 12px;
}
.works-review-files .works-file-row { background: #EEF0FB; }

.dark .works-page { color: #E3E2DE; }
.dark .works-heading h1,
.dark .works-section-head h2 { color: #E5E4E0; }
.dark .works-heading > span,
.dark .works-list-main small { color: #82817C; }
.dark .works-list,
.dark .works-surface { background: #222220; box-shadow: none; }
.dark .works-list-item { border-bottom-color: #333330; }
.dark .works-list-item:hover { background: #292927; }
.dark .works-list-main strong,
.dark .works-empty strong { color: #DEDDD9; }
.dark .works-empty,
.dark .works-loading { background: #222220; color: #85847F; }
.dark .works-markdown { color: #C8C7C2; }
.dark .works-markdown h1,
.dark .works-markdown h2,
.dark .works-markdown h3,
.dark .works-markdown h4 { color: #E0DFDB; }
.dark .works-markdown img,
.dark .works-editor img { outline-color: rgba(255, 255, 255, 0.1); }
.dark .works-markdown blockquote { background: #2A2A2D; }
.dark .works-markdown th,
.dark .works-markdown td,
.dark .works-editor th,
.dark .works-editor td { border-color: #3A3A36; }
.dark .works-markdown th { background: #2A2A27; color: #E0DFDB; }
.dark .works-prompt-files,
.dark .works-submit-row { border-top-color: #353531; }
.dark .works-file-row { background: #2B2B28; }
.dark .works-file-icon { background: #353531; }
.dark .works-file-copy strong,
.dark .works-attachments-head strong,
.dark .works-review-files > strong { color: #D2D1CD; }
.dark .works-review-files .works-file-row { background: #2B2B35; }
.dark .works-editor-shell { border-color: #41413D; background: #232321; }
.dark .works-editor-shell.is-disabled { border-color: transparent; background: #292927; }
.dark .works-editor-toolbar { border-bottom-color: #3A3A36; background: #2B2B28; }
.dark .works-editor-toolbar button { color: #B3B2AD; }
.dark .works-editor-toolbar button:hover { background: #363633; color: #EFEFEB; }
.dark .works-editor { color: #D4D3CE; }
.dark .works-editor h2 { color: #E5E4E0; }
.dark .works-attach-button { background: #30302D; color: #D0CFCB; }
.dark .works-submit { background: #F0EFEB; color: #2D2D2D; box-shadow: none; }
.dark .works-submit:hover { background: #FFFFFF; box-shadow: none; }

@media (max-width: 980px) {
  .works-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 899px) {
  .works-page { padding: max(env(safe-area-inset-top), 22px) 16px 110px; }
  .works-header {
    min-height: 126px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
  }
  .works-header > .works-status { justify-self: start; margin-top: 7px; }
  .works-heading h1 { font-size: 27px; }
  .works-heading > span { font-size: 12px; }
  .works-list { border-radius: 19px; }
  .works-list-item {
    min-height: 102px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    padding: 15px;
  }
  .works-list-type { grid-column: 1 / -1; font-size: 9px; }
  .works-list-state { max-width: 128px; overflow: hidden; text-overflow: ellipsis; }
  .works-list-main strong,
  .works-list-main small { white-space: normal; }
  .works-list-main small { line-height: 1.45; }
  .works-surface { padding: 17px; border-radius: 19px; }
  .works-detail-grid { gap: 12px; }
  .works-editor { min-height: 300px; padding: 15px; }
  .works-section-head { display: block; }
  .works-save-state { margin-top: 10px; }
  .works-attachments-head,
  .works-submit-row { align-items: stretch; flex-direction: column; }
  .works-attachment-actions { width: 100%; justify-content: stretch; }
  .works-attachment-actions .works-attach-button { width: auto; flex: 1; }
  .works-attach-button,
  .works-submit { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .works-page *,
  .works-page *::before,
  .works-page *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
