:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --surface-strong: #eef6f5;
  --text: #17202a;
  --muted: #657182;
  --line: #dce3e8;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --teal-soft: #e1f3ef;
  --blue: #2563eb;
  --amber: #b45309;
  --amber-soft: #fff4dc;
  --red: #be123c;
  --red-soft: #ffe8ee;
  --green: #15803d;
  --green-soft: #e5f8eb;
  --shadow: 0 14px 34px rgba(29, 41, 57, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  width: 100%;
  height: 100%;
}

html {
  overflow: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
  overflow: hidden;
  color: var(--text);
  background: var(--bg);
  letter-spacing: 0;
}

.top-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 1200;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  color: #ffffff;
  background: #0f766e;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(15, 118, 110, 0.24);
  transform: translateX(-50%);
}

.top-toast svg {
  width: 18px;
  height: 18px;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  border: 0;
  cursor: pointer;
}

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

.app-shell {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 450px;
  min-height: 100%;
  height: 100%;
  overflow: hidden;
}

.sidebar,
.memory-panel {
  background: #fbfcfd;
  border-color: var(--line);
  padding: 20px;
  height: 100vh;
  min-height: 0;
  overflow-y: auto;
}

.sidebar {
  border-right: 1px solid var(--line);
}

.memory-panel {
  border-left: 1px solid var(--line);
}

.brand,
.memory-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand strong,
.brand span,
.course-item strong,
.course-item small,
.document-row strong,
.document-row span,
.history-item span,
.history-item small,
.task-button strong,
.task-button small {
  display: block;
}

.brand strong {
  font-size: 24px;
}

.auth-card {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.auth-heading,
.auth-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.auth-heading strong {
  font-size: 14px;
}

.auth-status {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: #eef2f7;
  font-size: 11px;
  font-weight: 900;
}

.auth-status.synced {
  color: var(--green);
  background: var(--green-soft);
}

.auth-status.syncing,
.auth-status.pending,
.auth-status.checking {
  color: var(--blue);
  background: #eaf1ff;
}

.auth-status.error,
.auth-status.unavailable {
  color: var(--amber);
  background: var(--amber-soft);
}

.auth-card small,
.auth-email {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.auth-email {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-form {
  display: grid;
  gap: 8px;
}

.auth-form input {
  height: 38px;
}

.auth-button {
  flex: 1 1 0;
  min-height: 34px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
}

.auth-button.primary {
  color: white;
  background: var(--teal);
}

.auth-button.secondary {
  color: var(--teal-dark);
  border: 1px solid rgba(15, 118, 110, 0.22);
  background: var(--teal-soft);
}

.auth-button.ghost {
  color: var(--muted);
  border: 1px solid var(--line);
  background: white;
}

.bi {
  display: inline-grid;
  gap: 2px;
}

.bi small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-transform: none;
}

.brand span,
.course-item small,
.document-row span,
.history-item small,
.task-button small,
.eyebrow,
.empty-state span,
.parse-message {
  color: var(--muted);
  font-size: 12px;
}

.course-form {
  margin-top: 28px;
}

.course-form label,
.settings-grid label span,
.requirement-box span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
  border-radius: 8px;
  outline: none;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 106px;
  padding: 12px;
  resize: vertical;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.13);
}

.icon-button,
.create-course-button,
.upload-button,
.primary-action,
.secondary-action,
.task-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 8px;
}

.icon-button {
  color: white;
  background: var(--teal);
}

.create-course-button {
  min-width: 76px;
  height: 42px;
  padding: 0 12px;
  color: white;
  background: var(--teal);
  font-size: 14px;
  font-weight: 900;
}

.create-course-button.full-width {
  width: 100%;
}

.create-course-button:hover {
  background: var(--teal-dark);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.34);
}

.modal-card {
  width: min(440px, 100%);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-heading,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-heading h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}

.modal-form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.modal-form label span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.modal-actions {
  justify-content: flex-end;
}

.auth-dialog-status {
  margin: -4px 0 0;
  padding: 10px 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  font-size: 13px;
  line-height: 1.45;
}

.auth-dialog-status.error {
  color: var(--amber);
  border-color: rgba(180, 83, 9, 0.28);
  background: var(--amber-soft);
}

.relevance-dialog {
  width: min(520px, 100%);
}

.relevance-dialog-body {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.relevance-dialog-body p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}

.relevance-file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.relevance-file-row > svg {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  color: var(--amber);
}

