/* Professional workspaces. Load after the component styles.
   Only interface chrome and explicitly named explanatory text receive smaller
   type. Lesson text, pinyin, translations, quotations and saved evidence keep
   their component typography and their existing natural document flow. */

html.atelier-theme body .shell.workspace-shell .main.page-admin {
  --admin-ink: var(--design-ink, #242935);
  --admin-muted: var(--design-muted, #6d7482);
  --admin-line: var(--design-line, #e4e7ed);
  --admin-accent: var(--design-accent, #384c86);
}

html.atelier-theme body .shell.workspace-shell .main[class] :is(
  .admin-console, .teacher-assessment, .writing-plans, .culture-review,
  .english-review, .course-quality, .maintenance-workspace, .speech-settings
) {
  color: var(--design-ink, #242935);
}

/* A clear, continuous workspace navigation; its existing responsive grid and
   section count remain controlled by the administration component. */
html.atelier-theme body .shell.workspace-shell .main.page-admin .admin-navigation {
  gap: 5px;
  padding: 6px;
  margin-bottom: 26px;
  border: 1px solid var(--design-line, #e4e7ed);
  border-radius: 13px;
  background: var(--design-soft, #f1f4fa);
}
html.atelier-theme body .shell.workspace-shell .main.page-admin .admin-nav-item {
  min-height: 44px;
  border-radius: 8px;
  color: var(--design-muted, #6d7482);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}
html.atelier-theme body .shell.workspace-shell .main.page-admin .admin-nav-item:hover {
  background: var(--design-surface, #fff);
  color: var(--design-accent, #384c86);
}
html.atelier-theme body .shell.workspace-shell .main.page-admin .admin-nav-item.active {
  background: var(--design-surface, #fff);
  color: var(--design-accent, #384c86);
  box-shadow: 0 1px 5px #2429350a;
}
html.atelier-theme body .shell.workspace-shell .main.page-admin .admin-nav-item.active::after {
  left: 20%;
  right: 20%;
  bottom: 3px;
  height: 2px;
  background: var(--design-accent, #384c86);
}

/* Buttons keep readable labels and a consistent touch target. Long translated
   labels wrap instead of forcing a narrow heading or toolbar wider. */
html.atelier-theme body .shell.workspace-shell .main[class] :is(
  .admin-console, .teacher-assessment, .writing-plans, .culture-review,
  .english-review, .course-quality, .speech-settings, .admin-culture-entry,
  .admin-english-entry, .admin-course-quality-entry, .admin-speech-entry
) :is(.admin-button, .btn),
html.atelier-theme body .shell.workspace-shell .main.page-admin .admin-button,
html.atelier-theme body .shell.workspace-shell .main.page-teacher .btn,
html.atelier-theme body .shell.workspace-shell .main[class] .maintenance-workspace button {
  min-height: 40px;
  max-width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--design-line, #e4e7ed);
  border-radius: 9px;
  background: var(--design-surface, #fff);
  color: var(--design-ink, #242935);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  box-shadow: 0 1px 2px #24293504;
}
html.atelier-theme body .shell.workspace-shell .main[class] :is(
  .admin-console, .teacher-assessment, .writing-plans, .culture-review,
  .english-review, .course-quality, .speech-settings
) :is(.admin-button, .btn):not(:disabled):hover,
html.atelier-theme body .shell.workspace-shell .main.page-admin .admin-button:not(:disabled):hover,
html.atelier-theme body .shell.workspace-shell .main.page-teacher .btn:not(:disabled):hover,
html.atelier-theme body .shell.workspace-shell .main[class] .maintenance-workspace button:not(:disabled):hover {
  border-color: var(--design-accent, #384c86);
  background: var(--design-soft, #f1f4fa);
  color: var(--design-accent, #384c86);
}
html.atelier-theme body .shell.workspace-shell .main[class] :is(
  .admin-console, .teacher-assessment, .writing-plans, .culture-review,
  .english-review, .course-quality, .speech-settings
) :is(.admin-button.primary, .btn:not(.secondary):not(.soft):not(.danger)),
html.atelier-theme body .shell.workspace-shell .main.page-admin .admin-button.primary,
html.atelier-theme body .shell.workspace-shell .main.page-teacher .btn:not(.secondary):not(.soft):not(.danger),
html.atelier-theme body .shell.workspace-shell .main[class] .maintenance-workspace :is(button[type=submit], button[data-maintenance-record]) {
  border-color: var(--design-accent, #384c86);
  background: var(--design-accent, #384c86);
  color: #fff;
  box-shadow: 0 2px 5px #384c8614;
}
html.atelier-theme body .shell.workspace-shell .main[class] :is(
  .admin-console, .teacher-assessment, .writing-plans, .culture-review,
  .english-review, .course-quality, .speech-settings
) :is(.admin-button.primary, .btn:not(.secondary):not(.soft):not(.danger)):not(:disabled):hover,
html.atelier-theme body .shell.workspace-shell .main.page-admin .admin-button.primary:not(:disabled):hover,
html.atelier-theme body .shell.workspace-shell .main.page-teacher .btn:not(.secondary):not(.soft):not(.danger):not(:disabled):hover,
html.atelier-theme body .shell.workspace-shell .main[class] .maintenance-workspace :is(button[type=submit], button[data-maintenance-record]):not(:disabled):hover {
  border-color: var(--design-accent-hover, #2e3f70);
  background: var(--design-accent-hover, #2e3f70);
  color: #fff;
}
html.atelier-theme body .shell.workspace-shell .main[class] :is(
  .admin-console, .teacher-assessment, .writing-plans, .culture-review,
  .english-review, .course-quality
) :is(.admin-button.danger, .btn.danger),
html.atelier-theme body .shell.workspace-shell .main.page-admin .admin-button.danger {
  border-color: #ead9de;
  background: #fff;
  color: var(--design-danger, #b74255);
}
html.atelier-theme body .shell.workspace-shell .main[class] :is(
  .admin-console, .teacher-assessment, .writing-plans, .culture-review,
  .english-review, .course-quality
) :is(.admin-button.danger, .btn.danger):not(:disabled):hover,
html.atelier-theme body .shell.workspace-shell .main.page-admin .admin-button.danger:not(:disabled):hover {
  border-color: var(--design-danger, #b74255);
  background: #fbf2f4;
  color: var(--design-danger, #b74255);
}
html.atelier-theme body .shell.workspace-shell .main[class] :is(
  .admin-console, .teacher-assessment, .writing-plans, .culture-review,
  .english-review, .course-quality, .speech-settings
) :is(.admin-button, .btn):disabled,
html.atelier-theme body .shell.workspace-shell .main.page-admin .admin-button:disabled,
html.atelier-theme body .shell.workspace-shell .main.page-teacher .btn:disabled,
html.atelier-theme body .shell.workspace-shell .main[class] .maintenance-workspace button:disabled {
  border-color: var(--design-line, #e4e7ed);
  background: var(--design-soft, #f1f4fa);
  color: var(--design-muted, #6d7482);
  box-shadow: none;
  opacity: .65;
}

/* Light card boundaries separate decisions, observations and immutable history. */
html.atelier-theme body .shell.workspace-shell .main[class] :is(
  .admin-stat, .admin-priority, .admin-feedback-card, .admin-operation-card,
  .admin-review-event, .admin-knowledge-editor, .admin-knowledge-revision,
  .admin-evaluation-metric, .admin-management-event, .maintenance-card,
  .culture-review-text, .culture-review-claims>article, .culture-review-event,
  .english-review-text, .english-review-criterion, .english-review-event,
  .course-quality-slot-editor, .course-quality-event, .course-quality-claim,
  .course-quality-preview, .course-quality-empty, .writing-plan-card,
  .writing-plan-task, .speech-settings
) {
  border-color: var(--design-line, #e4e7ed);
  border-radius: 12px;
  background: var(--design-surface, #fff);
  box-shadow: 0 2px 7px #24293503;
}
html.atelier-theme body .shell.workspace-shell .main.page-admin :is(.admin-stat, .admin-priority):hover {
  border-color: #bcc7dd;
  background: var(--design-surface, #fff);
  box-shadow: 0 4px 14px #24293507;
}
html.atelier-theme body .shell.workspace-shell .main.page-admin :is(
  .admin-stat>span, .admin-stat>small, .admin-record span, .admin-stage,
  .admin-number small, .admin-protected, .admin-operation-meta,
  .admin-operation-footer, .admin-operation-facts dt, .admin-operation-metrics dt
) {
  color: var(--design-muted, #6d7482);
  font-size: 12px;
  line-height: 1.7;
}
html.atelier-theme body .shell.workspace-shell .main.page-admin :is(.admin-stat>strong, .admin-record strong) {
  color: var(--design-ink, #242935);
}
html.atelier-theme body .shell.workspace-shell .main.page-admin :is(.admin-priority-icon, .admin-priority strong>span) {
  background: var(--design-soft, #f1f4fa);
  color: var(--design-accent, #384c86);
}
html.atelier-theme body .shell.workspace-shell .main.page-admin :is(.admin-priority>small, .admin-usage .icon) {
  color: var(--design-accent, #384c86);
}
html.atelier-theme body .shell.workspace-shell .main.page-admin :is(
  .admin-operations, .admin-role-guide, .admin-notice, .admin-loading
) {
  border-color: var(--design-line, #e4e7ed);
  border-radius: 12px;
  background: var(--design-soft, #f1f4fa);
}
html.atelier-theme body .shell.workspace-shell .main.page-admin :is(.admin-notice, .admin-loading, .admin-role-guide strong) {
  color: var(--design-accent, #384c86);
}
html.atelier-theme body .shell.workspace-shell .main[class] :is(
  .admin-section-heading h2, .admin-operations-heading h2, .assessment-heading h2,
  .writing-plan-heading h2, .maintenance-head h2, .speech-settings h2,
  .culture-review h2, .english-review h2, .course-quality h2
) {
  color: var(--design-ink, #242935);
  font-size: 23px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -.025em;
}
html.atelier-theme body .shell.workspace-shell .main.page-admin :is(
  .admin-table th, .admin-table td, .admin-table-wrap, .admin-course-chapter,
  .admin-course-chapter-body, .admin-review-item, .admin-job-diagnostics-body,
  .admin-review-history, .admin-review-snapshot, .admin-knowledge-revision-body
) {
  border-color: var(--design-line, #e4e7ed);
}
html.atelier-theme body .shell.workspace-shell .main.page-admin .admin-table th {
  background: var(--design-soft, #f1f4fa);
  color: var(--design-muted, #6d7482);
  font-size: 12px;
  font-weight: 500;
}
html.atelier-theme body .shell.workspace-shell .main.page-admin .admin-table td {
  color: var(--design-ink, #242935);
}
html.atelier-theme body .shell.workspace-shell .main.page-admin .admin-status {
  border-color: var(--design-line, #e4e7ed);
  background: var(--design-soft, #f1f4fa);
  color: var(--design-muted, #6d7482);
  font-size: 12px;
  border-radius: 6px;
}
html.atelier-theme body .shell.workspace-shell .main.page-admin :is(
  .admin-status-approved, .admin-status-active, .admin-status-done,
  .admin-status-paid, .admin-status-resolved
) {
  background: #eef2fa;
  border-color: #dce3f1;
  color: var(--design-accent, #384c86);
}
html.atelier-theme body .shell.workspace-shell .main.page-admin :is(
  .admin-status-rejected, .admin-status-failed, .admin-status-inactive,
  .admin-operation-state.is-unavailable, .admin-operation-state.is-stale,
  .admin-language-state.state-fail
) {
  background: #fbf2f4;
  border-color: #ead9de;
  color: var(--design-danger, #b74255);
}

/* Explanations are deliberately compact. Saved statements and evidence do not
   appear in this list: their current readable typography remains untouched. */
html.atelier-theme body .shell.workspace-shell .main[class] :is(
  .admin-subtitle, .admin-payment-note, .admin-quality-evidence-note,
  .admin-confirm-copy span, .admin-notice, .admin-loading,
  .admin-operations-heading p, .admin-operation-advice, .admin-operation-footer,
  .admin-priority p, .admin-role-guide span, .admin-evaluation-basis,
  .admin-evaluation-coverage p, .admin-management-coverage p, .admin-job-note,
  .teacher-class-context p, .teacher-week-definition, .teacher-task-note,
  .teacher-common-errors-basis, .teacher-common-errors-scope,
  .teacher-assessment-entry, .assessment-heading p, .assessment-note,
  .assessment-context-note, .writing-plan-heading p, .writing-plan-caution,
  .writing-plan-note, .writing-plan-loading, .maintenance-head p,
  .maintenance-workspace>p:not([data-learning-content]), .maintenance-source>p,
  .maintenance-workspace form>p, .maintenance-card>p, .speech-note,
  .speech-settings-message, .speech-settings-unknown p, .speech-settings-conflict,
  .course-quality-note, .course-quality-warning, .english-review-note,
  .english-review-warning, .culture-review-note, .culture-review-warning,
  .admin-culture-entry>p, .admin-english-entry>p, .admin-course-quality-entry>p,
  .admin-speech-entry>p
) {
  color: var(--design-muted, #6d7482);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.85;
}
html.atelier-theme body .shell.workspace-shell .main[class] :is(
  .assessment-unavailable, .assessment-unconfirmed, .assessment-conflict,
  .course-quality-warning, .english-review-warning, .culture-review-warning,
  .speech-settings-conflict, .maintenance-error, .admin-error
) {
  color: var(--design-danger, #b74255);
}
html.atelier-theme body .shell.workspace-shell .main[class] :is(
  .course-quality-note, .english-review-note, .culture-review-note,
  .writing-plan-caution, .speech-settings-unknown, .admin-management-coverage
) {
  border-color: var(--design-line, #e4e7ed);
  border-radius: 10px;
  background: var(--design-soft, #f1f4fa);
}
html.atelier-theme body .shell.workspace-shell .main[class] :is(
  .course-quality-warning, .english-review-warning, .culture-review-warning,
  .speech-settings-conflict, .admin-error
) {
  border-color: #ead9de;
  background: #fbf2f4;
}

/* Input labels remain distinct from instructions; form controls retain their
   component height and text-area auto-sizing. */
html.atelier-theme body .shell.workspace-shell .main[class] :is(
  .admin-review-form, .admin-knowledge-editor, .admin-model-form, .assessment-form,
  .writing-plan-form, .culture-review, .english-review, .course-quality,
  .maintenance-workspace, .speech-settings
) :is(label, legend),
html.atelier-theme body .shell.workspace-shell .main.page-teacher .teacher-class-context label {
  color: var(--design-ink, #242935);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.7;
}
html.atelier-theme body .shell.workspace-shell .main[class] :is(
  .admin-review-form, .admin-knowledge-editor, .admin-model-form, .assessment-form,
  .writing-plan-form, .culture-review, .english-review, .course-quality,
  .maintenance-workspace, .speech-settings
) :is(input:not([type=checkbox]):not([type=radio]), textarea, select, .hb-select-trigger),
html.atelier-theme body .shell.workspace-shell .main.page-admin :is(.admin-search, .admin-filter-label .hb-select-trigger, .admin-management-filter select),
html.atelier-theme body .shell.workspace-shell .main.page-teacher .teacher-class-context :is(select, .hb-select-trigger) {
  border-color: var(--design-line, #e4e7ed);
  border-radius: 9px;
  background: var(--design-surface, #fff);
  color: var(--design-ink, #242935);
  box-shadow: 0 1px 2px #24293503;
}
html.atelier-theme body .shell.workspace-shell .main.page-admin .admin-search input {
  color: var(--design-ink, #242935);
  font-size: 14px;
}
html.atelier-theme body .shell.workspace-shell .main.page-admin .admin-search input::placeholder {
  color: var(--design-muted, #6d7482);
}
html.atelier-theme body .shell.workspace-shell .main[class] :is(
  .admin-console, .teacher-assessment, .writing-plans, .culture-review,
  .english-review, .course-quality, .maintenance-workspace, .speech-settings
) :is(input[type=checkbox], input[type=radio]) {
  accent-color: var(--design-accent, #384c86);
}
html.atelier-theme body .shell.workspace-shell .main[class] :is(
  .admin-console, .teacher-assessment, .writing-plans, .culture-review,
  .english-review, .course-quality, .maintenance-workspace, .speech-settings
) :is(button, a, input, select, textarea, summary, .hb-select-trigger):focus-visible,
html.atelier-theme body .shell.workspace-shell .main.page-teacher :is(.btn, select, summary, .hb-select-trigger):focus-visible {
  outline: 2px solid var(--design-accent, #384c86);
  outline-offset: 3px;
}
html.atelier-theme body .shell.workspace-shell .main.page-admin .admin-search:focus-within {
  border-color: var(--design-accent, #384c86);
  box-shadow: 0 0 0 3px #384c8610;
}

/* Smaller version/status annotations give actual results a stronger hierarchy. */
html.atelier-theme body .shell.workspace-shell .main[class] :is(
  .admin-review-version-bar, .admin-review-event-state, .admin-review-event time,
  .admin-content-version, .admin-quality-provenance, .admin-quality-provenance code,
  .admin-language-gate dl>div, .admin-language-state, .admin-knowledge-summary span,
  .admin-knowledge-revision>summary>span, .admin-knowledge-review-record small,
  .admin-management-filter, .assessment-facts dt, .assessment-summary span,
  .assessment-section-heading>span, .speech-settings-facts dt,
  .english-review-metadata dt, .english-review-event header time,
  .course-quality-meta, .maintenance-version-pair dt,
  .maintenance-head>div>span, .maintenance-card>span,
  .teacher-history-row small, .teacher-assignment>summary small
) {
  color: var(--design-muted, #6d7482);
  font-size: 12px;
  line-height: 1.75;
}
html.atelier-theme body .shell.workspace-shell .main[class] :is(
  .admin-language-gate, .admin-knowledge-summary>div, .admin-knowledge-review-record,
  .speech-settings-facts>div, .assessment-summary>div
) {
  border-color: var(--design-line, #e4e7ed);
  background: var(--design-soft, #f1f4fa);
  border-radius: 10px;
}
html.atelier-theme body .shell.workspace-shell .main[class] :is(.speech-settings-facts>div, .assessment-summary>div) {
  padding: 15px 17px;
}
html.atelier-theme body .shell.workspace-shell .main[class] .speech-settings-facts dd {
  color: var(--design-ink, #242935);
  font-size: 14px;
  font-weight: 500;
}
html.atelier-theme body .shell.workspace-shell .main.page-admin :is(
  .admin-language-state.state-pass, .admin-operation-state.is-ready,
  .admin-operation-state.is-active
) {
  border-color: #dce3f1;
  background: #eef2fa;
  color: var(--design-accent, #384c86);
}
html.atelier-theme body .shell.workspace-shell .main.page-admin .admin-language-state.state-review {
  border-color: #e7decc;
  background: #faf7f0;
  color: #806940;
}

/* Teacher tools use the same fine dividers without changing report/table
   responsiveness or reducing learning feedback to administrative microcopy. */
html.atelier-theme body .shell.workspace-shell .main.page-teacher :is(
  .teacher-class-context, .teacher-assignments, .teacher-learning-panel,
  .teacher-recommendation-history
) {
  border-color: var(--design-line, #e4e7ed);
  border-radius: 13px;
  background: var(--design-surface, #fff);
}
html.atelier-theme body .shell.workspace-shell .main.page-teacher .teacher-class-context {
  padding: 20px;
  background: var(--design-soft, #f1f4fa);
}
html.atelier-theme body .shell.workspace-shell .main.page-teacher :is(
  .teacher-assignment, .teacher-history-row, .teacher-learning-table td,
  .teacher-learning-table th, .teacher-level-map>div
) {
  border-color: var(--design-line, #e4e7ed);
}
html.atelier-theme body .shell.workspace-shell .main.page-teacher .teacher-level-map>div {
  border-radius: 9px;
  background: var(--design-soft, #f1f4fa);
}
html.atelier-theme body .shell.workspace-shell .main.page-teacher .teacher-level-map a {
  color: var(--design-accent, #384c86);
}
html.atelier-theme body .shell.workspace-shell .main.page-teacher .teacher-row-actions {
  gap: 8px;
}

/* Never compress an English action into a shrinking one-line heading. */
@media (max-width: 700px) {
  html.atelier-theme body .shell.workspace-shell .main[class] :is(
    .admin-section-heading, .admin-operations-heading, .maintenance-head,
    .speech-settings>header, .assessment-heading
  ) {
    flex-direction: column;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
  }
  html.atelier-theme body .shell.workspace-shell .main[class] :is(
    .admin-section-heading, .admin-operations-heading, .maintenance-head,
    .speech-settings>header, .assessment-heading
  ) > :is(button, .btn, .admin-button) {
    flex: 0 0 auto;
  }
  html.atelier-theme body .shell.workspace-shell .main[class] :is(
    .admin-console, .teacher-assessment, .writing-plans, .culture-review,
    .english-review, .course-quality, .speech-settings
  ) :is(.admin-button, .btn),
  html.atelier-theme body .shell.workspace-shell .main.page-admin .admin-button,
  html.atelier-theme body .shell.workspace-shell .main.page-teacher .btn,
  html.atelier-theme body .shell.workspace-shell .main[class] .maintenance-workspace button {
    min-height: 44px;
  }
  html.atelier-theme body .shell.workspace-shell .main[class] :is(
    .admin-review-form, .admin-knowledge-editor, .admin-model-form, .assessment-form,
    .writing-plan-form, .culture-review, .english-review, .course-quality,
    .maintenance-workspace, .speech-settings
  ) :is(input:not([type=checkbox]):not([type=radio]), textarea, select, .hb-select-trigger),
  html.atelier-theme body .shell.workspace-shell .main.page-admin .admin-search input,
  html.atelier-theme body .shell.workspace-shell .main.page-teacher .teacher-class-context :is(select, .hb-select-trigger) {
    font-size: 16px;
  }
  html.atelier-theme body .shell.workspace-shell .main.page-teacher .teacher-class-context {
    padding: 17px;
  }
  html.atelier-theme body .shell.workspace-shell .main[class] :is(
    .admin-section-heading h2, .assessment-heading h2, .maintenance-head h2,
    .speech-settings h2, .culture-review h2, .english-review h2, .course-quality h2
  ) {
    font-size: 21px;
  }
}
