:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #172b3a;
  background: #eef3f6;
  --ink: #172b3a;
  --muted: #607181;
  --line: #dbe5eb;
  --surface: #fff;
  --surface-soft: #f7fafb;
  --brand: #0d6471;
  --brand-deep: #084954;
  --accent: #d78a36;
  --success: #28704a;
  --danger: #a64040;
  --radius: 0.8rem;
  --shadow: 0 0.75rem 2rem rgb(27 55 71 / 7%);
}

body {
  margin: 0;
  min-width: 320px;
  line-height: 1.6;
}

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  width: min(1440px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  flex-shrink: 0;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: auto;
  height: 40px;
  max-width: 100%;
  flex: 0 0 auto;
  object-fit: contain;
}

@media (max-width: 768px) {
  .brand-mark {
    height: 32px;
  }
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.primary-nav a,
.nav-button {
  padding: 0.45rem 0.7rem;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: var(--muted);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.primary-nav a:hover,
.primary-nav a:focus-visible,
.nav-button:hover,
.nav-button:focus-visible {
  background: #e4f0f1;
  color: var(--brand-deep);
}

.primary-nav a[aria-current="page"] {
  background: #e4f0f1;
  color: var(--brand-deep);
  font-weight: 700;
}

.container {
  width: min(1180px, calc(100% - 2rem));
  box-sizing: border-box;
  min-height: 60vh;
  margin: 0 auto;
  padding: 2.2rem;
  border: 1px solid rgb(219 229 235 / 70%);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

nav {
  display: flex;
  gap: 1rem;
}

a {
  color: var(--brand);
}

h1,
h2 {
  margin-top: 0;
  color: var(--ink);
  letter-spacing: -0.015em;
}

h1 {
  margin-bottom: 0.55rem;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1.2;
}

h2 {
  margin-bottom: 0.7rem;
  font-size: 1.25rem;
}

h3 {
  margin-top: 0;
  color: var(--ink);
}

.eyebrow {
  margin-bottom: 0.5rem;
  color: var(--brand);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.lead {
  max-width: 72ch;
  color: var(--muted);
  line-height: 1.7;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2.25rem;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid var(--line);
}

.site-search {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 0 0.6rem;
}

.site-search label {
  font-weight: 700;
}

.site-search input {
  box-sizing: border-box;
  flex: 1 1 18rem;
  min-width: 0;
  max-width: 32rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid #b6c6ce;
  border-radius: 0.35rem;
  font: inherit;
}

.site-result-count {
  color: var(--muted);
}

.site-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

.button {
  display: inline-block;
  box-sizing: border-box;
  padding: 0.7rem 1rem;
  border: 1px solid var(--brand);
  border-radius: 0.5rem;
  background: var(--brand);
  color: #fff;
  font: inherit;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.button-secondary {
  border-color: #a9c4c9;
  background: #fff;
  color: var(--brand-deep);
}

.button-danger {
  border-color: var(--danger);
  background: var(--danger);
}

.button:hover,
.button:focus-visible {
  filter: brightness(0.94);
}

.button-small {
  padding: 0.45rem 0.65rem;
  font-size: 0.875rem;
}

.action-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.card-link {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 7rem;
  justify-content: center;
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  text-decoration: none;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.card-link:hover,
.card-link:focus-visible {
  border-color: #9fc4c9;
  box-shadow: 0 0.5rem 1.2rem rgb(27 55 71 / 8%);
  transform: translateY(-1px);
}

.card-link span {
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.management-list-title {
  margin: 0;
  color: var(--brand-deep);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.25;
}

@media (max-width: 600px) {
  .management-list-title { font-size: 1.2rem; }
}

.batch-list-table {
  min-width: 78rem;
  table-layout: fixed;
}

.batch-list-table th:nth-child(1) { width: 23%; }
.batch-list-table th:nth-child(2) { width: 10%; }
.batch-list-table th:nth-child(3) { width: 31%; }
.batch-list-table th:nth-child(4) { width: 6%; }
.batch-list-table th:nth-child(5) { width: 8%; }
.batch-list-table th:nth-child(6) { width: 17%; }
.batch-list-table th:nth-child(7) { width: 5%; }
.batch-list-table th { white-space: nowrap; }
.batch-list-table td { overflow-wrap: anywhere; }
.batch-list-table td:nth-child(4),
.batch-list-table td:nth-child(5),
.batch-list-table td:nth-child(7) { white-space: nowrap; }
.batch-list-time span { display: block; white-space: nowrap; }
.batch-list-time span + span::before { content: "— "; }

.invite-link {
  overflow-wrap: anywhere;
}

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

th,
td {
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

tbody tr:hover {
  background: #fbfcfd;
}

th {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 700;
}

.empty-state,
.notice {
  margin: 2rem 0;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

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

.form-field {
  margin-bottom: 1.25rem;
}

.form-field label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 700;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  box-sizing: border-box;
  padding: 0.7rem 0.75rem;
  border: 1px solid #b6c6ce;
  border-radius: 0.35rem;
  color: inherit;
  font: inherit;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus,
.invitation-link-input:focus {
  border-color: var(--brand);
  outline: 3px solid rgb(13 100 113 / 14%);
}

.form-field textarea {
  resize: vertical;
}

.form-field input[hidden] {
  display: none;
}

.form-card {
  display: grid;
  gap: 0.65rem;
}

.form-card input {
  box-sizing: border-box;
  width: 100%;
  padding: 0.7rem 0.75rem;
  border: 1px solid #b6c6ce;
  border-radius: 0.35rem;
  font: inherit;
}

.portal-card {
  max-width: 46rem;
  margin: 2rem auto;
}

.portal-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 2rem;
  border-bottom: 1px solid var(--line);
}

.portal-tab {
  padding: 0.85rem;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.portal-tab.is-active {
  border-bottom-color: var(--brand);
  color: var(--brand-deep);
}

.portal-panel {
  padding: 1.5rem 0;
}

.portal-panel[hidden] {
  display: none;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

.form-help {
  color: var(--muted);
  font-size: 0.875rem;
}

.card,
.summary-card {
  margin: 1rem 0;
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

fieldset {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
}

legend {
  padding: 0 0.35rem;
  color: var(--muted);
  font-weight: 700;
}

.checkbox-label,
.checkbox-field {
  margin: 0.5rem 0;
}

.required,
.field-error {
  color: var(--danger);
}

.required {
  font-size: 0.8rem;
  font-weight: 400;
}

.field-error {
  margin: 0.4rem 0 0;
}

.field-help,
.table-note {
  color: var(--muted);
  font-size: 0.875rem;
}

.field-help {
  margin: 0.4rem 0 0;
}

.table-note {
  margin: 0.35rem 0 0;
  white-space: pre-wrap;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.inline-form {
  display: inline;
}

.content-section {
  margin-top: 2.5rem;
}

.learner-section {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.learner-shell .content-section {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.learner-section > h2:first-child {
  margin-bottom: 1rem;
}

.learner-header .status-badge {
  flex: 0 0 auto;
  margin-top: 0.25rem;
}

.choice-option {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin: 0.65rem 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: var(--surface-soft);
  cursor: pointer;
}

.choice-option:has(input:checked) {
  border-color: #8dbbc0;
  background: #eef8f8;
}

.choice-option input {
  flex: 0 0 auto;
  margin-top: 0.35rem;
}

.form-group {
  margin: 1rem 0;
}

.form-group label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 700;
}

.form-group textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem;
  border: 1px solid #b6c6ce;
  border-radius: 0.45rem;
  color: inherit;
  font: inherit;
  resize: vertical;
}

.notice.success {
  border-color: #9bc9a9;
  background: #eef8f0;
  color: var(--success);
}

.invitation-content {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.invitation-qr {
  display: block;
  width: 12rem;
  height: 12rem;
  padding: 0.5rem;
  background: #fff;
}

.invitation-details {
  min-width: 0;
  flex: 1;
}

.copy-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  margin-top: 0.45rem;
}

.invitation-link-input {
  min-width: 0;
  flex: 1;
  box-sizing: border-box;
  padding: 0.7rem 0.75rem;
  border: 1px solid #b6c6ce;
  border-radius: 0.35rem;
  color: inherit;
  font: inherit;
}

.secondary-section {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.compact-empty-state {
  margin-top: 1rem;
}

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

.module-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.module-card:hover,
.module-card:focus-visible {
  border-color: #9fc4c9;
  box-shadow: 0 0.4rem 1rem rgb(27 55 71 / 7%);
}

.module-card span {
  color: var(--muted);
  font-size: 0.875rem;
}

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  background: #edf3f5;
  color: var(--muted);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.4;
}

.status-active {
  background: #e9f6ec;
  color: #245f31;
}

.status-not_started,
.status-draft {
  background: #edf3f5;
  color: var(--muted);
}

.status-completed,
.status-submitted {
  background: #e9f6ec;
  color: var(--success);
}

.status-inactive {
  background: #edf0f2;
  color: var(--muted);
}

.status-preparing {
  background: #edf0f2;
  color: #52616b;
}

.status-published {
  background: #fff3d6;
  color: #795600;
}

.status-in_progress {
  background: #e2f1f3;
  color: var(--brand-deep);
}

.status-ended {
  background: #e9f6ec;
  color: #245f31;
}

details summary {
  color: #52616b;
  cursor: pointer;
  font-weight: 700;
}

.list-editor {
  margin: 2rem 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.list-editor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.list-editor-header h2 {
  margin-bottom: 0;
}

.list-editor-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: start;
  margin-bottom: 0.75rem;
}

.list-editor-item textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem;
  border: 1px solid #b6c6ce;
  border-radius: 0.35rem;
  color: inherit;
  font: inherit;
  resize: vertical;
}

.list-item-number {
  min-width: 1.5rem;
  padding-top: 0.65rem;
  color: #52616b;
  font-weight: 700;
  text-align: center;
}

.list-item-actions {
  display: flex;
  gap: 0.35rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.step-progress {
  margin: 1.5rem 0 0;
  color: var(--brand-deep);
  font-weight: 700;
}

.step-panel textarea {
  width: 100%;
  min-height: 12rem;
  box-sizing: border-box;
  padding: 0.85rem;
  border: 1px solid #b6c6ce;
  border-radius: 0.45rem;
  color: inherit;
  font: inherit;
  resize: vertical;
}

.step-actions {
  justify-content: space-between;
}

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

.learner-progress-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.learner-progress-item {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) minmax(0, 2fr);
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.learner-next-step {
  border-left: 0.3rem solid var(--brand);
}

.learner-next-step .button {
  display: inline-block;
  min-width: 12rem;
  text-align: center;
}

.learner-next-step progress {
  width: min(100%, 32rem);
  height: 0.85rem;
  accent-color: var(--brand);
}

.evaluation-evidence {
  margin: 0.45rem 0;
}

.evaluation-evidence summary {
  cursor: pointer;
  color: var(--brand-deep);
}

.status-evidence-insufficient {
  background: #edf0f2;
  color: #4b5660;
}

.status-generated,
.status-generating {
  background: #e8f1f7;
  color: #235879;
}

.status-published {
  background: #e8f3ed;
  color: #246443;
}

.status-failed {
  background: #fbece9;
  color: #8d3427;
}

.content-section progress {
  width: min(100%, 24rem);
  accent-color: var(--brand);
}

.summary-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.summary-metrics > div {
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.summary-metrics strong,
.summary-metrics span {
  display: block;
}

.summary-metrics strong {
  font-size: 1.5rem;
  color: var(--brand-deep);
}

.summary-stage-bars > div {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) 4rem minmax(8rem, 2fr);
  gap: 0.75rem;
  align-items: center;
  margin: 0.5rem 0;
}

.candidate-draft-layout {
  display: grid;
  gap: 1rem;
}

.candidate-draft-layout > .content-section {
  min-width: 0;
  margin-top: 0;
}

.generation-sources {
  margin: 0.7rem 0 1rem;
}

.generation-sources summary {
  cursor: pointer;
  color: var(--brand-deep);
}

@media (min-width: 940px) {
  .candidate-draft-layout.has-candidate {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

@media (max-width: 480px) {
  .summary-stage-bars > div {
    grid-template-columns: 1fr auto;
  }

  .summary-stage-bars progress {
    grid-column: 1 / -1;
    width: 100%;
  }
}

.discussion-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 1rem;
}

.discussion-group-card {
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.discussion-group-card .form-actions:first-child {
  margin-top: 0;
}

.discussion-group-card input,
.discussion-group-card select {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.detail-list > div {
  padding: 1rem;
  background: var(--surface);
}

.batch-version-meta dt:not(:first-child) { margin-top: 0.8rem; }

.detail-list .full-row {
  grid-column: 1 / -1;
}

.detail-list dt {
  margin-bottom: 0.4rem;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 700;
}

.detail-list dd {
  margin: 0;
  line-height: 1.65;
  white-space: pre-wrap;
}

.collapsible-detail dd.is-collapsed {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.text-toggle {
  margin-top: 0.65rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  cursor: pointer;
}

.ai-loading-overlay {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: none;
  place-items: center;
  padding: 1rem;
  background: rgb(31 43 49 / 58%);
}

.ai-loading-overlay.is-visible {
  display: grid;
}

.ai-loading-card {
  display: grid;
  justify-items: center;
  gap: 0.9rem;
  width: min(24rem, calc(100% - 2rem));
  padding: 2rem;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 1rem 3rem rgb(0 0 0 / 22%);
  text-align: center;
}

.ai-loading-card strong {
  font-size: 1.35rem;
}

.ai-loading-spinner {
  width: 2.8rem;
  height: 2.8rem;
  border: 0.3rem solid #cbdadd;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: ai-loading-spin 0.8s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .ai-loading-spinner { animation: none; }
}

.flash {
  margin-bottom: 1.5rem;
  padding: 0.85rem 1rem;
  border-radius: 0.4rem;
}

.flash-success {
  border: 1px solid #65a672;
  background: #eef8f0;
  color: #245f31;
}

.flash-error {
  border: 1px solid #c76a6a;
  background: #fff1f1;
  color: #7d1111;
}

.site-footer {
  width: min(1180px, calc(100% - 2rem));
  box-sizing: border-box;
  margin: 0 auto;
  padding: 1.25rem 0 2rem;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

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

.pre-line,
.pre-wrap,
.text-content {
  white-space: pre-wrap;
  line-height: 1.85;
}

@media (max-width: 680px) {
  .site-header {
    width: min(1440px, calc(100% - 2rem));
    padding: 1rem 0 0.75rem;
  }

  .primary-nav {
    gap: 0;
  }

  .primary-nav a,
  .nav-button {
    padding: 0.35rem 0.45rem;
    font-size: 0.8rem;
  }

  .container {
    width: auto;
    margin: 0;
    padding: 1.25rem;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .action-list {
    grid-template-columns: 1fr;
  }

  .page-header,
  .form-grid,
  .section-header {
    display: block;
  }

  .page-header .button {
    margin-top: 0.5rem;
  }

  .detail-list {
    grid-template-columns: 1fr;
  }

  .detail-list .full-row {
    grid-column: auto;
  }

  .invitation-content {
    display: block;
  }

  .invitation-qr {
    width: min(12rem, 100%);
    height: auto;
    margin: 0 auto 1rem;
  }

  .copy-row {
    display: block;
  }

  .invitation-link-input,
  .copy-row .button {
    width: 100%;
  }

  .copy-row .button {
    margin-top: 0.5rem;
  }

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

  table {
    min-width: 38rem;
  }

  .table-wrap {
    margin-right: -1.25rem;
    padding-right: 1.25rem;
  }

  .list-editor-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .list-item-actions {
    grid-column: 2;
    flex-wrap: wrap;
  }

  .learner-progress-item {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .step-actions .button {
    flex: 1 1 8rem;
  }
}

@media (max-width: 430px) {
  .site-header {
    align-items: flex-start;
  }

  .brand strong {
    font-size: 0.92rem;
  }

  .primary-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .page-header .form-actions,
  .page-header .button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .site-header {
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }

  .primary-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .learner-next-step .button {
    width: 100%;
  }
}

.task-list {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
}

.task-card {
  align-items: center;
  border: 1px solid #d9e2e8;
  border-radius: 0.6rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: 2.5rem minmax(0, 1fr) auto;
  padding: 1rem;
}

.task-order {
  align-items: center;
  background: #eef5f0;
  border-radius: 50%;
  display: flex;
  font-weight: 700;
  height: 2.25rem;
  justify-content: center;
  width: 2.25rem;
}

.task-main h2 {
  font-size: 1rem;
  margin: 0.35rem 0 0;
}

.task-meta,
.task-actions,
.radio-group {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.task-type-panel {
  border: 1px solid #d9e2e8;
  border-radius: 0.6rem;
  margin: 1.25rem 0;
  padding: 1rem;
}

.task-type-panel[hidden] {
  display: none;
}

.option-editor {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.option-row {
  align-items: center;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 2rem minmax(0, 1fr) auto auto;
}

.option-label {
  font-weight: 700;
  text-align: center;
}

.option-answer,
.checkbox-field {
  align-items: center;
  display: flex;
  gap: 0.4rem;
}

@media (max-width: 720px) {
  .task-card {
    align-items: start;
    grid-template-columns: 2.5rem minmax(0, 1fr);
  }

  .task-actions {
    grid-column: 1 / -1;
  }

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

  .option-answer,
  .option-row .button {
    grid-column: 2;
  }
}
audio {
  width: 100%;
  max-width: 36rem;
}
.teaching-audio-player audio { display: block; width: 100%; min-height: 54px; }
.teaching-audio-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.65rem; margin: 0.8rem 0; }
.teaching-audio-actions .button { min-height: 3.25rem; padding: 0.7rem 0.35rem; font-weight: 700; touch-action: manipulation; }
@media (max-width: 430px) {
  .teaching-audio-actions { grid-template-columns: 1fr 1fr; }
  .teaching-audio-toggle { grid-column: 1 / -1; grid-row: 1; }
}

@media (max-width: 430px) {
  .site-header {
    width: calc(100% - 1rem);
  }
}

@media (max-width: 640px) {
  .portal-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.import-status, .import-jump { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1rem 0; }
.import-status span { padding: 0.4rem 0.75rem; border-radius: 999px; background: #e7f1f2; font-weight: 700; }
.import-jump a { padding: 0.45rem 0.65rem; border: 1px solid var(--line); border-radius: 0.45rem; text-decoration: none; }
.import-progress-nav.is-sticky { position: sticky; top: 0; z-index: 5; padding: 0.1rem 0; background: var(--surface); }
.import-progress { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; margin: 1rem 0; }
.import-progress-step { display: flex; align-items: center; gap: 0.65rem; min-width: 0; padding: 0.7rem; border: 1px solid var(--line); border-radius: 0.65rem; color: var(--muted); background: var(--surface); font-size: 0.9rem; }
.import-progress-step.is-complete { border-color: #8fcbb1; background: #edf8f2; color: #176344; }
.import-progress-step.is-current { border-color: #5697d7; background: #edf5ff; color: #175a9b; }
.import-progress-step.is-blocked { border-color: #cf8078; background: #fff1ef; color: #8a332b; }
.import-progress-step strong, .import-progress-step small { display: block; }
.import-progress-step small { margin-top: 0.1rem; font-size: 0.75rem; }
.import-progress-number { display: inline-grid; flex: 0 0 1.8rem; width: 1.8rem; height: 1.8rem; place-items: center; border-radius: 50%; background: #e0e5eb; color: #596574; font-weight: 700; }
.import-progress-step.is-complete .import-progress-number { background: #22835d; color: #fff; }
.import-progress-step.is-current .import-progress-number { background: #1767b3; color: #fff; }
.import-progress-step.is-blocked .import-progress-number { background: #a53f35; color: #fff; }
.import-action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; margin: 1rem 0 1.5rem; }
.import-action-panel { min-width: 0; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); scroll-margin-top: 6rem; }
.import-action-panel h2 { margin-top: 0; }
.import-action-panel .notice { margin: 0.75rem 0; }
.import-action-scroll { max-height: 10rem; overflow: auto; }
.import-action-warnings { margin: 0.7rem 0; }
.import-action-warnings summary { cursor: pointer; font-weight: 700; }
.import-review-section { margin: 0.75rem 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); scroll-margin-top: 6rem; }
.import-review-section > summary { padding: 0.9rem 1rem; cursor: pointer; font-weight: 700; }
.import-review-section[open] > summary { border-bottom: 1px solid var(--line); }
.import-review-body { padding: 0.25rem 1rem 1rem; }
.import-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem 1.2rem; }
.import-field { min-width: 0; padding: 0.65rem; border: 1px solid var(--line); border-radius: 0.45rem; }
.import-field dt { color: var(--muted); font-size: 0.9rem; }
.import-field dd { margin: 0.2rem 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.import-item { padding: 0.8rem 0; border-top: 1px solid var(--line); }
.teacher-audio-player { display: block; width: min(100%, 38rem); }
.teacher-audio-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.unavailable-option { color: var(--muted); cursor: default; }
.feature-status {
  margin-left: 0.2rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  white-space: nowrap;
}
.import-choice { margin: 0.5rem 0; padding: 0.55rem; border: 1px solid var(--line); border-radius: 0.45rem; }
.import-choice label { cursor: pointer; }
.import-raw { max-height: 30rem; padding: 0.8rem; overflow: auto; border: 1px solid var(--line); background: var(--surface-soft); white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 680px) {
  .import-progress { grid-template-columns: 1fr; }
  .import-action-grid { grid-template-columns: 1fr; }
  .import-action-panel, .import-review-section { scroll-margin-top: 8rem; }
  .import-fields { grid-template-columns: 1fr; }
  .import-jump { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.summary-task-steps {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  padding-left: 1.5rem;
}
.summary-task-steps li { color: #607181; }
.summary-task-steps li.is-current { color: #0d6471; font-weight: 700; }
.summary-task-steps li.is-complete { color: #287347; }