.relevance-file-row div {
  min-width: 0;
}

.relevance-file-row strong,
.relevance-file-row span {
  display: block;
  overflow-wrap: anywhere;
}

.relevance-summary {
  font-size: 14px;
  line-height: 1.45;
}

.relevance-actions .secondary-action,
.relevance-actions .create-course-button {
  gap: 7px;
}

.settings-launcher {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  background: var(--teal);
  box-shadow: 0 12px 30px rgba(15, 118, 110, 0.18);
  font-size: 14px;
  font-weight: 900;
}

.settings-launcher:hover {
  background: var(--teal-dark);
}

.settings-launcher svg {
  width: 18px;
  height: 18px;
}

.settings-backdrop {
  z-index: 50;
}

.feedback-thread-backdrop {
  z-index: 60;
}

.feedback-reply-backdrop {
  z-index: 70;
}

.settings-dialog {
  width: min(860px, calc(100vw - 36px));
  height: min(680px, calc(100vh - 36px));
  max-height: min(88vh, 900px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.settings-dialog-body {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
  margin-top: 16px;
  overflow: hidden;
}

.settings-nav {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  font-size: 14px;
  font-weight: 800;
  text-align: left;
}

.settings-nav-item:hover {
  background: rgba(255, 255, 255, 0.72);
}

.settings-nav-item.active {
  color: var(--teal-dark);
  border-color: var(--line);
  background: white;
  box-shadow: 0 5px 16px rgba(15, 23, 42, 0.06);
}

.settings-nav-item svg {
  width: 18px;
  height: 18px;
}

.settings-content {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.settings-section-heading {
  margin-bottom: 12px;
}

.settings-section-heading h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

.settings-section-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.settings-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.settings-account-card {
  grid-column: auto;
}

.settings-admin-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  align-content: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.settings-feedback-card {
  padding: 0;
  border: 0;
  background: transparent;
}

.settings-card-head,
.settings-inline-actions,
.settings-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.settings-card-head h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.settings-card-head span,
.settings-muted,
.settings-empty-line,
.settings-summary-row span,
.settings-summary-row time,
.settings-account-stack p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.settings-account-stack {
  display: grid;
  justify-items: start;
  gap: 10px;
}

.settings-account-stack p {
  margin: 0;
}

.settings-account-identity {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.developer-account-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  color: #8a5a00;
  background: #fff0b3;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.settings-logout-button {
  min-height: 34px;
  padding: 0 12px;
}

.settings-account-email {
  color: var(--text) !important;
  font-size: 14px !important;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.settings-inline-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.settings-summary-list {
  display: grid;
  gap: 10px;
  max-height: 280px;
  overflow: auto;
  padding-right: 2px;
}

.settings-summary-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.settings-summary-row strong,
.settings-summary-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-summary-row time {
  white-space: nowrap;
}

.settings-empty-line {
  margin: 0;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: white;
  text-align: center;
}

.settings-feedback-card .feedback-heading {
  margin-bottom: 4px;
}

.settings-feedback-card .feedback-hub {
  grid-template-columns: minmax(0, 1fr);
}

.settings-feedback-card .feedback-list {
  max-height: 360px;
}

input.needs-value {
  border-color: rgba(190, 18, 60, 0.55);
  background: #fff8fa;
  box-shadow: 0 0 0 3px rgba(190, 18, 60, 0.1);
}

input.needs-value::placeholder {
  color: var(--red);
}

.icon-button.quiet {
  width: 34px;
  height: 34px;
  min-height: 34px;
  color: var(--muted);
  background: transparent;
}

.icon-button.quiet:hover {
  color: var(--red);
  background: var(--red-soft);
}

.icon-button.quiet.neutral:hover {
  color: var(--teal);
  background: var(--teal-soft);
}

.course-list,
.history-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.history-panel .history-list {
  margin-top: 0;
}

.course-entry,
.history-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 4px;
  border-radius: 8px;
}

.course-item,
.history-item {
  display: grid;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.course-item {
  grid-template-columns: 10px 1fr 18px;
  padding: 10px;
}

.course-entry.active,
.history-entry.active {
  background: var(--surface-strong);
}

.course-entry .icon-button,
.history-entry .icon-button {
  justify-self: end;
}

.course-color {
  width: 10px;
  height: 36px;
  border-radius: 999px;
}

.workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.topbar-brand {
  min-width: 220px;
}

.course-heading {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.course-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.course-switcher select {
  flex: 1 1 auto;
  width: min(420px, 100%);
  min-width: 220px;
  height: 44px;
  color: var(--text);
  font-size: 24px;
  font-weight: 900;
}

.course-switcher .create-course-button,
.course-switcher .icon-button.quiet {
  flex: 0 0 auto;
}

.course-switcher .icon-button.quiet {
  border: 1px solid var(--line);
  background: white;
}

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

.language-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.language-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  color: var(--teal-dark);
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
  background: var(--teal-soft);
  font-size: 15px;
  font-weight: 900;
}

.language-control select {
  height: 42px;
  min-width: 132px;
}

.eyebrow {
  font-weight: 900;
  margin: 0 0 6px;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.14;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 18px;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(320px, 480px) minmax(0, 1fr);
  gap: 18px;
  min-height: 0;
}

.main-grid > *,
.panel,
.left-column {
  min-width: 0;
  min-height: 0;
}

.left-column {
  display: grid;
  gap: 18px;
  align-content: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

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

.upload-button,
.primary-action,
.secondary-action {
  flex: 0 0 auto;
  padding: 0 14px;
  font-weight: 800;
}

.upload-button {
  color: white;
  background: var(--teal);
}

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

.primary-action {
  color: white;
  background: var(--blue);
}

.secondary-action {
  color: var(--text);
  border: 1px solid var(--line);
  background: white;
}

.secondary-action.active {
  color: var(--teal-dark);
  border-color: rgba(15, 118, 110, 0.28);
  background: var(--teal-soft);
}

.secondary-action:hover {
  border-color: #c2ccd4;
  background: var(--surface-muted);
}

.upload-button input {
  display: none;
}

.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.parse-message {
  margin: -4px 0 12px;
}

.document-list,
.result-list,
.generated-stack {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.document-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto 34px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.document-row.no-status {
  grid-template-columns: 38px minmax(0, 1fr) 34px;
}

.document-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 8px;
}

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

.task-button {
  min-height: 64px;
  justify-content: flex-start;
  padding: 0 12px;
  color: var(--text);
  border: 1px solid var(--line);
  background: var(--surface-muted);
  font-weight: 800;
  text-align: left;
}

.task-button.selected {
  color: var(--teal-dark);
  border-color: rgba(15, 118, 110, 0.45);
  background: var(--teal-soft);
}

.assessment-mode-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.assessment-mode-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  min-height: 52px;
  padding: 8px 10px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  text-align: left;
}

.assessment-mode-button svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.assessment-mode-button span,
.assessment-mode-button strong,
.assessment-mode-button small {
  display: block;
}

.assessment-mode-button strong {
  color: var(--text);
  font-size: 14px;
}

.assessment-mode-button small {
  margin-top: 2px;
  font-size: 11px;
}

.assessment-mode-button.selected {
  color: var(--teal-dark);
  border-color: rgba(15, 118, 110, 0.32);
  background: white;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.exam-time-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.exam-time-toggle,
.exam-time-minutes {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.exam-time-toggle input {
  width: 18px;
  height: 18px;
}

.exam-time-toggle span,
.exam-time-minutes span {
  font-size: 13px;
  font-weight: 800;
}

.exam-time-minutes input {
  width: 78px;
  height: 36px;
}

.exam-time-minutes.disabled {
  opacity: 0.45;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.settings-grid.knowledge-settings {
  grid-template-columns: minmax(0, 1fr);
}

.settings-grid label span,
.requirement-box span {
  margin-bottom: 8px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 68px;
  padding-top: 22px;
}

.toggle-row input {
  width: 18px;
  height: 18px;
}

.toggle-row span {
  margin: 0;
  color: var(--text);
  line-height: 1.25;
  white-space: normal;
}

.requirement-box {
  display: block;
  margin-top: 14px;
}

#extraRequirement,
#feedbackBody {
  resize: none;
  overflow: hidden;
}

.output-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  max-height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.output-heading {
  z-index: 1;
  padding-bottom: 12px;
  background: white;
}

.output-panel > .generated-stack,
.output-panel > .empty-state {
  min-height: 0;
}

.output-panel > .generated-stack {
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  overscroll-behavior: contain;
}

.output-panel > .empty-state {
  height: 100%;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  white-space: nowrap;
  font-weight: 900;
}

.status-badge {
  padding: 6px 9px;
  font-size: 12px;
}

.status-badge.blocked {
  color: var(--red);
  background: var(--red-soft);
}

.result-item {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.result-item.blocked {
  border-color: rgba(190, 18, 60, 0.28);
  background: #fff8fa;
}

.result-title {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.result-title strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.rich-text {
  min-width: 0;
  max-width: 100%;
  color: #344054;
  font-size: 15px;
  line-height: 1.68;
  overflow-wrap: anywhere;
}

.rich-text p {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 10px 0 0;
  padding-bottom: 2px;
}

.rich-text ul {
  display: grid;
  gap: 6px;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 10px 0 0;
  padding-left: 20px;
}

.rich-text li {
  padding-left: 2px;
}

.rich-text code {
  padding: 1px 5px;
  border-radius: 6px;
  background: #eef2f7;
  font-size: 0.94em;
}

.code-block {
  position: relative;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 12px 0 0;
  padding: 16px;
  border: 1px solid #d2dbe5;
  border-radius: 8px;
  background: #f7fafc;
  color: #102033;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre;
}

.code-block[data-language]::before {
  content: attr(data-language);
  position: sticky;
  left: 0;
  display: inline-block;
  margin: -6px 0 8px;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--muted);
  background: #eef2f7;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 900;
}

.code-block code {
  display: block;
  padding: 0;
  background: transparent;
  font: inherit;
}

.circuit-render {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 12px 0 0;
  padding: 14px;
  border: 1px solid #d7dde6;
  border-radius: 8px;
  background: #ffffff;
}

.circuit-render svg {
  display: block;
  min-width: 560px;
  width: 100%;
  height: auto;
}

.circuit-wire,
.circuit-component,
.circuit-source,
.circuit-symbol,
.circuit-contact,
.circuit-ground-line {
  fill: none;
  stroke: #111827;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.circuit-component {
  stroke-width: 2.1;
}

.circuit-source,
.circuit-symbol,
.circuit-contact {
  fill: #ffffff;
}

.circuit-node {
  fill: #111827;
  stroke: none;
}

.circuit-arrow-line {
  fill: none;
  stroke: #111827;
  stroke-width: 2.1;
  stroke-linecap: round;
  marker-end: url("#circuit-arrow");
}

.circuit-render marker path {
  fill: #111827;
}

.circuit-label,
.circuit-title,
.circuit-polarity,
.circuit-meter-label {
  fill: #111827;
  stroke: #ffffff;
  stroke-linejoin: round;
  stroke-width: 4px;
  paint-order: stroke fill;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: 12px;
  font-weight: 800;
}

.circuit-title {
  font-size: 13px;
}

.circuit-polarity {
  font-size: 13px;
  font-weight: 900;
}

.circuit-meter-label {
  font-size: 13px;
  font-style: normal;
  stroke-width: 3px;
}

.circuit-symbol-name {
  font-style: italic;
}

.circuit-subscript {
  baseline-shift: -18%;
  font-size: 100%;
}

.inline-image,
.inline-diagram-note {
  margin: 12px 0 0;
  border-radius: 8px;
}

.inline-image {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.inline-image img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.inline-image figcaption {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.inline-diagram-note {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px dashed #cfd8e3;
  background: #f8fafc;
}

.inline-diagram-note div {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: var(--muted);
  background: #eef2f7;
}

.inline-diagram-note figcaption {
  display: grid;
  gap: 2px;
}

.inline-diagram-note strong {
  color: var(--text);
}

.inline-diagram-note span {
  color: var(--muted);
  font-size: 12px;
}

.rich-text mjx-container {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.rich-text mjx-container[display="true"] {
  display: block;
  padding-bottom: 4px;
}

.result-body {
  margin-top: 10px;
}

.question-options {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.question-option {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

label.question-option {
  cursor: pointer;
}

.question-option:has(input:focus-visible) {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.question-option.selected,
.question-option:has(input:checked) {
  border-color: #78bdb5;
  background: #edf9f7;
}

.question-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.option-letter {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid #b8c7d3;
  border-radius: 50%;
  font-weight: 700;
  line-height: 1;
}

.multiple-choice .option-letter {
  border-radius: 4px;
}

.question-option.selected .option-letter,
.question-option:has(input:checked) .option-letter {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.option-text,
.option-text .rich-paragraph {
  min-width: 0;
  margin: 2px 0 0;
}

.missing-choice-options {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid #efc36d;
  border-radius: 6px;
  background: #fff8e8;
  color: #8b4d05;
}

.answer-box {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  margin-top: 10px;
  padding: 10px 12px;
  color: #1f3b2c;
  background: #edf8ef;
  border-radius: 8px;
}

.answer-box.rich-text {
  color: #1f3b2c;
}

.result-item,
.answer-box,
.rich-text p,
.rich-text ul,
.code-block,
.rich-text mjx-container {
  scrollbar-width: thin;
  scrollbar-color: #b9c7d2 transparent;
}

.result-item::-webkit-scrollbar,
.answer-box::-webkit-scrollbar,
.rich-text p::-webkit-scrollbar,
.rich-text ul::-webkit-scrollbar,
.code-block::-webkit-scrollbar,
.rich-text mjx-container::-webkit-scrollbar {
  height: 8px;
}

.result-item::-webkit-scrollbar-thumb,
.answer-box::-webkit-scrollbar-thumb,
.rich-text p::-webkit-scrollbar-thumb,
.rich-text ul::-webkit-scrollbar-thumb,
.code-block::-webkit-scrollbar-thumb,
.rich-text mjx-container::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #b9c7d2;
}

.answer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.answer-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 172px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

.empty-state strong {
  color: var(--text);
  margin-top: 8px;
}

.empty-state.compact {
  min-height: 120px;
}

.history-entry {
  grid-template-columns: minmax(0, 1fr) 34px 34px;
  border: 1px solid var(--line);
  background: white;
}

.question-points {
  flex: 0 0 auto;
  padding: 3px 8px;
  color: var(--teal-dark);
  border-radius: 999px;
  background: var(--teal-soft);
  font-size: 12px;
  font-weight: 900;
}

.exam-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 14px;
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 8px;
  background: #f7f9ff;
}

.exam-toolbar.submitted {
  border-color: rgba(15, 118, 110, 0.25);
  background: #f4fbf9;
}

.exam-toolbar > div {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.exam-mode-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 900;
}

.exam-mode-label svg {
  width: 18px;
  height: 18px;
}

.exam-timer {
  font-variant-numeric: tabular-nums;
  font-size: 18px;
  letter-spacing: 0;
}

.exam-total-score {
  color: var(--teal-dark);
  font-size: 20px;
}

.exam-summary,
.exam-grading-error {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.exam-grading-error {
  color: var(--amber);
}

.exam-response-field {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.exam-response-field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.exam-response-field textarea {
  min-height: 92px;
  max-height: 320px;
  resize: none;
  overflow-y: auto;
}

.exam-response-result,
.exam-reference-answer {
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: 8px;
}

.exam-response-result {
  border: 1px solid var(--line);
  background: var(--surface-muted);
}

.exam-reference-answer {
  color: #1f3b2c;
  background: #edf8ef;
}

.exam-response-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.exam-response-heading span {
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
}

.exam-feedback {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.unanswered-text {
  color: var(--muted);
  font-style: italic;
}

.history-entry.active {
  background: var(--surface-strong);
}

.history-item {
  padding: 10px 0 10px 12px;
}

.feedback-list-head,
.feedback-compose-head,
.feedback-thread-header,
.feedback-thread-subhead,
.feedback-message-head,
.feedback-compose-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.feedback-thread-header h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.feedback-thread-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.spotlight-link {
  padding: 0;
  color: var(--teal);
  background: transparent;
  font-size: 13px;
  font-weight: 900;
}

.feedback-list,
.feedback-thread-replies {
  display: grid;
  gap: 10px;
}

.feedback-item {
  width: 100%;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  text-align: left;
}

.feedback-item strong,
.feedback-message-head strong {
  display: block;
}

.feedback-item p,
.feedback-message-head span,
.feedback-item-meta span,
.feedback-inline-status,
.feedback-compose small,
.feedback-compose-actions span,
.feedback-list-head span,
.feedback-thread-subhead span,
.feedback-thread-header time {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.feedback-item p,
.feedback-item-meta span {
  overflow-wrap: anywhere;
}

.feedback-item:hover {
  border-color: #c2ccd4;
  background: white;
}

.feedback-heading {
  align-items: flex-start;
  margin-bottom: 8px;
  padding-bottom: 0;
}

.feedback-banner {
  margin: 0 0 14px;
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.feedback-banner.error {
  color: var(--red);
  background: var(--red-soft);
}

.feedback-banner.success {
  color: var(--green);
  background: var(--green-soft);
}

.feedback-hub {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(340px, 1.05fr);
  gap: 16px;
  min-width: 0;
}

.feedback-board,
.feedback-thread-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.feedback-compose,
.feedback-list-panel,
.feedback-thread-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.feedback-compose {
  align-content: start;
  gap: 10px;
}

.feedback-author-controls {
  display: grid;
  gap: 10px;
}

.feedback-nickname-field {
  display: grid;
  gap: 6px;
}

.feedback-nickname-field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.feedback-list-panel {
  align-content: start;
}

.feedback-compose textarea,
.feedback-reply-form textarea {
  min-height: 132px;
}

.feedback-compose-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.feedback-compose-actions .primary-action span {
  color: #ffffff;
}

.feedback-compose-head strong,
.feedback-list-head strong,
.feedback-thread-subhead strong {
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
}

.feedback-list {
  max-height: 460px;
  overflow: auto;
  padding-right: 2px;
}

.feedback-item {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.feedback-item.active {
  border-color: rgba(15, 118, 110, 0.45);
  background: var(--teal-soft);
}

.feedback-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.feedback-item p {
  margin: 0;
}

.feedback-item-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.feedback-item-stats {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  white-space: nowrap;
}

.feedback-thread-panel {
  align-content: start;
}

.feedback-thread-card {
  background: white;
}

.feedback-thread-dialog {
  width: min(760px, 100%);
  max-height: min(86vh, 820px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.feedback-thread-dialog-body {
  min-height: 0;
  margin-top: 16px;
  overflow-y: auto;
  padding-right: 2px;
}

.feedback-thread-dialog .feedback-thread-card {
  border: 0;
  padding: 0;
  background: white;
}

.feedback-thread-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.feedback-original-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.feedback-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.feedback-icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0 7px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
}

.feedback-icon-action:hover {
  color: var(--text);
  background: rgba(15, 23, 42, 0.06);
}

.feedback-icon-action svg {
  width: 18px;
  height: 18px;
}

.feedback-icon-action span {
  color: currentColor;
  font-size: 13px;
  font-weight: 800;
}

.feedback-delete-button {
  color: var(--red);
}

.feedback-delete-button:hover {
  border-color: rgba(190, 18, 60, 0.3);
  background: var(--red-soft);
}

.feedback-reply-dialog {
  width: min(520px, 100%);
}

.feedback-reply-dialog .feedback-reply-form {
  margin-top: 16px;
  padding-top: 0;
}

.feedback-like-button.active {
  color: #b45309;
  background: transparent;
  opacity: 1;
}

.feedback-like-button.active svg {
  fill: #f5b86b;
  stroke: #b45309;
}

.feedback-message {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
}

.feedback-message.original {
  border: 1px solid rgba(37, 99, 235, 0.12);
  background: #f8fbff;
}

.feedback-original-title h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.feedback-original-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.feedback-original-meta time {
  color: inherit;
  font: inherit;
}

.feedback-message.reply {
  border: 1px solid rgba(15, 118, 110, 0.16);
  background: #f6fcfb;
}

.feedback-message-head {
  flex-wrap: wrap;
}

.feedback-reply-author {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.feedback-message-head .developer-reply-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.feedback-message-body {
  color: #344054;
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: normal;
}

.feedback-reply-form {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding-top: 4px;
}

.feedback-reply-form label {
  display: grid;
  gap: 8px;
}

.feedback-inline-status {
  margin: 0;
}

.memory-section-head,
.announcement-item-head,
.study-board-metrics,
.study-board-columns,
.result-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.announcement-panel,
.search-panel,
.study-board,
.history-panel {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.announcement-list,
.search-result-list,
.study-link-list,
.study-collection-list {
  display: grid;
  gap: 10px;
}

.memory-section-head h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.memory-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.memory-chip.draft {
  color: var(--amber);
  background: var(--amber-soft);
}

.announcement-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.announcement-item p {
  margin: 0;
  color: #344054;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-line;
}

.announcement-item time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.search-input-wrap {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.search-input-wrap:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.13);
}

.search-input-wrap i {
  color: var(--muted);
}

.search-input-wrap input {
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.search-result-item,
.study-link-item,
.study-collection-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  text-align: left;
}

.search-result-item:hover,
.study-link-item:hover,
.study-collection-item:hover {
  border-color: #c2ccd4;
  background: white;
}

.search-result-item span,
.study-link-item span,
.search-result-item small,
.study-link-item small,
.study-collection-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.study-section-head,
.study-collection-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.study-collection-item {
  padding: 10px;
}

.study-collection-item.active {
  border-color: rgba(15, 118, 110, 0.45);
  background: var(--teal-soft);
}

.study-collection-item > button:first-child {
  flex: 1 1 auto;
  display: grid;
  gap: 3px;
  min-width: 0;
  color: inherit;
  text-align: left;
}

.study-collection-detail {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.collection-select {
  width: auto;
  min-width: 124px;
  max-width: 180px;
  height: 34px;
  padding: 0 28px 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.study-board-metrics {
  justify-content: flex-start;
  gap: 8px;
}

.memory-mini-metric {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.memory-mini-metric strong,
.memory-mini-metric span {
  display: block;
}

.memory-mini-metric strong {
  font-size: 20px;
  line-height: 1;
}

.memory-mini-metric span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.study-board-columns {
  align-items: stretch;
}

.study-board-section {
  flex: 1 1 0;
  display: grid;
  gap: 10px;
}

.study-board-section > strong {
  font-size: 14px;
}

.study-create-button {
  min-width: 0;
  min-height: 34px;
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.study-create-button svg {
  width: 16px;
  height: 16px;
}

.document-note {
  display: block;
  margin-top: 4px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.result-tools {
  flex-wrap: wrap;
  justify-content: flex-start;
  margin-top: 12px;
}

.bookmark-toggle,
.study-status-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.bookmark-toggle.active {
  color: #8a5300;
  border-color: rgba(180, 83, 9, 0.28);
  background: #fff5e6;
}

.study-status-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.study-status-button.active {
  color: var(--teal-dark);
  border-color: rgba(15, 118, 110, 0.28);
  background: var(--teal-soft);
}

.result-item.focused {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.focus-flash {
  animation: focus-flash 1.2s ease;
}

@keyframes focus-flash {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.18);
  }
  35% {
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.14);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

@media (max-width: 1180px) {
  html,
  body {
    overflow: auto;
  }

  .app-shell {
    position: static;
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .sidebar,
  .workspace,
  .memory-panel {
    height: auto;
    overflow: visible;
  }

  .memory-panel {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 940px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace {
    padding: 18px;
  }

  .topbar,
  .panel-heading,
  .result-title,
  .feedback-list-head,
  .feedback-compose-head,
  .feedback-thread-header,
  .feedback-thread-subhead,
  .feedback-message-head,
  .feedback-compose-actions,
  .feedback-item-top,
  .feedback-item-meta,
  .memory-section-head,
  .announcement-item-head,
  .study-board-metrics,
  .study-board-columns,
  .result-tools {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .course-heading,
  .course-switcher,
  .course-switcher select {
    width: 100%;
  }

  .course-switcher {
    flex-wrap: wrap;
  }

  .course-switcher select {
    min-width: 0;
  }

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

  .output-panel {
    height: auto;
    max-height: none;
    min-height: auto;
  }

  .output-panel > .generated-stack {
    overflow: visible;
    padding-right: 0;
  }

  .feedback-hub {
    grid-template-columns: 1fr;
  }

  .settings-dialog-body {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .settings-nav {
    display: flex;
    overflow-x: auto;
  }

  .settings-nav-item {
    width: auto;
    min-width: max-content;
  }

  .settings-content {
    overflow: visible;
    padding-right: 0;
  }

  .settings-content-grid,
  .settings-feedback-card .feedback-hub {
    grid-template-columns: 1fr;
  }

  .settings-account-card {
    grid-column: auto;
  }

  .feedback-list {
    max-height: none;
  }
}

@media (max-width: 620px) {
  .task-grid,
  .settings-grid,
  .assessment-mode-control {
    grid-template-columns: 1fr;
  }

  .exam-time-setting {
    align-items: flex-start;
    flex-direction: column;
  }

  .exam-toolbar {
    grid-template-columns: 1fr;
  }

  .exam-toolbar .primary-action {
    width: 100%;
  }

  .document-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .document-row .status-badge,
  .document-row .icon-button {
    grid-column: 2;
    justify-self: start;
  }

  .settings-summary-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .settings-summary-row time {
    grid-column: 2;
  }

  .settings-launcher {
    left: 18px;
    bottom: 18px;
  }

  h1 {
    font-size: 24px;
  }
}
